On Tue Feb 14 11:21:22 2023 +0000, Giovanni Mascellani wrote:
I am not sure I understand the problem. As you said, you can reimplement `isnan()` with something like:
bool4 xisnan(float4 x) { return (asuint(x) & 0x7FFFFFFF) > 0x7F800000; }
(adapted from [this tweet](https://twitter.com/_humus_/status/1074973351276371968) and [this shader playground](https://shader-playground.timjones.io/0bbe04704caddadb52cd4134daab8ac3) mentioned by Zeb) Or you can just pass the NaN to `asuint()`, so we can also test the actual NaN bits. Also, you can constrain the test to SM4 using:
[require] shader model >= 4.0
on the test with negative numbers. It's not important if we still do not support `asuint()` yet. You can leave the test `todo`, but at least have it pinpoint the expected outcome. This doesn't seem to be particularly difficult or long. Or am I missing something?
I'd be happy to look into that, if this is the approach we want to take. It's more about improving existing testing tools, and not the problem this MR is for.
I don't know if "require" ends up a correct name for this functionality, shader does not require specific version, results do. Limiting to >= 4.0 is also insufficient, because that does not show the difference with SM3 and below, which takes absolute value of the input internally.