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)
@MrSidims MrSidims merged commit dd57ef7 into KhronosGroup:llvm_release_160 Aug 26, 2024
8 of 9 checks passed
@wenju-he wenju-he deleted the atomic_compare_exchange-float-double-16 branch August 26, 2024 09:21
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.

2 participants