]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
math: Fix isgreater* and isless* for clang
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 1 Apr 2022 19:35:32 +0000 (16:35 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 28 Oct 2025 16:54:55 +0000 (13:54 -0300)
clang does not check for unordered numbers with builtins for
_Float128 type.

It fixes multiple issues with math tests, such as:

Failure: fmax (0, qNaN): Exception "Invalid operation" set
Failure: fmax (0, -qNaN): Exception "Invalid operation" set
Failure: fmax (-0, qNaN): Exception "Invalid operation" set
Failure: fmax (-0, -qNaN): Exception "Invalid operation" set
Failure: fmax (9, qNaN): Exception "Invalid operation" set
Failure: fmax (9, -qNaN): Exception "Invalid operation" set
Failure: fmax (-9, qNaN): Exception "Invalid operation" set
Failure: fmax (-9, -qNaN): Exception "Invalid operation" set

math/math.h

index b0d99cff8e27172d25056c6ca622d96668192864..d97f33a828fe05a996065e7d33066588582f0c77 100644 (file)
@@ -1265,7 +1265,7 @@ iszero (__T __val)
 #endif
 
 #ifdef __USE_ISOC99
-# if __GNUC_PREREQ (3, 1)
+# if __GNUC_PREREQ (3, 1) && !defined __clang__
 /* ISO C99 defines some macros to compare number while taking care for
    unordered numbers.  Many FPUs provide special instructions to support
    these operations.  Generic support in GCC for these as builtins went