The OpenCL SPIR-V Environment Specification currently says that for all atomic instructions "only 32-bit integer types are supported for the Result Type and/or type of Value", yet the OpenCL C spec describes an atomic_float type that supports at least some atomic operations. While I believe all of the float atomic operations can be implemented using bitcasts and atomic operations on 32-bit integer values, I don't think this is the intent, and the SPIR-V LLVM Translator is generating atomic operations on floating-point types directly.
Are the current rules in the OpenCL SPIR-V Environment specification too strict, and should atomic operations on 32-bit (and probably 64-bit?) floating-point types be supported, at least in some cases and for some atomic operations?
One especially interesting case to consider is the OpenCL C floating-point compare-and-exchange operation, which is supported but is specified to operate using a bitwise comparison. Note that the SPIR-V OpAtomicCompareExchange is only supported for integer types, unlike OpAtomicLoad, OpAtomicStore, and OpAtomicExchange, which support for both integer types and floating-point types.
The text was updated successfully, but these errors were encountered:
The OpenCL SPIR-V Environment Specification currently says that for all atomic instructions "only 32-bit integer types are supported for the Result Type and/or type of Value", yet the OpenCL C spec describes an
atomic_float
type that supports at least some atomic operations. While I believe all of the float atomic operations can be implemented using bitcasts and atomic operations on 32-bit integer values, I don't think this is the intent, and the SPIR-V LLVM Translator is generating atomic operations on floating-point types directly.Are the current rules in the OpenCL SPIR-V Environment specification too strict, and should atomic operations on 32-bit (and probably 64-bit?) floating-point types be supported, at least in some cases and for some atomic operations?
One especially interesting case to consider is the OpenCL C floating-point compare-and-exchange operation, which is supported but is specified to operate using a bitwise comparison. Note that the SPIR-V OpAtomicCompareExchange is only supported for integer types, unlike OpAtomicLoad, OpAtomicStore, and OpAtomicExchange, which support for both integer types and floating-point types.
The text was updated successfully, but these errors were encountered: