[llvm] [IVDescriptors] Don't require nsz/nnan for (min|max)num. (PR #137003)

David Green via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 25 09:22:43 PDT 2025


davemgreen wrote:

> I guess with the new intrinsics definitions, generating maxnum for fmax is technically incorrect, and would have to be fixed regardless?

My understanding is that it is now correct. With the new definition glibc fmax() == llvm.maxnum == aarch64 fmaxnm.

GCC might have an equally troubled past with snan as clang, and treats it more like nan under fast-math. (But not quite like poison, that goes too far some times). They have a `-fsignaling-nans` from https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fsignaling-nans, which is still described as experimental. And https://gcc.gnu.org/wiki/FloatingPointMath lists what is supported and not under the default options. It "does not care about signalling NaNs" under the default fp model (which could be interpreted be a little different from treating them as numbers vs nans in max).

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


More information about the llvm-commits mailing list