]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 25 May 2000 06:27:20 +0000 (06:27 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 25 May 2000 06:27:20 +0000 (06:27 +0000)
2000-05-22  Andreas Jaeger  <aj@suse.de>

* math/Makefile: Add -D__FAST_MATH__ to CFLAGS-test-ifloat.c,
CFLAGS-test-idouble.c, CFLAGS-test-ildoubl.c.

* manual/math.texi (FP Function Optimizations): Document gcc
-ffast-math behaviour with mathinlines.

* sysdeps/i386/fpu/bits/mathinline.h: Only use save inline
functions unless -ffast-math is given to gcc.

ChangeLog
linuxthreads/ChangeLog
manual/math.texi
math/Makefile
sysdeps/i386/fpu/bits/mathinline.h

index 6e47417269353fbf0cb2ff54a1d739ee05970449..4430e3c5547a20730b19f487b6fe50fbe324826a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2000-05-22  Andreas Jaeger  <aj@suse.de>
+
+       * math/Makefile: Add -D__FAST_MATH__ to CFLAGS-test-ifloat.c,
+       CFLAGS-test-idouble.c, CFLAGS-test-ildoubl.c.
+
+       * manual/math.texi (FP Function Optimizations): Document gcc
+       -ffast-math behaviour with mathinlines.
+
+       * sysdeps/i386/fpu/bits/mathinline.h: Only use save inline
+       functions unless -ffast-math is given to gcc.
+
 2000-05-23  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/i386/fpu/bits/mathinline.h (__sincos, __sincosf,
index bde417e2de8578a55baef7229ef57b8dcbb99f31..4bb1a81d174863416efd2d08371e132a09e740f0 100644 (file)
@@ -1,3 +1,30 @@
+2000-05-24  Ulrich Drepper  <drepper@redhat.com>
+
+       * Makefile (libpthread-routines): Add pspinlock.
+       * cancel.c: Rename __pthread_spin_unlock back to __pthread_unlock.
+       Use struct _pthread_fastlock instead of pthread_spinlock_t.
+       * condvar.c: Likewise.
+       * internals.h: Likewise.
+       * join.c: Likewise.
+       * manager.c: Likewise.
+       * mutex.c: Likewise.
+       * pthread.c: Likewise.
+       * rwlock.c: Likewise.
+       * semaphore.c: Likewise.
+       * signals.c: Likewise.
+       * spinlock.h: Likewise.
+       * spinlock.c: Likewise.  Remove pthread_spin_lock functions.
+       * sysdeps/alpha/pspinlock.c: New file.
+       * sysdeps/arm/pspinlock.c: New file.
+       * sysdeps/i386/pspinlock.c: New file.
+       * sysdeps/m68k/pspinlock.c: New file.
+       * sysdeps/mips/pspinlock.c: New file.
+       * sysdeps/powerpc/pspinlock.c: New file.
+       * sysdeps/sparc/sparc32/pspinlock.c: New file.
+       * sysdeps/sparc/sparc64/pspinlock.c: New file.
+       * sysdeps/pthread/bits/pthreadtypes.h: Remove pthread_spinlock_t
+       back to _pthread_fastlock.  Define new pthread_spinlock_t.
+
 2000-05-24  Andreas Jaeger  <aj@suse.de>
 
        * sysdeps/i386/i686/pt-machine.h: Only use LDT on newer kernels.
index 65ec8dd85ea984a09602062323125b46ab2e3d74..cc29cd61015a93b68533b4e5fc1810a1bcad4bfd 100644 (file)
@@ -1770,9 +1770,11 @@ This means that no calls to the library functions may be necessary, and
 can increase the speed of generated code significantly.  The drawback is
 that code size will increase, and the increase is not always negligible.
 
-The speed increase has one drawback: the inline functions might not set
-@code{errno} and might not have the same precission as the library
-functions.
+There are two kind of inline functions: Those that give the same result
+as the library functions and others that might not set @code{errno} and
+might have a reduced precision and/or argument range in comparison with
+the library functions.  The latter inline functions are only available
+if the flag @code{-ffast-math} is given to GNU CC.
 
 In cases where the inline functions and macros are not wanted the symbol
 @code{__NO_MATH_INLINES} should be defined before any system header is
index 408e6ebcf800f55352e893731d43dcf13cb31b89..e545031c67e6efb0466896c23be92bf51abbd718 100644 (file)
@@ -116,9 +116,9 @@ endif
 CFLAGS-test-float.c = -fno-inline -ffloat-store
 CFLAGS-test-double.c = -fno-inline -ffloat-store
 CFLAGS-test-ldouble.c = -fno-inline -ffloat-store
-CFLAGS-test-ifloat.c = -U__LIBC_INTERNAL_MATH_INLINES
-CFLAGS-test-idouble.c = -U__LIBC_INTERNAL_MATH_INLINES
-CFLAGS-test-ildoubl.c = -U__LIBC_INTERNAL_MATH_INLINES
+CFLAGS-test-ifloat.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__
+CFLAGS-test-idouble.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__
+CFLAGS-test-ildoubl.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__
 LDLIBS-test-ifloat = math/libm
 LDLIBS-test-idouble = math/libm
 LDLIBS-test-ildoubl = math/libm
index a1d9532083e3ca95f6928e28765cdc53f69eee4e..9e9db8873d15e929cea36e07c1e756b2a64ffaf6 100644 (file)
@@ -281,6 +281,8 @@ __signbitl (long double __x)
 __inline_mathcode (__sgn, __x, \
   return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0))
 
+/* __FAST_MATH__ is defined by gcc -ffast-math.  */
+#ifdef __FAST_MATH__
 __inline_mathcode (__pow2, __x, \
   register long double __value;                                                      \
   register long double __exponent;                                           \
@@ -305,8 +307,8 @@ __inline_mathcode (__pow2, __x, \
      : "=t" (__value) : "0" (__value), "u" (__exponent));                    \
   return __value)
 
-#ifdef __USE_GNU
-# define __sincos_code \
+# ifdef __USE_GNU
+#  define __sincos_code \
   register long double __cosr;                                               \
   register long double __sinr;                                               \
   __asm __volatile__                                                         \
@@ -345,13 +347,13 @@ __sincosl (long double __x, long double *__sinx, long double *__cosx)
 {
   __sincos_code;
 }
-#endif
+# endif
 
 
 /* Optimized inline implementation, sometimes with reduced precision
    and/or argument range.  */
 
-#define __expm1_code \
+# define __expm1_code \
   register long double __value;                                                      \
   register long double __exponent;                                           \
   register long double __temp;                                               \
@@ -373,7 +375,7 @@ __sincosl (long double __x, long double *__sinx, long double *__cosx)
 __inline_mathcodeNP_ (long double, __expm1l, __x, __expm1_code)
 
 
-#define __exp_code \
+# define __exp_code \
   register long double __value;                                                      \
   register long double __exponent;                                           \
   __asm __volatile__                                                         \
@@ -403,27 +405,6 @@ __inline_mathcodeNP (tan, __x, \
   return __value)
 
 
-#define __atan2_code \
-  register long double __value;                                                      \
-  __asm __volatile__                                                         \
-    ("fpatan"                                                                \
-     : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)");                     \
-  return __value
-__inline_mathcodeNP2 (atan2, __y, __x, __atan2_code)
-__inline_mathcodeNP2_ (long double, __atan2l, __y, __x, __atan2_code)
-
-
-__inline_mathcodeNP2 (fmod, __x, __y, \
-  register long double __value;                                                      \
-  __asm __volatile__                                                         \
-    ("1:       fprem\n\t"                                                    \
-     "fnstsw   %%ax\n\t"                                                     \
-     "sahf\n\t"                                                                      \
-     "jp       1b"                                                           \
-     : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc");                  \
-  return __value)
-
-
 __inline_mathcodeNP2 (pow, __x, __y, \
   register long double __value;                                                      \
   register long double __exponent;                                           \
@@ -472,6 +453,28 @@ __inline_mathcodeNP2 (pow, __x, __y, \
     ("fscale"                                                                \
      : "=t" (__value) : "0" (__value), "u" (__exponent));                    \
   return __value)
+#endif /* __FAST_MATH__ */
+
+
+#define __atan2_code \
+  register long double __value;                                                      \
+  __asm __volatile__                                                         \
+    ("fpatan"                                                                \
+     : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)");                     \
+  return __value
+__inline_mathcodeNP2 (atan2, __y, __x, __atan2_code)
+__inline_mathcodeNP2_ (long double, __atan2l, __y, __x, __atan2_code)
+
+
+__inline_mathcodeNP2 (fmod, __x, __y, \
+  register long double __value;                                                      \
+  __asm __volatile__                                                         \
+    ("1:       fprem\n\t"                                                    \
+     "fnstsw   %%ax\n\t"                                                     \
+     "sahf\n\t"                                                                      \
+     "jp       1b"                                                           \
+     : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc");                  \
+  return __value)
 
 
 __inline_mathopNP (sqrt, "fsqrt")
@@ -487,17 +490,20 @@ __inline_mathop (fabs, "fabs")
 __inline_mathop_ (long double, __fabsl, "fabs")
 #endif
 
+#ifdef __FAST_MATH__
 /* The argument range of this inline version is reduced.  */
 __inline_mathopNP (sin, "fsin")
 /* The argument range of this inline version is reduced.  */
 __inline_mathopNP (cos, "fcos")
 
-__inline_mathop_declNP (atan, "fld1; fpatan", "0" (__x) : "st(1)")
 __inline_mathop_declNP (log, "fldln2; fxch; fyl2x", "0" (__x) : "st(1)")
 __inline_mathop_declNP (log10, "fldlg2; fxch; fyl2x", "0" (__x) : "st(1)")
 
 __inline_mathcodeNP (asin, __x, return __atan2l (__x, __sqrtl (1.0 - __x * __x)))
 __inline_mathcodeNP (acos, __x, return __atan2l (__sqrtl (1.0 - __x * __x), __x))
+#endif /* __FAST_MATH__ */
+
+__inline_mathop_declNP (atan, "fld1; fpatan", "0" (__x) : "st(1)")
 
 __inline_mathcode_ (long double, __sgn1l, __x, \
   union { long double __xld; unsigned int __xi[3]; } __n = { __xld: __x };  \
@@ -713,10 +719,12 @@ __inline_mathcode (__acosh1p, __x, \
 #endif /* __USE_MISC  */
 
 /* Undefine some of the large macros which are not used anymore.  */
-#undef __expm1_code
-#undef __exp_code
 #undef __atan2_code
-#undef __sincos_code
+#ifdef __FAST_MATH__
+# undef __expm1_code
+# undef __exp_code
+# undef __sincos_code
+#endif /* __FAST_MATH__ */
 
 #endif /* __NO_MATH_INLINES  */