diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2009-11-14 15:59:35 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2009-11-14 16:25:33 +0100 |
commit | 73d6e5c41b61633e22ea74e3aa2df721512dca57 (patch) | |
tree | 496997a4fe295418c7d34b5ffc194c805470fadd | |
parent | 2c3ed060512a2e90ec9f912cf1a5eb1ecd700fb9 (diff) |
libm: fix C99_MATH on __NO_LONG_DOUBLE_MATH hosts
alias l to their normal double counterparts.
Works around problems with libgcc blindly calling __finitel on e.g. ppc32
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r-- | libm/Makefile.in | 5 | ||||
-rw-r--r-- | libm/ldouble_wrappers.c | 39 | ||||
-rw-r--r-- | libm/math_private.h | 13 | ||||
-rw-r--r-- | libm/s_finite.c | 3 | ||||
-rw-r--r-- | libm/s_fpclassify.c | 3 | ||||
-rw-r--r-- | libm/s_isinf.c | 3 | ||||
-rw-r--r-- | libm/s_isnan.c | 3 | ||||
-rw-r--r-- | libm/s_signbit.c | 3 |
8 files changed, 28 insertions, 44 deletions
diff --git a/libm/Makefile.in b/libm/Makefile.in index d17d64fae..f1f42f696 100644 --- a/libm/Makefile.in +++ b/libm/Makefile.in @@ -129,11 +129,6 @@ FL_MOBJ := \ # Not implemented [yet?]: nexttowardl.o LD_MOBJ := \ - __finitel.o \ - __fpclassifyl.o \ - __isinfl.o \ - __isnanl.o \ - __signbitl.o \ acoshl.o \ acosl.o \ asinhl.o \ diff --git a/libm/ldouble_wrappers.c b/libm/ldouble_wrappers.c index c53b99773..9c2e522bb 100644 --- a/libm/ldouble_wrappers.c +++ b/libm/ldouble_wrappers.c @@ -116,16 +116,6 @@ long long func##l(long double x) \ } #endif /* __i386__ && __OPTIMIZE__ */ -#if defined __NO_LONG_DOUBLE_MATH -# define int_WRAPPER_C99(func) /* not needed */ -# else -# define int_WRAPPER_C99(func) \ -int func##l(long double x) \ -{ \ - return func((double) x); \ -} \ -libm_hidden_def(func##l) -#endif /* Implement the following, as defined by SuSv3 */ #if 0 @@ -501,32 +491,3 @@ long double significandl(long double x) return (long double) significand((double) x); } #endif - -#ifdef __DO_C99_MATH__ - -#ifdef L___fpclassifyl -int_WRAPPER1(__fpclassify) -libm_hidden_def(__fpclassifyl) -#endif - -#ifdef L___finitel -int_WRAPPER1(__finite) -libm_hidden_def(__finitel) -#endif - -#ifdef L___signbitl -int_WRAPPER1(__signbit) -libm_hidden_def(__signbitl) -#endif - -#ifdef L___isnanl -int_WRAPPER1(__isnan) -libm_hidden_def(__isnanl) -#endif - -#ifdef L___isinfl -int_WRAPPER1(__isinf) -libm_hidden_def(__isinfl) -#endif - -#endif diff --git a/libm/math_private.h b/libm/math_private.h index 2c5a30ac2..b6bea80ae 100644 --- a/libm/math_private.h +++ b/libm/math_private.h @@ -255,5 +255,18 @@ extern int __kernel_rem_pio2 (double*,double*,int,int,int,const int*) attribu #define math_force_eval(x) do { __typeof(x) __x = (x); __asm __volatile ("" : : "m" (__x)); } while (0) #endif +/* If we do not have long double support, then alias to the double variant. */ +#if defined __NO_LONG_DOUBLE_MATH +# define int_WRAPPER_C99(func) \ +weak_alias(func,func##l) +# else +# define int_WRAPPER_C99(func) \ +int func##l(long double x) \ +{ \ + return func((double) x); \ +} \ +libm_hidden_def(func##l) +#endif + #endif /* _MATH_PRIVATE_H_ */ diff --git a/libm/s_finite.c b/libm/s_finite.c index 9bbc00286..5b2bc2907 100644 --- a/libm/s_finite.c +++ b/libm/s_finite.c @@ -30,3 +30,6 @@ int __finite(double x) return (hx | 0x800fffff) != 0xffffffff; } libm_hidden_def(__finite) +#if defined __DO_C99_MATH__ +int_WRAPPER_C99(__finite) +#endif diff --git a/libm/s_fpclassify.c b/libm/s_fpclassify.c index a05cd563e..99a635474 100644 --- a/libm/s_fpclassify.c +++ b/libm/s_fpclassify.c @@ -40,3 +40,6 @@ int __fpclassify(double x) return retval; } libm_hidden_def(__fpclassify) +#if defined __DO_C99_MATH__ +int_WRAPPER_C99(__fpclassify) +#endif diff --git a/libm/s_isinf.c b/libm/s_isinf.c index 62e5263bb..1f65b8378 100644 --- a/libm/s_isinf.c +++ b/libm/s_isinf.c @@ -21,3 +21,6 @@ int __isinf(double x) return ~(lx >> 31) & (hx >> 30); } libm_hidden_def(__isinf) +#if defined __DO_C99_MATH__ +int_WRAPPER_C99(__isinf) +#endif diff --git a/libm/s_isnan.c b/libm/s_isnan.c index 1bc49cb02..fb44f6a6e 100644 --- a/libm/s_isnan.c +++ b/libm/s_isnan.c @@ -27,3 +27,6 @@ int __isnan(double x) return (int)(((u_int32_t)hx)>>31); } libm_hidden_def(__isnan) +#if defined __DO_C99_MATH__ +int_WRAPPER_C99(__isnan) +#endif diff --git a/libm/s_signbit.c b/libm/s_signbit.c index ee1b7c62e..ca4144af8 100644 --- a/libm/s_signbit.c +++ b/libm/s_signbit.c @@ -33,3 +33,6 @@ __signbit (double x) return hx & 0x80000000; } libm_hidden_def(__signbit) +#if defined __DO_C99_MATH__ +int_WRAPPER_C99(__signbit) +#endif |