[llvm] [AMDGPU] Use nan as the identity for atomicrmw fmax/fmin (PR #97411)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 06:41:05 PDT 2024


arsenm wrote:

> Then can you please revert #96739 ("AMDGPU: Remove ds_fmin/ds_fmax intrinsics")? 

No, that will make the situation worse, not better. I'm inclined to say ignore the signaling nan handling problem. It's deeply broken, and the standards (OpenCL at least) have been debased to permit whatever happens to happen. We should at least comment what happens here. It's hard enough to find documentation in the languages, or the hardware that actually spell out what the signaling case does. 

> I am trying to migrate [LLPC](https://github.com/GPUOpen-Drivers/llpc) from using the intrinsics to atomicrmw but I can't do that if I don't know the semantics of atomicrmw fmax/fmin and it's liable to change under my feet.

Where you can presumably just continue ignoring the existence of signaling nans. 

https://github.com/llvm/llvm-project/pull/97411


More information about the llvm-commits mailing list