Skip to content

Conversation

wenju-he
Copy link
Contributor

OpenCL spec supports atomic_float/atomic_double type for atomic_compare_exchange* functions. However, value and return type in OpAtomicCompareExchange in SPIR-V spec must be integer type. Therefore, in OCLToSPIRV translation we need to translate floating-point type to corresponding integer variant that has the same type size. Floating-point value is bitcasted so that bits remain the same.

(cherry picked from commit e554401)

…exchange as integer (KhronosGroup#2668)

OpenCL spec supports atomic_float/atomic_double type for
atomic_compare_exchange* functions. However, value and return type in
OpAtomicCompareExchange in SPIR-V spec must be integer type.
Therefore, in OCLToSPIRV translation we need to translate floating-point
type to corresponding integer variant that has the same type size.
Floating-point value is bitcasted so that bits remain the same.

(cherry picked from commit e554401)
@svenvh svenvh closed this Aug 14, 2024
@svenvh svenvh reopened this Aug 14, 2024
@svenvh
Copy link
Member

svenvh commented Aug 14, 2024

Close/reopen to retrigger CI.

@wenju-he
Copy link
Contributor Author

@MrSidims could you please help to review? thanks. This is to fix a P1 issue for IGC.
I'll cherry-pick to 15~19 branches as well.

@MrSidims MrSidims merged commit d838f77 into KhronosGroup:llvm_release_140 Aug 20, 2024
15 of 17 checks passed
@wenju-he wenju-he deleted the atomic_compare_exchange-float-double-14 branch August 20, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants