Don't use long double *_finite functions if no long double math

This commit is contained in:
Andreas Schwab 2012-04-28 16:39:41 +02:00
parent 7e0d315da8
commit ded5180a3b
2 changed files with 122 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2012-04-28 Andreas Schwab <schwab@linux-m68k.org>
* math/bits/math-finite.h [__NO_LONG_DOUBLE_MATH]: Redirect long
double functions to double *_finite functions.
[BZ #13941]
* sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
(__mpn_extract_long_double): Use DBL_MIN_EXP instead of

View File

@ -24,7 +24,11 @@
extern double __REDIRECT_NTH (acos, (double), __acos_finite);
extern float __REDIRECT_NTH (acosf, (float), __acosf_finite);
#ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (acosl, (long double), __acos_finite);
# else
extern long double __REDIRECT_NTH (acosl, (long double), __acosl_finite);
# endif
#endif
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
@ -32,7 +36,11 @@ extern long double __REDIRECT_NTH (acosl, (long double), __acosl_finite);
extern double __REDIRECT_NTH (acosh, (double), __acosh_finite);
extern float __REDIRECT_NTH (acoshf, (float), __acoshf_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (acoshl, (long double), __acosh_finite);
# else
extern long double __REDIRECT_NTH (acoshl, (long double), __acoshl_finite);
# endif
# endif
#endif
@ -40,15 +48,24 @@ extern long double __REDIRECT_NTH (acoshl, (long double), __acoshl_finite);
extern double __REDIRECT_NTH (asin, (double), __asin_finite);
extern float __REDIRECT_NTH (asinf, (float), __asinf_finite);
#ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (asinl, (long double), __asin_finite);
# else
extern long double __REDIRECT_NTH (asinl, (long double), __asinl_finite);
# endif
#endif
/* atan2. */
extern double __REDIRECT_NTH (atan2, (double, double), __atan2_finite);
extern float __REDIRECT_NTH (atan2f, (float, float), __atan2f_finite);
#ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (atan2l, (long double, long double),
__atan2_finite);
# else
extern long double __REDIRECT_NTH (atan2l, (long double, long double),
__atan2l_finite);
# endif
#endif
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
@ -56,7 +73,11 @@ extern long double __REDIRECT_NTH (atan2l, (long double, long double),
extern double __REDIRECT_NTH (atanh, (double), __atanh_finite);
extern float __REDIRECT_NTH (atanhf, (float), __atanhf_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (atanhl, (long double), __atanh_finite);
# else
extern long double __REDIRECT_NTH (atanhl, (long double), __atanhl_finite);
# endif
# endif
#endif
@ -64,14 +85,22 @@ extern long double __REDIRECT_NTH (atanhl, (long double), __atanhl_finite);
extern double __REDIRECT_NTH (cosh, (double), __cosh_finite);
extern float __REDIRECT_NTH (coshf, (float), __coshf_finite);
#ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (coshl, (long double), __cosh_finite);
# else
extern long double __REDIRECT_NTH (coshl, (long double), __coshl_finite);
# endif
#endif
/* exp. */
extern double __REDIRECT_NTH (exp, (double), __exp_finite);
extern float __REDIRECT_NTH (expf, (float), __expf_finite);
#ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (expl, (long double), __exp_finite);
# else
extern long double __REDIRECT_NTH (expl, (long double), __expl_finite);
# endif
#endif
#ifdef __USE_GNU
@ -79,14 +108,22 @@ extern long double __REDIRECT_NTH (expl, (long double), __expl_finite);
extern double __REDIRECT_NTH (exp10, (double), __exp10_finite);
extern float __REDIRECT_NTH (exp10f, (float), __exp10f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (exp10l, (long double), __exp10_finite);
# else
extern long double __REDIRECT_NTH (exp10l, (long double), __exp10l_finite);
# endif
# endif
/* pow10. */
extern double __REDIRECT_NTH (pow10, (double), __exp10_finite);
extern float __REDIRECT_NTH (pow10f, (float), __exp10f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (pow10l, (long double), __exp10_finite);
# else
extern long double __REDIRECT_NTH (pow10l, (long double), __exp10l_finite);
# endif
# endif
#endif
@ -95,7 +132,11 @@ extern long double __REDIRECT_NTH (pow10l, (long double), __exp10l_finite);
extern double __REDIRECT_NTH (exp2, (double), __exp2_finite);
extern float __REDIRECT_NTH (exp2f, (float), __exp2f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (exp2l, (long double), __exp2_finite);
# else
extern long double __REDIRECT_NTH (exp2l, (long double), __exp2l_finite);
# endif
# endif
#endif
@ -103,8 +144,13 @@ extern long double __REDIRECT_NTH (exp2l, (long double), __exp2l_finite);
extern double __REDIRECT_NTH (fmod, (double, double), __fmod_finite);
extern float __REDIRECT_NTH (fmodf, (float, float), __fmodf_finite);
#ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (fmodl, (long double, long double),
__fmod_finite);
# else
extern long double __REDIRECT_NTH (fmodl, (long double, long double),
__fmodl_finite);
# endif
#endif
#ifdef __USE_ISOC99
@ -112,8 +158,13 @@ extern long double __REDIRECT_NTH (fmodl, (long double, long double),
extern double __REDIRECT_NTH (hypot, (double, double), __hypot_finite);
extern float __REDIRECT_NTH (hypotf, (float, float), __hypotf_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (hypotl, (long double, long double),
__hypot_finite);
# else
extern long double __REDIRECT_NTH (hypotl, (long double, long double),
__hypotl_finite);
# endif
# endif
#endif
@ -122,42 +173,66 @@ extern long double __REDIRECT_NTH (hypotl, (long double, long double),
extern double __REDIRECT_NTH (j0, (double), __j0_finite);
extern float __REDIRECT_NTH (j0f, (float), __j0f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (j0l, (long double), __j0_finite);
# else
extern long double __REDIRECT_NTH (j0l, (long double), __j0l_finite);
# endif
# endif
/* y0. */
extern double __REDIRECT_NTH (y0, (double), __y0_finite);
extern float __REDIRECT_NTH (y0f, (float), __y0f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (y0l, (long double), __y0_finite);
# else
extern long double __REDIRECT_NTH (y0l, (long double), __y0l_finite);
# endif
# endif
/* j1. */
extern double __REDIRECT_NTH (j1, (double), __j1_finite);
extern float __REDIRECT_NTH (j1f, (float), __j1f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (j1l, (long double), __j1_finite);
# else
extern long double __REDIRECT_NTH (j1l, (long double), __j1l_finite);
# endif
# endif
/* y1. */
extern double __REDIRECT_NTH (y1, (double), __y1_finite);
extern float __REDIRECT_NTH (y1f, (float), __y1f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (y1l, (long double), __y1_finite);
# else
extern long double __REDIRECT_NTH (y1l, (long double), __y1l_finite);
# endif
# endif
/* jn. */
extern double __REDIRECT_NTH (jn, (int, double), __jn_finite);
extern float __REDIRECT_NTH (jnf, (int, float), __jnf_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (jnl, (int, long double), __jn_finite);
# else
extern long double __REDIRECT_NTH (jnl, (int, long double), __jnl_finite);
# endif
# endif
/* yn. */
extern double __REDIRECT_NTH (yn, (int, double), __yn_finite);
extern float __REDIRECT_NTH (ynf, (int, float), __ynf_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (ynl, (int, long double), __yn_finite);
# else
extern long double __REDIRECT_NTH (ynl, (int, long double), __ynl_finite);
# endif
# endif
#endif
@ -166,8 +241,13 @@ extern long double __REDIRECT_NTH (ynl, (int, long double), __ynl_finite);
extern double __REDIRECT_NTH (lgamma_r, (double, int *), __lgamma_r_finite);
extern float __REDIRECT_NTH (lgammaf_r, (float, int *), __lgammaf_r_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (lgammal_r, (long double, int *),
__lgamma_r_finite);
# else
extern long double __REDIRECT_NTH (lgammal_r, (long double, int *),
__lgammal_r_finite);
# endif
# endif
#endif
@ -241,14 +321,22 @@ __extern_always_inline long double __NTH (gammal (long double __d))
extern double __REDIRECT_NTH (log, (double), __log_finite);
extern float __REDIRECT_NTH (logf, (float), __logf_finite);
#ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (logl, (long double), __log_finite);
# else
extern long double __REDIRECT_NTH (logl, (long double), __logl_finite);
# endif
#endif
/* log10. */
extern double __REDIRECT_NTH (log10, (double), __log10_finite);
extern float __REDIRECT_NTH (log10f, (float), __log10f_finite);
#ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (log10l, (long double), __log10_finite);
# else
extern long double __REDIRECT_NTH (log10l, (long double), __log10l_finite);
# endif
#endif
#ifdef __USE_ISOC99
@ -256,7 +344,11 @@ extern long double __REDIRECT_NTH (log10l, (long double), __log10l_finite);
extern double __REDIRECT_NTH (log2, (double), __log2_finite);
extern float __REDIRECT_NTH (log2f, (float), __log2f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (log2l, (long double), __log2_finite);
# else
extern long double __REDIRECT_NTH (log2l, (long double), __log2l_finite);
# endif
# endif
#endif
@ -271,16 +363,26 @@ extern long double __REDIRECT_NTH (ldexpl, (long double, int), scalbnl);
extern double __REDIRECT_NTH (pow, (double, double), __pow_finite);
extern float __REDIRECT_NTH (powf, (float, float), __powf_finite);
#ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (powl, (long double, long double),
__pow_finite);
# else
extern long double __REDIRECT_NTH (powl, (long double, long double),
__powl_finite);
# endif
#endif
/* remainder. */
extern double __REDIRECT_NTH (remainder, (double, double), __remainder_finite);
extern float __REDIRECT_NTH (remainderf, (float, float), __remainderf_finite);
#ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (remainderl, (long double, long double),
__remainder_finite);
# else
extern long double __REDIRECT_NTH (remainderl, (long double, long double),
__remainderl_finite);
# endif
#endif
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
@ -288,8 +390,13 @@ extern long double __REDIRECT_NTH (remainderl, (long double, long double),
extern double __REDIRECT_NTH (scalb, (double, double), __scalb_finite);
extern float __REDIRECT_NTH (scalbf, (float, float), __scalbf_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (scalbl, (long double, long double),
__scalb_finite);
# else
extern long double __REDIRECT_NTH (scalbl, (long double, long double),
__scalbl_finite);
# endif
# endif
#endif
@ -297,14 +404,22 @@ extern long double __REDIRECT_NTH (scalbl, (long double, long double),
extern double __REDIRECT_NTH (sinh, (double), __sinh_finite);
extern float __REDIRECT_NTH (sinhf, (float), __sinhf_finite);
#ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (sinhl, (long double), __sinh_finite);
# else
extern long double __REDIRECT_NTH (sinhl, (long double), __sinhl_finite);
# endif
#endif
/* sqrt. */
extern double __REDIRECT_NTH (sqrt, (double), __sqrt_finite);
extern float __REDIRECT_NTH (sqrtf, (float), __sqrtf_finite);
#ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (sqrtl, (long double), __sqrt_finite);
# else
extern long double __REDIRECT_NTH (sqrtl, (long double), __sqrtl_finite);
# endif
#endif
#ifdef __USE_ISOC99
@ -328,7 +443,11 @@ extern long double __gammal_r_finite (long double, int *);
__extern_always_inline long double __NTH (tgammal (long double __d))
{
int __local_signgam = 0;
# ifdef __NO_LONG_DOUBLE_MATH
long double __res = __gamma_r_finite (__d, &__local_signgam);
# else
long double __res = __gammal_r_finite (__d, &__local_signgam);
# endif
return __local_signgam < 0 ? -__res : __res;
}
# endif