From e6f50abbb623025fbe5b59211dc186653b7d1f05 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 1 Apr 2022 16:35:32 -0300 Subject: math: Fix isgreater* and isless* for clang 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math/math.h b/math/math.h index 5f1933a2f9..8e904e5d93 100644 --- a/math/math.h +++ b/math/math.h @@ -1429,7 +1429,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 -- cgit v1.2.3