Following up after !9108 (merged), this is the third batch of NaN-related fixes.
There is another batch ready after this. That batch only affects SPIR-V, so I may send those changes out before this MR lands.
The changes in this MR either remove some unsafe optimizations or make some optimizations safe by using
is_a_number and related predicates.
The last "FYI" patch is not intended to land. There had been some discussion in another MR about trying that technique. I tried it, and it made things worse on Intel GPUs. It is included here just to show the results. If it helps other GPUs by a significant margin, we might be able to work something out.
I have a ton of other patches in this area. They're all living in https://cgit.freedesktop.org/~idr/mesa/log/?h=NaNu-NaNu. I might pull some of those out for another MR in the future. I think there's some other work that I would want to land first.