Clarification around returning -0.0 from certain builtins
I was wondering if the specification could clarify whenever it says returns 0.0 whether this means strictly +0.0 or whether -0.0 is possible?
This appears to apply to the sign, step and smoothstep builtins but admittedly I only really have sign in mind. A more efficient implementation of sign may be possible in some cases if the sign was able to be copied directly from x, in which case negative NaNs would produce -0.0.
My interpretation of sign would be that it returns +0.0 but since the documentation goes out of its way to specify a return value of +0.0 and -0.0 when x is either of those values, leaving in 0.0 without an explicit sign as an option could be misinterpreted.
The OpenCL-CTS currently passes for an implementation of sign that returns -0.0 for -NaN. I don't know if those specific input values are being tested, but either way, if -0.0 is not intended then it is currently being allowed by omission.
Apologies, I meant to ask this over in OpenCL-Docs