From f4c024d1f956a7e853eba10ce33ab6851b5d43d1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 10 Mar 2004 06:05:14 +0000 Subject: Update. 2004-03-09 Richard Henderson * math/math.h (isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered): Use builtins if available. * sysdeps/i386/fpu/bits/mathinline.h: Don't define via builtins. * sysdeps/m68k/fpu/bits/mathinline.h: Likewise. * sysdeps/powerpc/fpu/bits/mathinline.h: Likewise. * sysdeps/sparc/fpu/bits/mathinline.h: Likewise. * sysdeps/x86_64/fpu/bits/mathinline.h: Likewise. * sysdeps/alpha/fpu/bits/mathinline.h (isgreater, isgreaterequal, isless, islessequal, islessgreater): Remove; use default. (isunordered): Convert inputs to double. --- math/math.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'math') diff --git a/math/math.h b/math/math.h index 7d311462d9..9161412f98 100644 --- a/math/math.h +++ b/math/math.h @@ -357,18 +357,28 @@ extern int matherr (struct exception *__exc); # define __NO_MATH_INLINES 1 #endif +#if __USE_ISOC99 && __GNUC_PREREQ(2,97) +/* 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 + in before 3.0.0, but not all cpus added their patterns. We define + versions that use the builtins here, and will + undef/redefine as appropriate for the specific GCC version in use. */ +# define isgreater(x, y) __builtin_isgreater(x, y) +# define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) +# define isless(x, y) __builtin_isless(x, y) +# define islessequal(x, y) __builtin_islessequal(x, y) +# define islessgreater(x, y) __builtin_islessgreater(x, y) +# define isunordered(u, v) __builtin_isunordered(u, v) +#endif + /* Get machine-dependent inline versions (if there are any). */ #ifdef __USE_EXTERN_INLINES # include #endif - #if __USE_ISOC99 -/* ISO C99 defines some macros to compare number while taking care - for unordered numbers. Since many FPUs provide special - instructions to support these operations and these tests are - defined in , we define the generic macros at - this late point and only if they are not defined yet. */ +/* If we've still got undefined comparison macros, provide defaults. */ /* Return nonzero value if X is greater than Y. */ # ifndef isgreater -- cgit 1.4.1