aboutsummaryrefslogtreecommitdiff
path: root/math/math.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-03-10 06:05:14 +0000
committerUlrich Drepper <drepper@redhat.com>2004-03-10 06:05:14 +0000
commitf4c024d1f956a7e853eba10ce33ab6851b5d43d1 (patch)
tree1e1fb47ee60867cc36f948b08e1388786b3ad161 /math/math.h
parent8b9d605485be779bb03778e780e9875525ec2ca4 (diff)
downloadglibc-f4c024d1f956a7e853eba10ce33ab6851b5d43d1.tar
glibc-f4c024d1f956a7e853eba10ce33ab6851b5d43d1.tar.gz
glibc-f4c024d1f956a7e853eba10ce33ab6851b5d43d1.tar.bz2
glibc-f4c024d1f956a7e853eba10ce33ab6851b5d43d1.zip
Update.
2004-03-09 Richard Henderson <rth@redhat.com> * 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.
Diffstat (limited to 'math/math.h')
-rw-r--r--math/math.h22
1 files changed, 16 insertions, 6 deletions
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 <bits/mathinline.h> 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 <bits/mathinline.h>
#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 <bits/mathinline.h>, 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