[llvm] Intrinsic: Fix minnum and introduce minimumnum (PR #93373)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sat May 25 00:58:14 PDT 2024
nikic wrote:
Needs LangRef update and an RFC.
I only briefly looked at this, but I think we can probably get away with just changing minnum to follow IEEE behavior and then make use of the following general rule about our FP operations:
> Floating-point math operations are allowed to treat all NaNs as if they were quiet NaNs. For example, “pow(1.0, SNaN)” may be simplified to 1.0.
The effective outcome of this would be that both behaviors become valid. The sNaN -> qNaN case would be the plain intrinsic definition and the sNaN -> other operand case would be via sNaN -> qNaN relaxation.
Only the constrained minnum intrinsics would require precise sNaN/qNaN distinction, as usual.
I think this would be in the spirit of the general FP handling in LLVM.
https://github.com/llvm/llvm-project/pull/93373
More information about the llvm-commits
mailing list