[clang] [llvm] Clang: Add nsz to llvm.minnum and llvm.maxnum emitted from fmin and fmax (PR #113133)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 25 12:26:05 PDT 2025


nikic wrote:

> > I'm not sure this is correct. At least the way alive models the flag, I believe this would also allow returning -0.0 even if both operands are 0.0, which is not a legal outcome.
> 
> That sounds like a bad modeling. It shouldn't permit synthesizing a -0 out of nowhere

Hm, how would you suggest to model it? Considering an example like https://discourse.llvm.org/t/rfc-clarify-the-behavior-of-fp-operations-on-bit-strings-with-nsz-flag/85981/4?u=nikic, looking at it from the perspective of the select only, requires it to convert a 0.0 into -0.0 "out of nowhere".

I guess we could specify the semantics of nsz per-operation and use something different for minnum...

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


More information about the cfe-commits mailing list