]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 10 Mar 2004 06:05:14 +0000 (06:05 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 10 Mar 2004 06:05:14 +0000 (06:05 +0000)
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.

ChangeLog
math/math.h
nptl/ChangeLog
nptl/tst-cancel20.c
nptl/tst-cancel21.c
sysdeps/alpha/fpu/bits/mathinline.h
sysdeps/i386/fpu/bits/mathinline.h
sysdeps/m68k/fpu/bits/mathinline.h
sysdeps/powerpc/fpu/bits/mathinline.h
sysdeps/sparc/fpu/bits/mathinline.h
sysdeps/x86_64/fpu/bits/mathinline.h

index bff1807f798ecffb3a38012d25e867896a0b5195..5a4a6fc0088c3f08b780c717e4c53dcc3ca30643 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+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.
+
 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
 
        * posix/Makefile (tests): Add tst-vfork2.
index 7d311462d906001d92b6ab8b6f372bc04393b89a..9161412f984778793c5ffd426e3f478b10aeb80a 100644 (file)
@@ -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
index 1ea68cfcc745e08e9c9553f69e19e0b896b59820..650a1662f2faff9b93abc06cd9edd071c8f56059 100644 (file)
@@ -1,3 +1,16 @@
+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.
+
 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
index 8155c0e9fadef2dd0197b442f0a7f2ea938855ca..d88cb9caf85323fa491a74dd4e471d1f40103b33 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
@@ -105,6 +105,7 @@ tf (void *arg)
 static int
 do_one_test (void)
 {
+  in_sh_body = 0;
   cleanups = 0;
   if (pipe (fd) != 0 || pipe (fd + 2) != 0)
     {
index c40d87b84bdf564ed5155c5c14d6b0e763fcacb0..cc00cc1683207e3e383119e660a618a26f77110a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
@@ -162,6 +162,8 @@ tf (void *arg)
 static int
 do_one_test (void)
 {
+  in_sh_body = 0;
+
   pid_t pid = fork ();
 
   if (pid == -1)
index 8141485b47c2060864d31211dfed8b4a3101d0f4..0ba79f989554c02584f94242a738cd9c71e080f1 100644 (file)
 # define __MATH_INLINE extern __inline
 #endif
 
-#ifdef __USE_ISOC99
-# define isunordered(x, y)                             \
+#if defined __USE_ISOC99 && defined __GNUC__ && !__GNUC_PREREQ(3,0)
+# undef isgreater
+# undef isgreaterequal
+# undef isless
+# undef islessequal
+# undef islessgreater
+# undef isunordered
+# define isunordered(u, v)                             \
   (__extension__                                       \
-   ({ double __r;                                      \
+   ({ double __r, __u = (u), __v = (v);                        \
       __asm ("cmptun/su %1,%2,%0\n\ttrapb"             \
-            : "=&f" (__r) : "f" (x), "f"(y));          \
+            : "=&f" (__r) : "f" (__u), "f"(__v));      \
       __r != 0; }))
-
-# define isgreater(x, y)                               \
-  (__extension__                                       \
-   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);        \
-      !isunordered(__x, __y) && __x > __y; }))
-# define isgreaterequal(x, y)                          \
-  (__extension__                                       \
-   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);        \
-      !isunordered(__x, __y) && __x >= __y; }))
-# define isless(x, y)                                  \
-  (__extension__                                       \
-   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);        \
-      !isunordered(__x, __y) && __x < __y; }))
-# define islessequal(x, y)                             \
-  (__extension__                                       \
-   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);        \
-      !isunordered(__x, __y) && __x <= __y; }))
-# define islessgreater(x, y)                           \
-  (__extension__                                       \
-   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);        \
-      !isunordered(__x, __y) && __x != __y; }))
 #endif /* ISO C99 */
 
 #if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
index ab3b54def5368841f0519745e0cbdda29e94973e..85d48a5c90b4672729274e2a3e6ce4af10fb37a4 100644 (file)
 
 
 #if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
-# if __GNUC_PREREQ (2,97)
 /* GCC 2.97 and up have builtins that actually can be used.  */
-#  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(x, y) __builtin_isunordered (x, y)
-# else
+# if !__GNUC_PREREQ (2,97)
 /* ISO C99 defines some macros to perform unordered comparisons.  The
    ix87 FPU supports this with special opcodes and we should use them.
    These must not be inline functions since we have to be able to handle
    all floating-point types.  */
+#  undef isgreater
+#  undef isgreaterequal
+#  undef isless
+#  undef islessequal
+#  undef islessgreater
+#  undef isunordered
 #  ifdef __i686__
 /* For the PentiumPro and more recent processors we can provide
    better code.  */
index ec00b4b71147551862d8ef1e316de66fd8df978a..1e43e43047009cee6c8fa2f08de4df4eab51101a 100644 (file)
 #ifdef __GNUC__
 
 #ifdef __USE_ISOC99
-
-# if __GNUC_PREREQ (3,1)
 /* GCC 3.1 and up have builtins that actually can be used.  */
-#  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(x, y) __builtin_isunordered (x, y)
-# else
+# if !__GNUC_PREREQ (3,1)
 /* ISO C99 defines some macros to perform unordered comparisons.  The
    m68k FPU supports this with special opcodes and we should use them.
    These must not be inline functions since we have to be able to handle
    all floating-point types.  */
+#  undef isgreater
+#  undef isgreaterequal
+#  undef isless
+#  undef islessequal
+#  undef islessgreater
+#  undef isunordered
 #  define isgreater(x, y)                                      \
    __extension__                                       \
    ({ char __result;                                   \
index dcd506d49e61d77d7eb2867259a894495344739c..01956d9ee8068cbe1b677c80d3f754be9d39737b 100644 (file)
 #if defined __GNUC__ && !defined _SOFT_FLOAT
 
 #ifdef __USE_ISOC99
-# if __GNUC_PREREQ (2,96)
-
-#  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(x, y) __builtin_isunordered (x, y)
-
-# else
-
+# if !__GNUC_PREREQ (2,97)
 #  define __unordered_cmp(x, y) \
   (__extension__                                                             \
    ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);                              \
               : "cr7");  \
       __r; }))
 
+#  undef isgreater
+#  undef isgreaterequal
+#  undef isless
+#  undef islessequal
+#  undef islessgreater
+#  undef isunordered
+
 #  define isgreater(x, y) (__unordered_cmp (x, y) >> 2 & 1)
 #  define isgreaterequal(x, y) ((__unordered_cmp (x, y) & 6) != 0)
 #  define isless(x, y) (__unordered_cmp (x, y) >> 3 & 1)
index 81c2539b6bffdaf788ee8fbc192bf7ba04ad1076..734ff0590d11c06a04999f704307adbbf7b1aaa6 100644 (file)
 
 #include <bits/wordsize.h>
 
-#ifdef __GNUC__
-
-#ifdef __USE_ISOC99
+#if defined __USE_ISOC99 && defined __GNUC__ && !__GNUC_PREREQ(3,0)
+# undef isgreater
+# undef isgreaterequal
+# undef isless
+# undef islessequal
+# undef islessgreater
+# undef isunordered
 
 # if __WORDSIZE == 32
 
index c77412d28d680ab1d9d0d8d55d9882efd6cd8cba..3f61ff5e928d940c25a3cfd4c15392b7fa1ae7e5 100644 (file)
 
 
 #if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
-/* GCC has builtins that can be used.  */
-# 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(x, y) __builtin_isunordered (x, y)
-
 
 /* Test for negative number.  Used in the signbit() macro.  */
 __MATH_INLINE int