Open bashbaug opened 2 months ago
While we're at it, we also should document a few other OpenCL C requirements in the OpenCL SPIR-V environment spec, or decide that they have defined behavior via SPIR-V:
If a vector specifier appears without a length modifier, the behavior is undefined. The vector data type described by the vector specifier and length modifier must match the data type of the argument; otherwise the behavior is undefined.
If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
(related to: https://github.com/KhronosGroup/OpenCL-CTS/issues/2039)
The OpenCL SPIR-V environment spec should clarify which operand types are valid for the printf extended instruction, likely based on the printf format specifier for that operand.
For reference, the printf extended instruction currently says:
But neither it nor the OpenCL SPIR-V environment spec describe which operand types are valid.
Some example questions:
FWIW, the OpenCL C spec seems to say:
This matches what Clang is doing: https://godbolt.org/z/Ebr5EqEsh
We could allow more than this via SPIR-V if we want to, or we could only allow what Clang is currently generating. What is the group's preference?