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.15-336-g67bb6da


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  67bb6da6798d55fff7ed759af51799dfeca740d3 (commit)
       via  15194b4b3d39e3d2099f9159f3a8abb52d37cc00 (commit)
       via  64e21edef13c6d2592f276d599d8eed01a1b1a9a (commit)
      from  38842f4553f5dfebd8c276e07dbbbadc60921fef (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://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=67bb6da6798d55fff7ed759af51799dfeca740d3

commit 67bb6da6798d55fff7ed759af51799dfeca740d3
Author: Richard Henderson <rth@twiddle.net>
Date:   Wed Mar 7 09:16:59 2012 -0800

    powerpc: Convert __ieee754_sqrt{,f} from macros to inlines.

diff --git a/ChangeLog b/ChangeLog
index 59d7e9e..3cc0d2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-03-08  Richard Henderson  <rth@twiddle.net>
 
+	* sysdeps/powerpc/fpu/math_private.h (__ieee754_sqrt): Convert
+	from macro to inline function; merge with the
+	!__LIBC_INTERNAL_MATH_INLINES version.
+	(__ieee754_sqrtf): Likewise.
+
 	* sysdeps/x86_64/fpu/math_private.h (__rint): Convert from macro
 	to inline function.
 	(__rintf, __floor, __floorf): Likewise.
diff --git a/sysdeps/powerpc/fpu/math_private.h b/sysdeps/powerpc/fpu/math_private.h
index 7bacecb..28628f0 100644
--- a/sysdeps/powerpc/fpu/math_private.h
+++ b/sysdeps/powerpc/fpu/math_private.h
@@ -23,35 +23,49 @@
 #include <sysdep.h>
 #include <ldsodefs.h>
 #include <dl-procinfo.h>
-
 #include <math/math_private.h>
 
 # if __WORDSIZE == 64 || defined _ARCH_PWR4
 #  define __CPU_HAS_FSQRT 1
-
-#ifndef __ieee754_sqrt
-# define __ieee754_sqrt(x)		\
-  ({ double __z;			\
-     __asm __volatile (			\
-	"	fsqrt %0,%1\n"		\
-		: "=f" (__z)		\
-		: "f"(x));		\
-     __z; })
-#endif
-#ifndef __ieee754_sqrtf
-# define __ieee754_sqrtf(x)		\
-  ({ float __z;				\
-     __asm __volatile (			\
-	"	fsqrts %0,%1\n"		\
-		: "=f" (__z)		\
-		: "f"(x));		\
-     __z; })
-#endif
-
 # else
 #  define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
-# endif	// __WORDSIZE == 64 || defined _ARCH_PWR4
+# endif
+
+extern double __slow_ieee754_sqrt (double);
+extern __always_inline double
+__ieee754_sqrt (double __x)
+{
+  double __z;
 
+  if (__CPU_HAS_FSQRT)
+    {
+      /* Volatile is required to prevent the compiler from moving the
+         fsqrt instruction above the branch.  */
+      __asm __volatile ("fsqrt	%0,%1" : "=f" (__z) : "f" (__x));
+    }
+  else
+     __z = __slow_ieee754_sqrt(__x);
+
+  return __z;
+}
+
+extern float __slow_ieee754_sqrtf (float);
+extern __always_inline float
+__ieee754_sqrtf (float __x)
+{
+  float __z;
+
+  if (__CPU_HAS_FSQRT)
+    {
+      /* Volatile is required to prevent the compiler from moving the
+         fsqrts instruction above the branch.  */
+      __asm __volatile ("fsqrts	%0,%1" : "=f" (__z) : "f" (__x));
+    }
+  else
+     __z = __slow_ieee754_sqrtf(__x);
+
+  return __z;
+}
 
 #if defined _ARCH_PWR5X
 
@@ -162,52 +176,4 @@
 
 #endif /* defined _ARCH_PWR6 */
 
-
-# ifndef __LIBC_INTERNAL_MATH_INLINES
-extern double __slow_ieee754_sqrt (double);
-__inline double
-__ieee754_sqrt (double __x)
-{
-  double __z;
-
-  /* If the CPU is 64-bit we can use the optional FP instructions.  */
-  if (__CPU_HAS_FSQRT)
-  {
-    /* Volatile is required to prevent the compiler from moving the
-       fsqrt instruction above the branch.  */
-     __asm __volatile (
-	"	fsqrt	%0,%1\n"
-		: "=f" (__z)
-		: "f" (__x));
-  }
-  else
-     __z = __slow_ieee754_sqrt(__x);
-
-  return __z;
-}
-
-extern float __slow_ieee754_sqrtf (float);
-
-__inline float
-__ieee754_sqrtf (float __x)
-{
-  float __z;
-
-  /* If the CPU is 64-bit we can use the optional FP instructions.  */
-  if (__CPU_HAS_FSQRT)
-  {
-    /* Volatile is required to prevent the compiler from moving the
-       fsqrts instruction above the branch.  */
-     __asm __volatile (
-	"	fsqrts	%0,%1\n"
-		: "=f" (__z)
-		: "f" (__x));
-  }
-  else
-     __z = __slow_ieee754_sqrtf(__x);
-
-  return __z;
-}
-#endif /* __LIBC_INTERNAL_MATH_INLINES */
-
 #endif /* _PPC_MATH_PRIVATE_H_ */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=15194b4b3d39e3d2099f9159f3a8abb52d37cc00

commit 15194b4b3d39e3d2099f9159f3a8abb52d37cc00
Author: Richard Henderson <rth@twiddle.net>
Date:   Tue Mar 6 15:58:51 2012 -0800

    x86_64: Convert __rint* and __floor* from macros to inlines.

diff --git a/ChangeLog b/ChangeLog
index d8d167a..59d7e9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-03-08  Richard Henderson  <rth@twiddle.net>
 
+	* sysdeps/x86_64/fpu/math_private.h (__rint): Convert from macro
+	to inline function.
+	(__rintf, __floor, __floorf): Likewise.
+
 	* sysdeps/x86_64/fpu/math_private.h (__ieee754_sqrt): Convert from
 	macro to inline function.
 	(__ieee754_sqrtf, __ieee754_sqrtl): Likewise.
diff --git a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h
index 07bc7e3..9b8d31d 100644
--- a/sysdeps/x86_64/fpu/math_private.h
+++ b/sysdeps/x86_64/fpu/math_private.h
@@ -123,60 +123,54 @@ __ieee754_sqrtl (long double d)
 }
 
 #ifdef __SSE4_1__
-# ifndef __rint
-#  if defined __AVX__ || defined SSE2AVX
-#   define __rint(d) \
-  ({ double __res; \
-    asm ("vroundsd $4, %1, %0, %0" : "=x" (__res) : "xm" ((double) (d)));      \
-     __res; })
-#  else
-#   define __rint(d) \
-  ({ double __res; \
-    asm ("roundsd $4, %1, %0" : "=x" (__res) : "xm" ((double) (d)));	      \
-     __res; })
-#  endif
+extern __always_inline double
+__rint (double d)
+{
+  double res;
+# if defined __AVX__ || defined SSE2AVX
+  asm ("vroundsd $4, %1, %0, %0" : "=x" (res) : "xm" (d));
+# else
+  asm ("roundsd $4, %1, %0" : "=x" (res) : "xm" (d));
 # endif
-# ifndef __rintf
-#  if defined __AVX__ || defined SSE2AVX
-#   define __rintf(d) \
-  ({ float __res; \
-    asm ("vroundss $4, %1, %0, %0" : "=x" (__res) : "xm" ((float) (d)));      \
-     __res; })
-#  else
-#   define __rintf(d) \
-  ({ float __res; \
-    asm ("roundss $4, %1, %0" : "=x" (__res) : "xm" ((float) (d)));	      \
-     __res; })
-#  endif
+  return res;
+}
+
+extern __always_inline float
+__rintf (float d)
+{
+  float res;
+# if defined __AVX__ || defined SSE2AVX
+  asm ("vroundss $4, %1, %0, %0" : "=x" (res) : "xm" (d));
+# else
+  asm ("roundss $4, %1, %0" : "=x" (res) : "xm" (d));
 # endif
+  return res;
+}
 
-# ifndef __floor
-#  if defined __AVX__ || defined SSE2AVX
-#   define __floor(d) \
-  ({ double __res; \
-    asm ("vroundsd $1, %1, %0, %0" : "=x" (__res) : "xm" ((double) (d)));      \
-     __res; })
-#  else
-#   define __floor(d) \
-  ({ double __res; \
-    asm ("roundsd $1, %1, %0" : "=x" (__res) : "xm" ((double) (d)));	      \
-     __res; })
-#  endif
+extern __always_inline double
+__floor (double d)
+{
+  double res;
+# if defined __AVX__ || defined SSE2AVX
+  asm ("vroundsd $1, %1, %0, %0" : "=x" (res) : "xm" (d));
+# else
+  asm ("roundsd $1, %1, %0" : "=x" (res) : "xm" (d));
 # endif
-# ifndef __floorf
-#  if defined __AVX__ || defined SSE2AVX
-#   define __floorf(d) \
-  ({ float __res; \
-    asm ("vroundss $1, %1, %0, %0" : "=x" (__res) : "xm" ((float) (d)));      \
-     __res; })
-#  else
-#   define __floorf(d) \
-  ({ float __res; \
-    asm ("roundss $1, %1, %0" : "=x" (__res) : "xm" ((float) (d)));	      \
-     __res; })
+  return res;
+}
+
+extern __always_inline float
+__floorf (float d)
+{
+  float res;
+# if defined __AVX__ || defined SSE2AVX
+  asm ("vroundss $1, %1, %0, %0" : "=x" (res) : "xm" (d));
+# else
+  asm ("roundss $1, %1, %0" : "=x" (res) : "xm" (d));
 #  endif
-# endif
-#endif
+  return res;
+}
+#endif /* __SSE4_1__ */
 
 
 /* Specialized variants of the <fenv.h> interfaces which only handle

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=64e21edef13c6d2592f276d599d8eed01a1b1a9a

commit 64e21edef13c6d2592f276d599d8eed01a1b1a9a
Author: Richard Henderson <rth@twiddle.net>
Date:   Tue Mar 6 15:41:14 2012 -0800

    x86_64: Convert __ieee754_sqrt{,f,l} from macros to inlines.

diff --git a/ChangeLog b/ChangeLog
index 0f89a95..d8d167a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-03-08  Richard Henderson  <rth@twiddle.net>
 
+	* sysdeps/x86_64/fpu/math_private.h (__ieee754_sqrt): Convert from
+	macro to inline function.
+	(__ieee754_sqrtf, __ieee754_sqrtl): Likewise.
+
 	* sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h: Include <math_private.h>,
 	not <math/math_private.h>.
 
diff --git a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h
index 8e79718..07bc7e3 100644
--- a/sysdeps/x86_64/fpu/math_private.h
+++ b/sysdeps/x86_64/fpu/math_private.h
@@ -1,4 +1,5 @@
-#ifndef _MATH_PRIVATE_H
+#ifndef X86_64_MATH_PRIVATE_H
+#define X86_64_MATH_PRIVATE_H 1
 
 #define math_opt_barrier(x) \
   ({ __typeof(x) __x;							      \
@@ -67,7 +68,6 @@
     f = f__;								      \
   } while (0)
 
-#endif
 
 #define __isnan(d) \
   ({ long int __di; EXTRACT_WORDS64 (__di, (double) (d));		      \
@@ -90,29 +90,37 @@
   ({ int __di; GET_FLOAT_WORD (__di, (float) d);			      \
      (__di & 0x7fffffff) < 0x7f800000; })
 
+extern __always_inline double
+__ieee754_sqrt (double d)
+{
+  double res;
 #if defined __AVX__ || defined SSE2AVX
-# define __ieee754_sqrt(d) \
-  ({ double __res;							      \
-    asm ("vsqrtsd %1, %0, %0" : "=x" (__res) : "xm" ((double) (d)));	      \
-     __res; })
-# define __ieee754_sqrtf(d) \
-  ({ float __res;							      \
-    asm ("vsqrtss %1, %0, %0" : "=x" (__res) : "xm" ((float) (d)));	      \
-     __res; })
+  asm ("vsqrtsd %1, %0, %0" : "=x" (res) : "xm" (d));
 #else
-# define __ieee754_sqrt(d) \
-  ({ double __res;							      \
-    asm ("sqrtsd %1, %0" : "=x" (__res) : "xm" ((double) (d)));		      \
-     __res; })
-# define __ieee754_sqrtf(d) \
-  ({ float __res;							      \
-    asm ("sqrtss %1, %0" : "=x" (__res) : "xm" ((float) (d)));		      \
-     __res; })
+  asm ("sqrtsd %1, %0" : "=x" (res) : "xm" (d));
 #endif
-#define __ieee754_sqrtl(d) \
-  ({ long double __res;							      \
-    asm ("fsqrt" : "=t" (__res) : "0" ((long double) (d)));		      \
-     __res; })
+  return res;
+}
+
+extern __always_inline float
+__ieee754_sqrtf (float d)
+{
+  float res;
+#if defined __AVX__ || defined SSE2AVX
+  asm ("vsqrtss %1, %0, %0" : "=x" (res) : "xm" (d));
+#else
+  asm ("sqrtss %1, %0" : "=x" (res) : "xm" (d));
+#endif
+  return res;
+}
+
+extern __always_inline long double
+__ieee754_sqrtl (long double d)
+{
+  long double res;
+  asm ("fsqrt" : "=t" (res) : "0" (d));
+  return res;
+}
 
 #ifdef __SSE4_1__
 # ifndef __rint
@@ -226,3 +234,5 @@
 #undef libc_feupdateenvf
 #define libc_feupdateenvf(e) libc_feupdateenv (e)
 // #define libc_feupdateenvl(e) (void) feupdateenv (e)
+
+#endif /* X86_64_MATH_PRIVATE_H */

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

Summary of changes:
 ChangeLog                          |   13 +++
 sysdeps/powerpc/fpu/math_private.h |  106 +++++++++-----------------
 sysdeps/x86_64/fpu/math_private.h  |  148 ++++++++++++++++++-----------------
 3 files changed, 125 insertions(+), 142 deletions(-)


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]