This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
copysign in gcc 4.0
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-alpha at gcc dot gnu dot org
- Date: Sun, 6 Feb 2005 19:04:08 -0800
- Subject: copysign in gcc 4.0
Ok?
* math/math_private.h (__copysign): Define as builtin for gcc 4.
(__copysignf, __copysignl): Likewise.
* sysdeps/alpha/fpu/bits/mathinline.h (copysign): Don't define
for gcc 4.0.
(copysignf, copysignl, fabsf, fabs): Likewise.
(__copysign, __copysignf, __copysignl): Remove.
(__fabs, __fabsf): Remove.
Index: math/math_private.h
===================================================================
RCS file: /cvs/glibc/libc/math/math_private.h,v
retrieving revision 1.18
diff -c -p -d -r1.18 math_private.h
*** math/math_private.h 28 Aug 2003 00:10:15 -0000 1.18
--- math/math_private.h 7 Feb 2005 03:00:59 -0000
*************** extern int __kernel_rem_pio2 (double*
*** 192,197 ****
--- 192,201 ----
/* internal functions. */
extern double __copysign (double x, double __y);
+ #if __GNUC_PREREQ (4, 0)
+ extern inline double __copysign (double x, double y)
+ { return __builtin_copysign (x, y); }
+ #endif
/* ieee style elementary float functions */
extern float __ieee754_sqrtf (float);
*************** extern int __kernel_rem_pio2f (float*,
*** 235,240 ****
--- 239,248 ----
/* internal functions. */
extern float __copysignf (float x, float __y);
+ #if __GNUC_PREREQ (4, 0)
+ extern inline float __copysignf (float x, float y)
+ { return __builtin_copysignf (x, y); }
+ #endif
/* ieee style elementary long double functions */
extern long double __ieee754_sqrtl (long double);
*************** extern long double fabsl (long double x)
*** 298,303 ****
--- 306,317 ----
extern void __sincosl (long double, long double *, long double *);
extern long double __logbl (long double x);
extern long double __significandl (long double x);
+
+ #if __GNUC_PREREQ (4, 0)
+ extern inline long double __copysignl (long double x, long double y)
+ { return __builtin_copysignl (x, y); }
+ #endif
+
#endif
/* Prototypes for functions of the IBM Accurate Mathematical Library. */
Index: sysdeps/alpha/fpu/bits/mathinline.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/fpu/bits/mathinline.h,v
retrieving revision 1.14
diff -c -p -d -r1.14 mathinline.h
*** sysdeps/alpha/fpu/bits/mathinline.h 30 Sep 2004 06:16:28 -0000 1.14
--- sysdeps/alpha/fpu/bits/mathinline.h 7 Feb 2005 03:00:59 -0000
***************
*** 46,52 ****
#if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
&& defined __OPTIMIZE__
! #define __inline_copysign(NAME, TYPE) \
__MATH_INLINE TYPE \
__NTH (NAME (TYPE __x, TYPE __y)) \
{ \
--- 46,53 ----
#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)) \
{ \
*************** __inline_copysign (copysignf, float)
*** 60,78 ****
__inline_copysign (__copysign, double)
__inline_copysign (copysign, double)
! #undef __MATH_INLINE_copysign
! #if __GNUC_PREREQ (2, 8)
! __MATH_INLINE float
! __NTH (__fabsf (float __x)) { return __builtin_fabsf (__x); }
! __MATH_INLINE float
! __NTH (fabsf (float __x)) { return __builtin_fabsf (__x); }
! __MATH_INLINE double
! __NTH (__fabs (double __x)) { return __builtin_fabs (__x); }
! __MATH_INLINE double
! __NTH (fabs (double __x)) { return __builtin_fabs (__x); }
! #else
# define __inline_fabs(NAME, TYPE) \
__MATH_INLINE TYPE \
__NTH (NAME (TYPE __x)) \
--- 61,71 ----
__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)) \