This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.26-415-g4d3693e


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  4d3693ec1cb7d247a217dc1eb7121c658f818dca (commit)
       via  1e6d07234fc0edcf0e88d75cf48f0b0dbbea3f39 (commit)
      from  b2f03cf3a4b7ae4d1db155fba2180e3f580ce805 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4d3693ec1cb7d247a217dc1eb7121c658f818dca

commit 4d3693ec1cb7d247a217dc1eb7121c658f818dca
Author: Wilco Dijkstra <wdijkstr@arm.com>
Date:   Thu Sep 28 19:52:13 2017 +0100

    Remove ancient __signbit inlines
    
    Remove __signbit inlines from mathinline.h.  Math.h already uses
    the builtin when supported, so additional inlines are only used
    on pre 4.0 GCCs.  Similarly remove ancient copysign and fabs
    inlines.
    
    	* sysdeps/alpha/fpu/bits/mathinline.h: Delete file.
    	* sysdeps/ia64/fpu/bits/mathinline.h: Delete file.
    	* sysdeps/m68k/coldfire/fpu/bits/mathinline.h: Delete file.
    	* sysdeps/m68k/m680x0/fpu/bits/mathinline.h: (__signbitf): Remove.
    	(__signbit): Remove.
    	(__signbitl): Remove.
    	* sysdeps/powerpc/bits/mathinline.h (__signbitf): Remove.
    	(__signbit): Remove.
    	(__signbitl): Remove.
    	* sysdeps/s390/fpu/bits/mathinline.h: (__signbitf): Remove.
    	(__signbit): Remove.
    	(__signbitl): Remove
    	* sysdeps/sparc/fpu/bits/mathinline.h (__signbitf): Remove.
    	(__signbit): Remove.
    	(__signbitl): Remove.
    	* sysdeps/tile/bits/mathinline.h: Delete file.
    	* sysdeps/x86/fpu/bits/mathinline.h (__signbitf): Remove.
    	(__signbit): Remove.
    	(__signbitl): Remove.

diff --git a/ChangeLog b/ChangeLog
index 85ae290..e4919f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
 2017-09-28  Wilco Dijkstra  <wdijkstr@arm.com>
 
+	* sysdeps/alpha/fpu/bits/mathinline.h: Delete file.
+	* sysdeps/ia64/fpu/bits/mathinline.h: Delete file.
+	* sysdeps/m68k/coldfire/fpu/bits/mathinline.h: Delete file.
+	* sysdeps/m68k/m680x0/fpu/bits/mathinline.h: (__signbitf): Remove.
+	(__signbit): Remove.
+	(__signbitl): Remove.
+	* sysdeps/powerpc/bits/mathinline.h (__signbitf): Remove.
+	(__signbit): Remove.
+	(__signbitl): Remove.
+	* sysdeps/s390/fpu/bits/mathinline.h: (__signbitf): Remove.
+	(__signbit): Remove.
+	(__signbitl): Remove.
+	* sysdeps/sparc/fpu/bits/mathinline.h (__signbitf): Remove.
+	(__signbit): Remove.
+	(__signbitl): Remove.
+	* sysdeps/tile/bits/mathinline.h: Delete file.
+	* sysdeps/x86/fpu/bits/mathinline.h (__signbitf): Remove.
+	(__signbit): Remove.
+	(__signbitl): Remove.
+
+2017-09-28  Wilco Dijkstra  <wdijkstr@arm.com>
+
 	* math/math.h: Improve handling of C99 isgreater macros.
 	* sysdeps/alpha/fpu/bits/mathinline.h: Remove isgreater macros.
 	* sysdeps/m68k/m680x0/fpu/bits/mathinline.h: Likewise.
diff --git a/sysdeps/alpha/fpu/bits/mathinline.h b/sysdeps/alpha/fpu/bits/mathinline.h
deleted file mode 100644
index dad99d3..0000000
--- a/sysdeps/alpha/fpu/bits/mathinline.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Inline math functions for Alpha.
-   Copyright (C) 1996-2017 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by David Mosberger-Tang.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _MATH_H
-# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
-#endif
-
-#ifndef __extern_inline
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE __extern_inline
-#endif
-
-#if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
-    && defined __OPTIMIZE__
-
-#if !__GNUC_PREREQ (4, 0)
-# define __inline_copysign(NAME, TYPE)					\
-__MATH_INLINE TYPE							\
-__NTH (NAME (TYPE __x, TYPE __y))					\
-{									\
-  TYPE __z;								\
-  __asm ("cpys %1, %2, %0" : "=f" (__z) : "f" (__y), "f" (__x));	\
-  return __z;								\
-}
-
-__inline_copysign (__copysignf, float)
-__inline_copysign (copysignf, float)
-__inline_copysign (__copysign, double)
-__inline_copysign (copysign, double)
-
-# undef __inline_copysign
-#endif
-
-
-#if !__GNUC_PREREQ (2, 8)
-# define __inline_fabs(NAME, TYPE)			\
-__MATH_INLINE TYPE					\
-__NTH (NAME (TYPE __x))					\
-{							\
-  TYPE __z;						\
-  __asm ("cpys $f31, %1, %0" : "=f" (__z) : "f" (__x));	\
-  return __z;						\
-}
-
-__inline_fabs (__fabsf, float)
-__inline_fabs (fabsf, float)
-__inline_fabs (__fabs, double)
-__inline_fabs (fabs, double)
-
-# undef __inline_fabs
-#endif
-
-#ifdef __USE_ISOC99
-
-/* Test for negative number.  Used in the signbit() macro.  */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-#if !__GNUC_PREREQ (4, 0)
-  __extension__ union { float __f; int __i; } __u = { __f: __x };
-  return __u.__i < 0;
-#else
-  return __builtin_signbitf (__x);
-#endif
-}
-
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-#if !__GNUC_PREREQ (4, 0)
-  __extension__ union { double __d; long __i; } __u = { __d: __x };
-  return __u.__i < 0;
-#else
-  return __builtin_signbit (__x);
-#endif
-}
-
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
-#if !__GNUC_PREREQ (4, 0)
-  __extension__ union {
-    long double __d;
-    long __i[sizeof(long double)/sizeof(long)];
-  } __u = { __d: __x };
-  return __u.__i[sizeof(long double)/sizeof(long) - 1] < 0;
-#else
-  return __builtin_signbitl (__x);
-#endif
-}
-#endif /* C99 */
-
-#endif /* __NO_MATH_INLINES */
diff --git a/sysdeps/ia64/fpu/bits/mathinline.h b/sysdeps/ia64/fpu/bits/mathinline.h
deleted file mode 100644
index c2107af..0000000
--- a/sysdeps/ia64/fpu/bits/mathinline.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Inline math functions for ia64.
-   Copyright (C) 2004-2017 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _MATH_H
-# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
-#endif
-
-#ifndef __extern_inline
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE __extern_inline
-#endif
-
-#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
-/* The gcc, version 2.7 or below, has problems with all this inlining
-   code.  So disable it for this version of the compiler.  */
-# if __GNUC_PREREQ (2, 8)
-/* Test for negative number.  Used in the signbit() macro.  */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-  __extension__ union { float __f; int __i; } __u = { __f: __x };
-  return __u.__i < 0;
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
-  return __u.__i[1] < 0;
-}
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
-  __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
-  return (__u.__i[2] & 0x8000) != 0;
-}
-# endif
-#endif
diff --git a/sysdeps/m68k/coldfire/fpu/bits/mathinline.h b/sysdeps/m68k/coldfire/fpu/bits/mathinline.h
deleted file mode 100644
index 7dbfe37..0000000
--- a/sysdeps/m68k/coldfire/fpu/bits/mathinline.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Inline math functions for Coldfire.
-   Copyright (C) 2012-2017 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _MATH_H
-# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
-#endif
-
-#ifndef __extern_always_inline
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE __extern_always_inline
-#endif
-
-#if defined __USE_ISOC99 && defined __GNUC__
-
-/* Test for negative number.  Used in the signbit macro.  */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-  return __builtin_signbitf (__x);
-}
-
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-  return __builtin_signbit (__x);
-}
-
-#endif
diff --git a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
index 07ba145..dcc2a4e 100644
--- a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
+++ b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
@@ -28,30 +28,6 @@
 
 #ifdef	__GNUC__
 
-#ifdef __USE_ISOC99
-
-/* Test for negative number.  Used in the signbit() macro.  */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-  __extension__ union { float __f; int __i; } __u = { __f: __x };
-  return __u.__i < 0;
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
-  return __u.__i[0] < 0;
-}
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
-  __extension__ union { long double __d; int __i[3]; } __u = { __d: __x };
-  return __u.__i[0] < 0;
-}
-#endif
-
-
 #if (!defined __NO_MATH_INLINES && defined __OPTIMIZE__) \
     || defined __LIBC_INTERNAL_MATH_INLINES
 
diff --git a/sysdeps/powerpc/bits/mathinline.h b/sysdeps/powerpc/bits/mathinline.h
index 406465f..a5f63e4 100644
--- a/sysdeps/powerpc/bits/mathinline.h
+++ b/sysdeps/powerpc/bits/mathinline.h
@@ -28,41 +28,6 @@
 
 #if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__
 
-#ifdef __USE_ISOC99
-/* The gcc, version 2.7 or below, has problems with all this inlining
-   code.  So disable it for this version of the compiler.  */
-# if __GNUC_PREREQ (2, 8)
-/* Test for negative number.  Used in the signbit() macro.  */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-#if __GNUC_PREREQ (4, 0)
-  return __builtin_signbitf (__x);
-#else
-  __extension__ union { float __f; int __i; } __u = { __f: __x };
-  return __u.__i < 0;
-#endif
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-#if __GNUC_PREREQ (4, 0)
-  return __builtin_signbit (__x);
-#else
-  __extension__ union { double __d; long long __i; } __u = { __d: __x };
-  return __u.__i < 0;
-#endif
-}
-#  ifdef __LONG_DOUBLE_128__
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
-  return __signbit ((double) __x);
-}
-#  endif
-# endif
-#endif /* __USE_ISOC99 */
-
 #if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
 
 #ifdef __USE_ISOC99
diff --git a/sysdeps/s390/fpu/bits/mathinline.h b/sysdeps/s390/fpu/bits/mathinline.h
index 52e21db..287ac1b 100644
--- a/sysdeps/s390/fpu/bits/mathinline.h
+++ b/sysdeps/s390/fpu/bits/mathinline.h
@@ -29,40 +29,6 @@
 #if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
     && defined __OPTIMIZE__
 
-#ifdef __USE_ISOC99
-
-/* Test for negative number.  Used in the signbit() macro.  */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-  __extension__ union { float __f; int __i; } __u = { __f: __x };
-  return __u.__i < 0;
-}
-
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-  __extension__ union { double __d; long __i; } __u = { __d: __x };
-  return __u.__i < 0;
-}
-
-# ifndef __NO_LONG_DOUBLE_MATH
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
-  __extension__ union { long double __l; int __i[4]; } __u = { __l: __x };
-  return __u.__i[0] < 0;
-}
-# else
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
-  return __signbit ((double) __x);
-}
-# endif
-
-#endif /* C99 */
-
 /* This code is used internally in the GNU libc.  */
 #ifdef __LIBC_INTERNAL_MATH_INLINES
 
diff --git a/sysdeps/sparc/fpu/bits/mathinline.h b/sysdeps/sparc/fpu/bits/mathinline.h
index 6d68136..0c5da62 100644
--- a/sysdeps/sparc/fpu/bits/mathinline.h
+++ b/sysdeps/sparc/fpu/bits/mathinline.h
@@ -37,60 +37,6 @@
    code.  So disable it for this version of the compiler.  */
 # if __GNUC_PREREQ (2, 8)
 
-#  ifdef __USE_ISOC99
-
-/* Test for negative number.  Used in the signbit() macro.  */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-  __extension__ union { float __f; int __i; } __u = { __f: __x };
-  return __u.__i < 0;
-}
-
-#   if __WORDSIZE == 32
-
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
-  return __u.__i[0] < 0;
-}
-
-#    ifndef __NO_LONG_DOUBLE_MATH
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
-  __extension__ union { long double __l; int __i[4]; } __u = { __l: __x };
-  return __u.__i[0] < 0;
-}
-#    else
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
-  return __signbit ((double)__x);
-}
-#    endif
-
-#   else /* sparc64 */
-
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-  __extension__ union { double __d; long int __i; } __u = { __d: __x };
-  return __u.__i < 0;
-}
-
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
-  __extension__ union { long double __l; long int __i[2]; } __u = { __l: __x };
-  return __u.__i[0] < 0;
-}
-
-#   endif /* sparc64 */
-
-#  endif /* __USE_ISOC99 */
-
 #  if !defined __NO_MATH_INLINES && !__GNUC_PREREQ (3, 2)
 
 __MATH_INLINE double
diff --git a/sysdeps/tile/bits/mathinline.h b/sysdeps/tile/bits/mathinline.h
deleted file mode 100644
index 5692d91..0000000
--- a/sysdeps/tile/bits/mathinline.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _MATH_H
-# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
-#endif
-
-#ifndef __extern_always_inline
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE __extern_always_inline
-#endif
-
-
-#if defined __USE_ISOC99 && defined __GNUC__
-
-/* Test for negative number.  Used in the signbit() macro.  */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-  return __builtin_signbitf (__x);
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-  return __builtin_signbit (__x);
-}
-
-#endif
diff --git a/sysdeps/x86/fpu/bits/mathinline.h b/sysdeps/x86/fpu/bits/mathinline.h
index ac31dee..bae6969 100644
--- a/sysdeps/x86/fpu/bits/mathinline.h
+++ b/sysdeps/x86/fpu/bits/mathinline.h
@@ -28,44 +28,6 @@
 
 /* The gcc, version 2.7 or below, has problems with all this inlining
    code.  So disable it for this version of the compiler.  */
-# if __GNUC_PREREQ (2, 8)
-
-/* Test for negative number.  Used in the signbit() macro.  */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-#  ifdef __SSE2_MATH__
-  int __m;
-  __asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
-  return (__m & 0x8) != 0;
-#  else
-  __extension__ union { float __f; int __i; } __u = { __f: __x };
-  return __u.__i < 0;
-#  endif
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-#  ifdef __SSE2_MATH__
-  int __m;
-  __asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
-  return (__m & 0x80) != 0;
-#  else
-  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
-  return __u.__i[1] < 0;
-#  endif
-}
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
-  __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
-  return (__u.__i[2] & 0x8000) != 0;
-}
-
-# endif
-
-/* The gcc, version 2.7 or below, has problems with all this inlining
-   code.  So disable it for this version of the compiler.  */
 #if __GNUC_PREREQ (2, 8)
 # if !__GNUC_PREREQ (3, 4) && !defined __NO_MATH_INLINES \
      && defined __OPTIMIZE__

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1e6d07234fc0edcf0e88d75cf48f0b0dbbea3f39

commit 1e6d07234fc0edcf0e88d75cf48f0b0dbbea3f39
Author: Wilco Dijkstra <wdijkstr@arm.com>
Date:   Thu Sep 28 19:20:33 2017 +0100

    Simplify C99 isgreater macros
    
    Simplify the C99 isgreater macros.  Although some support was added
    in GCC 2.97, not all targets added support until GCC 3.1.  Therefore
    only use the builtins in math.h from GCC 3.1 onwards, and defer to
    generic macros otherwise.  Improve the generic isunordered macro
    to use compares rather than call fpclassify twice - this is not only
    faster but also correct for signaling NaNs.
    
    	* math/math.h: Improve handling of C99 isgreater macros.
    	* sysdeps/alpha/fpu/bits/mathinline.h: Remove isgreater macros.
    	* sysdeps/m68k/m680x0/fpu/bits/mathinline.h: Likewise.
    	* sysdeps/powerpc/bits/mathinline.h: Likewise.
    	* sysdeps/sparc/fpu/bits/mathinline.h: Likewise.
    	* sysdeps/x86/fpu/bits/mathinline.h: Likewise.

diff --git a/ChangeLog b/ChangeLog
index 8fd06de..85ae290 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-09-28  Wilco Dijkstra  <wdijkstr@arm.com>
+
+	* math/math.h: Improve handling of C99 isgreater macros.
+	* sysdeps/alpha/fpu/bits/mathinline.h: Remove isgreater macros.
+	* sysdeps/m68k/m680x0/fpu/bits/mathinline.h: Likewise.
+	* sysdeps/powerpc/bits/mathinline.h: Likewise.
+	* sysdeps/sparc/fpu/bits/mathinline.h: Likewise.
+	* sysdeps/x86/fpu/bits/mathinline.h: Likewise.
+
 2017-09-28  Szabolcs Nagy  <szabolcs.nagy@arm.com>
 
 	* sysdeps/aarch64/libm-test-ulps: Update.
diff --git a/math/math.h b/math/math.h
index c6c289d..e72c12f 100644
--- a/math/math.h
+++ b/math/math.h
@@ -652,19 +652,41 @@ iszero (__T __val)
 # define __NO_MATH_INLINES	1
 #endif
 
-#if defined __USE_ISOC99 && __GNUC_PREREQ(2,97)
+#ifdef __USE_ISOC99
+# if __GNUC_PREREQ (3, 1)
 /* 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)
+   in 2.97, but not all cpus added their patterns until 3.1.  Therefore
+   we enable the builtins from 3.1 onwards and use a generic implementation
+   othwerwise.  */
+#  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
+#  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; }))
+/* isunordered must always check both operands first for signaling NaNs.  */
+#  define isunordered(x, y) \
+  (__extension__ ({ __typeof__ (x) __u = (x); __typeof__ (y) __v = (y); \
+		    __u != __v && (__u != __u || __v != __v); }))
+# endif
 #endif
 
 /* Get machine-dependent inline versions (if there are any).  */
@@ -758,59 +780,6 @@ iszero (__T __val)
 # endif
 #endif /* __FINITE_MATH_ONLY__ > 0.  */
 
-#ifdef __USE_ISOC99
-/* If we've still got undefined comparison macros, provide defaults.  */
-
-/* Return nonzero value if X is greater than Y.  */
-# ifndef isgreater
-#  define isgreater(x, y) \
-  (__extension__							      \
-   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
-      !isunordered (__x, __y) && __x > __y; }))
-# endif
-
-/* Return nonzero value if X is greater than or equal to Y.  */
-# ifndef isgreaterequal
-#  define isgreaterequal(x, y) \
-  (__extension__							      \
-   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
-      !isunordered (__x, __y) && __x >= __y; }))
-# endif
-
-/* Return nonzero value if X is less than Y.  */
-# ifndef isless
-#  define isless(x, y) \
-  (__extension__							      \
-   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
-      !isunordered (__x, __y) && __x < __y; }))
-# endif
-
-/* Return nonzero value if X is less than or equal to Y.  */
-# ifndef islessequal
-#  define islessequal(x, y) \
-  (__extension__							      \
-   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
-      !isunordered (__x, __y) && __x <= __y; }))
-# endif
-
-/* Return nonzero value if either X is less than Y or Y is less than X.  */
-# ifndef islessgreater
-#  define islessgreater(x, y) \
-  (__extension__							      \
-   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
-      !isunordered (__x, __y) && (__x < __y || __y < __x); }))
-# endif
-
-/* Return nonzero value if arguments are unordered.  */
-# ifndef isunordered
-#  define isunordered(u, v) \
-  (__extension__							      \
-   ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v);			      \
-      fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; }))
-# endif
-
-#endif
-
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
 /* An expression whose type has the widest of the evaluation formats
    of X and Y (which are of floating-point types).  */
diff --git a/sysdeps/alpha/fpu/bits/mathinline.h b/sysdeps/alpha/fpu/bits/mathinline.h
index 00c8c42..dad99d3 100644
--- a/sysdeps/alpha/fpu/bits/mathinline.h
+++ b/sysdeps/alpha/fpu/bits/mathinline.h
@@ -27,21 +27,6 @@
 # define __MATH_INLINE __extern_inline
 #endif
 
-#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, __u = (u), __v = (v);			\
-      __asm ("cmptun/su %1,%2,%0\n\ttrapb"		\
-	     : "=&f" (__r) : "f" (__u), "f"(__v));	\
-      __r != 0; }))
-#endif /* ISO C99 */
-
 #if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
     && defined __OPTIMIZE__
 
diff --git a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
index b92b1f8..07ba145 100644
--- a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
+++ b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
@@ -29,60 +29,6 @@
 #ifdef	__GNUC__
 
 #ifdef __USE_ISOC99
-/* GCC 3.1 and up have builtins that actually can be used.  */
-# 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;					\
-      __asm__ ("fcmp%.x %2,%1; fsogt %0"		\
-	       : "=dm" (__result) : "f" (x), "f" (y));	\
-      __result != 0; })
-
-#  define isgreaterequal(x, y)				\
-   __extension__					\
-   ({ char __result;					\
-      __asm__ ("fcmp%.x %2,%1; fsoge %0"		\
-	       : "=dm" (__result) : "f" (x), "f" (y));	\
-      __result != 0; })
-
-#  define isless(x, y)					\
-   __extension__					\
-   ({ char __result;					\
-      __asm__ ("fcmp%.x %2,%1; fsolt %0"		\
-	       : "=dm" (__result) : "f" (x), "f" (y));	\
-      __result != 0; })
-
-#  define islessequal(x, y)				\
-   __extension__					\
-   ({ char __result;					\
-      __asm__ ("fcmp%.x %2,%1; fsole %0"		\
-	       : "=dm" (__result) : "f" (x), "f" (y));	\
-      __result != 0; })
-
-#  define islessgreater(x, y)				\
-   __extension__					\
-   ({ char __result;					\
-      __asm__ ("fcmp%.x %2,%1; fsogl %0"		\
-	       : "=dm" (__result) : "f" (x), "f" (y));	\
-      __result != 0; })
-
-#  define isunordered(x, y)				\
-   __extension__					\
-   ({ char __result;					\
-      __asm__ ("fcmp%.x %2,%1; fsun %0"			\
-	       : "=dm" (__result) : "f" (x), "f" (y));	\
-      __result != 0; })
-# endif /* GCC 3.1 */
 
 /* Test for negative number.  Used in the signbit() macro.  */
 __MATH_INLINE int
diff --git a/sysdeps/powerpc/bits/mathinline.h b/sysdeps/powerpc/bits/mathinline.h
index e5f0cd3..406465f 100644
--- a/sysdeps/powerpc/bits/mathinline.h
+++ b/sysdeps/powerpc/bits/mathinline.h
@@ -29,31 +29,6 @@
 #if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__
 
 #ifdef __USE_ISOC99
-# if !__GNUC_PREREQ (2,97)
-#  define __unordered_cmp(x, y) \
-  (__extension__							      \
-   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
-      unsigned __r;							      \
-      __asm__("fcmpu 7,%1,%2 ; mfcr %0" : "=r" (__r) : "f" (__x), "f"(__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)
-#  define islessequal(x, y) ((__unordered_cmp (x, y) & 0xA) != 0)
-#  define islessgreater(x, y) ((__unordered_cmp (x, y) & 0xC) != 0)
-#  define isunordered(x, y) (__unordered_cmp (x, y) & 1)
-
-# endif /* __GNUC_PREREQ (2,97) */
-
 /* The gcc, version 2.7 or below, has problems with all this inlining
    code.  So disable it for this version of the compiler.  */
 # if __GNUC_PREREQ (2, 8)
diff --git a/sysdeps/sparc/fpu/bits/mathinline.h b/sysdeps/sparc/fpu/bits/mathinline.h
index 60a2028..6d68136 100644
--- a/sysdeps/sparc/fpu/bits/mathinline.h
+++ b/sysdeps/sparc/fpu/bits/mathinline.h
@@ -25,105 +25,6 @@
 
 #ifdef __GNUC__
 
-#if defined __USE_ISOC99 && !__GNUC_PREREQ (3, 0)
-# undef isgreater
-# undef isgreaterequal
-# undef isless
-# undef islessequal
-# undef islessgreater
-# undef isunordered
-
-# if __WORDSIZE == 32
-
-#  ifndef __NO_LONG_DOUBLE_MATH
-
-#   define __unordered_cmp(x, y) \
-  (__extension__							      \
-   ({ unsigned __r;							      \
-      if (sizeof (x) == 4 && sizeof (y) == 4)				      \
-	{								      \
-	  float __x = (x); float __y = (y);				      \
-	  __asm__ ("fcmps %1,%2; st %%fsr, %0" : "=m" (__r) : "f" (__x),      \
-		   "f" (__y) : "cc");					      \
-	}								      \
-      else if (sizeof (x) <= 8 && sizeof (y) <= 8)			      \
-	{								      \
-	  double __x = (x); double __y = (y);				      \
-	  __asm__ ("fcmpd\t%1,%2\n\tst\t%%fsr,%0" : "=m" (__r) : "f" (__x),   \
-		   "f" (__y) : "cc");					      \
-	}								      \
-      else								      \
-	{								      \
-	  long double __x = (x); long double __y = (y);			      \
-	  extern int _Q_cmp (const long double a, const long double b);	      \
-	  __r = _Q_cmp (__x, __y) << 10;				      \
-	}								      \
-      __r; }))
-
-#  else
-
-#   define __unordered_cmp(x, y) \
-  (__extension__							      \
-   ({ unsigned __r;							      \
-      if (sizeof (x) == 4 && sizeof (y) == 4)				      \
-	{								      \
-	  float __x = (x); float __y = (y);				      \
-	  __asm__ ("fcmps %1,%2; st %%fsr, %0" : "=m" (__r) : "f" (__x),      \
-		   "f" (__y) : "cc");					      \
-	}								      \
-      else								      \
-	{								      \
-	  double __x = (x); double __y = (y);				      \
-	  __asm__ ("fcmpd\t%1,%2\n\tst\t%%fsr,%0" : "=m" (__r) : "f" (__x),   \
-		   "f" (__y) : "cc");					      \
-	}								      \
-      __r; }))
-
-#  endif
-
-#  define isgreater(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (2 << 10))
-#  define isgreaterequal(x, y) ((__unordered_cmp (x, y) & (1 << 10)) == 0)
-#  define isless(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (1 << 10))
-#  define islessequal(x, y) ((__unordered_cmp (x, y) & (2 << 10)) == 0)
-#  define islessgreater(x, y) (((__unordered_cmp (x, y) + (1 << 10)) & (2 << 10)) != 0)
-#  define isunordered(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (3 << 10))
-
-# else /* sparc64 */
-
-#  define __unordered_v9cmp(x, y, op, qop) \
-  (__extension__							      \
-   ({ unsigned __r;						      	      \
-      if (sizeof (x) == 4 && sizeof (y) == 4)				      \
-	{								      \
-	  float __x = (x); float __y = (y);				      \
-	  __asm__ ("fcmps\t%%fcc3,%1,%2\n\tmov" op "\t%%fcc3,1,%0"	      \
-		   : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc");      \
-	}								      \
-      else if (sizeof (x) <= 8 && sizeof (y) <= 8)			      \
-	{								      \
-	  double __x = (x); double __y = (y);				      \
-	  __asm__ ("fcmpd\t%%fcc3,%1,%2\n\tmov" op "\t%%fcc3,1,%0"	      \
-		   : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc");      \
-	}								      \
-      else								      \
-	{								      \
-	  long double __x = (x); long double __y = (y);			      \
-	  extern int _Qp_cmp (const long double *a, const long double *b);    \
-	  __r = qop;						      	      \
-	}								      \
-      __r; }))
-
-#  define isgreater(x, y) __unordered_v9cmp(x, y, "g", _Qp_cmp (&__x, &__y) == 2)
-#  define isgreaterequal(x, y) __unordered_v9cmp(x, y, "ge", (_Qp_cmp (&__x, &__y) & 1) == 0)
-#  define isless(x, y) __unordered_v9cmp(x, y, "l", _Qp_cmp (&__x, &__y) == 1)
-#  define islessequal(x, y) __unordered_v9cmp(x, y, "le", (_Qp_cmp (&__x, &__y) & 2) == 0)
-#  define islessgreater(x, y) __unordered_v9cmp(x, y, "lg", ((_Qp_cmp (&__x, &__y) + 1) & 2) != 0)
-#  define isunordered(x, y) __unordered_v9cmp(x, y, "u", _Qp_cmp (&__x, &__y) == 3)
-
-# endif /* sparc64 */
-
-#endif /* __USE_ISOC99 */
-
 #if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) && defined __OPTIMIZE__
 
 # ifndef __extern_inline
diff --git a/sysdeps/x86/fpu/bits/mathinline.h b/sysdeps/x86/fpu/bits/mathinline.h
index bcd99bd..ac31dee 100644
--- a/sysdeps/x86/fpu/bits/mathinline.h
+++ b/sysdeps/x86/fpu/bits/mathinline.h
@@ -26,97 +26,6 @@
 # define __MATH_INLINE __extern_always_inline
 #endif
 
-
-#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
-/* GCC 2.97 and up have builtins that actually can be used.  */
-# 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.  */
-#   define isgreater(x, y) \
-     ({ register char __result;						      \
-	__asm__ ("fucomip %%st(1), %%st; seta %%al"			      \
-		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
-	__result; })
-#   define isgreaterequal(x, y) \
-     ({ register char __result;						      \
-	__asm__ ("fucomip %%st(1), %%st; setae %%al"			      \
-		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
-	__result; })
-
-#   define isless(x, y) \
-     ({ register char __result;						      \
-	__asm__ ("fucomip %%st(1), %%st; seta %%al"			      \
-		 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st");	      \
-	__result; })
-
-#   define islessequal(x, y) \
-     ({ register char __result;						      \
-	__asm__ ("fucomip %%st(1), %%st; setae %%al"			      \
-		 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st");	      \
-	__result; })
-
-#   define islessgreater(x, y) \
-     ({ register char __result;						      \
-	__asm__ ("fucomip %%st(1), %%st; setne %%al"			      \
-		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
-	__result; })
-
-#   define isunordered(x, y) \
-     ({ register char __result;						      \
-	__asm__ ("fucomip %%st(1), %%st; setp %%al"			      \
-		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
-	__result; })
-#  else
-/* This is the dumb, portable code for i386 and above.  */
-#   define isgreater(x, y) \
-     ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al"	      \
-		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
-	__result; })
-
-#   define isgreaterequal(x, y) \
-     ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al"	      \
-		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
-	__result; })
-
-#   define isless(x, y) \
-     ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al"	      \
-		 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
-	__result; })
-
-#   define islessequal(x, y) \
-     ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al"	      \
-		 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
-	__result; })
-
-#   define islessgreater(x, y) \
-     ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al"	      \
-		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
-	__result; })
-
-#   define isunordered(x, y) \
-     ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; sahf; setp %%al"			      \
-		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
-	__result; })
-#  endif /* __i686__ */
-# endif	/* GCC 2.97 */
-
 /* The gcc, version 2.7 or below, has problems with all this inlining
    code.  So disable it for this version of the compiler.  */
 # if __GNUC_PREREQ (2, 8)
@@ -154,8 +63,6 @@ __NTH (__signbitl (long double __x))
 }
 
 # endif
-#endif
-
 
 /* The gcc, version 2.7 or below, has problems with all this inlining
    code.  So disable it for this version of the compiler.  */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                   |   31 ++++++
 math/math.h                                 |   95 ++++++-----------
 sysdeps/alpha/fpu/bits/mathinline.h         |  125 ----------------------
 sysdeps/ia64/fpu/bits/mathinline.h          |   53 ---------
 sysdeps/m68k/coldfire/fpu/bits/mathinline.h |   44 --------
 sysdeps/m68k/m680x0/fpu/bits/mathinline.h   |   78 --------------
 sysdeps/powerpc/bits/mathinline.h           |   60 -----------
 sysdeps/s390/fpu/bits/mathinline.h          |   34 ------
 sysdeps/sparc/fpu/bits/mathinline.h         |  153 ---------------------------
 sysdeps/tile/bits/mathinline.h              |   44 --------
 sysdeps/x86/fpu/bits/mathinline.h           |  131 -----------------------
 11 files changed, 63 insertions(+), 785 deletions(-)
 delete mode 100644 sysdeps/alpha/fpu/bits/mathinline.h
 delete mode 100644 sysdeps/ia64/fpu/bits/mathinline.h
 delete mode 100644 sysdeps/m68k/coldfire/fpu/bits/mathinline.h
 delete mode 100644 sysdeps/tile/bits/mathinline.h


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]