diff --git a/ChangeLog b/ChangeLog index 27c491de9f..6e901aa96f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,1130 @@ +1999-07-12 Jakub Jelinek + + * stdio-common/printf_fp.c (__printf_fp): Adjust for IEEE quad + as _FPIO_CONST_OFFSET does not cover all bits after binary dot. + * sysdeps/generic/printf_fphex.c (__printf_fphex): Support IEEE + quad by moving long double support into PRINT_FPHEX_LONG_DOUBLE + macro. + * sysdeps/alpha/Implies: Imply ieee754/flt-32 and ieee754/dbl-64 + instead of ieee754. + * sysdeps/arm/Implies: Likewise. + * sysdeps/i386/Implies: Imply ieee754/flt-32, ieee754/dbl-64, and + ieee754/ldbl-96 instead of ieee754. + * sysdeps/i386/i686/Implies: Remove implication for libm-i387/i686. + * sysdeps/generic/strtold.c: Remove. + * sysdeps/generic/e_atanhl.c: New file. + * sysdeps/generic/e_coshl.c: New file. + * sysdeps/generic/e_sinhl.c: New file. + * sysdeps/generic/e_gammal_r.c: New file. + * sysdeps/generic/e_hypotl.c: New file. + * sysdeps/generic/s_cbrtl.c: New file. + * sysdeps/generic/s_asinhl.c: New file. + * sysdeps/generic/s_tanhl.c: New file. + * sysdeps/generic/w_expl.c: New file. + * sysdeps/m68k/Implies: Imply ieee754/flt-32, ieee754/dbl-64, and + ieee754/ldbl-96 instead of ieee754. + * sysdeps/m68k/strtold.c: Include ldbl-96 version of strtold. + * sysdeps/m68k/printf_fphex.c: Include ldbl-96 version of + printf_fphex. + * sysdeps/mips/Implies: Imply ieee754/flt-32 and ieee754/dbl-64 + instead of ieee754. + * sysdeps/mips/mips64/Implies: Likewise. + * sysdeps/powerpc/Implies: Likewise. + * sysdeps/sparc/Implies: Remove. + * sysdeps/sparc/sparc32/Implies: Imply ieee754/flt-32 and + ieee754/dbl-64. + * sysdeps/sparc/sparc64/Implies: Imply ieee754/flt-32, ieee754/dbl-64, + and ieee754/ldbl-128. + + * sysdeps/sparc/bits/wordsize.h: Remove. + * sysdeps/sparc/fpu/bits/mathinline.h: New file. + * sysdeps/sparc/fpu/bits/mathdef.h: __NO_LONG_DOUBLE_MATH + only for sparc32. + * sysdeps/sparc/sparc32/fpu/bits/huge_val.h: New file. + * sysdeps/sparc/sparc32/bits/wordsize.h: New file. + * sysdeps/sparc/sparc64/fpu/bits/huge_val.h: New file. + * sysdeps/sparc/sparc64/bits/wordsize.h: New file. + * sysdeps/sparc/sparc64/Makefile: Add IEEE quad long double + support. + + * sysdeps/sparc/sparc64/addmul_1.S: Fix miscalculation + of carries. Optimize. + + * sysdeps/libm-ieee754/e_exp10.c: Moved to ... + * math/e_exp10.c: ...here. + * sysdeps/libm-ieee754/e_exp10f.c: Moved to ... + * math/e_exp10f.c: ...here. + * sysdeps/libm-ieee754/e_exp10l.c: Moved to ... + * math/e_exp10l.c: ...here. + * sysdeps/libm-ieee754/e_scalb.c: Moved to ... + * math/e_scalb.c: ...here. + * sysdeps/libm-ieee754/e_scalbf.c: Moved to ... + * math/e_scalbf.c: ...here. + * sysdeps/libm-ieee754/e_scalbl.c: Moved to ... + * math/e_scalbl.c: ...here. + * sysdeps/libm-ieee754/s_cacos.c: Moved to ... + * math/s_cacos.c: ...here. + * sysdeps/libm-ieee754/s_cacosf.c: Moved to ... + * math/s_cacosf.c: ...here. + * sysdeps/libm-ieee754/s_cacosh.c: Moved to ... + * math/s_cacosh.c: ...here. + * sysdeps/libm-ieee754/s_cacoshf.c: Moved to ... + * math/s_cacoshf.c: ...here. + * sysdeps/libm-ieee754/s_cacoshl.c: Moved to ... + * math/s_cacoshl.c: ...here. + * sysdeps/libm-ieee754/s_cacosl.c: Moved to ... + * math/s_cacosl.c: ...here. + * sysdeps/libm-ieee754/s_casin.c: Moved to ... + * math/s_casin.c: ...here. + * sysdeps/libm-ieee754/s_casinf.c: Moved to ... + * math/s_casinf.c: ...here. + * sysdeps/libm-ieee754/s_casinh.c: Moved to ... + * math/s_casinh.c: ...here. + * sysdeps/libm-ieee754/s_casinhf.c: Moved to ... + * math/s_casinhf.c: ...here. + * sysdeps/libm-ieee754/s_casinhl.c: Moved to ... + * math/s_casinhl.c: ...here. + * sysdeps/libm-ieee754/s_casinl.c: Moved to ... + * math/s_casinl.c: ...here. + * sysdeps/libm-ieee754/s_catan.c: Moved to ... + * math/s_catan.c: ...here. + * sysdeps/libm-ieee754/s_catanf.c: Moved to ... + * math/s_catanf.c: ...here. + * sysdeps/libm-ieee754/s_catanh.c: Moved to ... + * math/s_catanh.c: ...here. + * sysdeps/libm-ieee754/s_catanhf.c: Moved to ... + * math/s_catanhf.c: ...here. + * sysdeps/libm-ieee754/s_catanhl.c: Moved to ... + * math/s_catanhl.c: ...here. + * sysdeps/libm-ieee754/s_catanl.c: Moved to ... + * math/s_catanl.c: ...here. + * sysdeps/libm-ieee754/s_ccos.c: Moved to ... + * math/s_ccos.c: ...here. + * sysdeps/libm-ieee754/s_ccosf.c: Moved to ... + * math/s_ccosf.c: ...here. + * sysdeps/libm-ieee754/s_ccosh.c: Moved to ... + * math/s_ccosh.c: ...here. + * sysdeps/libm-ieee754/s_ccoshf.c: Moved to ... + * math/s_ccoshf.c: ...here. + * sysdeps/libm-ieee754/s_ccoshl.c: Moved to ... + * math/s_ccoshl.c: ...here. + * sysdeps/libm-ieee754/s_ccosl.c: Moved to ... + * math/s_ccosl.c: ...here. + * sysdeps/libm-ieee754/s_cexp.c: Moved to ... + * math/s_cexp.c: ...here. + * sysdeps/libm-ieee754/s_cexpf.c: Moved to ... + * math/s_cexpf.c: ...here. + * sysdeps/libm-ieee754/s_cexpl.c: Moved to ... + * math/s_cexpl.c: ...here. + * sysdeps/libm-ieee754/s_clog.c: Moved to ... + * math/s_clog.c: ...here. + * sysdeps/libm-ieee754/s_clog10.c: Moved to ... + * math/s_clog10.c: ...here. + * sysdeps/libm-ieee754/s_clog10f.c: Moved to ... + * math/s_clog10f.c: ...here. + * sysdeps/libm-ieee754/s_clog10l.c: Moved to ... + * math/s_clog10l.c: ...here. + * sysdeps/libm-ieee754/s_clogf.c: Moved to ... + * math/s_clogf.c: ...here. + * sysdeps/libm-ieee754/s_clogl.c: Moved to ... + * math/s_clogl.c: ...here. + * sysdeps/libm-ieee754/s_cpow.c: Moved to ... + * math/s_cpow.c: ...here. + * sysdeps/libm-ieee754/s_cpowf.c: Moved to ... + * math/s_cpowf.c: ...here. + * sysdeps/libm-ieee754/s_cpowl.c: Moved to ... + * math/s_cpowl.c: ...here. + * sysdeps/libm-ieee754/s_cproj.c: Moved to ... + * math/s_cproj.c: ...here. + * sysdeps/libm-ieee754/s_cprojf.c: Moved to ... + * math/s_cprojf.c: ...here. + * sysdeps/libm-ieee754/s_cprojl.c: Moved to ... + * math/s_cprojl.c: ...here. + * sysdeps/libm-ieee754/s_csin.c: Moved to ... + * math/s_csin.c: ...here. + * sysdeps/libm-ieee754/s_csinf.c: Moved to ... + * math/s_csinf.c: ...here. + * sysdeps/libm-ieee754/s_csinh.c: Moved to ... + * math/s_csinh.c: ...here. + * sysdeps/libm-ieee754/s_csinhf.c: Moved to ... + * math/s_csinhf.c: ...here. + * sysdeps/libm-ieee754/s_csinhl.c: Moved to ... + * math/s_csinhl.c: ...here. + * sysdeps/libm-ieee754/s_csinl.c: Moved to ... + * math/s_csinl.c: ...here. + * sysdeps/libm-ieee754/s_csqrt.c: Moved to ... + * math/s_csqrt.c: ...here. + * sysdeps/libm-ieee754/s_csqrtf.c: Moved to ... + * math/s_csqrtf.c: ...here. + * sysdeps/libm-ieee754/s_csqrtl.c: Moved to ... + * math/s_csqrtl.c: ...here. + * sysdeps/libm-ieee754/s_ctan.c: Moved to ... + * math/s_ctan.c: ...here. + * sysdeps/libm-ieee754/s_ctanf.c: Moved to ... + * math/s_ctanf.c: ...here. + * sysdeps/libm-ieee754/s_ctanh.c: Moved to ... + * math/s_ctanh.c: ...here. + * sysdeps/libm-ieee754/s_ctanhf.c: Moved to ... + * math/s_ctanhf.c: ...here. + * sysdeps/libm-ieee754/s_ctanhl.c: Moved to ... + * math/s_ctanhl.c: ...here. + * sysdeps/libm-ieee754/s_ctanl.c: Moved to ... + * math/s_ctanl.c: ...here. + * sysdeps/libm-ieee754/s_fdim.c: Moved to ... + * math/s_fdim.c: ...here. + * sysdeps/libm-ieee754/s_fdimf.c: Moved to ... + * math/s_fdimf.c: ...here. + * sysdeps/libm-ieee754/s_fdiml.c: Moved to ... + * math/s_fdiml.c: ...here. + * sysdeps/libm-ieee754/s_fma.c: Moved to ... + * math/s_fma.c: ...here. + * sysdeps/libm-ieee754/s_fmaf.c: Moved to ... + * math/s_fmaf.c: ...here. + * sysdeps/libm-ieee754/s_fmal.c: Moved to ... + * math/s_fmal.c: ...here. + * sysdeps/libm-ieee754/s_fmax.c: Moved to ... + * math/s_fmax.c: ...here. + * sysdeps/libm-ieee754/s_fmaxf.c: Moved to ... + * math/s_fmaxf.c: ...here. + * sysdeps/libm-ieee754/s_fmaxl.c: Moved to ... + * math/s_fmaxl.c: ...here. + * sysdeps/libm-ieee754/s_fmin.c: Moved to ... + * math/s_fmin.c: ...here. + * sysdeps/libm-ieee754/s_fminf.c: Moved to ... + * math/s_fminf.c: ...here. + * sysdeps/libm-ieee754/s_fminl.c: Moved to ... + * math/s_fminl.c: ...here. + * sysdeps/libm-ieee754/s_ldexp.c: Moved to ... + * math/s_ldexp.c: ...here. + * sysdeps/libm-ieee754/s_ldexpf.c: Moved to ... + * math/s_ldexpf.c: ...here. + * sysdeps/libm-ieee754/s_ldexpl.c: Moved to ... + * math/s_ldexpl.c: ...here. + * sysdeps/libm-ieee754/s_nan.c: Moved to ... + * math/s_nan.c: ...here. + * sysdeps/libm-ieee754/s_nanf.c: Moved to ... + * math/s_nanf.c: ...here. + * sysdeps/libm-ieee754/s_nanl.c: Moved to ... + * math/s_nanl.c: ...here. + * sysdeps/libm-ieee754/s_significand.c: Moved to ... + * math/s_significand.c: ...here. + * sysdeps/libm-ieee754/s_significandf.c: Moved to ... + * math/s_significandf.c: ...here. + * sysdeps/libm-ieee754/s_significandl.c: Moved to ... + * math/s_significandl.c: ...here. + Avoid conversion from int to double and then to long double. + * sysdeps/libm-ieee754/w_acos.c: Moved to ... + * math/w_acos.c: ...here. + * sysdeps/libm-ieee754/w_acosf.c: Moved to ... + * math/w_acosf.c: ...here. + * sysdeps/libm-ieee754/w_acosh.c: Moved to ... + * math/w_acosh.c: ...here. + * sysdeps/libm-ieee754/w_acoshf.c: Moved to ... + * math/w_acoshf.c: ...here. + * sysdeps/libm-ieee754/w_acoshl.c: Moved to ... + * math/w_acoshl.c: ...here. + * sysdeps/libm-ieee754/w_acosl.c: Moved to ... + * math/w_acosl.c: ...here. + * sysdeps/libm-ieee754/w_asin.c: Moved to ... + * math/w_asin.c: ...here. + * sysdeps/libm-ieee754/w_asinf.c: Moved to ... + * math/w_asinf.c: ...here. + * sysdeps/libm-ieee754/w_asinl.c: Moved to ... + * math/w_asinl.c: ...here. + * sysdeps/libm-ieee754/w_atan2.c: Moved to ... + * math/w_atan2.c: ...here. + * sysdeps/libm-ieee754/w_atan2f.c: Moved to ... + * math/w_atan2f.c: ...here. + * sysdeps/libm-ieee754/w_atan2l.c: Moved to ... + * math/w_atan2l.c: ...here. + * sysdeps/libm-ieee754/w_atanh.c: Moved to ... + * math/w_atanh.c: ...here. + * sysdeps/libm-ieee754/w_atanhf.c: Moved to ... + * math/w_atanhf.c: ...here. + * sysdeps/libm-ieee754/w_atanhl.c: Moved to ... + * math/w_atanhl.c: ...here. + * sysdeps/libm-ieee754/w_cosh.c: Moved to ... + * math/w_cosh.c: ...here. + * sysdeps/libm-ieee754/w_coshf.c: Moved to ... + * math/w_coshf.c: ...here. + * sysdeps/libm-ieee754/w_coshl.c: Moved to ... + * math/w_coshl.c: ...here. + * sysdeps/libm-ieee754/w_drem.c: Moved to ... + * math/w_drem.c: ...here. + * sysdeps/libm-ieee754/w_dremf.c: Moved to ... + * math/w_dremf.c: ...here. + * sysdeps/libm-ieee754/w_dreml.c: Moved to ... + * math/w_dreml.c: ...here. + * sysdeps/libm-ieee754/w_exp10.c: Moved to ... + * math/w_exp10.c: ...here. + * sysdeps/libm-ieee754/w_exp10f.c: Moved to ... + * math/w_exp10f.c: ...here. + * sysdeps/libm-ieee754/w_exp10l.c: Moved to ... + * math/w_exp10l.c: ...here. + * sysdeps/libm-ieee754/w_exp2.c: Moved to ... + * math/w_exp2.c: ...here. + * sysdeps/libm-ieee754/w_exp2f.c: Moved to ... + * math/w_exp2f.c: ...here. + * sysdeps/libm-ieee754/w_exp2l.c: Moved to ... + * math/w_exp2l.c: ...here. + * sysdeps/libm-ieee754/w_fmod.c: Moved to ... + * math/w_fmod.c: ...here. + * sysdeps/libm-ieee754/w_fmodf.c: Moved to ... + * math/w_fmodf.c: ...here. + * sysdeps/libm-ieee754/w_fmodl.c: Moved to ... + * math/w_fmodl.c: ...here. + * sysdeps/libm-ieee754/w_hypot.c: Moved to ... + * math/w_hypot.c: ...here. + * sysdeps/libm-ieee754/w_hypotf.c: Moved to ... + * math/w_hypotf.c: ...here. + * sysdeps/libm-ieee754/w_hypotl.c: Moved to ... + * math/w_hypotl.c: ...here. + * sysdeps/libm-ieee754/w_j0.c: Moved to ... + * math/w_j0.c: ...here. + * sysdeps/libm-ieee754/w_j0f.c: Moved to ... + * math/w_j0f.c: ...here. + * sysdeps/libm-ieee754/w_j0l.c: Moved to ... + * math/w_j0l.c: ...here. + * sysdeps/libm-ieee754/w_j1.c: Moved to ... + * math/w_j1.c: ...here. + * sysdeps/libm-ieee754/w_j1f.c: Moved to ... + * math/w_j1f.c: ...here. + * sysdeps/libm-ieee754/w_j1l.c: Moved to ... + * math/w_j1l.c: ...here. + * sysdeps/libm-ieee754/w_jn.c: Moved to ... + * math/w_jn.c: ...here. + * sysdeps/libm-ieee754/w_jnf.c: Moved to ... + * math/w_jnf.c: ...here. + * sysdeps/libm-ieee754/w_jnl.c: Moved to ... + * math/w_jnl.c: ...here. + * sysdeps/libm-ieee754/w_lgamma.c: Moved to ... + * math/w_lgamma.c: ...here. + * sysdeps/libm-ieee754/w_lgamma_r.c: Moved to ... + * math/w_lgamma_r.c: ...here. + * sysdeps/libm-ieee754/w_lgammaf.c: Moved to ... + * math/w_lgammaf.c: ...here. + * sysdeps/libm-ieee754/w_lgammaf_r.c: Moved to ... + * math/w_lgammaf_r.c: ...here. + * sysdeps/libm-ieee754/w_lgammal.c: Moved to ... + * math/w_lgammal.c: ...here. + * sysdeps/libm-ieee754/w_lgammal_r.c: Moved to ... + * math/w_lgammal_r.c: ...here. + * sysdeps/libm-ieee754/w_log.c: Moved to ... + * math/w_log.c: ...here. + * sysdeps/libm-ieee754/w_log10.c: Moved to ... + * math/w_log10.c: ...here. + * sysdeps/libm-ieee754/w_log10f.c: Moved to ... + * math/w_log10f.c: ...here. + * sysdeps/libm-ieee754/w_log10l.c: Moved to ... + * math/w_log10l.c: ...here. + * sysdeps/libm-ieee754/w_logf.c: Moved to ... + * math/w_logf.c: ...here. + * sysdeps/libm-ieee754/w_logl.c: Moved to ... + * math/w_logl.c: ...here. + * sysdeps/libm-ieee754/w_pow.c: Moved to ... + * math/w_pow.c: ...here. + * sysdeps/libm-ieee754/w_powf.c: Moved to ... + * math/w_powf.c: ...here. + * sysdeps/libm-ieee754/w_powl.c: Moved to ... + * math/w_powl.c: ...here. + * sysdeps/libm-ieee754/w_remainder.c: Moved to ... + * math/w_remainder.c: ...here. + * sysdeps/libm-ieee754/w_remainderf.c: Moved to ... + * math/w_remainderf.c: ...here. + * sysdeps/libm-ieee754/w_remainderl.c: Moved to ... + * math/w_remainderl.c: ...here. + * sysdeps/libm-ieee754/w_scalb.c: Moved to ... + * math/w_scalb.c: ...here. + * sysdeps/libm-ieee754/w_scalbf.c: Moved to ... + * math/w_scalbf.c: ...here. + * sysdeps/libm-ieee754/w_scalbl.c: Moved to ... + * math/w_scalbl.c: ...here. + * sysdeps/libm-ieee754/w_sinh.c: Moved to ... + * math/w_sinh.c: ...here. + * sysdeps/libm-ieee754/w_sinhf.c: Moved to ... + * math/w_sinhf.c: ...here. + * sysdeps/libm-ieee754/w_sinhl.c: Moved to ... + * math/w_sinhl.c: ...here. + * sysdeps/libm-ieee754/w_sqrt.c: Moved to ... + * math/w_sqrt.c: ...here. + * sysdeps/libm-ieee754/w_sqrtf.c: Moved to ... + * math/w_sqrtf.c: ...here. + * sysdeps/libm-ieee754/w_sqrtl.c: Moved to ... + * math/w_sqrtl.c: ...here. + * sysdeps/libm-ieee754/w_tgamma.c: Moved to ... + * math/w_tgamma.c: ...here. + * sysdeps/libm-ieee754/w_tgammaf.c: Moved to ... + * math/w_tgammaf.c: ...here. + * sysdeps/libm-ieee754/w_tgammal.c: Moved to ... + * math/w_tgammal.c: ...here. + * sysdeps/libm-i387/e_acos.S: Moved to ... + * sysdeps/i386/fpu/e_acos.S: ...here. + * sysdeps/libm-i387/e_acosf.S: Moved to ... + * sysdeps/i386/fpu/e_acosf.S: ...here. + * sysdeps/libm-i387/e_acosh.S: Moved to ... + * sysdeps/i386/fpu/e_acosh.S: ...here. + * sysdeps/libm-i387/e_acoshf.S: Moved to ... + * sysdeps/i386/fpu/e_acoshf.S: ...here. + * sysdeps/libm-i387/e_acoshl.S: Moved to ... + * sysdeps/i386/fpu/e_acoshl.S: ...here. + * sysdeps/libm-i387/e_acosl.S: Moved to ... + * sysdeps/i386/fpu/e_acosl.S: ...here. + * sysdeps/libm-i387/e_asin.S: Moved to ... + * sysdeps/i386/fpu/e_asin.S: ...here. + * sysdeps/libm-i387/e_asinf.S: Moved to ... + * sysdeps/i386/fpu/e_asinf.S: ...here. + * sysdeps/libm-i387/e_asinl.S: Moved to ... + * sysdeps/i386/fpu/e_asinl.S: ...here. + * sysdeps/libm-i387/e_atan2.S: Moved to ... + * sysdeps/i386/fpu/e_atan2.S: ...here. + * sysdeps/libm-i387/e_atan2f.S: Moved to ... + * sysdeps/i386/fpu/e_atan2f.S: ...here. + * sysdeps/libm-i387/e_atan2l.S: Moved to ... + * sysdeps/i386/fpu/e_atan2l.S: ...here. + * sysdeps/libm-i387/e_atanh.S: Moved to ... + * sysdeps/i386/fpu/e_atanh.S: ...here. + * sysdeps/libm-i387/e_atanhf.S: Moved to ... + * sysdeps/i386/fpu/e_atanhf.S: ...here. + * sysdeps/libm-i387/e_atanhl.S: Moved to ... + * sysdeps/i386/fpu/e_atanhl.S: ...here. + * sysdeps/libm-i387/e_exp.S: Moved to ... + * sysdeps/i386/fpu/e_exp.S: ...here. + * sysdeps/libm-i387/e_exp10.S: Moved to ... + * sysdeps/i386/fpu/e_exp10.S: ...here. + * sysdeps/libm-i387/e_exp10f.S: Moved to ... + * sysdeps/i386/fpu/e_exp10f.S: ...here. + * sysdeps/libm-i387/e_exp10l.S: Moved to ... + * sysdeps/i386/fpu/e_exp10l.S: ...here. + * sysdeps/libm-i387/e_expf.S: Moved to ... + * sysdeps/i386/fpu/e_expf.S: ...here. + * sysdeps/libm-i387/e_expl.S: Moved to ... + * sysdeps/i386/fpu/e_expl.S: ...here. + * sysdeps/libm-i387/e_fmod.S: Moved to ... + * sysdeps/i386/fpu/e_fmod.S: ...here. + * sysdeps/libm-i387/e_fmodf.S: Moved to ... + * sysdeps/i386/fpu/e_fmodf.S: ...here. + * sysdeps/libm-i387/e_fmodl.S: Moved to ... + * sysdeps/i386/fpu/e_fmodl.S: ...here. + * sysdeps/libm-i387/e_hypot.S: Moved to ... + * sysdeps/i386/fpu/e_hypot.S: ...here. + * sysdeps/libm-i387/e_hypotf.S: Moved to ... + * sysdeps/i386/fpu/e_hypotf.S: ...here. + * sysdeps/libm-i387/e_log.S: Moved to ... + * sysdeps/i386/fpu/e_log.S: ...here. + * sysdeps/libm-i387/e_log10.S: Moved to ... + * sysdeps/i386/fpu/e_log10.S: ...here. + * sysdeps/libm-i387/e_log10f.S: Moved to ... + * sysdeps/i386/fpu/e_log10f.S: ...here. + * sysdeps/libm-i387/e_log10l.S: Moved to ... + * sysdeps/i386/fpu/e_log10l.S: ...here. + * sysdeps/libm-i387/e_logf.S: Moved to ... + * sysdeps/i386/fpu/e_logf.S: ...here. + * sysdeps/libm-i387/e_logl.S: Moved to ... + * sysdeps/i386/fpu/e_logl.S: ...here. + * sysdeps/libm-i387/e_pow.S: Moved to ... + * sysdeps/i386/fpu/e_pow.S: ...here. + * sysdeps/libm-i387/e_powf.S: Moved to ... + * sysdeps/i386/fpu/e_powf.S: ...here. + * sysdeps/libm-i387/e_powl.S: Moved to ... + * sysdeps/i386/fpu/e_powl.S: ...here. + * sysdeps/libm-i387/e_rem_pio2l.c: Moved to ... + * sysdeps/i386/fpu/e_rem_pio2l.c: ...here. + * sysdeps/libm-i387/e_remainder.S: Moved to ... + * sysdeps/i386/fpu/e_remainder.S: ...here. + * sysdeps/libm-i387/e_remainderf.S: Moved to ... + * sysdeps/i386/fpu/e_remainderf.S: ...here. + * sysdeps/libm-i387/e_remainderl.S: Moved to ... + * sysdeps/i386/fpu/e_remainderl.S: ...here. + * sysdeps/libm-i387/e_scalb.S: Moved to ... + * sysdeps/i386/fpu/e_scalb.S: ...here. + * sysdeps/libm-i387/e_scalbf.S: Moved to ... + * sysdeps/i386/fpu/e_scalbf.S: ...here. + * sysdeps/libm-i387/e_scalbl.S: Moved to ... + * sysdeps/i386/fpu/e_scalbl.S: ...here. + * sysdeps/libm-i387/e_sqrt.S: Moved to ... + * sysdeps/i386/fpu/e_sqrt.S: ...here. + * sysdeps/libm-i387/e_sqrtf.S: Moved to ... + * sysdeps/i386/fpu/e_sqrtf.S: ...here. + * sysdeps/libm-i387/e_sqrtl.S: Moved to ... + * sysdeps/i386/fpu/e_sqrtl.S: ...here. + * sysdeps/libm-i387/k_rem_pio2l.c: Moved to ... + * sysdeps/i386/fpu/k_rem_pio2l.c: ...here. + * sysdeps/libm-i387/s_asinh.S: Moved to ... + * sysdeps/i386/fpu/s_asinh.S: ...here. + * sysdeps/libm-i387/s_asinhf.S: Moved to ... + * sysdeps/i386/fpu/s_asinhf.S: ...here. + * sysdeps/libm-i387/s_asinhl.S: Moved to ... + * sysdeps/i386/fpu/s_asinhl.S: ...here. + * sysdeps/libm-i387/s_atan.S: Moved to ... + * sysdeps/i386/fpu/s_atan.S: ...here. + * sysdeps/libm-i387/s_atanf.S: Moved to ... + * sysdeps/i386/fpu/s_atanf.S: ...here. + * sysdeps/libm-i387/s_atanl.S: Moved to ... + * sysdeps/i386/fpu/s_atanl.S: ...here. + * sysdeps/libm-i387/s_cbrt.S: Moved to ... + * sysdeps/i386/fpu/s_cbrt.S: ...here. + * sysdeps/libm-i387/s_cbrtf.S: Moved to ... + * sysdeps/i386/fpu/s_cbrtf.S: ...here. + * sysdeps/libm-i387/s_cbrtl.S: Moved to ... + * sysdeps/i386/fpu/s_cbrtl.S: ...here. + * sysdeps/libm-i387/s_ceil.S: Moved to ... + * sysdeps/i386/fpu/s_ceil.S: ...here. + * sysdeps/libm-i387/s_ceilf.S: Moved to ... + * sysdeps/i386/fpu/s_ceilf.S: ...here. + * sysdeps/libm-i387/s_ceill.S: Moved to ... + * sysdeps/i386/fpu/s_ceill.S: ...here. + * sysdeps/libm-i387/s_cexp.S: Moved to ... + * sysdeps/i386/fpu/s_cexp.S: ...here. + * sysdeps/libm-i387/s_cexpf.S: Moved to ... + * sysdeps/i386/fpu/s_cexpf.S: ...here. + * sysdeps/libm-i387/s_cexpl.S: Moved to ... + * sysdeps/i386/fpu/s_cexpl.S: ...here. + * sysdeps/libm-i387/s_copysign.S: Moved to ... + * sysdeps/i386/fpu/s_copysign.S: ...here. + * sysdeps/libm-i387/s_copysignf.S: Moved to ... + * sysdeps/i386/fpu/s_copysignf.S: ...here. + * sysdeps/libm-i387/s_copysignl.S: Moved to ... + * sysdeps/i386/fpu/s_copysignl.S: ...here. + * sysdeps/libm-i387/s_cos.S: Moved to ... + * sysdeps/i386/fpu/s_cos.S: ...here. + * sysdeps/libm-i387/s_cosf.S: Moved to ... + * sysdeps/i386/fpu/s_cosf.S: ...here. + * sysdeps/libm-i387/s_cosl.S: Moved to ... + * sysdeps/i386/fpu/s_cosl.S: ...here. + * sysdeps/libm-i387/s_exp2.S: Moved to ... + * sysdeps/i386/fpu/s_exp2.S: ...here. + * sysdeps/libm-i387/s_exp2f.S: Moved to ... + * sysdeps/i386/fpu/s_exp2f.S: ...here. + * sysdeps/libm-i387/s_exp2l.S: Moved to ... + * sysdeps/i386/fpu/s_exp2l.S: ...here. + * sysdeps/libm-i387/s_expm1.S: Moved to ... + * sysdeps/i386/fpu/s_expm1.S: ...here. + * sysdeps/libm-i387/s_expm1f.S: Moved to ... + * sysdeps/i386/fpu/s_expm1f.S: ...here. + * sysdeps/libm-i387/s_expm1l.S: Moved to ... + * sysdeps/i386/fpu/s_expm1l.S: ...here. + * sysdeps/libm-i387/s_fdim.S: Moved to ... + * sysdeps/i386/fpu/s_fdim.S: ...here. + * sysdeps/libm-i387/s_fdimf.S: Moved to ... + * sysdeps/i386/fpu/s_fdimf.S: ...here. + * sysdeps/libm-i387/s_fdiml.S: Moved to ... + * sysdeps/i386/fpu/s_fdiml.S: ...here. + * sysdeps/libm-i387/s_finite.S: Moved to ... + * sysdeps/i386/fpu/s_finite.S: ...here. + * sysdeps/libm-i387/s_finitef.S: Moved to ... + * sysdeps/i386/fpu/s_finitef.S: ...here. + * sysdeps/libm-i387/s_finitel.S: Moved to ... + * sysdeps/i386/fpu/s_finitel.S: ...here. + * sysdeps/libm-i387/s_floor.S: Moved to ... + * sysdeps/i386/fpu/s_floor.S: ...here. + * sysdeps/libm-i387/s_floorf.S: Moved to ... + * sysdeps/i386/fpu/s_floorf.S: ...here. + * sysdeps/libm-i387/s_floorl.S: Moved to ... + * sysdeps/i386/fpu/s_floorl.S: ...here. + * sysdeps/libm-i387/s_fma.S: Moved to ... + * sysdeps/i386/fpu/s_fma.S: ...here. + * sysdeps/libm-i387/s_fmaf.S: Moved to ... + * sysdeps/i386/fpu/s_fmaf.S: ...here. + * sysdeps/libm-i387/s_fmal.S: Moved to ... + * sysdeps/i386/fpu/s_fmal.S: ...here. + * sysdeps/libm-i387/s_fmax.S: Moved to ... + * sysdeps/i386/fpu/s_fmax.S: ...here. + * sysdeps/libm-i387/s_fmaxf.S: Moved to ... + * sysdeps/i386/fpu/s_fmaxf.S: ...here. + * sysdeps/libm-i387/s_fmaxl.S: Moved to ... + * sysdeps/i386/fpu/s_fmaxl.S: ...here. + * sysdeps/libm-i387/s_fmin.S: Moved to ... + * sysdeps/i386/fpu/s_fmin.S: ...here. + * sysdeps/libm-i387/s_fminf.S: Moved to ... + * sysdeps/i386/fpu/s_fminf.S: ...here. + * sysdeps/libm-i387/s_fminl.S: Moved to ... + * sysdeps/i386/fpu/s_fminl.S: ...here. + * sysdeps/libm-i387/s_frexp.S: Moved to ... + * sysdeps/i386/fpu/s_frexp.S: ...here. + * sysdeps/libm-i387/s_frexpf.S: Moved to ... + * sysdeps/i386/fpu/s_frexpf.S: ...here. + * sysdeps/libm-i387/s_frexpl.S: Moved to ... + * sysdeps/i386/fpu/s_frexpl.S: ...here. + * sysdeps/libm-i387/s_ilogb.S: Moved to ... + * sysdeps/i386/fpu/s_ilogb.S: ...here. + * sysdeps/libm-i387/s_ilogbf.S: Moved to ... + * sysdeps/i386/fpu/s_ilogbf.S: ...here. + * sysdeps/libm-i387/s_ilogbl.S: Moved to ... + * sysdeps/i386/fpu/s_ilogbl.S: ...here. + * sysdeps/libm-i387/s_llrint.S: Moved to ... + * sysdeps/i386/fpu/s_llrint.S: ...here. + * sysdeps/libm-i387/s_llrintf.S: Moved to ... + * sysdeps/i386/fpu/s_llrintf.S: ...here. + * sysdeps/libm-i387/s_llrintl.S: Moved to ... + * sysdeps/i386/fpu/s_llrintl.S: ...here. + * sysdeps/libm-i387/s_log1p.S: Moved to ... + * sysdeps/i386/fpu/s_log1p.S: ...here. + * sysdeps/libm-i387/s_log1pf.S: Moved to ... + * sysdeps/i386/fpu/s_log1pf.S: ...here. + * sysdeps/libm-i387/s_log1pl.S: Moved to ... + * sysdeps/i386/fpu/s_log1pl.S: ...here. + * sysdeps/libm-i387/s_log2.S: Moved to ... + * sysdeps/i386/fpu/s_log2.S: ...here. + * sysdeps/libm-i387/s_log2f.S: Moved to ... + * sysdeps/i386/fpu/s_log2f.S: ...here. + * sysdeps/libm-i387/s_log2l.S: Moved to ... + * sysdeps/i386/fpu/s_log2l.S: ...here. + * sysdeps/libm-i387/s_logb.S: Moved to ... + * sysdeps/i386/fpu/s_logb.S: ...here. + * sysdeps/libm-i387/s_logbf.S: Moved to ... + * sysdeps/i386/fpu/s_logbf.S: ...here. + * sysdeps/libm-i387/s_logbl.S: Moved to ... + * sysdeps/i386/fpu/s_logbl.S: ...here. + * sysdeps/libm-i387/s_lrint.S: Moved to ... + * sysdeps/i386/fpu/s_lrint.S: ...here. + * sysdeps/libm-i387/s_lrintf.S: Moved to ... + * sysdeps/i386/fpu/s_lrintf.S: ...here. + * sysdeps/libm-i387/s_lrintl.S: Moved to ... + * sysdeps/i386/fpu/s_lrintl.S: ...here. + * sysdeps/libm-i387/s_nearbyint.S: Moved to ... + * sysdeps/i386/fpu/s_nearbyint.S: ...here. + * sysdeps/libm-i387/s_nearbyintf.S: Moved to ... + * sysdeps/i386/fpu/s_nearbyintf.S: ...here. + * sysdeps/libm-i387/s_nearbyintl.S: Moved to ... + * sysdeps/i386/fpu/s_nearbyintl.S: ...here. + * sysdeps/libm-i387/s_remquo.S: Moved to ... + * sysdeps/i386/fpu/s_remquo.S: ...here. + * sysdeps/libm-i387/s_remquof.S: Moved to ... + * sysdeps/i386/fpu/s_remquof.S: ...here. + * sysdeps/libm-i387/s_remquol.S: Moved to ... + * sysdeps/i386/fpu/s_remquol.S: ...here. + * sysdeps/libm-i387/s_rint.S: Moved to ... + * sysdeps/i386/fpu/s_rint.S: ...here. + * sysdeps/libm-i387/s_rintf.S: Moved to ... + * sysdeps/i386/fpu/s_rintf.S: ...here. + * sysdeps/libm-i387/s_rintl.S: Moved to ... + * sysdeps/i386/fpu/s_rintl.S: ...here. + * sysdeps/libm-i387/s_scalbn.S: Moved to ... + * sysdeps/i386/fpu/s_scalbn.S: ...here. + * sysdeps/libm-i387/s_scalbnf.S: Moved to ... + * sysdeps/i386/fpu/s_scalbnf.S: ...here. + * sysdeps/libm-i387/s_scalbnl.S: Moved to ... + * sysdeps/i386/fpu/s_scalbnl.S: ...here. + * sysdeps/libm-i387/s_significand.S: Moved to ... + * sysdeps/i386/fpu/s_significand.S: ...here. + * sysdeps/libm-i387/s_significandf.S: Moved to ... + * sysdeps/i386/fpu/s_significandf.S: ...here. + * sysdeps/libm-i387/s_significandl.S: Moved to ... + * sysdeps/i386/fpu/s_significandl.S: ...here. + * sysdeps/libm-i387/s_sin.S: Moved to ... + * sysdeps/i386/fpu/s_sin.S: ...here. + * sysdeps/libm-i387/s_sincos.S: Moved to ... + * sysdeps/i386/fpu/s_sincos.S: ...here. + * sysdeps/libm-i387/s_sincosf.S: Moved to ... + * sysdeps/i386/fpu/s_sincosf.S: ...here. + * sysdeps/libm-i387/s_sincosl.S: Moved to ... + * sysdeps/i386/fpu/s_sincosl.S: ...here. + * sysdeps/libm-i387/s_sinf.S: Moved to ... + * sysdeps/i386/fpu/s_sinf.S: ...here. + * sysdeps/libm-i387/s_sinl.S: Moved to ... + * sysdeps/i386/fpu/s_sinl.S: ...here. + * sysdeps/libm-i387/s_tan.S: Moved to ... + * sysdeps/i386/fpu/s_tan.S: ...here. + * sysdeps/libm-i387/s_tanf.S: Moved to ... + * sysdeps/i386/fpu/s_tanf.S: ...here. + * sysdeps/libm-i387/s_tanl.S: Moved to ... + * sysdeps/i386/fpu/s_tanl.S: ...here. + * sysdeps/libm-i387/s_trunc.S: Moved to ... + * sysdeps/i386/fpu/s_trunc.S: ...here. + * sysdeps/libm-i387/s_truncf.S: Moved to ... + * sysdeps/i386/fpu/s_truncf.S: ...here. + * sysdeps/libm-i387/s_truncl.S: Moved to ... + * sysdeps/i386/fpu/s_truncl.S: ...here. + * sysdeps/libm-ieee754/k_standard.c: Moved to ... + * sysdeps/ieee754/k_standard.c: ...here. + * sysdeps/libm-ieee754/s_lib_version.c: Moved to ... + * sysdeps/ieee754/s_lib_version.c: ...here. + * sysdeps/libm-ieee754/s_matherr.c: Moved to ... + * sysdeps/ieee754/s_matherr.c: ...here. + * sysdeps/libm-ieee754/s_signgam.c: Moved to ... + * sysdeps/ieee754/s_signgam.c: ...here. + * sysdeps/ieee754/dbl2mpn.c: Moved to ... + * sysdeps/ieee754/dbl-64/dbl2mpn.c: ...here. + * sysdeps/ieee754/mpn2dbl.c: Moved to ... + * sysdeps/ieee754/dbl-64/mpn2dbl.c: ...here. + * sysdeps/libm-ieee754/e_acos.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_acos.c: ...here. + * sysdeps/libm-ieee754/e_acosh.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_acosh.c: ...here. + * sysdeps/libm-ieee754/e_asin.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_asin.c: ...here. + * sysdeps/libm-ieee754/e_atan2.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_atan2.c: ...here. + * sysdeps/libm-ieee754/e_atanh.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_atanh.c: ...here. + * sysdeps/libm-ieee754/e_cosh.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_cosh.c: ...here. + * sysdeps/libm-ieee754/e_exp.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_exp.c: ...here. + * sysdeps/libm-ieee754/e_fmod.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_fmod.c: ...here. + * sysdeps/libm-ieee754/e_gamma_r.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_gamma_r.c: ...here. + * sysdeps/libm-ieee754/e_hypot.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_hypot.c: ...here. + * sysdeps/libm-ieee754/e_j0.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_j0.c: ...here. + * sysdeps/libm-ieee754/e_j1.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_j1.c: ...here. + * sysdeps/libm-ieee754/e_jn.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_jn.c: ...here. + * sysdeps/libm-ieee754/e_lgamma_r.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_lgamma_r.c: ...here. + * sysdeps/libm-ieee754/e_log.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_log.c: ...here. + * sysdeps/libm-ieee754/e_log10.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_log10.c: ...here. + * sysdeps/libm-ieee754/e_pow.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_pow.c: ...here. + * sysdeps/libm-ieee754/e_remainder.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_remainder.c: ...here. + * sysdeps/libm-ieee754/e_sinh.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_sinh.c: ...here. + * sysdeps/libm-ieee754/e_sqrt.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_sqrt.c: ...here. + * sysdeps/libm-ieee754/k_cos.c: Moved to ... + * sysdeps/ieee754/dbl-64/k_cos.c: ...here. + * sysdeps/libm-ieee754/k_sin.c: Moved to ... + * sysdeps/ieee754/dbl-64/k_sin.c: ...here. + * sysdeps/libm-ieee754/k_tan.c: Moved to ... + * sysdeps/ieee754/dbl-64/k_tan.c: ...here. + * sysdeps/libm-ieee754/s_asinh.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_asinh.c: ...here. + * sysdeps/libm-ieee754/s_atan.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_atan.c: ...here. + * sysdeps/libm-ieee754/s_cbrt.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_cbrt.c: ...here. + * sysdeps/libm-ieee754/s_ceil.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_ceil.c: ...here. + * sysdeps/libm-ieee754/s_copysign.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_copysign.c: ...here. + * sysdeps/libm-ieee754/s_cos.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_cos.c: ...here. + * sysdeps/libm-ieee754/s_erf.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_erf.c: ...here. + * sysdeps/libm-ieee754/s_exp2.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_exp2.c: ...here. + * sysdeps/libm-ieee754/s_expm1.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_expm1.c: ...here. + * sysdeps/libm-ieee754/s_fabs.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_fabs.c: ...here. + * sysdeps/libm-ieee754/s_finite.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_finite.c: ...here. + * sysdeps/libm-ieee754/s_floor.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_floor.c: ...here. + * sysdeps/libm-ieee754/s_fpclassify.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_fpclassify.c: ...here. + * sysdeps/libm-ieee754/s_frexp.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_frexp.c: ...here. + * sysdeps/libm-ieee754/s_ilogb.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_ilogb.c: ...here. + * sysdeps/libm-ieee754/s_isinf.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_isinf.c: ...here. + * sysdeps/libm-ieee754/s_isnan.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_isnan.c: ...here. + (__isnan): Comment above function says it returns 0 or 1, but it + used to return 0 or -1. + * sysdeps/libm-ieee754/s_llrint.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_llrint.c: ...here. + * sysdeps/libm-ieee754/s_llround.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_llround.c: ...here. + * sysdeps/libm-ieee754/s_log1p.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_log1p.c: ...here. + * sysdeps/libm-ieee754/s_log2.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_log2.c: ...here. + * sysdeps/libm-ieee754/s_logb.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_logb.c: ...here. + * sysdeps/libm-ieee754/s_lrint.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_lrint.c: ...here. + * sysdeps/libm-ieee754/s_lround.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_lround.c: ...here. + * sysdeps/libm-ieee754/s_modf.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_modf.c: ...here. + * sysdeps/libm-ieee754/s_nearbyint.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_nearbyint.c: ...here. + * sysdeps/libm-ieee754/s_nextafter.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_nextafter.c: ...here. + Add __nexttoward and nexttoward aliases if NO_LONG_DOUBLE. + * sysdeps/libm-ieee754/s_remquo.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_remquo.c: ...here. + * sysdeps/libm-ieee754/s_rint.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_rint.c: ...here. + * sysdeps/libm-ieee754/s_round.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_round.c: ...here. + * sysdeps/libm-ieee754/s_scalbn.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_scalbn.c: ...here. + * sysdeps/libm-ieee754/s_signbit.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_signbit.c: ...here. + * sysdeps/libm-ieee754/s_sin.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_sin.c: ...here. + * sysdeps/libm-ieee754/s_sincos.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_sincos.c: ...here. + * sysdeps/libm-ieee754/s_tan.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_tan.c: ...here. + * sysdeps/libm-ieee754/s_tanh.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_tanh.c: ...here. + * sysdeps/libm-ieee754/s_trunc.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_trunc.c: ...here. + * sysdeps/libm-ieee754/t_exp2.h: Moved to ... + * sysdeps/ieee754/dbl-64/t_exp2.h: ...here. + * sysdeps/libm-ieee754/w_exp.c: Moved to ... + * sysdeps/ieee754/dbl-64/w_exp.c: ...here. + * sysdeps/ieee754/mpn2flt.c: Moved to ... + * sysdeps/ieee754/flt-32/mpn2flt.c: ...here. + * sysdeps/libm-ieee754/e_acosf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_acosf.c: ...here. + * sysdeps/libm-ieee754/e_acoshf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_acoshf.c: ...here. + * sysdeps/libm-ieee754/e_asinf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_asinf.c: ...here. + * sysdeps/libm-ieee754/e_atan2f.c: Moved to ... + * sysdeps/ieee754/flt-32/e_atan2f.c: ...here. + * sysdeps/libm-ieee754/e_atanhf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_atanhf.c: ...here. + * sysdeps/libm-ieee754/e_coshf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_coshf.c: ...here. + * sysdeps/libm-ieee754/e_expf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_expf.c: ...here. + * sysdeps/libm-ieee754/e_fmodf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_fmodf.c: ...here. + * sysdeps/libm-ieee754/e_gammaf_r.c: Moved to ... + * sysdeps/ieee754/flt-32/e_gammaf_r.c: ...here. + * sysdeps/libm-ieee754/e_hypotf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_hypotf.c: ...here. + * sysdeps/libm-ieee754/e_j0f.c: Moved to ... + * sysdeps/ieee754/flt-32/e_j0f.c: ...here. + * sysdeps/libm-ieee754/e_j1f.c: Moved to ... + * sysdeps/ieee754/flt-32/e_j1f.c: ...here. + * sysdeps/libm-ieee754/e_jnf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_jnf.c: ...here. + * sysdeps/libm-ieee754/e_lgammaf_r.c: Moved to ... + * sysdeps/ieee754/flt-32/e_lgammaf_r.c: ...here. + * sysdeps/libm-ieee754/e_log10f.c: Moved to ... + * sysdeps/ieee754/flt-32/e_log10f.c: ...here. + * sysdeps/libm-ieee754/e_logf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_logf.c: ...here. + * sysdeps/libm-ieee754/e_powf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_powf.c: ...here. + * sysdeps/libm-ieee754/e_remainderf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_remainderf.c: ...here. + * sysdeps/libm-ieee754/e_sinhf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_sinhf.c: ...here. + * sysdeps/libm-ieee754/e_sqrtf.c: Moved to ... + * sysdeps/ieee754/flt-32/e_sqrtf.c: ...here. + * sysdeps/libm-ieee754/k_cosf.c: Moved to ... + * sysdeps/ieee754/flt-32/k_cosf.c: ...here. + * sysdeps/libm-ieee754/k_sinf.c: Moved to ... + * sysdeps/ieee754/flt-32/k_sinf.c: ...here. + * sysdeps/libm-ieee754/k_tanf.c: Moved to ... + * sysdeps/ieee754/flt-32/k_tanf.c: ...here. + * sysdeps/libm-ieee754/s_asinhf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_asinhf.c: ...here. + * sysdeps/libm-ieee754/s_atanf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_atanf.c: ...here. + * sysdeps/libm-ieee754/s_cbrtf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_cbrtf.c: ...here. + * sysdeps/libm-ieee754/s_ceilf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_ceilf.c: ...here. + * sysdeps/libm-ieee754/s_copysignf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_copysignf.c: ...here. + * sysdeps/libm-ieee754/s_cosf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_cosf.c: ...here. + * sysdeps/libm-ieee754/s_erff.c: Moved to ... + * sysdeps/ieee754/flt-32/s_erff.c: ...here. + * sysdeps/libm-ieee754/s_exp2f.c: Moved to ... + * sysdeps/ieee754/flt-32/s_exp2f.c: ...here. + * sysdeps/libm-ieee754/s_expm1f.c: Moved to ... + * sysdeps/ieee754/flt-32/s_expm1f.c: ...here. + * sysdeps/libm-ieee754/s_fabsf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_fabsf.c: ...here. + * sysdeps/libm-ieee754/s_finitef.c: Moved to ... + * sysdeps/ieee754/flt-32/s_finitef.c: ...here. + * sysdeps/libm-ieee754/s_floorf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_floorf.c: ...here. + * sysdeps/libm-ieee754/s_fpclassifyf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_fpclassifyf.c: ...here. + * sysdeps/libm-ieee754/s_frexpf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_frexpf.c: ...here. + * sysdeps/libm-ieee754/s_ilogbf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_ilogbf.c: ...here. + * sysdeps/libm-ieee754/s_isinff.c: Moved to ... + * sysdeps/ieee754/flt-32/s_isinff.c: ...here. + * sysdeps/libm-ieee754/s_isnanf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_isnanf.c: ...here. + * sysdeps/libm-ieee754/s_llrintf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_llrintf.c: ...here. + * sysdeps/libm-ieee754/s_llroundf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_llroundf.c: ...here. + * sysdeps/libm-ieee754/s_log1pf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_log1pf.c: ...here. + * sysdeps/libm-ieee754/s_log2f.c: Moved to ... + * sysdeps/ieee754/flt-32/s_log2f.c: ...here. + * sysdeps/libm-ieee754/s_logbf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_logbf.c: ...here. + * sysdeps/libm-ieee754/s_lrintf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_lrintf.c: ...here. + * sysdeps/libm-ieee754/s_lroundf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_lroundf.c: ...here. + * sysdeps/libm-ieee754/s_modff.c: Moved to ... + * sysdeps/ieee754/flt-32/s_modff.c: ...here. + * sysdeps/libm-ieee754/s_nearbyintf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_nearbyintf.c: ...here. + * sysdeps/libm-ieee754/s_nextafterf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_nextafterf.c: ...here. + * sysdeps/libm-ieee754/s_remquof.c: Moved to ... + * sysdeps/ieee754/flt-32/s_remquof.c: ...here. + * sysdeps/libm-ieee754/s_rintf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_rintf.c: ...here. + * sysdeps/libm-ieee754/s_roundf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_roundf.c: ...here. + * sysdeps/libm-ieee754/s_scalbnf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_scalbnf.c: ...here. + * sysdeps/libm-ieee754/s_signbitf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_signbitf.c: ...here. + * sysdeps/libm-ieee754/s_sincosf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_sincosf.c: ...here. + * sysdeps/libm-ieee754/s_sinf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_sinf.c: ...here. + * sysdeps/libm-ieee754/s_tanf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_tanf.c: ...here. + * sysdeps/libm-ieee754/s_tanhf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_tanhf.c: ...here. + * sysdeps/libm-ieee754/s_truncf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_truncf.c: ...here. + * sysdeps/libm-ieee754/t_exp2f.h: Moved to ... + * sysdeps/ieee754/flt-32/t_exp2f.h: ...here. + * sysdeps/libm-ieee754/w_expf.c: Moved to ... + * sysdeps/ieee754/flt-32/w_expf.c: ...here. + * sysdeps/libm-ieee754/e_acoshl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/e_acoshl.c: ...here. + * sysdeps/libm-ieee754/e_atan2l.c: Moved to ... + * sysdeps/ieee754/ldbl-96/e_atan2l.c: ...here. + * sysdeps/libm-ieee754/e_atanhl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/e_atanhl.c: ...here. + * sysdeps/libm-ieee754/e_coshl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/e_coshl.c: ...here. + * sysdeps/libm-ieee754/e_gammal_r.c: Moved to ... + * sysdeps/ieee754/ldbl-96/e_gammal_r.c: ...here. + * sysdeps/libm-ieee754/e_hypotl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/e_hypotl.c: ...here. + * sysdeps/libm-ieee754/e_remainderl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/e_remainderl.c: ...here. + * sysdeps/libm-ieee754/e_sinhl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/e_sinhl.c: ...here. + * sysdeps/libm-ieee754/s_asinhl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_asinhl.c: ...here. + * sysdeps/libm-ieee754/s_cbrtl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_cbrtl.c: ...here. + * sysdeps/libm-ieee754/s_ceill.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_ceill.c: ...here. + * sysdeps/libm-ieee754/s_copysignl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_copysignl.c: ...here. + * sysdeps/libm-ieee754/s_cosl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_cosl.c: ...here. + * sysdeps/libm-ieee754/s_fabsl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_fabsl.c: ...here. + * sysdeps/libm-ieee754/s_finitel.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_finitel.c: ...here. + * sysdeps/libm-ieee754/s_floorl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_floorl.c: ...here. + * sysdeps/libm-ieee754/s_fpclassifyl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_fpclassifyl.c: ...here. + * sysdeps/libm-ieee754/s_frexpl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_frexpl.c: ...here. + * sysdeps/libm-ieee754/s_ilogbl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_ilogbl.c: ...here. + * sysdeps/libm-ieee754/s_llrintl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_llrintl.c: ...here. + * sysdeps/libm-ieee754/s_llroundl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_llroundl.c: ...here. + * sysdeps/libm-ieee754/s_logbl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_logbl.c: ...here. + * sysdeps/libm-ieee754/s_lrintl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_lrintl.c: ...here. + * sysdeps/libm-ieee754/s_lroundl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_lroundl.c: ...here. + * sysdeps/libm-ieee754/s_modfl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_modfl.c: ...here. + (__modfl): IEEE 854 long doubles should use SET_LDOUBLE_WORDS, not + INSERT_WORDS. + * sysdeps/libm-ieee754/s_nearbyintl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_nearbyintl.c: ...here. + (__nearbyintl): Fix for exponents 2^30. + * sysdeps/libm-ieee754/s_remquol.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_remquol.c: ...here. + * sysdeps/libm-ieee754/s_rintl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_rintl.c: ...here. + (__rintl): Fix for exponents 2^30. + * sysdeps/libm-ieee754/s_roundl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_roundl.c: ...here. + * sysdeps/libm-ieee754/s_scalbnl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_scalbnl.c: ...here. + (__scalbnl): Fix exponent for subnormal result. + * sysdeps/libm-ieee754/s_signbitl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_signbitl.c: ...here. + * sysdeps/libm-ieee754/s_sincosl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_sincosl.c: ...here. + * sysdeps/libm-ieee754/s_sinl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_sinl.c: ...here. + * sysdeps/libm-ieee754/s_tanhl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_tanhl.c: ...here. + * sysdeps/libm-ieee754/s_tanl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_tanl.c: ...here. + * sysdeps/libm-ieee754/s_truncl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_truncl.c: ...here. + * sysdeps/libm-ieee754/w_expl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/w_expl.c: ...here. + * sysdeps/libm-i387/i686/s_fminl.S: Moved to ... + * sysdeps/i386/i686/fpu/s_fminl.S: ...here. + * sysdeps/libm-i387/s_scalblnf.c: Moved to ... + * sysdeps/i386/fpu/s_scalblnf.c: ...here. + * sysdeps/libm-ieee754/s_scalblnf.c: Moved to ... + * sysdeps/ieee754/flt-32/s_scalblnf.c: ...here. + * sysdeps/libm-i387/i686/s_fdiml.S: Moved to ... + * sysdeps/i386/i686/fpu/s_fdiml.S: ...here. + * sysdeps/libm-i387/e_rem_pio2f.c: Moved to ... + * sysdeps/i386/fpu/e_rem_pio2f.c: ...here. + * sysdeps/libm-ieee754/e_rem_pio2f.c: Moved to ... + * sysdeps/ieee754/flt-32/e_rem_pio2f.c: ...here. + * sysdeps/libm-i387/i686/s_fmin.S: Moved to ... + * sysdeps/i386/i686/fpu/s_fmin.S: ...here. + * sysdeps/libm-i387/k_rem_pio2.c: Moved to ... + * sysdeps/i386/fpu/k_rem_pio2.c: ...here. + * sysdeps/libm-ieee754/k_rem_pio2.c: Moved to ... + * sysdeps/ieee754/dbl-64/k_rem_pio2.c: ...here. + * sysdeps/libm-i387/k_rem_pio2f.c: Moved to ... + * sysdeps/i386/fpu/k_rem_pio2f.c: ...here. + * sysdeps/libm-ieee754/k_rem_pio2f.c: Moved to ... + * sysdeps/ieee754/flt-32/k_rem_pio2f.c: ...here. + * sysdeps/libm-i387/s_scalbln.c: Moved to ... + * sysdeps/i386/fpu/s_scalbln.c: ...here. + * sysdeps/libm-ieee754/s_scalbln.c: Moved to ... + * sysdeps/ieee754/dbl-64/s_scalbln.c: ...here. + * sysdeps/libm-i387/i686/s_fmax.S: Moved to ... + * sysdeps/i386/i686/fpu/s_fmax.S: ...here. + * sysdeps/libm-i387/t_exp.c: Moved to ... + * sysdeps/i386/fpu/t_exp.c: ...here. + * sysdeps/libm-ieee754/t_exp.c: Moved to ... + * sysdeps/ieee754/dbl-64/t_exp.c: ...here. + * sysdeps/libm-i387/e_rem_pio2.c: Moved to ... + * sysdeps/i386/fpu/e_rem_pio2.c: ...here. + * sysdeps/libm-ieee754/e_rem_pio2.c: Moved to ... + * sysdeps/ieee754/dbl-64/e_rem_pio2.c: ...here. + * sysdeps/libm-i387/s_isinfl.c: Moved to ... + * sysdeps/i386/fpu/s_isinfl.c: ...here. + * sysdeps/libm-ieee754/s_isinfl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_isinfl.c: ...here. + * sysdeps/libm-i387/s_scalblnl.c: Moved to ... + * sysdeps/i386/fpu/s_scalblnl.c: ...here. + * sysdeps/libm-ieee754/s_scalblnl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_scalblnl.c: ...here. + Fix exponent for subnormal result. + * sysdeps/libm-ieee754/s_nexttowardl.c: Moved to ... + * math/s_nexttowardl.c: ...here. + * sysdeps/libm-i387/i686/s_fmaxf.S: Moved to ... + * sysdeps/i386/i686/fpu/s_fmaxf.S: ...here. + * sysdeps/libm-i387/s_isnanl.c: Moved to ... + * sysdeps/i386/fpu/s_isnanl.c: ...here. + * sysdeps/libm-ieee754/s_isnanl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_isnanl.c: ...here. + Comment above function says it returns 0 or 1, but it used to return + 0 or -1. + * sysdeps/libm-i387/i686/s_fminf.S: Moved to ... + * sysdeps/i386/i686/fpu/s_fminf.S: ...here. + * sysdeps/libm-i387/i686/s_fdim.S: Moved to ... + * sysdeps/i386/i686/fpu/s_fdim.S: ...here. + * sysdeps/libm-i387/i686/s_fdimf.S: Moved to ... + * sysdeps/i386/i686/fpu/s_fdimf.S: ...here. + * sysdeps/libm-i387/i686/s_fmaxl.S: Moved to ... + * sysdeps/i386/i686/fpu/s_fmaxl.S: ...here. + * sysdeps/libm-ieee754/s_nexttoward.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_nexttoward.c: ...here. + Cannot compare exponents with different biases without adjusting. + * sysdeps/libm-ieee754/s_nexttowardf.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_nexttowardf.c: ...here. + Cannot compare exponents with different biases without adjusting. + * sysdeps/libm-i387/s_nextafterl.c: Moved to ... + * sysdeps/i386/fpu/s_nextafterl.c: ...here. + * sysdeps/libm-ieee754/s_nextafterl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/s_nextafterl.c: ...here. + * sysdeps/ieee754/ldbl2mpn.c: Moved to ... + * sysdeps/ieee754/ldbl-96/ldbl2mpn.c: ...here. + Removed __NO_LONG_DOUBLE_MATH ifndef around the whole file. + * sysdeps/ieee754/mpn2ldbl.c: Moved to ... + * sysdeps/ieee754/ldbl-96/mpn2ldbl.c: ...here. + Removed __NO_LONG_DOUBLE_MATH ifndef around the whole file. + * sysdeps/libm-ieee754/Dist: Split into ... + * sysdeps/ieee754/dbl-64/Dist: ...this and ... + * sysdeps/ieee754/flt-32/Dist: ...this file. + + * sysdeps/ieee754/flt-32/Implies: New file. + * sysdeps/ieee754/dbl-64/Implies: New file. + * sysdeps/ieee754/dbl-64/math_ldbl.h: New file. + * sysdeps/ieee754/dbl-64/s_nexttoward.c: New file. + * sysdeps/ieee754/dbl-64/s_nexttowardf.c: New file. + * sysdeps/ieee754/dbl-64/strtold.c: New file. + * sysdeps/ieee754/dbl-64/mpn2ldbl.c: New file. + * sysdeps/ieee754/dbl-64/ldbl2mpn.c: New file. + * sysdeps/ieee754/ldbl-96/Implies: New file. + * sysdeps/ieee754/ldbl-96/math_ldbl.h: New file. + * sysdeps/ieee754/ldbl-96/strtold.c: New file. + * sysdeps/ieee754/ldbl-96/printf_fphex.c: New file. + * sysdeps/ieee754/ldbl-128/Implies: New file. + * sysdeps/ieee754/ldbl-128/s_sinl.c: New file. + * sysdeps/ieee754/ldbl-128/s_ceill.c: New file. + * sysdeps/ieee754/ldbl-128/e_remainderl.c: New file. + * sysdeps/ieee754/ldbl-128/ieee754.h: New file. + * sysdeps/ieee754/ldbl-128/e_atan2l.c: New file. + * sysdeps/ieee754/ldbl-128/s_finitel.c: New file. + * sysdeps/ieee754/ldbl-128/s_roundl.c: New file. + * sysdeps/ieee754/ldbl-128/s_llrintl.c: New file. + * sysdeps/ieee754/ldbl-128/e_gammal_r.c: New file. + * sysdeps/ieee754/ldbl-128/s_llroundl.c: New file. + * sysdeps/ieee754/ldbl-128/s_sincosl.c: New file. + * sysdeps/ieee754/ldbl-128/s_cosl.c: New file. + * sysdeps/ieee754/ldbl-128/s_fpclassifyl.c: New file. + * sysdeps/ieee754/ldbl-128/s_ilogbl.c: New file. + * sysdeps/ieee754/ldbl-128/s_floorl.c: New file. + * sysdeps/ieee754/ldbl-128/s_logbl.c: New file. + * sysdeps/ieee754/ldbl-128/s_scalbnl.c: New file. + * sysdeps/ieee754/ldbl-128/s_remquol.c: New file. + * sysdeps/ieee754/ldbl-128/s_nearbyintl.c: New file. + * sysdeps/ieee754/ldbl-128/s_tanl.c: New file. + * sysdeps/ieee754/ldbl-128/s_rintl.c: New file. + * sysdeps/ieee754/ldbl-128/e_acoshl.c: New file. + * sysdeps/ieee754/ldbl-128/s_lroundl.c: New file. + * sysdeps/ieee754/ldbl-128/s_signbitl.c: New file. + * sysdeps/ieee754/ldbl-128/s_copysignl.c: New file. + * sysdeps/ieee754/ldbl-128/s_fabsl.c: New file. + * sysdeps/ieee754/ldbl-128/s_frexpl.c: New file. + * sysdeps/ieee754/ldbl-128/s_truncl.c: New file. + * sysdeps/ieee754/ldbl-128/s_modfl.c: New file. + * sysdeps/ieee754/ldbl-128/s_lrintl.c: New file. + * sysdeps/ieee754/ldbl-128/s_isinfl.c: New file. + * sysdeps/ieee754/ldbl-128/s_scalblnl.c: New file. + * sysdeps/ieee754/ldbl-128/e_fmodl.c: New file. + * sysdeps/ieee754/ldbl-128/s_isnanl.c: New file. + * sysdeps/ieee754/ldbl-128/math_ldbl.h: New file. + * sysdeps/ieee754/ldbl-128/strtold.c: New file. + * sysdeps/ieee754/ldbl-128/s_nextafterl.c: New file. + * sysdeps/ieee754/ldbl-128/s_nexttoward.c: New file. + * sysdeps/ieee754/ldbl-128/s_nexttowardf.c: New file. + * sysdeps/ieee754/ldbl-128/printf_fphex.c: New file. + * sysdeps/ieee754/ldbl-128/mpn2ldbl.c: New file. + * sysdeps/ieee754/ldbl-128/ldbl2mpn.c: New file. + + * math/machine/endian.h: Remove. + * sysdeps/i386/fpu/Implies: Remove. + * sysdeps/ieee754/Implies: Remove. + + * math/math_private.h: Move long double macros to math_ldbl.h + header. + 1999-07-12 Ulrich Drepper * sysdeps/posix/getaddrinfo.c (gaih_inet): For non-passive diff --git a/math/machine/endian.h b/math/machine/endian.h deleted file mode 100644 index 88804564bf..0000000000 --- a/math/machine/endian.h +++ /dev/null @@ -1,4 +0,0 @@ -/* math_private.h wants to include ; we provide this - file so it can, leaving math_private.h unmodified from the original. */ - -#include diff --git a/math/math_private.h b/math/math_private.h index 906b1dabba..35e3e4e7ca 100644 --- a/math/math_private.h +++ b/math/math_private.h @@ -17,7 +17,7 @@ #ifndef _MATH_PRIVATE_H_ #define _MATH_PRIVATE_H_ -#include +#include #include /* The original fdlibm code used statements like: @@ -147,101 +147,8 @@ do { \ (d) = sf_u.value; \ } while (0) -/* A union which permits us to convert between a long double and - three 32 bit ints. */ - -#if __FLOAT_WORD_ORDER == BIG_ENDIAN - -typedef union -{ - long double value; - struct - { - unsigned int sign_exponent:16; - unsigned int empty:16; - u_int32_t msw; - u_int32_t lsw; - } parts; -} ieee_long_double_shape_type; - -#endif - -#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN - -typedef union -{ - long double value; - struct - { - u_int32_t lsw; - u_int32_t msw; - unsigned int sign_exponent:16; - unsigned int empty:16; - } parts; -} ieee_long_double_shape_type; - -#endif - -/* Get three 32 bit ints from a double. */ - -#define GET_LDOUBLE_WORDS(exp,ix0,ix1,d) \ -do { \ - ieee_long_double_shape_type ew_u; \ - ew_u.value = (d); \ - (exp) = ew_u.parts.sign_exponent; \ - (ix0) = ew_u.parts.msw; \ - (ix1) = ew_u.parts.lsw; \ -} while (0) - -/* Set a double from two 32 bit ints. */ - -#define SET_LDOUBLE_WORDS(d,exp,ix0,ix1) \ -do { \ - ieee_long_double_shape_type iw_u; \ - iw_u.parts.sign_exponent = (exp); \ - iw_u.parts.msw = (ix0); \ - iw_u.parts.lsw = (ix1); \ - (d) = iw_u.value; \ -} while (0) - -/* Get the more significant 32 bits of a long double mantissa. */ - -#define GET_LDOUBLE_MSW(v,d) \ -do { \ - ieee_long_double_shape_type sh_u; \ - sh_u.value = (d); \ - (v) = sh_u.parts.msw; \ -} while (0) - -/* Set the more significant 32 bits of a long double mantissa from an int. */ - -#define SET_LDOUBLE_MSW(d,v) \ -do { \ - ieee_long_double_shape_type sh_u; \ - sh_u.value = (d); \ - sh_u.parts.msw = (v); \ - (d) = sh_u.value; \ -} while (0) - -/* Get int from the exponent of a long double. */ - -#define GET_LDOUBLE_EXP(exp,d) \ -do { \ - ieee_long_double_shape_type ge_u; \ - ge_u.value = (d); \ - (exp) = ge_u.parts.sign_exponent; \ -} while (0) - -/* Set exponent of a long double from an int. */ - -#define SET_LDOUBLE_EXP(d,exp) \ -do { \ - ieee_long_double_shape_type se_u; \ - se_u.value = (d); \ - se_u.parts.sign_exponent = (exp); \ - (d) = se_u.value; \ -} while (0) - +/* Get long double macros from a separate header. */ +#include /* ieee style elementary functions */ extern double __ieee754_sqrt __P((double)); diff --git a/sysdeps/libm-ieee754/w_acos.c b/math/w_acos.c similarity index 100% rename from sysdeps/libm-ieee754/w_acos.c rename to math/w_acos.c diff --git a/sysdeps/libm-ieee754/w_acosf.c b/math/w_acosf.c similarity index 100% rename from sysdeps/libm-ieee754/w_acosf.c rename to math/w_acosf.c diff --git a/sysdeps/libm-ieee754/w_acosh.c b/math/w_acosh.c similarity index 100% rename from sysdeps/libm-ieee754/w_acosh.c rename to math/w_acosh.c diff --git a/sysdeps/libm-ieee754/w_acoshf.c b/math/w_acoshf.c similarity index 100% rename from sysdeps/libm-ieee754/w_acoshf.c rename to math/w_acoshf.c diff --git a/sysdeps/libm-ieee754/w_acoshl.c b/math/w_acoshl.c similarity index 100% rename from sysdeps/libm-ieee754/w_acoshl.c rename to math/w_acoshl.c diff --git a/sysdeps/libm-ieee754/w_acosl.c b/math/w_acosl.c similarity index 100% rename from sysdeps/libm-ieee754/w_acosl.c rename to math/w_acosl.c diff --git a/sysdeps/libm-ieee754/w_asin.c b/math/w_asin.c similarity index 100% rename from sysdeps/libm-ieee754/w_asin.c rename to math/w_asin.c diff --git a/sysdeps/libm-ieee754/w_asinf.c b/math/w_asinf.c similarity index 100% rename from sysdeps/libm-ieee754/w_asinf.c rename to math/w_asinf.c diff --git a/sysdeps/libm-ieee754/w_asinl.c b/math/w_asinl.c similarity index 100% rename from sysdeps/libm-ieee754/w_asinl.c rename to math/w_asinl.c diff --git a/sysdeps/libm-ieee754/w_atan2.c b/math/w_atan2.c similarity index 100% rename from sysdeps/libm-ieee754/w_atan2.c rename to math/w_atan2.c diff --git a/sysdeps/libm-ieee754/w_atan2f.c b/math/w_atan2f.c similarity index 100% rename from sysdeps/libm-ieee754/w_atan2f.c rename to math/w_atan2f.c diff --git a/sysdeps/libm-ieee754/w_atan2l.c b/math/w_atan2l.c similarity index 100% rename from sysdeps/libm-ieee754/w_atan2l.c rename to math/w_atan2l.c diff --git a/sysdeps/libm-ieee754/w_atanh.c b/math/w_atanh.c similarity index 100% rename from sysdeps/libm-ieee754/w_atanh.c rename to math/w_atanh.c diff --git a/sysdeps/libm-ieee754/w_atanhf.c b/math/w_atanhf.c similarity index 100% rename from sysdeps/libm-ieee754/w_atanhf.c rename to math/w_atanhf.c diff --git a/sysdeps/libm-ieee754/w_atanhl.c b/math/w_atanhl.c similarity index 100% rename from sysdeps/libm-ieee754/w_atanhl.c rename to math/w_atanhl.c diff --git a/sysdeps/libm-ieee754/w_cosh.c b/math/w_cosh.c similarity index 100% rename from sysdeps/libm-ieee754/w_cosh.c rename to math/w_cosh.c diff --git a/sysdeps/libm-ieee754/w_coshf.c b/math/w_coshf.c similarity index 100% rename from sysdeps/libm-ieee754/w_coshf.c rename to math/w_coshf.c diff --git a/sysdeps/libm-ieee754/w_coshl.c b/math/w_coshl.c similarity index 100% rename from sysdeps/libm-ieee754/w_coshl.c rename to math/w_coshl.c diff --git a/sysdeps/libm-ieee754/w_drem.c b/math/w_drem.c similarity index 100% rename from sysdeps/libm-ieee754/w_drem.c rename to math/w_drem.c diff --git a/sysdeps/libm-ieee754/w_dremf.c b/math/w_dremf.c similarity index 100% rename from sysdeps/libm-ieee754/w_dremf.c rename to math/w_dremf.c diff --git a/sysdeps/libm-ieee754/w_dreml.c b/math/w_dreml.c similarity index 100% rename from sysdeps/libm-ieee754/w_dreml.c rename to math/w_dreml.c diff --git a/sysdeps/libm-ieee754/w_exp10.c b/math/w_exp10.c similarity index 100% rename from sysdeps/libm-ieee754/w_exp10.c rename to math/w_exp10.c diff --git a/sysdeps/libm-ieee754/w_exp10f.c b/math/w_exp10f.c similarity index 100% rename from sysdeps/libm-ieee754/w_exp10f.c rename to math/w_exp10f.c diff --git a/sysdeps/libm-ieee754/w_exp10l.c b/math/w_exp10l.c similarity index 100% rename from sysdeps/libm-ieee754/w_exp10l.c rename to math/w_exp10l.c diff --git a/sysdeps/libm-ieee754/w_exp2.c b/math/w_exp2.c similarity index 100% rename from sysdeps/libm-ieee754/w_exp2.c rename to math/w_exp2.c diff --git a/sysdeps/libm-ieee754/w_exp2f.c b/math/w_exp2f.c similarity index 100% rename from sysdeps/libm-ieee754/w_exp2f.c rename to math/w_exp2f.c diff --git a/sysdeps/libm-ieee754/w_exp2l.c b/math/w_exp2l.c similarity index 100% rename from sysdeps/libm-ieee754/w_exp2l.c rename to math/w_exp2l.c diff --git a/sysdeps/libm-ieee754/w_fmod.c b/math/w_fmod.c similarity index 100% rename from sysdeps/libm-ieee754/w_fmod.c rename to math/w_fmod.c diff --git a/sysdeps/libm-ieee754/w_fmodf.c b/math/w_fmodf.c similarity index 100% rename from sysdeps/libm-ieee754/w_fmodf.c rename to math/w_fmodf.c diff --git a/sysdeps/libm-ieee754/w_fmodl.c b/math/w_fmodl.c similarity index 100% rename from sysdeps/libm-ieee754/w_fmodl.c rename to math/w_fmodl.c diff --git a/sysdeps/libm-ieee754/w_hypot.c b/math/w_hypot.c similarity index 100% rename from sysdeps/libm-ieee754/w_hypot.c rename to math/w_hypot.c diff --git a/sysdeps/libm-ieee754/w_hypotf.c b/math/w_hypotf.c similarity index 100% rename from sysdeps/libm-ieee754/w_hypotf.c rename to math/w_hypotf.c diff --git a/sysdeps/libm-ieee754/w_hypotl.c b/math/w_hypotl.c similarity index 100% rename from sysdeps/libm-ieee754/w_hypotl.c rename to math/w_hypotl.c diff --git a/sysdeps/libm-ieee754/w_j0.c b/math/w_j0.c similarity index 100% rename from sysdeps/libm-ieee754/w_j0.c rename to math/w_j0.c diff --git a/sysdeps/libm-ieee754/w_j0f.c b/math/w_j0f.c similarity index 100% rename from sysdeps/libm-ieee754/w_j0f.c rename to math/w_j0f.c diff --git a/sysdeps/libm-ieee754/w_j0l.c b/math/w_j0l.c similarity index 100% rename from sysdeps/libm-ieee754/w_j0l.c rename to math/w_j0l.c diff --git a/sysdeps/libm-ieee754/w_j1.c b/math/w_j1.c similarity index 100% rename from sysdeps/libm-ieee754/w_j1.c rename to math/w_j1.c diff --git a/sysdeps/libm-ieee754/w_j1f.c b/math/w_j1f.c similarity index 100% rename from sysdeps/libm-ieee754/w_j1f.c rename to math/w_j1f.c diff --git a/sysdeps/libm-ieee754/w_j1l.c b/math/w_j1l.c similarity index 100% rename from sysdeps/libm-ieee754/w_j1l.c rename to math/w_j1l.c diff --git a/sysdeps/libm-ieee754/w_jn.c b/math/w_jn.c similarity index 100% rename from sysdeps/libm-ieee754/w_jn.c rename to math/w_jn.c diff --git a/sysdeps/libm-ieee754/w_jnf.c b/math/w_jnf.c similarity index 100% rename from sysdeps/libm-ieee754/w_jnf.c rename to math/w_jnf.c diff --git a/sysdeps/libm-ieee754/w_jnl.c b/math/w_jnl.c similarity index 100% rename from sysdeps/libm-ieee754/w_jnl.c rename to math/w_jnl.c diff --git a/sysdeps/libm-ieee754/w_lgamma.c b/math/w_lgamma.c similarity index 100% rename from sysdeps/libm-ieee754/w_lgamma.c rename to math/w_lgamma.c diff --git a/sysdeps/libm-ieee754/w_lgamma_r.c b/math/w_lgamma_r.c similarity index 100% rename from sysdeps/libm-ieee754/w_lgamma_r.c rename to math/w_lgamma_r.c diff --git a/sysdeps/libm-ieee754/w_lgammaf.c b/math/w_lgammaf.c similarity index 100% rename from sysdeps/libm-ieee754/w_lgammaf.c rename to math/w_lgammaf.c diff --git a/sysdeps/libm-ieee754/w_lgammaf_r.c b/math/w_lgammaf_r.c similarity index 100% rename from sysdeps/libm-ieee754/w_lgammaf_r.c rename to math/w_lgammaf_r.c diff --git a/sysdeps/libm-ieee754/w_lgammal.c b/math/w_lgammal.c similarity index 100% rename from sysdeps/libm-ieee754/w_lgammal.c rename to math/w_lgammal.c diff --git a/sysdeps/libm-ieee754/w_lgammal_r.c b/math/w_lgammal_r.c similarity index 100% rename from sysdeps/libm-ieee754/w_lgammal_r.c rename to math/w_lgammal_r.c diff --git a/sysdeps/libm-ieee754/w_log.c b/math/w_log.c similarity index 100% rename from sysdeps/libm-ieee754/w_log.c rename to math/w_log.c diff --git a/sysdeps/libm-ieee754/w_log10.c b/math/w_log10.c similarity index 100% rename from sysdeps/libm-ieee754/w_log10.c rename to math/w_log10.c diff --git a/sysdeps/libm-ieee754/w_log10f.c b/math/w_log10f.c similarity index 100% rename from sysdeps/libm-ieee754/w_log10f.c rename to math/w_log10f.c diff --git a/sysdeps/libm-ieee754/w_log10l.c b/math/w_log10l.c similarity index 100% rename from sysdeps/libm-ieee754/w_log10l.c rename to math/w_log10l.c diff --git a/sysdeps/libm-ieee754/w_logf.c b/math/w_logf.c similarity index 100% rename from sysdeps/libm-ieee754/w_logf.c rename to math/w_logf.c diff --git a/sysdeps/libm-ieee754/w_logl.c b/math/w_logl.c similarity index 100% rename from sysdeps/libm-ieee754/w_logl.c rename to math/w_logl.c diff --git a/sysdeps/libm-ieee754/w_pow.c b/math/w_pow.c similarity index 100% rename from sysdeps/libm-ieee754/w_pow.c rename to math/w_pow.c diff --git a/sysdeps/libm-ieee754/w_powf.c b/math/w_powf.c similarity index 100% rename from sysdeps/libm-ieee754/w_powf.c rename to math/w_powf.c diff --git a/sysdeps/libm-ieee754/w_powl.c b/math/w_powl.c similarity index 100% rename from sysdeps/libm-ieee754/w_powl.c rename to math/w_powl.c diff --git a/sysdeps/libm-ieee754/w_remainder.c b/math/w_remainder.c similarity index 100% rename from sysdeps/libm-ieee754/w_remainder.c rename to math/w_remainder.c diff --git a/sysdeps/libm-ieee754/w_remainderf.c b/math/w_remainderf.c similarity index 100% rename from sysdeps/libm-ieee754/w_remainderf.c rename to math/w_remainderf.c diff --git a/sysdeps/libm-ieee754/w_remainderl.c b/math/w_remainderl.c similarity index 100% rename from sysdeps/libm-ieee754/w_remainderl.c rename to math/w_remainderl.c diff --git a/sysdeps/libm-ieee754/w_scalb.c b/math/w_scalb.c similarity index 100% rename from sysdeps/libm-ieee754/w_scalb.c rename to math/w_scalb.c diff --git a/sysdeps/libm-ieee754/w_scalbf.c b/math/w_scalbf.c similarity index 100% rename from sysdeps/libm-ieee754/w_scalbf.c rename to math/w_scalbf.c diff --git a/sysdeps/libm-ieee754/w_scalbl.c b/math/w_scalbl.c similarity index 100% rename from sysdeps/libm-ieee754/w_scalbl.c rename to math/w_scalbl.c diff --git a/sysdeps/libm-ieee754/w_sinh.c b/math/w_sinh.c similarity index 100% rename from sysdeps/libm-ieee754/w_sinh.c rename to math/w_sinh.c diff --git a/sysdeps/libm-ieee754/w_sinhf.c b/math/w_sinhf.c similarity index 100% rename from sysdeps/libm-ieee754/w_sinhf.c rename to math/w_sinhf.c diff --git a/sysdeps/libm-ieee754/w_sinhl.c b/math/w_sinhl.c similarity index 100% rename from sysdeps/libm-ieee754/w_sinhl.c rename to math/w_sinhl.c diff --git a/sysdeps/libm-ieee754/w_sqrt.c b/math/w_sqrt.c similarity index 100% rename from sysdeps/libm-ieee754/w_sqrt.c rename to math/w_sqrt.c diff --git a/sysdeps/libm-ieee754/w_sqrtf.c b/math/w_sqrtf.c similarity index 100% rename from sysdeps/libm-ieee754/w_sqrtf.c rename to math/w_sqrtf.c diff --git a/sysdeps/libm-ieee754/w_sqrtl.c b/math/w_sqrtl.c similarity index 100% rename from sysdeps/libm-ieee754/w_sqrtl.c rename to math/w_sqrtl.c diff --git a/sysdeps/libm-ieee754/w_tgamma.c b/math/w_tgamma.c similarity index 100% rename from sysdeps/libm-ieee754/w_tgamma.c rename to math/w_tgamma.c diff --git a/sysdeps/libm-ieee754/w_tgammaf.c b/math/w_tgammaf.c similarity index 100% rename from sysdeps/libm-ieee754/w_tgammaf.c rename to math/w_tgammaf.c diff --git a/sysdeps/libm-ieee754/w_tgammal.c b/math/w_tgammal.c similarity index 100% rename from sysdeps/libm-ieee754/w_tgammal.c rename to math/w_tgammal.c diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c index 1b550abe4f..0a2efb7891 100644 --- a/stdio-common/printf_fp.c +++ b/stdio-common/printf_fp.c @@ -439,9 +439,28 @@ __printf_fp (FILE *fp, { if (scalesize == 0) { - tmpsize = powers->arraysize; - memcpy (tmp, &__tens[powers->arrayoff], - tmpsize * sizeof (mp_limb_t)); +#ifndef __NO_LONG_DOUBLE_MATH + if (LDBL_MANT_DIG > _FPIO_CONST_OFFSET * BITS_PER_MP_LIMB + && info->is_long_double) + { +#define _FPIO_CONST_SHIFT \ + (((LDBL_MANT_DIG + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB) \ + - _FPIO_CONST_OFFSET) + /* 64bit const offset is not enough for + IEEE quad long double. */ + tmpsize = powers->arraysize + _FPIO_CONST_SHIFT; + memcpy (tmp + _FPIO_CONST_SHIFT, + &__tens[powers->arrayoff], + tmpsize * sizeof (mp_limb_t)); + MPN_ZERO (tmp, _FPIO_CONST_SHIFT); + } + else +#endif + { + tmpsize = powers->arraysize; + memcpy (tmp, &__tens[powers->arrayoff], + tmpsize * sizeof (mp_limb_t)); + } } else { diff --git a/sysdeps/alpha/Implies b/sysdeps/alpha/Implies index 37fee79d97..2c6af5b7bb 100644 --- a/sysdeps/alpha/Implies +++ b/sysdeps/alpha/Implies @@ -1,3 +1,4 @@ wordsize-64 -# Alpha uses IEEE 754 floating point. -ieee754 +# Alpha uses IEEE 754 single and double precision floating point. +ieee754/flt-32 +ieee754/dbl-64 diff --git a/sysdeps/arm/Implies b/sysdeps/arm/Implies index d6acf04a82..780c4e2467 100644 --- a/sysdeps/arm/Implies +++ b/sysdeps/arm/Implies @@ -1,2 +1,3 @@ wordsize-32 -ieee754 +ieee754/flt-32 +ieee754/dbl-64 diff --git a/sysdeps/generic/e_atanhl.c b/sysdeps/generic/e_atanhl.c new file mode 100644 index 0000000000..625d42db31 --- /dev/null +++ b/sysdeps/generic/e_atanhl.c @@ -0,0 +1,14 @@ +#include +#include +#include + +long double +__ieee754_atanhl (long double x) +{ + fputs ("__ieee754_atanhl not implemented\n", stderr); + __set_errno (ENOSYS); + return 0.0; +} + +stub_warning (__ieee754_atanhl) +#include diff --git a/sysdeps/generic/e_coshl.c b/sysdeps/generic/e_coshl.c new file mode 100644 index 0000000000..0da319b785 --- /dev/null +++ b/sysdeps/generic/e_coshl.c @@ -0,0 +1,14 @@ +#include +#include +#include + +long double +__ieee754_coshl (long double x) +{ + fputs ("__ieee754_coshl not implemented\n", stderr); + __set_errno (ENOSYS); + return 0.0; +} + +stub_warning (__ieee754_coshl) +#include diff --git a/sysdeps/libm-ieee754/e_exp10.c b/sysdeps/generic/e_exp10.c similarity index 100% rename from sysdeps/libm-ieee754/e_exp10.c rename to sysdeps/generic/e_exp10.c diff --git a/sysdeps/libm-ieee754/e_exp10f.c b/sysdeps/generic/e_exp10f.c similarity index 100% rename from sysdeps/libm-ieee754/e_exp10f.c rename to sysdeps/generic/e_exp10f.c diff --git a/sysdeps/libm-ieee754/e_exp10l.c b/sysdeps/generic/e_exp10l.c similarity index 100% rename from sysdeps/libm-ieee754/e_exp10l.c rename to sysdeps/generic/e_exp10l.c diff --git a/sysdeps/generic/e_gammal_r.c b/sysdeps/generic/e_gammal_r.c new file mode 100644 index 0000000000..16b641bdd9 --- /dev/null +++ b/sysdeps/generic/e_gammal_r.c @@ -0,0 +1,14 @@ +#include +#include +#include + +long double +__ieee754_gammal_r (long double x, int *signgamp) +{ + fputs ("__ieee754_gammal_r not implemented\n", stderr); + __set_errno (ENOSYS); + return 0.0; +} + +stub_warning (__ieee754_gammal_r) +#include diff --git a/sysdeps/generic/e_hypotl.c b/sysdeps/generic/e_hypotl.c new file mode 100644 index 0000000000..07df22eb36 --- /dev/null +++ b/sysdeps/generic/e_hypotl.c @@ -0,0 +1,14 @@ +#include +#include +#include + +long double +__ieee754_hypotl (long double x, long double y) +{ + fputs ("__ieee754_hypotl not implemented\n", stderr); + __set_errno (ENOSYS); + return 0.0; +} + +stub_warning (__ieee754_hypotl) +#include diff --git a/sysdeps/libm-ieee754/e_scalb.c b/sysdeps/generic/e_scalb.c similarity index 100% rename from sysdeps/libm-ieee754/e_scalb.c rename to sysdeps/generic/e_scalb.c diff --git a/sysdeps/libm-ieee754/e_scalbf.c b/sysdeps/generic/e_scalbf.c similarity index 100% rename from sysdeps/libm-ieee754/e_scalbf.c rename to sysdeps/generic/e_scalbf.c diff --git a/sysdeps/libm-ieee754/e_scalbl.c b/sysdeps/generic/e_scalbl.c similarity index 100% rename from sysdeps/libm-ieee754/e_scalbl.c rename to sysdeps/generic/e_scalbl.c diff --git a/sysdeps/generic/e_sinhl.c b/sysdeps/generic/e_sinhl.c new file mode 100644 index 0000000000..4cec79cb2d --- /dev/null +++ b/sysdeps/generic/e_sinhl.c @@ -0,0 +1,14 @@ +#include +#include +#include + +long double +__ieee754_sinhl (long double x) +{ + fputs ("__ieee754_sinhl not implemented\n", stderr); + __set_errno (ENOSYS); + return 0.0; +} + +stub_warning (__ieee754_sinhl) +#include diff --git a/sysdeps/generic/ldbl2mpn.c b/sysdeps/generic/ldbl2mpn.c index e456d59e1d..450f9381cc 100644 --- a/sysdeps/generic/ldbl2mpn.c +++ b/sysdeps/generic/ldbl2mpn.c @@ -1,32 +1 @@ -/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include "gmp.h" -#include "gmp-impl.h" - -/* Convert a `long double' to a multi-precision integer representing the - significand scaled up by the highest possible number of significant bits - of fraction (LDBL_MANT_DIG), and an integral power of two (MPN frexpl). */ - -mp_size_t -__mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size, - int *expt, int *is_neg, - double value) -{ -#error "not implemented for this floating point format" -} +/* Empty. Not needed unless ldbl support is in. */ diff --git a/sysdeps/generic/math_ldbl.h b/sysdeps/generic/math_ldbl.h new file mode 100644 index 0000000000..83684e61c4 --- /dev/null +++ b/sysdeps/generic/math_ldbl.h @@ -0,0 +1,5 @@ +#ifndef _MATH_PRIVATE_H +#error "Never use directly; include instead." +#endif + +/* This is empty. Any machine using long double type will override this header. */ diff --git a/sysdeps/generic/mpn2ldbl.c b/sysdeps/generic/mpn2ldbl.c index c269ce689b..450f9381cc 100644 --- a/sysdeps/generic/mpn2ldbl.c +++ b/sysdeps/generic/mpn2ldbl.c @@ -1,30 +1 @@ -/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include "gmp.h" -#include "gmp-impl.h" -#include - -/* Convert a multi-precision integer of the needed number of bits and an - integral power of two to a `long double'. */ - -long double -__mpn_construct_long_double (mp_srcptr frac_ptr, int expt, int negative) -{ -#error "__mpn_construct_long_double not implemented for floating point format" -} +/* Empty. Not needed unless ldbl support is in. */ diff --git a/sysdeps/generic/printf_fphex.c b/sysdeps/generic/printf_fphex.c index 9e9fd07dfc..53e3254286 100644 --- a/sysdeps/generic/printf_fphex.c +++ b/sysdeps/generic/printf_fphex.c @@ -106,8 +106,8 @@ __printf_fphex (FILE *fp, const char *special = NULL; /* Buffer for the generated number string for the mantissa. The - maximal size for the mantissa is 64 bits. */ - char numbuf[16]; + maximal size for the mantissa is 128 bits. */ + char numbuf[32]; char *numstr; char *numend; int negative; @@ -229,8 +229,6 @@ __printf_fphex (FILE *fp, return done; } - /* We are handling here only 64 and 80 bit IEEE foating point - numbers. */ if (info->is_long_double == 0 || sizeof (double) == sizeof (long double)) { /* We have 52 bits of mantissa plus one implicit digit. Since @@ -281,64 +279,10 @@ __printf_fphex (FILE *fp, exponent = -(exponent - IEEE754_DOUBLE_BIAS); } } +#ifdef PRINT_FPHEX_LONG_DOUBLE else - { - /* The "strange" 80 bit format on ix86 and m68k has an explicit - leading digit in the 64 bit mantissa. */ - unsigned long long int num; - - assert (sizeof (long double) == 12); - - num = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 - | fpnum.ldbl.ieee.mantissa1); - - zero_mantissa = num == 0; - - if (sizeof (unsigned long int) > 6) - numstr = _itoa_word (num, numbuf + sizeof numbuf, 16, - info->spec == 'A'); - else - numstr = _itoa (num, numbuf + sizeof numbuf, 16, info->spec == 'A'); - - /* Fill with zeroes. */ - while (numstr > numbuf + (sizeof numbuf - 64 / 4)) - *--numstr = '0'; - - /* We use a full nibble for the leading digit. */ - leading = *numstr++; - - /* We have 3 bits from the mantissa in the leading nibble. - Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ - exponent = fpnum.ldbl.ieee.exponent; - - if (exponent == 0) - { - if (zero_mantissa) - expnegative = 0; - else - { - /* This is a denormalized number. */ - expnegative = 1; - /* This is a hook for the m68k long double format, where the - exponent bias is the same for normalized and denormalized - numbers. */ -#ifndef LONG_DOUBLE_DENORM_BIAS -# define LONG_DOUBLE_DENORM_BIAS (IEEE854_LONG_DOUBLE_BIAS - 1) + PRINT_FPHEX_LONG_DOUBLE; #endif - exponent = LONG_DOUBLE_DENORM_BIAS + 3; - } - } - else if (exponent >= IEEE854_LONG_DOUBLE_BIAS + 3) - { - expnegative = 0; - exponent -= IEEE854_LONG_DOUBLE_BIAS + 3; - } - else - { - expnegative = 1; - exponent = -(exponent - (IEEE854_LONG_DOUBLE_BIAS + 3)); - } - } /* Look for trailing zeroes. */ if (! zero_mantissa) diff --git a/sysdeps/generic/s_asinhl.c b/sysdeps/generic/s_asinhl.c new file mode 100644 index 0000000000..1d5cf47a4f --- /dev/null +++ b/sysdeps/generic/s_asinhl.c @@ -0,0 +1,15 @@ +#include +#include +#include + +long double +__asinhl(long double x) +{ + fputs ("__asinhl not implemented\n", stderr); + __set_errno (ENOSYS); + return 0.0; +} + +weak_alias (__asinhl, asinhl) +stub_warning (asinhl) +#include diff --git a/sysdeps/libm-ieee754/s_cacos.c b/sysdeps/generic/s_cacos.c similarity index 100% rename from sysdeps/libm-ieee754/s_cacos.c rename to sysdeps/generic/s_cacos.c diff --git a/sysdeps/libm-ieee754/s_cacosf.c b/sysdeps/generic/s_cacosf.c similarity index 100% rename from sysdeps/libm-ieee754/s_cacosf.c rename to sysdeps/generic/s_cacosf.c diff --git a/sysdeps/libm-ieee754/s_cacosh.c b/sysdeps/generic/s_cacosh.c similarity index 100% rename from sysdeps/libm-ieee754/s_cacosh.c rename to sysdeps/generic/s_cacosh.c diff --git a/sysdeps/libm-ieee754/s_cacoshf.c b/sysdeps/generic/s_cacoshf.c similarity index 100% rename from sysdeps/libm-ieee754/s_cacoshf.c rename to sysdeps/generic/s_cacoshf.c diff --git a/sysdeps/libm-ieee754/s_cacoshl.c b/sysdeps/generic/s_cacoshl.c similarity index 100% rename from sysdeps/libm-ieee754/s_cacoshl.c rename to sysdeps/generic/s_cacoshl.c diff --git a/sysdeps/libm-ieee754/s_cacosl.c b/sysdeps/generic/s_cacosl.c similarity index 100% rename from sysdeps/libm-ieee754/s_cacosl.c rename to sysdeps/generic/s_cacosl.c diff --git a/sysdeps/libm-ieee754/s_casin.c b/sysdeps/generic/s_casin.c similarity index 100% rename from sysdeps/libm-ieee754/s_casin.c rename to sysdeps/generic/s_casin.c diff --git a/sysdeps/libm-ieee754/s_casinf.c b/sysdeps/generic/s_casinf.c similarity index 100% rename from sysdeps/libm-ieee754/s_casinf.c rename to sysdeps/generic/s_casinf.c diff --git a/sysdeps/libm-ieee754/s_casinh.c b/sysdeps/generic/s_casinh.c similarity index 100% rename from sysdeps/libm-ieee754/s_casinh.c rename to sysdeps/generic/s_casinh.c diff --git a/sysdeps/libm-ieee754/s_casinhf.c b/sysdeps/generic/s_casinhf.c similarity index 100% rename from sysdeps/libm-ieee754/s_casinhf.c rename to sysdeps/generic/s_casinhf.c diff --git a/sysdeps/libm-ieee754/s_casinhl.c b/sysdeps/generic/s_casinhl.c similarity index 100% rename from sysdeps/libm-ieee754/s_casinhl.c rename to sysdeps/generic/s_casinhl.c diff --git a/sysdeps/libm-ieee754/s_casinl.c b/sysdeps/generic/s_casinl.c similarity index 100% rename from sysdeps/libm-ieee754/s_casinl.c rename to sysdeps/generic/s_casinl.c diff --git a/sysdeps/libm-ieee754/s_catan.c b/sysdeps/generic/s_catan.c similarity index 100% rename from sysdeps/libm-ieee754/s_catan.c rename to sysdeps/generic/s_catan.c diff --git a/sysdeps/libm-ieee754/s_catanf.c b/sysdeps/generic/s_catanf.c similarity index 100% rename from sysdeps/libm-ieee754/s_catanf.c rename to sysdeps/generic/s_catanf.c diff --git a/sysdeps/libm-ieee754/s_catanh.c b/sysdeps/generic/s_catanh.c similarity index 100% rename from sysdeps/libm-ieee754/s_catanh.c rename to sysdeps/generic/s_catanh.c diff --git a/sysdeps/libm-ieee754/s_catanhf.c b/sysdeps/generic/s_catanhf.c similarity index 100% rename from sysdeps/libm-ieee754/s_catanhf.c rename to sysdeps/generic/s_catanhf.c diff --git a/sysdeps/libm-ieee754/s_catanhl.c b/sysdeps/generic/s_catanhl.c similarity index 100% rename from sysdeps/libm-ieee754/s_catanhl.c rename to sysdeps/generic/s_catanhl.c diff --git a/sysdeps/libm-ieee754/s_catanl.c b/sysdeps/generic/s_catanl.c similarity index 100% rename from sysdeps/libm-ieee754/s_catanl.c rename to sysdeps/generic/s_catanl.c diff --git a/sysdeps/generic/s_cbrtl.c b/sysdeps/generic/s_cbrtl.c new file mode 100644 index 0000000000..d668e377af --- /dev/null +++ b/sysdeps/generic/s_cbrtl.c @@ -0,0 +1,15 @@ +#include +#include +#include + +long double +__cbrtl(long double x) +{ + fputs ("__cbrtl not implemented\n", stderr); + __set_errno (ENOSYS); + return 0.0; +} + +weak_alias (__cbrtl, cbrtl) +stub_warning (cbrtl) +#include diff --git a/sysdeps/libm-ieee754/s_ccos.c b/sysdeps/generic/s_ccos.c similarity index 100% rename from sysdeps/libm-ieee754/s_ccos.c rename to sysdeps/generic/s_ccos.c diff --git a/sysdeps/libm-ieee754/s_ccosf.c b/sysdeps/generic/s_ccosf.c similarity index 100% rename from sysdeps/libm-ieee754/s_ccosf.c rename to sysdeps/generic/s_ccosf.c diff --git a/sysdeps/libm-ieee754/s_ccosh.c b/sysdeps/generic/s_ccosh.c similarity index 100% rename from sysdeps/libm-ieee754/s_ccosh.c rename to sysdeps/generic/s_ccosh.c diff --git a/sysdeps/libm-ieee754/s_ccoshf.c b/sysdeps/generic/s_ccoshf.c similarity index 100% rename from sysdeps/libm-ieee754/s_ccoshf.c rename to sysdeps/generic/s_ccoshf.c diff --git a/sysdeps/libm-ieee754/s_ccoshl.c b/sysdeps/generic/s_ccoshl.c similarity index 100% rename from sysdeps/libm-ieee754/s_ccoshl.c rename to sysdeps/generic/s_ccoshl.c diff --git a/sysdeps/libm-ieee754/s_ccosl.c b/sysdeps/generic/s_ccosl.c similarity index 100% rename from sysdeps/libm-ieee754/s_ccosl.c rename to sysdeps/generic/s_ccosl.c diff --git a/sysdeps/libm-ieee754/s_cexp.c b/sysdeps/generic/s_cexp.c similarity index 100% rename from sysdeps/libm-ieee754/s_cexp.c rename to sysdeps/generic/s_cexp.c diff --git a/sysdeps/libm-ieee754/s_cexpf.c b/sysdeps/generic/s_cexpf.c similarity index 100% rename from sysdeps/libm-ieee754/s_cexpf.c rename to sysdeps/generic/s_cexpf.c diff --git a/sysdeps/libm-ieee754/s_cexpl.c b/sysdeps/generic/s_cexpl.c similarity index 100% rename from sysdeps/libm-ieee754/s_cexpl.c rename to sysdeps/generic/s_cexpl.c diff --git a/sysdeps/libm-ieee754/s_clog.c b/sysdeps/generic/s_clog.c similarity index 100% rename from sysdeps/libm-ieee754/s_clog.c rename to sysdeps/generic/s_clog.c diff --git a/sysdeps/libm-ieee754/s_clog10.c b/sysdeps/generic/s_clog10.c similarity index 100% rename from sysdeps/libm-ieee754/s_clog10.c rename to sysdeps/generic/s_clog10.c diff --git a/sysdeps/libm-ieee754/s_clog10f.c b/sysdeps/generic/s_clog10f.c similarity index 100% rename from sysdeps/libm-ieee754/s_clog10f.c rename to sysdeps/generic/s_clog10f.c diff --git a/sysdeps/libm-ieee754/s_clog10l.c b/sysdeps/generic/s_clog10l.c similarity index 100% rename from sysdeps/libm-ieee754/s_clog10l.c rename to sysdeps/generic/s_clog10l.c diff --git a/sysdeps/libm-ieee754/s_clogf.c b/sysdeps/generic/s_clogf.c similarity index 100% rename from sysdeps/libm-ieee754/s_clogf.c rename to sysdeps/generic/s_clogf.c diff --git a/sysdeps/libm-ieee754/s_clogl.c b/sysdeps/generic/s_clogl.c similarity index 100% rename from sysdeps/libm-ieee754/s_clogl.c rename to sysdeps/generic/s_clogl.c diff --git a/sysdeps/libm-ieee754/s_cpow.c b/sysdeps/generic/s_cpow.c similarity index 100% rename from sysdeps/libm-ieee754/s_cpow.c rename to sysdeps/generic/s_cpow.c diff --git a/sysdeps/libm-ieee754/s_cpowf.c b/sysdeps/generic/s_cpowf.c similarity index 100% rename from sysdeps/libm-ieee754/s_cpowf.c rename to sysdeps/generic/s_cpowf.c diff --git a/sysdeps/libm-ieee754/s_cpowl.c b/sysdeps/generic/s_cpowl.c similarity index 100% rename from sysdeps/libm-ieee754/s_cpowl.c rename to sysdeps/generic/s_cpowl.c diff --git a/sysdeps/libm-ieee754/s_cproj.c b/sysdeps/generic/s_cproj.c similarity index 100% rename from sysdeps/libm-ieee754/s_cproj.c rename to sysdeps/generic/s_cproj.c diff --git a/sysdeps/libm-ieee754/s_cprojf.c b/sysdeps/generic/s_cprojf.c similarity index 100% rename from sysdeps/libm-ieee754/s_cprojf.c rename to sysdeps/generic/s_cprojf.c diff --git a/sysdeps/libm-ieee754/s_cprojl.c b/sysdeps/generic/s_cprojl.c similarity index 100% rename from sysdeps/libm-ieee754/s_cprojl.c rename to sysdeps/generic/s_cprojl.c diff --git a/sysdeps/libm-ieee754/s_csin.c b/sysdeps/generic/s_csin.c similarity index 100% rename from sysdeps/libm-ieee754/s_csin.c rename to sysdeps/generic/s_csin.c diff --git a/sysdeps/libm-ieee754/s_csinf.c b/sysdeps/generic/s_csinf.c similarity index 100% rename from sysdeps/libm-ieee754/s_csinf.c rename to sysdeps/generic/s_csinf.c diff --git a/sysdeps/libm-ieee754/s_csinh.c b/sysdeps/generic/s_csinh.c similarity index 100% rename from sysdeps/libm-ieee754/s_csinh.c rename to sysdeps/generic/s_csinh.c diff --git a/sysdeps/libm-ieee754/s_csinhf.c b/sysdeps/generic/s_csinhf.c similarity index 100% rename from sysdeps/libm-ieee754/s_csinhf.c rename to sysdeps/generic/s_csinhf.c diff --git a/sysdeps/libm-ieee754/s_csinhl.c b/sysdeps/generic/s_csinhl.c similarity index 100% rename from sysdeps/libm-ieee754/s_csinhl.c rename to sysdeps/generic/s_csinhl.c diff --git a/sysdeps/libm-ieee754/s_csinl.c b/sysdeps/generic/s_csinl.c similarity index 100% rename from sysdeps/libm-ieee754/s_csinl.c rename to sysdeps/generic/s_csinl.c diff --git a/sysdeps/libm-ieee754/s_csqrt.c b/sysdeps/generic/s_csqrt.c similarity index 100% rename from sysdeps/libm-ieee754/s_csqrt.c rename to sysdeps/generic/s_csqrt.c diff --git a/sysdeps/libm-ieee754/s_csqrtf.c b/sysdeps/generic/s_csqrtf.c similarity index 100% rename from sysdeps/libm-ieee754/s_csqrtf.c rename to sysdeps/generic/s_csqrtf.c diff --git a/sysdeps/libm-ieee754/s_csqrtl.c b/sysdeps/generic/s_csqrtl.c similarity index 100% rename from sysdeps/libm-ieee754/s_csqrtl.c rename to sysdeps/generic/s_csqrtl.c diff --git a/sysdeps/libm-ieee754/s_ctan.c b/sysdeps/generic/s_ctan.c similarity index 100% rename from sysdeps/libm-ieee754/s_ctan.c rename to sysdeps/generic/s_ctan.c diff --git a/sysdeps/libm-ieee754/s_ctanf.c b/sysdeps/generic/s_ctanf.c similarity index 100% rename from sysdeps/libm-ieee754/s_ctanf.c rename to sysdeps/generic/s_ctanf.c diff --git a/sysdeps/libm-ieee754/s_ctanh.c b/sysdeps/generic/s_ctanh.c similarity index 100% rename from sysdeps/libm-ieee754/s_ctanh.c rename to sysdeps/generic/s_ctanh.c diff --git a/sysdeps/libm-ieee754/s_ctanhf.c b/sysdeps/generic/s_ctanhf.c similarity index 100% rename from sysdeps/libm-ieee754/s_ctanhf.c rename to sysdeps/generic/s_ctanhf.c diff --git a/sysdeps/libm-ieee754/s_ctanhl.c b/sysdeps/generic/s_ctanhl.c similarity index 100% rename from sysdeps/libm-ieee754/s_ctanhl.c rename to sysdeps/generic/s_ctanhl.c diff --git a/sysdeps/libm-ieee754/s_ctanl.c b/sysdeps/generic/s_ctanl.c similarity index 100% rename from sysdeps/libm-ieee754/s_ctanl.c rename to sysdeps/generic/s_ctanl.c diff --git a/sysdeps/libm-ieee754/s_fdim.c b/sysdeps/generic/s_fdim.c similarity index 100% rename from sysdeps/libm-ieee754/s_fdim.c rename to sysdeps/generic/s_fdim.c diff --git a/sysdeps/libm-ieee754/s_fdimf.c b/sysdeps/generic/s_fdimf.c similarity index 100% rename from sysdeps/libm-ieee754/s_fdimf.c rename to sysdeps/generic/s_fdimf.c diff --git a/sysdeps/libm-ieee754/s_fdiml.c b/sysdeps/generic/s_fdiml.c similarity index 100% rename from sysdeps/libm-ieee754/s_fdiml.c rename to sysdeps/generic/s_fdiml.c diff --git a/sysdeps/libm-ieee754/s_fma.c b/sysdeps/generic/s_fma.c similarity index 100% rename from sysdeps/libm-ieee754/s_fma.c rename to sysdeps/generic/s_fma.c diff --git a/sysdeps/libm-ieee754/s_fmaf.c b/sysdeps/generic/s_fmaf.c similarity index 100% rename from sysdeps/libm-ieee754/s_fmaf.c rename to sysdeps/generic/s_fmaf.c diff --git a/sysdeps/libm-ieee754/s_fmal.c b/sysdeps/generic/s_fmal.c similarity index 100% rename from sysdeps/libm-ieee754/s_fmal.c rename to sysdeps/generic/s_fmal.c diff --git a/sysdeps/libm-ieee754/s_fmax.c b/sysdeps/generic/s_fmax.c similarity index 100% rename from sysdeps/libm-ieee754/s_fmax.c rename to sysdeps/generic/s_fmax.c diff --git a/sysdeps/libm-ieee754/s_fmaxf.c b/sysdeps/generic/s_fmaxf.c similarity index 100% rename from sysdeps/libm-ieee754/s_fmaxf.c rename to sysdeps/generic/s_fmaxf.c diff --git a/sysdeps/libm-ieee754/s_fmaxl.c b/sysdeps/generic/s_fmaxl.c similarity index 100% rename from sysdeps/libm-ieee754/s_fmaxl.c rename to sysdeps/generic/s_fmaxl.c diff --git a/sysdeps/libm-ieee754/s_fmin.c b/sysdeps/generic/s_fmin.c similarity index 100% rename from sysdeps/libm-ieee754/s_fmin.c rename to sysdeps/generic/s_fmin.c diff --git a/sysdeps/libm-ieee754/s_fminf.c b/sysdeps/generic/s_fminf.c similarity index 100% rename from sysdeps/libm-ieee754/s_fminf.c rename to sysdeps/generic/s_fminf.c diff --git a/sysdeps/libm-ieee754/s_fminl.c b/sysdeps/generic/s_fminl.c similarity index 100% rename from sysdeps/libm-ieee754/s_fminl.c rename to sysdeps/generic/s_fminl.c diff --git a/sysdeps/libm-ieee754/s_ldexp.c b/sysdeps/generic/s_ldexp.c similarity index 100% rename from sysdeps/libm-ieee754/s_ldexp.c rename to sysdeps/generic/s_ldexp.c diff --git a/sysdeps/libm-ieee754/s_ldexpf.c b/sysdeps/generic/s_ldexpf.c similarity index 100% rename from sysdeps/libm-ieee754/s_ldexpf.c rename to sysdeps/generic/s_ldexpf.c diff --git a/sysdeps/libm-ieee754/s_ldexpl.c b/sysdeps/generic/s_ldexpl.c similarity index 100% rename from sysdeps/libm-ieee754/s_ldexpl.c rename to sysdeps/generic/s_ldexpl.c diff --git a/sysdeps/libm-ieee754/s_nan.c b/sysdeps/generic/s_nan.c similarity index 100% rename from sysdeps/libm-ieee754/s_nan.c rename to sysdeps/generic/s_nan.c diff --git a/sysdeps/libm-ieee754/s_nanf.c b/sysdeps/generic/s_nanf.c similarity index 100% rename from sysdeps/libm-ieee754/s_nanf.c rename to sysdeps/generic/s_nanf.c diff --git a/sysdeps/libm-ieee754/s_nanl.c b/sysdeps/generic/s_nanl.c similarity index 100% rename from sysdeps/libm-ieee754/s_nanl.c rename to sysdeps/generic/s_nanl.c diff --git a/sysdeps/libm-ieee754/s_nextafter.c b/sysdeps/generic/s_nextafter.c similarity index 96% rename from sysdeps/libm-ieee754/s_nextafter.c rename to sysdeps/generic/s_nextafter.c index b98a161cf2..8b81e563d9 100644 --- a/sysdeps/libm-ieee754/s_nextafter.c +++ b/sysdeps/generic/s_nextafter.c @@ -81,4 +81,6 @@ weak_alias (__nextafter, nextafter) #ifdef NO_LONG_DOUBLE strong_alias (__nextafter, __nextafterl) weak_alias (__nextafter, nextafterl) +strong_alias (__nextafter, __nexttoward) +weak_alias (__nextafter, nexttoward) #endif diff --git a/sysdeps/generic/s_nexttowardf.c b/sysdeps/generic/s_nexttowardf.c new file mode 100644 index 0000000000..f4cf18d06e --- /dev/null +++ b/sysdeps/generic/s_nexttowardf.c @@ -0,0 +1,79 @@ +/* Single precision version of nexttoward.c. + Conversion to IEEE single float by Jakub Jelinek, jj@ultra.linux.cz. */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* IEEE functions + * nexttowardf(x,y) + * return the next machine floating-point number of x in the + * direction toward y. + * This is for machines which use the same binary type for double and + * long double. + * Special cases: + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + float __nexttowardf(float x, long double y) +#else + float __nexttowardf(x,y) + float x; + long double y; +#endif +{ + int32_t hx,hy,ix,iy; + u_int32_t ly; + + GET_FLOAT_WORD(hx,x); + EXTRACT_WORDS(hy,ly,y); + ix = hx&0x7fffffff; /* |x| */ + iy = hy&0x7fffffff; /* |y| */ + + if(((ix>=0x7f800000) || /* x is nan */ + ((iy>=0x7ff00000)&&((iy-0x7ff00000)|ly)!=0)) /* y is nan */ + return x+y; + if((long double) x==y) return y; /* x=y, return y */ + if(ix==0) { /* x == 0 */ + float x2; + SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/ + x2 = x*x; + if(x2==x) return x2; else return x; /* raise underflow flag */ + } + if(hx>=0) { /* x > 0 */ + if(hy<0||(ix>>23)>(iy>>20)-0x380 + || ((ix>>23)==(iy>>20)-0x380 + && (ix&0x7fffff)>((hy<<3)|(ly>>29))&0x7fffff)) /* x > y, x -= ulp */ + hx -= 1; + else /* x < y, x += ulp */ + hx += 1; + } else { /* x < 0 */ + if(hy>=0||(ix>>23)>(iy>>20)-0x380 + || ((ix>>23)==(iy>>20)-0x380 + && (ix&0x7fffff)>((hy<<3)|(ly>>29))&0x7fffff)) /* x < y, x -= ulp */ + hx -= 1; + else /* x > y, x += ulp */ + hx += 1; + } + hy = hx&0x7f800000; + if(hy>=0x7f800000) return x+x; /* overflow */ + if(hy<0x00800000) { /* underflow */ + float x2 = x*x; + if(x2!=x) { /* raise underflow flag */ + SET_FLOAT_WORD(x2,hx); + return x2; + } + } + SET_FLOAT_WORD(x,hx); + return x; +} +weak_alias (__nexttowardf, nexttowardf) diff --git a/sysdeps/libm-ieee754/s_nexttowardl.c b/sysdeps/generic/s_nexttowardl.c similarity index 100% rename from sysdeps/libm-ieee754/s_nexttowardl.c rename to sysdeps/generic/s_nexttowardl.c diff --git a/sysdeps/libm-ieee754/s_significand.c b/sysdeps/generic/s_significand.c similarity index 100% rename from sysdeps/libm-ieee754/s_significand.c rename to sysdeps/generic/s_significand.c diff --git a/sysdeps/libm-ieee754/s_significandf.c b/sysdeps/generic/s_significandf.c similarity index 100% rename from sysdeps/libm-ieee754/s_significandf.c rename to sysdeps/generic/s_significandf.c diff --git a/sysdeps/libm-ieee754/s_significandl.c b/sysdeps/generic/s_significandl.c similarity index 90% rename from sysdeps/libm-ieee754/s_significandl.c rename to sysdeps/generic/s_significandl.c index 6339274b5a..d84e806fdc 100644 --- a/sysdeps/libm-ieee754/s_significandl.c +++ b/sysdeps/generic/s_significandl.c @@ -20,7 +20,7 @@ static char rcsid[] = "$NetBSD: $"; /* * significandl(x) computes just - * scalbl(x, (double) -ilogbl(x)), + * scalbl(x, (long double) -ilogbl(x)), * for exercising the fraction-part(F) IEEE 754-1985 test vector. */ @@ -34,6 +34,6 @@ static char rcsid[] = "$NetBSD: $"; long double x; #endif { - return __ieee754_scalbl(x,(double) -ilogbl(x)); + return __ieee754_scalbl(x,(long double) -ilogbl(x)); } weak_alias (__significandl, significandl) diff --git a/sysdeps/generic/s_tanhl.c b/sysdeps/generic/s_tanhl.c new file mode 100644 index 0000000000..bc9a2d7f48 --- /dev/null +++ b/sysdeps/generic/s_tanhl.c @@ -0,0 +1,15 @@ +#include +#include +#include + +long double +__tanhl(long double x) +{ + fputs ("__tanhl not implemented\n", stderr); + __set_errno (ENOSYS); + return 0.0; +} + +weak_alias (__tanhl, tanhl) +stub_warning (tanhl) +#include diff --git a/sysdeps/generic/strtold.c b/sysdeps/generic/strtold.c index f1bb2f1c0d..86b2f7f2f4 100644 --- a/sysdeps/generic/strtold.c +++ b/sysdeps/generic/strtold.c @@ -1,31 +1,23 @@ -#include +/* Copyright (C) 1999 Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -#ifndef __NO_LONG_DOUBLE_MATH -/* The actual implementation for all floating point sizes is in strtod.c. - These macros tell it to produce the `long double' version, `strtold'. */ + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -# define FLOAT long double -# define FLT LDBL -# ifdef USE_IN_EXTENDED_LOCALE_MODEL -# define STRTOF __strtold_l -# else -# define STRTOF strtold -# endif -# define MPN2FLOAT __mpn_construct_long_double -# define FLOAT_HUGE_VAL HUGE_VALL -# define SET_MANTISSA(flt, mant) \ - do { union ieee854_long_double u; \ - u.d = (flt); \ - if ((mant & 0x7fffffffffffffffULL) == 0) \ - mant = 0x4000000000000000ULL; \ - u.ieee.mantissa0 = (((mant) >> 32) & 0x7fffffff) | 0x80000000; \ - u.ieee.mantissa1 = (mant) & 0xffffffff; \ - (flt) = u.d; \ - } while (0) + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include -# include "strtod.c" -#else -# include /* There is no `long double' type, use the `double' implementations. */ long double __strtold_internal (const char *nptr, char **endptr, int group) diff --git a/sysdeps/generic/w_expl.c b/sysdeps/generic/w_expl.c new file mode 100644 index 0000000000..70096a820c --- /dev/null +++ b/sysdeps/generic/w_expl.c @@ -0,0 +1,13 @@ +#include +#include +#include + +long double +__expl(long double x) +{ + fputs ("__expl not implemented\n", stderr); + __set_errno (ENOSYS); + return 0.0; +} + +weak_alias (__expl, expl) diff --git a/sysdeps/i386/Implies b/sysdeps/i386/Implies index d6acf04a82..ac22f59f78 100644 --- a/sysdeps/i386/Implies +++ b/sysdeps/i386/Implies @@ -1,2 +1,4 @@ wordsize-32 -ieee754 +ieee754/flt-32 +ieee754/dbl-64 +ieee754/ldbl-96 diff --git a/sysdeps/i386/fpu/Implies b/sysdeps/i386/fpu/Implies deleted file mode 100644 index de9b0b27aa..0000000000 --- a/sysdeps/i386/fpu/Implies +++ /dev/null @@ -1,2 +0,0 @@ -# For x86 machines with FPU, use the i387 port of libm by JT Conklin. -libm-i387 diff --git a/sysdeps/libm-i387/e_acos.S b/sysdeps/i386/fpu/e_acos.S similarity index 100% rename from sysdeps/libm-i387/e_acos.S rename to sysdeps/i386/fpu/e_acos.S diff --git a/sysdeps/libm-i387/e_acosf.S b/sysdeps/i386/fpu/e_acosf.S similarity index 100% rename from sysdeps/libm-i387/e_acosf.S rename to sysdeps/i386/fpu/e_acosf.S diff --git a/sysdeps/libm-i387/e_acosh.S b/sysdeps/i386/fpu/e_acosh.S similarity index 100% rename from sysdeps/libm-i387/e_acosh.S rename to sysdeps/i386/fpu/e_acosh.S diff --git a/sysdeps/libm-i387/e_acoshf.S b/sysdeps/i386/fpu/e_acoshf.S similarity index 100% rename from sysdeps/libm-i387/e_acoshf.S rename to sysdeps/i386/fpu/e_acoshf.S diff --git a/sysdeps/libm-i387/e_acoshl.S b/sysdeps/i386/fpu/e_acoshl.S similarity index 100% rename from sysdeps/libm-i387/e_acoshl.S rename to sysdeps/i386/fpu/e_acoshl.S diff --git a/sysdeps/libm-i387/e_acosl.S b/sysdeps/i386/fpu/e_acosl.S similarity index 100% rename from sysdeps/libm-i387/e_acosl.S rename to sysdeps/i386/fpu/e_acosl.S diff --git a/sysdeps/libm-i387/e_asin.S b/sysdeps/i386/fpu/e_asin.S similarity index 100% rename from sysdeps/libm-i387/e_asin.S rename to sysdeps/i386/fpu/e_asin.S diff --git a/sysdeps/libm-i387/e_asinf.S b/sysdeps/i386/fpu/e_asinf.S similarity index 100% rename from sysdeps/libm-i387/e_asinf.S rename to sysdeps/i386/fpu/e_asinf.S diff --git a/sysdeps/libm-i387/e_asinl.S b/sysdeps/i386/fpu/e_asinl.S similarity index 100% rename from sysdeps/libm-i387/e_asinl.S rename to sysdeps/i386/fpu/e_asinl.S diff --git a/sysdeps/libm-i387/e_atan2.S b/sysdeps/i386/fpu/e_atan2.S similarity index 100% rename from sysdeps/libm-i387/e_atan2.S rename to sysdeps/i386/fpu/e_atan2.S diff --git a/sysdeps/libm-i387/e_atan2f.S b/sysdeps/i386/fpu/e_atan2f.S similarity index 100% rename from sysdeps/libm-i387/e_atan2f.S rename to sysdeps/i386/fpu/e_atan2f.S diff --git a/sysdeps/libm-i387/e_atan2l.S b/sysdeps/i386/fpu/e_atan2l.S similarity index 100% rename from sysdeps/libm-i387/e_atan2l.S rename to sysdeps/i386/fpu/e_atan2l.S diff --git a/sysdeps/libm-i387/e_atanh.S b/sysdeps/i386/fpu/e_atanh.S similarity index 100% rename from sysdeps/libm-i387/e_atanh.S rename to sysdeps/i386/fpu/e_atanh.S diff --git a/sysdeps/libm-i387/e_atanhf.S b/sysdeps/i386/fpu/e_atanhf.S similarity index 100% rename from sysdeps/libm-i387/e_atanhf.S rename to sysdeps/i386/fpu/e_atanhf.S diff --git a/sysdeps/libm-i387/e_atanhl.S b/sysdeps/i386/fpu/e_atanhl.S similarity index 100% rename from sysdeps/libm-i387/e_atanhl.S rename to sysdeps/i386/fpu/e_atanhl.S diff --git a/sysdeps/libm-i387/e_exp.S b/sysdeps/i386/fpu/e_exp.S similarity index 100% rename from sysdeps/libm-i387/e_exp.S rename to sysdeps/i386/fpu/e_exp.S diff --git a/sysdeps/libm-i387/e_exp10.S b/sysdeps/i386/fpu/e_exp10.S similarity index 100% rename from sysdeps/libm-i387/e_exp10.S rename to sysdeps/i386/fpu/e_exp10.S diff --git a/sysdeps/libm-i387/e_exp10f.S b/sysdeps/i386/fpu/e_exp10f.S similarity index 100% rename from sysdeps/libm-i387/e_exp10f.S rename to sysdeps/i386/fpu/e_exp10f.S diff --git a/sysdeps/libm-i387/e_exp10l.S b/sysdeps/i386/fpu/e_exp10l.S similarity index 100% rename from sysdeps/libm-i387/e_exp10l.S rename to sysdeps/i386/fpu/e_exp10l.S diff --git a/sysdeps/libm-i387/e_expf.S b/sysdeps/i386/fpu/e_expf.S similarity index 100% rename from sysdeps/libm-i387/e_expf.S rename to sysdeps/i386/fpu/e_expf.S diff --git a/sysdeps/libm-i387/e_expl.S b/sysdeps/i386/fpu/e_expl.S similarity index 100% rename from sysdeps/libm-i387/e_expl.S rename to sysdeps/i386/fpu/e_expl.S diff --git a/sysdeps/libm-i387/e_fmod.S b/sysdeps/i386/fpu/e_fmod.S similarity index 100% rename from sysdeps/libm-i387/e_fmod.S rename to sysdeps/i386/fpu/e_fmod.S diff --git a/sysdeps/libm-i387/e_fmodf.S b/sysdeps/i386/fpu/e_fmodf.S similarity index 100% rename from sysdeps/libm-i387/e_fmodf.S rename to sysdeps/i386/fpu/e_fmodf.S diff --git a/sysdeps/libm-i387/e_fmodl.S b/sysdeps/i386/fpu/e_fmodl.S similarity index 100% rename from sysdeps/libm-i387/e_fmodl.S rename to sysdeps/i386/fpu/e_fmodl.S diff --git a/sysdeps/libm-i387/e_hypot.S b/sysdeps/i386/fpu/e_hypot.S similarity index 100% rename from sysdeps/libm-i387/e_hypot.S rename to sysdeps/i386/fpu/e_hypot.S diff --git a/sysdeps/libm-i387/e_hypotf.S b/sysdeps/i386/fpu/e_hypotf.S similarity index 100% rename from sysdeps/libm-i387/e_hypotf.S rename to sysdeps/i386/fpu/e_hypotf.S diff --git a/sysdeps/libm-i387/e_log.S b/sysdeps/i386/fpu/e_log.S similarity index 100% rename from sysdeps/libm-i387/e_log.S rename to sysdeps/i386/fpu/e_log.S diff --git a/sysdeps/libm-i387/e_log10.S b/sysdeps/i386/fpu/e_log10.S similarity index 100% rename from sysdeps/libm-i387/e_log10.S rename to sysdeps/i386/fpu/e_log10.S diff --git a/sysdeps/libm-i387/e_log10f.S b/sysdeps/i386/fpu/e_log10f.S similarity index 100% rename from sysdeps/libm-i387/e_log10f.S rename to sysdeps/i386/fpu/e_log10f.S diff --git a/sysdeps/libm-i387/e_log10l.S b/sysdeps/i386/fpu/e_log10l.S similarity index 100% rename from sysdeps/libm-i387/e_log10l.S rename to sysdeps/i386/fpu/e_log10l.S diff --git a/sysdeps/libm-i387/e_logf.S b/sysdeps/i386/fpu/e_logf.S similarity index 100% rename from sysdeps/libm-i387/e_logf.S rename to sysdeps/i386/fpu/e_logf.S diff --git a/sysdeps/libm-i387/e_logl.S b/sysdeps/i386/fpu/e_logl.S similarity index 100% rename from sysdeps/libm-i387/e_logl.S rename to sysdeps/i386/fpu/e_logl.S diff --git a/sysdeps/libm-i387/e_pow.S b/sysdeps/i386/fpu/e_pow.S similarity index 100% rename from sysdeps/libm-i387/e_pow.S rename to sysdeps/i386/fpu/e_pow.S diff --git a/sysdeps/libm-i387/e_powf.S b/sysdeps/i386/fpu/e_powf.S similarity index 100% rename from sysdeps/libm-i387/e_powf.S rename to sysdeps/i386/fpu/e_powf.S diff --git a/sysdeps/libm-i387/e_powl.S b/sysdeps/i386/fpu/e_powl.S similarity index 100% rename from sysdeps/libm-i387/e_powl.S rename to sysdeps/i386/fpu/e_powl.S diff --git a/sysdeps/libm-i387/e_rem_pio2.c b/sysdeps/i386/fpu/e_rem_pio2.c similarity index 100% rename from sysdeps/libm-i387/e_rem_pio2.c rename to sysdeps/i386/fpu/e_rem_pio2.c diff --git a/sysdeps/libm-i387/e_rem_pio2f.c b/sysdeps/i386/fpu/e_rem_pio2f.c similarity index 100% rename from sysdeps/libm-i387/e_rem_pio2f.c rename to sysdeps/i386/fpu/e_rem_pio2f.c diff --git a/sysdeps/libm-i387/e_rem_pio2l.c b/sysdeps/i386/fpu/e_rem_pio2l.c similarity index 100% rename from sysdeps/libm-i387/e_rem_pio2l.c rename to sysdeps/i386/fpu/e_rem_pio2l.c diff --git a/sysdeps/libm-i387/e_remainder.S b/sysdeps/i386/fpu/e_remainder.S similarity index 100% rename from sysdeps/libm-i387/e_remainder.S rename to sysdeps/i386/fpu/e_remainder.S diff --git a/sysdeps/libm-i387/e_remainderf.S b/sysdeps/i386/fpu/e_remainderf.S similarity index 100% rename from sysdeps/libm-i387/e_remainderf.S rename to sysdeps/i386/fpu/e_remainderf.S diff --git a/sysdeps/libm-i387/e_remainderl.S b/sysdeps/i386/fpu/e_remainderl.S similarity index 100% rename from sysdeps/libm-i387/e_remainderl.S rename to sysdeps/i386/fpu/e_remainderl.S diff --git a/sysdeps/libm-i387/e_scalb.S b/sysdeps/i386/fpu/e_scalb.S similarity index 100% rename from sysdeps/libm-i387/e_scalb.S rename to sysdeps/i386/fpu/e_scalb.S diff --git a/sysdeps/libm-i387/e_scalbf.S b/sysdeps/i386/fpu/e_scalbf.S similarity index 100% rename from sysdeps/libm-i387/e_scalbf.S rename to sysdeps/i386/fpu/e_scalbf.S diff --git a/sysdeps/libm-i387/e_scalbl.S b/sysdeps/i386/fpu/e_scalbl.S similarity index 100% rename from sysdeps/libm-i387/e_scalbl.S rename to sysdeps/i386/fpu/e_scalbl.S diff --git a/sysdeps/libm-i387/e_sqrt.S b/sysdeps/i386/fpu/e_sqrt.S similarity index 100% rename from sysdeps/libm-i387/e_sqrt.S rename to sysdeps/i386/fpu/e_sqrt.S diff --git a/sysdeps/libm-i387/e_sqrtf.S b/sysdeps/i386/fpu/e_sqrtf.S similarity index 100% rename from sysdeps/libm-i387/e_sqrtf.S rename to sysdeps/i386/fpu/e_sqrtf.S diff --git a/sysdeps/libm-i387/e_sqrtl.S b/sysdeps/i386/fpu/e_sqrtl.S similarity index 100% rename from sysdeps/libm-i387/e_sqrtl.S rename to sysdeps/i386/fpu/e_sqrtl.S diff --git a/sysdeps/libm-i387/k_rem_pio2.c b/sysdeps/i386/fpu/k_rem_pio2.c similarity index 100% rename from sysdeps/libm-i387/k_rem_pio2.c rename to sysdeps/i386/fpu/k_rem_pio2.c diff --git a/sysdeps/libm-i387/k_rem_pio2f.c b/sysdeps/i386/fpu/k_rem_pio2f.c similarity index 100% rename from sysdeps/libm-i387/k_rem_pio2f.c rename to sysdeps/i386/fpu/k_rem_pio2f.c diff --git a/sysdeps/libm-i387/k_rem_pio2l.c b/sysdeps/i386/fpu/k_rem_pio2l.c similarity index 100% rename from sysdeps/libm-i387/k_rem_pio2l.c rename to sysdeps/i386/fpu/k_rem_pio2l.c diff --git a/sysdeps/libm-i387/s_asinh.S b/sysdeps/i386/fpu/s_asinh.S similarity index 100% rename from sysdeps/libm-i387/s_asinh.S rename to sysdeps/i386/fpu/s_asinh.S diff --git a/sysdeps/libm-i387/s_asinhf.S b/sysdeps/i386/fpu/s_asinhf.S similarity index 100% rename from sysdeps/libm-i387/s_asinhf.S rename to sysdeps/i386/fpu/s_asinhf.S diff --git a/sysdeps/libm-i387/s_asinhl.S b/sysdeps/i386/fpu/s_asinhl.S similarity index 100% rename from sysdeps/libm-i387/s_asinhl.S rename to sysdeps/i386/fpu/s_asinhl.S diff --git a/sysdeps/libm-i387/s_atan.S b/sysdeps/i386/fpu/s_atan.S similarity index 100% rename from sysdeps/libm-i387/s_atan.S rename to sysdeps/i386/fpu/s_atan.S diff --git a/sysdeps/libm-i387/s_atanf.S b/sysdeps/i386/fpu/s_atanf.S similarity index 100% rename from sysdeps/libm-i387/s_atanf.S rename to sysdeps/i386/fpu/s_atanf.S diff --git a/sysdeps/libm-i387/s_atanl.S b/sysdeps/i386/fpu/s_atanl.S similarity index 100% rename from sysdeps/libm-i387/s_atanl.S rename to sysdeps/i386/fpu/s_atanl.S diff --git a/sysdeps/libm-i387/s_cbrt.S b/sysdeps/i386/fpu/s_cbrt.S similarity index 100% rename from sysdeps/libm-i387/s_cbrt.S rename to sysdeps/i386/fpu/s_cbrt.S diff --git a/sysdeps/libm-i387/s_cbrtf.S b/sysdeps/i386/fpu/s_cbrtf.S similarity index 100% rename from sysdeps/libm-i387/s_cbrtf.S rename to sysdeps/i386/fpu/s_cbrtf.S diff --git a/sysdeps/libm-i387/s_cbrtl.S b/sysdeps/i386/fpu/s_cbrtl.S similarity index 100% rename from sysdeps/libm-i387/s_cbrtl.S rename to sysdeps/i386/fpu/s_cbrtl.S diff --git a/sysdeps/libm-i387/s_ceil.S b/sysdeps/i386/fpu/s_ceil.S similarity index 100% rename from sysdeps/libm-i387/s_ceil.S rename to sysdeps/i386/fpu/s_ceil.S diff --git a/sysdeps/libm-i387/s_ceilf.S b/sysdeps/i386/fpu/s_ceilf.S similarity index 100% rename from sysdeps/libm-i387/s_ceilf.S rename to sysdeps/i386/fpu/s_ceilf.S diff --git a/sysdeps/libm-i387/s_ceill.S b/sysdeps/i386/fpu/s_ceill.S similarity index 100% rename from sysdeps/libm-i387/s_ceill.S rename to sysdeps/i386/fpu/s_ceill.S diff --git a/sysdeps/libm-i387/s_cexp.S b/sysdeps/i386/fpu/s_cexp.S similarity index 100% rename from sysdeps/libm-i387/s_cexp.S rename to sysdeps/i386/fpu/s_cexp.S diff --git a/sysdeps/libm-i387/s_cexpf.S b/sysdeps/i386/fpu/s_cexpf.S similarity index 100% rename from sysdeps/libm-i387/s_cexpf.S rename to sysdeps/i386/fpu/s_cexpf.S diff --git a/sysdeps/libm-i387/s_cexpl.S b/sysdeps/i386/fpu/s_cexpl.S similarity index 100% rename from sysdeps/libm-i387/s_cexpl.S rename to sysdeps/i386/fpu/s_cexpl.S diff --git a/sysdeps/libm-i387/s_copysign.S b/sysdeps/i386/fpu/s_copysign.S similarity index 100% rename from sysdeps/libm-i387/s_copysign.S rename to sysdeps/i386/fpu/s_copysign.S diff --git a/sysdeps/libm-i387/s_copysignf.S b/sysdeps/i386/fpu/s_copysignf.S similarity index 100% rename from sysdeps/libm-i387/s_copysignf.S rename to sysdeps/i386/fpu/s_copysignf.S diff --git a/sysdeps/libm-i387/s_copysignl.S b/sysdeps/i386/fpu/s_copysignl.S similarity index 100% rename from sysdeps/libm-i387/s_copysignl.S rename to sysdeps/i386/fpu/s_copysignl.S diff --git a/sysdeps/libm-i387/s_cos.S b/sysdeps/i386/fpu/s_cos.S similarity index 100% rename from sysdeps/libm-i387/s_cos.S rename to sysdeps/i386/fpu/s_cos.S diff --git a/sysdeps/libm-i387/s_cosf.S b/sysdeps/i386/fpu/s_cosf.S similarity index 100% rename from sysdeps/libm-i387/s_cosf.S rename to sysdeps/i386/fpu/s_cosf.S diff --git a/sysdeps/libm-i387/s_cosl.S b/sysdeps/i386/fpu/s_cosl.S similarity index 100% rename from sysdeps/libm-i387/s_cosl.S rename to sysdeps/i386/fpu/s_cosl.S diff --git a/sysdeps/libm-i387/s_exp2.S b/sysdeps/i386/fpu/s_exp2.S similarity index 100% rename from sysdeps/libm-i387/s_exp2.S rename to sysdeps/i386/fpu/s_exp2.S diff --git a/sysdeps/libm-i387/s_exp2f.S b/sysdeps/i386/fpu/s_exp2f.S similarity index 100% rename from sysdeps/libm-i387/s_exp2f.S rename to sysdeps/i386/fpu/s_exp2f.S diff --git a/sysdeps/libm-i387/s_exp2l.S b/sysdeps/i386/fpu/s_exp2l.S similarity index 100% rename from sysdeps/libm-i387/s_exp2l.S rename to sysdeps/i386/fpu/s_exp2l.S diff --git a/sysdeps/libm-i387/s_expm1.S b/sysdeps/i386/fpu/s_expm1.S similarity index 100% rename from sysdeps/libm-i387/s_expm1.S rename to sysdeps/i386/fpu/s_expm1.S diff --git a/sysdeps/libm-i387/s_expm1f.S b/sysdeps/i386/fpu/s_expm1f.S similarity index 100% rename from sysdeps/libm-i387/s_expm1f.S rename to sysdeps/i386/fpu/s_expm1f.S diff --git a/sysdeps/libm-i387/s_expm1l.S b/sysdeps/i386/fpu/s_expm1l.S similarity index 100% rename from sysdeps/libm-i387/s_expm1l.S rename to sysdeps/i386/fpu/s_expm1l.S diff --git a/sysdeps/libm-i387/s_fdim.S b/sysdeps/i386/fpu/s_fdim.S similarity index 100% rename from sysdeps/libm-i387/s_fdim.S rename to sysdeps/i386/fpu/s_fdim.S diff --git a/sysdeps/libm-i387/s_fdimf.S b/sysdeps/i386/fpu/s_fdimf.S similarity index 100% rename from sysdeps/libm-i387/s_fdimf.S rename to sysdeps/i386/fpu/s_fdimf.S diff --git a/sysdeps/libm-i387/s_fdiml.S b/sysdeps/i386/fpu/s_fdiml.S similarity index 100% rename from sysdeps/libm-i387/s_fdiml.S rename to sysdeps/i386/fpu/s_fdiml.S diff --git a/sysdeps/libm-i387/s_finite.S b/sysdeps/i386/fpu/s_finite.S similarity index 100% rename from sysdeps/libm-i387/s_finite.S rename to sysdeps/i386/fpu/s_finite.S diff --git a/sysdeps/libm-i387/s_finitef.S b/sysdeps/i386/fpu/s_finitef.S similarity index 100% rename from sysdeps/libm-i387/s_finitef.S rename to sysdeps/i386/fpu/s_finitef.S diff --git a/sysdeps/libm-i387/s_finitel.S b/sysdeps/i386/fpu/s_finitel.S similarity index 100% rename from sysdeps/libm-i387/s_finitel.S rename to sysdeps/i386/fpu/s_finitel.S diff --git a/sysdeps/libm-i387/s_floor.S b/sysdeps/i386/fpu/s_floor.S similarity index 100% rename from sysdeps/libm-i387/s_floor.S rename to sysdeps/i386/fpu/s_floor.S diff --git a/sysdeps/libm-i387/s_floorf.S b/sysdeps/i386/fpu/s_floorf.S similarity index 100% rename from sysdeps/libm-i387/s_floorf.S rename to sysdeps/i386/fpu/s_floorf.S diff --git a/sysdeps/libm-i387/s_floorl.S b/sysdeps/i386/fpu/s_floorl.S similarity index 100% rename from sysdeps/libm-i387/s_floorl.S rename to sysdeps/i386/fpu/s_floorl.S diff --git a/sysdeps/libm-i387/s_fma.S b/sysdeps/i386/fpu/s_fma.S similarity index 100% rename from sysdeps/libm-i387/s_fma.S rename to sysdeps/i386/fpu/s_fma.S diff --git a/sysdeps/libm-i387/s_fmaf.S b/sysdeps/i386/fpu/s_fmaf.S similarity index 100% rename from sysdeps/libm-i387/s_fmaf.S rename to sysdeps/i386/fpu/s_fmaf.S diff --git a/sysdeps/libm-i387/s_fmal.S b/sysdeps/i386/fpu/s_fmal.S similarity index 100% rename from sysdeps/libm-i387/s_fmal.S rename to sysdeps/i386/fpu/s_fmal.S diff --git a/sysdeps/libm-i387/s_fmax.S b/sysdeps/i386/fpu/s_fmax.S similarity index 100% rename from sysdeps/libm-i387/s_fmax.S rename to sysdeps/i386/fpu/s_fmax.S diff --git a/sysdeps/libm-i387/s_fmaxf.S b/sysdeps/i386/fpu/s_fmaxf.S similarity index 100% rename from sysdeps/libm-i387/s_fmaxf.S rename to sysdeps/i386/fpu/s_fmaxf.S diff --git a/sysdeps/libm-i387/s_fmaxl.S b/sysdeps/i386/fpu/s_fmaxl.S similarity index 100% rename from sysdeps/libm-i387/s_fmaxl.S rename to sysdeps/i386/fpu/s_fmaxl.S diff --git a/sysdeps/libm-i387/s_fmin.S b/sysdeps/i386/fpu/s_fmin.S similarity index 100% rename from sysdeps/libm-i387/s_fmin.S rename to sysdeps/i386/fpu/s_fmin.S diff --git a/sysdeps/libm-i387/s_fminf.S b/sysdeps/i386/fpu/s_fminf.S similarity index 100% rename from sysdeps/libm-i387/s_fminf.S rename to sysdeps/i386/fpu/s_fminf.S diff --git a/sysdeps/libm-i387/s_fminl.S b/sysdeps/i386/fpu/s_fminl.S similarity index 100% rename from sysdeps/libm-i387/s_fminl.S rename to sysdeps/i386/fpu/s_fminl.S diff --git a/sysdeps/libm-i387/s_frexp.S b/sysdeps/i386/fpu/s_frexp.S similarity index 100% rename from sysdeps/libm-i387/s_frexp.S rename to sysdeps/i386/fpu/s_frexp.S diff --git a/sysdeps/libm-i387/s_frexpf.S b/sysdeps/i386/fpu/s_frexpf.S similarity index 100% rename from sysdeps/libm-i387/s_frexpf.S rename to sysdeps/i386/fpu/s_frexpf.S diff --git a/sysdeps/libm-i387/s_frexpl.S b/sysdeps/i386/fpu/s_frexpl.S similarity index 100% rename from sysdeps/libm-i387/s_frexpl.S rename to sysdeps/i386/fpu/s_frexpl.S diff --git a/sysdeps/libm-i387/s_ilogb.S b/sysdeps/i386/fpu/s_ilogb.S similarity index 100% rename from sysdeps/libm-i387/s_ilogb.S rename to sysdeps/i386/fpu/s_ilogb.S diff --git a/sysdeps/libm-i387/s_ilogbf.S b/sysdeps/i386/fpu/s_ilogbf.S similarity index 100% rename from sysdeps/libm-i387/s_ilogbf.S rename to sysdeps/i386/fpu/s_ilogbf.S diff --git a/sysdeps/libm-i387/s_ilogbl.S b/sysdeps/i386/fpu/s_ilogbl.S similarity index 100% rename from sysdeps/libm-i387/s_ilogbl.S rename to sysdeps/i386/fpu/s_ilogbl.S diff --git a/sysdeps/libm-i387/s_isinfl.c b/sysdeps/i386/fpu/s_isinfl.c similarity index 100% rename from sysdeps/libm-i387/s_isinfl.c rename to sysdeps/i386/fpu/s_isinfl.c diff --git a/sysdeps/libm-i387/s_isnanl.c b/sysdeps/i386/fpu/s_isnanl.c similarity index 100% rename from sysdeps/libm-i387/s_isnanl.c rename to sysdeps/i386/fpu/s_isnanl.c diff --git a/sysdeps/libm-i387/s_llrint.S b/sysdeps/i386/fpu/s_llrint.S similarity index 100% rename from sysdeps/libm-i387/s_llrint.S rename to sysdeps/i386/fpu/s_llrint.S diff --git a/sysdeps/libm-i387/s_llrintf.S b/sysdeps/i386/fpu/s_llrintf.S similarity index 100% rename from sysdeps/libm-i387/s_llrintf.S rename to sysdeps/i386/fpu/s_llrintf.S diff --git a/sysdeps/libm-i387/s_llrintl.S b/sysdeps/i386/fpu/s_llrintl.S similarity index 100% rename from sysdeps/libm-i387/s_llrintl.S rename to sysdeps/i386/fpu/s_llrintl.S diff --git a/sysdeps/libm-i387/s_log1p.S b/sysdeps/i386/fpu/s_log1p.S similarity index 100% rename from sysdeps/libm-i387/s_log1p.S rename to sysdeps/i386/fpu/s_log1p.S diff --git a/sysdeps/libm-i387/s_log1pf.S b/sysdeps/i386/fpu/s_log1pf.S similarity index 100% rename from sysdeps/libm-i387/s_log1pf.S rename to sysdeps/i386/fpu/s_log1pf.S diff --git a/sysdeps/libm-i387/s_log1pl.S b/sysdeps/i386/fpu/s_log1pl.S similarity index 100% rename from sysdeps/libm-i387/s_log1pl.S rename to sysdeps/i386/fpu/s_log1pl.S diff --git a/sysdeps/libm-i387/s_log2.S b/sysdeps/i386/fpu/s_log2.S similarity index 100% rename from sysdeps/libm-i387/s_log2.S rename to sysdeps/i386/fpu/s_log2.S diff --git a/sysdeps/libm-i387/s_log2f.S b/sysdeps/i386/fpu/s_log2f.S similarity index 100% rename from sysdeps/libm-i387/s_log2f.S rename to sysdeps/i386/fpu/s_log2f.S diff --git a/sysdeps/libm-i387/s_log2l.S b/sysdeps/i386/fpu/s_log2l.S similarity index 100% rename from sysdeps/libm-i387/s_log2l.S rename to sysdeps/i386/fpu/s_log2l.S diff --git a/sysdeps/libm-i387/s_logb.S b/sysdeps/i386/fpu/s_logb.S similarity index 100% rename from sysdeps/libm-i387/s_logb.S rename to sysdeps/i386/fpu/s_logb.S diff --git a/sysdeps/libm-i387/s_logbf.S b/sysdeps/i386/fpu/s_logbf.S similarity index 100% rename from sysdeps/libm-i387/s_logbf.S rename to sysdeps/i386/fpu/s_logbf.S diff --git a/sysdeps/libm-i387/s_logbl.S b/sysdeps/i386/fpu/s_logbl.S similarity index 100% rename from sysdeps/libm-i387/s_logbl.S rename to sysdeps/i386/fpu/s_logbl.S diff --git a/sysdeps/libm-i387/s_lrint.S b/sysdeps/i386/fpu/s_lrint.S similarity index 100% rename from sysdeps/libm-i387/s_lrint.S rename to sysdeps/i386/fpu/s_lrint.S diff --git a/sysdeps/libm-i387/s_lrintf.S b/sysdeps/i386/fpu/s_lrintf.S similarity index 100% rename from sysdeps/libm-i387/s_lrintf.S rename to sysdeps/i386/fpu/s_lrintf.S diff --git a/sysdeps/libm-i387/s_lrintl.S b/sysdeps/i386/fpu/s_lrintl.S similarity index 100% rename from sysdeps/libm-i387/s_lrintl.S rename to sysdeps/i386/fpu/s_lrintl.S diff --git a/sysdeps/libm-i387/s_nearbyint.S b/sysdeps/i386/fpu/s_nearbyint.S similarity index 100% rename from sysdeps/libm-i387/s_nearbyint.S rename to sysdeps/i386/fpu/s_nearbyint.S diff --git a/sysdeps/libm-i387/s_nearbyintf.S b/sysdeps/i386/fpu/s_nearbyintf.S similarity index 100% rename from sysdeps/libm-i387/s_nearbyintf.S rename to sysdeps/i386/fpu/s_nearbyintf.S diff --git a/sysdeps/libm-i387/s_nearbyintl.S b/sysdeps/i386/fpu/s_nearbyintl.S similarity index 100% rename from sysdeps/libm-i387/s_nearbyintl.S rename to sysdeps/i386/fpu/s_nearbyintl.S diff --git a/sysdeps/libm-i387/s_nextafterl.c b/sysdeps/i386/fpu/s_nextafterl.c similarity index 100% rename from sysdeps/libm-i387/s_nextafterl.c rename to sysdeps/i386/fpu/s_nextafterl.c diff --git a/sysdeps/libm-i387/s_remquo.S b/sysdeps/i386/fpu/s_remquo.S similarity index 100% rename from sysdeps/libm-i387/s_remquo.S rename to sysdeps/i386/fpu/s_remquo.S diff --git a/sysdeps/libm-i387/s_remquof.S b/sysdeps/i386/fpu/s_remquof.S similarity index 100% rename from sysdeps/libm-i387/s_remquof.S rename to sysdeps/i386/fpu/s_remquof.S diff --git a/sysdeps/libm-i387/s_remquol.S b/sysdeps/i386/fpu/s_remquol.S similarity index 100% rename from sysdeps/libm-i387/s_remquol.S rename to sysdeps/i386/fpu/s_remquol.S diff --git a/sysdeps/libm-i387/s_rint.S b/sysdeps/i386/fpu/s_rint.S similarity index 100% rename from sysdeps/libm-i387/s_rint.S rename to sysdeps/i386/fpu/s_rint.S diff --git a/sysdeps/libm-i387/s_rintf.S b/sysdeps/i386/fpu/s_rintf.S similarity index 100% rename from sysdeps/libm-i387/s_rintf.S rename to sysdeps/i386/fpu/s_rintf.S diff --git a/sysdeps/libm-i387/s_rintl.S b/sysdeps/i386/fpu/s_rintl.S similarity index 100% rename from sysdeps/libm-i387/s_rintl.S rename to sysdeps/i386/fpu/s_rintl.S diff --git a/sysdeps/libm-i387/s_scalbln.c b/sysdeps/i386/fpu/s_scalbln.c similarity index 100% rename from sysdeps/libm-i387/s_scalbln.c rename to sysdeps/i386/fpu/s_scalbln.c diff --git a/sysdeps/libm-i387/s_scalblnf.c b/sysdeps/i386/fpu/s_scalblnf.c similarity index 100% rename from sysdeps/libm-i387/s_scalblnf.c rename to sysdeps/i386/fpu/s_scalblnf.c diff --git a/sysdeps/libm-i387/s_scalblnl.c b/sysdeps/i386/fpu/s_scalblnl.c similarity index 100% rename from sysdeps/libm-i387/s_scalblnl.c rename to sysdeps/i386/fpu/s_scalblnl.c diff --git a/sysdeps/libm-i387/s_scalbn.S b/sysdeps/i386/fpu/s_scalbn.S similarity index 100% rename from sysdeps/libm-i387/s_scalbn.S rename to sysdeps/i386/fpu/s_scalbn.S diff --git a/sysdeps/libm-i387/s_scalbnf.S b/sysdeps/i386/fpu/s_scalbnf.S similarity index 100% rename from sysdeps/libm-i387/s_scalbnf.S rename to sysdeps/i386/fpu/s_scalbnf.S diff --git a/sysdeps/libm-i387/s_scalbnl.S b/sysdeps/i386/fpu/s_scalbnl.S similarity index 100% rename from sysdeps/libm-i387/s_scalbnl.S rename to sysdeps/i386/fpu/s_scalbnl.S diff --git a/sysdeps/libm-i387/s_significand.S b/sysdeps/i386/fpu/s_significand.S similarity index 100% rename from sysdeps/libm-i387/s_significand.S rename to sysdeps/i386/fpu/s_significand.S diff --git a/sysdeps/libm-i387/s_significandf.S b/sysdeps/i386/fpu/s_significandf.S similarity index 100% rename from sysdeps/libm-i387/s_significandf.S rename to sysdeps/i386/fpu/s_significandf.S diff --git a/sysdeps/libm-i387/s_significandl.S b/sysdeps/i386/fpu/s_significandl.S similarity index 100% rename from sysdeps/libm-i387/s_significandl.S rename to sysdeps/i386/fpu/s_significandl.S diff --git a/sysdeps/libm-i387/s_sin.S b/sysdeps/i386/fpu/s_sin.S similarity index 100% rename from sysdeps/libm-i387/s_sin.S rename to sysdeps/i386/fpu/s_sin.S diff --git a/sysdeps/libm-i387/s_sincos.S b/sysdeps/i386/fpu/s_sincos.S similarity index 100% rename from sysdeps/libm-i387/s_sincos.S rename to sysdeps/i386/fpu/s_sincos.S diff --git a/sysdeps/libm-i387/s_sincosf.S b/sysdeps/i386/fpu/s_sincosf.S similarity index 100% rename from sysdeps/libm-i387/s_sincosf.S rename to sysdeps/i386/fpu/s_sincosf.S diff --git a/sysdeps/libm-i387/s_sincosl.S b/sysdeps/i386/fpu/s_sincosl.S similarity index 100% rename from sysdeps/libm-i387/s_sincosl.S rename to sysdeps/i386/fpu/s_sincosl.S diff --git a/sysdeps/libm-i387/s_sinf.S b/sysdeps/i386/fpu/s_sinf.S similarity index 100% rename from sysdeps/libm-i387/s_sinf.S rename to sysdeps/i386/fpu/s_sinf.S diff --git a/sysdeps/libm-i387/s_sinl.S b/sysdeps/i386/fpu/s_sinl.S similarity index 100% rename from sysdeps/libm-i387/s_sinl.S rename to sysdeps/i386/fpu/s_sinl.S diff --git a/sysdeps/libm-i387/s_tan.S b/sysdeps/i386/fpu/s_tan.S similarity index 100% rename from sysdeps/libm-i387/s_tan.S rename to sysdeps/i386/fpu/s_tan.S diff --git a/sysdeps/libm-i387/s_tanf.S b/sysdeps/i386/fpu/s_tanf.S similarity index 100% rename from sysdeps/libm-i387/s_tanf.S rename to sysdeps/i386/fpu/s_tanf.S diff --git a/sysdeps/libm-i387/s_tanl.S b/sysdeps/i386/fpu/s_tanl.S similarity index 100% rename from sysdeps/libm-i387/s_tanl.S rename to sysdeps/i386/fpu/s_tanl.S diff --git a/sysdeps/libm-i387/s_trunc.S b/sysdeps/i386/fpu/s_trunc.S similarity index 100% rename from sysdeps/libm-i387/s_trunc.S rename to sysdeps/i386/fpu/s_trunc.S diff --git a/sysdeps/libm-i387/s_truncf.S b/sysdeps/i386/fpu/s_truncf.S similarity index 100% rename from sysdeps/libm-i387/s_truncf.S rename to sysdeps/i386/fpu/s_truncf.S diff --git a/sysdeps/libm-i387/s_truncl.S b/sysdeps/i386/fpu/s_truncl.S similarity index 100% rename from sysdeps/libm-i387/s_truncl.S rename to sysdeps/i386/fpu/s_truncl.S diff --git a/sysdeps/libm-i387/t_exp.c b/sysdeps/i386/fpu/t_exp.c similarity index 100% rename from sysdeps/libm-i387/t_exp.c rename to sysdeps/i386/fpu/t_exp.c diff --git a/sysdeps/i386/i686/Implies b/sysdeps/i386/i686/Implies index 5e3b4cb5e7..b5c05ec7f2 100644 --- a/sysdeps/i386/i686/Implies +++ b/sysdeps/i386/i686/Implies @@ -2,4 +2,3 @@ # not really good to use heavily i586 optimized code on a i686. It's # better to use i486/i386 code. i386/i486 -libm-i387/i686 diff --git a/sysdeps/libm-i387/i686/s_fdim.S b/sysdeps/i386/i686/fpu/s_fdim.S similarity index 100% rename from sysdeps/libm-i387/i686/s_fdim.S rename to sysdeps/i386/i686/fpu/s_fdim.S diff --git a/sysdeps/libm-i387/i686/s_fdimf.S b/sysdeps/i386/i686/fpu/s_fdimf.S similarity index 100% rename from sysdeps/libm-i387/i686/s_fdimf.S rename to sysdeps/i386/i686/fpu/s_fdimf.S diff --git a/sysdeps/libm-i387/i686/s_fdiml.S b/sysdeps/i386/i686/fpu/s_fdiml.S similarity index 100% rename from sysdeps/libm-i387/i686/s_fdiml.S rename to sysdeps/i386/i686/fpu/s_fdiml.S diff --git a/sysdeps/libm-i387/i686/s_fmax.S b/sysdeps/i386/i686/fpu/s_fmax.S similarity index 100% rename from sysdeps/libm-i387/i686/s_fmax.S rename to sysdeps/i386/i686/fpu/s_fmax.S diff --git a/sysdeps/libm-i387/i686/s_fmaxf.S b/sysdeps/i386/i686/fpu/s_fmaxf.S similarity index 100% rename from sysdeps/libm-i387/i686/s_fmaxf.S rename to sysdeps/i386/i686/fpu/s_fmaxf.S diff --git a/sysdeps/libm-i387/i686/s_fmaxl.S b/sysdeps/i386/i686/fpu/s_fmaxl.S similarity index 100% rename from sysdeps/libm-i387/i686/s_fmaxl.S rename to sysdeps/i386/i686/fpu/s_fmaxl.S diff --git a/sysdeps/libm-i387/i686/s_fmin.S b/sysdeps/i386/i686/fpu/s_fmin.S similarity index 100% rename from sysdeps/libm-i387/i686/s_fmin.S rename to sysdeps/i386/i686/fpu/s_fmin.S diff --git a/sysdeps/libm-i387/i686/s_fminf.S b/sysdeps/i386/i686/fpu/s_fminf.S similarity index 100% rename from sysdeps/libm-i387/i686/s_fminf.S rename to sysdeps/i386/i686/fpu/s_fminf.S diff --git a/sysdeps/libm-i387/i686/s_fminl.S b/sysdeps/i386/i686/fpu/s_fminl.S similarity index 100% rename from sysdeps/libm-i387/i686/s_fminl.S rename to sysdeps/i386/i686/fpu/s_fminl.S diff --git a/sysdeps/i960/Implies b/sysdeps/i960/Implies index f8c4079ab5..1d569744ab 100644 --- a/sysdeps/i960/Implies +++ b/sysdeps/i960/Implies @@ -1,2 +1,3 @@ # i960 family uses IEEE 754 floating point. -ieee754 +ieee754/flt-32 +ieee754/dbl-64 diff --git a/sysdeps/ieee754/Implies b/sysdeps/ieee754/Implies deleted file mode 100644 index 5c9e98b7ae..0000000000 --- a/sysdeps/ieee754/Implies +++ /dev/null @@ -1,2 +0,0 @@ -# For all IEEE machines, use Sun's fdlibm code. -libm-ieee754 diff --git a/sysdeps/ieee754/dbl-64/Dist b/sysdeps/ieee754/dbl-64/Dist new file mode 100644 index 0000000000..1bb7be3537 --- /dev/null +++ b/sysdeps/ieee754/dbl-64/Dist @@ -0,0 +1 @@ +t_exp2.h diff --git a/sysdeps/ieee754/dbl2mpn.c b/sysdeps/ieee754/dbl-64/dbl2mpn.c similarity index 100% rename from sysdeps/ieee754/dbl2mpn.c rename to sysdeps/ieee754/dbl-64/dbl2mpn.c diff --git a/sysdeps/libm-ieee754/e_acos.c b/sysdeps/ieee754/dbl-64/e_acos.c similarity index 100% rename from sysdeps/libm-ieee754/e_acos.c rename to sysdeps/ieee754/dbl-64/e_acos.c diff --git a/sysdeps/libm-ieee754/e_acosh.c b/sysdeps/ieee754/dbl-64/e_acosh.c similarity index 100% rename from sysdeps/libm-ieee754/e_acosh.c rename to sysdeps/ieee754/dbl-64/e_acosh.c diff --git a/sysdeps/libm-ieee754/e_asin.c b/sysdeps/ieee754/dbl-64/e_asin.c similarity index 100% rename from sysdeps/libm-ieee754/e_asin.c rename to sysdeps/ieee754/dbl-64/e_asin.c diff --git a/sysdeps/libm-ieee754/e_atan2.c b/sysdeps/ieee754/dbl-64/e_atan2.c similarity index 100% rename from sysdeps/libm-ieee754/e_atan2.c rename to sysdeps/ieee754/dbl-64/e_atan2.c diff --git a/sysdeps/libm-ieee754/e_atanh.c b/sysdeps/ieee754/dbl-64/e_atanh.c similarity index 100% rename from sysdeps/libm-ieee754/e_atanh.c rename to sysdeps/ieee754/dbl-64/e_atanh.c diff --git a/sysdeps/libm-ieee754/e_cosh.c b/sysdeps/ieee754/dbl-64/e_cosh.c similarity index 100% rename from sysdeps/libm-ieee754/e_cosh.c rename to sysdeps/ieee754/dbl-64/e_cosh.c diff --git a/sysdeps/libm-ieee754/e_exp.c b/sysdeps/ieee754/dbl-64/e_exp.c similarity index 100% rename from sysdeps/libm-ieee754/e_exp.c rename to sysdeps/ieee754/dbl-64/e_exp.c diff --git a/sysdeps/libm-ieee754/e_fmod.c b/sysdeps/ieee754/dbl-64/e_fmod.c similarity index 100% rename from sysdeps/libm-ieee754/e_fmod.c rename to sysdeps/ieee754/dbl-64/e_fmod.c diff --git a/sysdeps/libm-ieee754/e_gamma_r.c b/sysdeps/ieee754/dbl-64/e_gamma_r.c similarity index 100% rename from sysdeps/libm-ieee754/e_gamma_r.c rename to sysdeps/ieee754/dbl-64/e_gamma_r.c diff --git a/sysdeps/libm-ieee754/e_hypot.c b/sysdeps/ieee754/dbl-64/e_hypot.c similarity index 100% rename from sysdeps/libm-ieee754/e_hypot.c rename to sysdeps/ieee754/dbl-64/e_hypot.c diff --git a/sysdeps/libm-ieee754/e_j0.c b/sysdeps/ieee754/dbl-64/e_j0.c similarity index 100% rename from sysdeps/libm-ieee754/e_j0.c rename to sysdeps/ieee754/dbl-64/e_j0.c diff --git a/sysdeps/libm-ieee754/e_j1.c b/sysdeps/ieee754/dbl-64/e_j1.c similarity index 100% rename from sysdeps/libm-ieee754/e_j1.c rename to sysdeps/ieee754/dbl-64/e_j1.c diff --git a/sysdeps/libm-ieee754/e_jn.c b/sysdeps/ieee754/dbl-64/e_jn.c similarity index 100% rename from sysdeps/libm-ieee754/e_jn.c rename to sysdeps/ieee754/dbl-64/e_jn.c diff --git a/sysdeps/libm-ieee754/e_lgamma_r.c b/sysdeps/ieee754/dbl-64/e_lgamma_r.c similarity index 100% rename from sysdeps/libm-ieee754/e_lgamma_r.c rename to sysdeps/ieee754/dbl-64/e_lgamma_r.c diff --git a/sysdeps/libm-ieee754/e_log.c b/sysdeps/ieee754/dbl-64/e_log.c similarity index 100% rename from sysdeps/libm-ieee754/e_log.c rename to sysdeps/ieee754/dbl-64/e_log.c diff --git a/sysdeps/libm-ieee754/e_log10.c b/sysdeps/ieee754/dbl-64/e_log10.c similarity index 100% rename from sysdeps/libm-ieee754/e_log10.c rename to sysdeps/ieee754/dbl-64/e_log10.c diff --git a/sysdeps/libm-ieee754/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c similarity index 100% rename from sysdeps/libm-ieee754/e_pow.c rename to sysdeps/ieee754/dbl-64/e_pow.c diff --git a/sysdeps/libm-ieee754/e_rem_pio2.c b/sysdeps/ieee754/dbl-64/e_rem_pio2.c similarity index 100% rename from sysdeps/libm-ieee754/e_rem_pio2.c rename to sysdeps/ieee754/dbl-64/e_rem_pio2.c diff --git a/sysdeps/libm-ieee754/e_remainder.c b/sysdeps/ieee754/dbl-64/e_remainder.c similarity index 100% rename from sysdeps/libm-ieee754/e_remainder.c rename to sysdeps/ieee754/dbl-64/e_remainder.c diff --git a/sysdeps/libm-ieee754/e_sinh.c b/sysdeps/ieee754/dbl-64/e_sinh.c similarity index 100% rename from sysdeps/libm-ieee754/e_sinh.c rename to sysdeps/ieee754/dbl-64/e_sinh.c diff --git a/sysdeps/libm-ieee754/e_sqrt.c b/sysdeps/ieee754/dbl-64/e_sqrt.c similarity index 100% rename from sysdeps/libm-ieee754/e_sqrt.c rename to sysdeps/ieee754/dbl-64/e_sqrt.c diff --git a/sysdeps/libm-ieee754/k_cos.c b/sysdeps/ieee754/dbl-64/k_cos.c similarity index 100% rename from sysdeps/libm-ieee754/k_cos.c rename to sysdeps/ieee754/dbl-64/k_cos.c diff --git a/sysdeps/libm-ieee754/k_rem_pio2.c b/sysdeps/ieee754/dbl-64/k_rem_pio2.c similarity index 100% rename from sysdeps/libm-ieee754/k_rem_pio2.c rename to sysdeps/ieee754/dbl-64/k_rem_pio2.c diff --git a/sysdeps/libm-ieee754/k_sin.c b/sysdeps/ieee754/dbl-64/k_sin.c similarity index 100% rename from sysdeps/libm-ieee754/k_sin.c rename to sysdeps/ieee754/dbl-64/k_sin.c diff --git a/sysdeps/libm-ieee754/k_tan.c b/sysdeps/ieee754/dbl-64/k_tan.c similarity index 100% rename from sysdeps/libm-ieee754/k_tan.c rename to sysdeps/ieee754/dbl-64/k_tan.c diff --git a/sysdeps/ieee754/mpn2dbl.c b/sysdeps/ieee754/dbl-64/mpn2dbl.c similarity index 100% rename from sysdeps/ieee754/mpn2dbl.c rename to sysdeps/ieee754/dbl-64/mpn2dbl.c diff --git a/sysdeps/libm-ieee754/s_asinh.c b/sysdeps/ieee754/dbl-64/s_asinh.c similarity index 100% rename from sysdeps/libm-ieee754/s_asinh.c rename to sysdeps/ieee754/dbl-64/s_asinh.c diff --git a/sysdeps/libm-ieee754/s_atan.c b/sysdeps/ieee754/dbl-64/s_atan.c similarity index 100% rename from sysdeps/libm-ieee754/s_atan.c rename to sysdeps/ieee754/dbl-64/s_atan.c diff --git a/sysdeps/libm-ieee754/s_cbrt.c b/sysdeps/ieee754/dbl-64/s_cbrt.c similarity index 100% rename from sysdeps/libm-ieee754/s_cbrt.c rename to sysdeps/ieee754/dbl-64/s_cbrt.c diff --git a/sysdeps/libm-ieee754/s_ceil.c b/sysdeps/ieee754/dbl-64/s_ceil.c similarity index 100% rename from sysdeps/libm-ieee754/s_ceil.c rename to sysdeps/ieee754/dbl-64/s_ceil.c diff --git a/sysdeps/libm-ieee754/s_copysign.c b/sysdeps/ieee754/dbl-64/s_copysign.c similarity index 100% rename from sysdeps/libm-ieee754/s_copysign.c rename to sysdeps/ieee754/dbl-64/s_copysign.c diff --git a/sysdeps/libm-ieee754/s_cos.c b/sysdeps/ieee754/dbl-64/s_cos.c similarity index 100% rename from sysdeps/libm-ieee754/s_cos.c rename to sysdeps/ieee754/dbl-64/s_cos.c diff --git a/sysdeps/libm-ieee754/s_erf.c b/sysdeps/ieee754/dbl-64/s_erf.c similarity index 100% rename from sysdeps/libm-ieee754/s_erf.c rename to sysdeps/ieee754/dbl-64/s_erf.c diff --git a/sysdeps/libm-ieee754/s_exp2.c b/sysdeps/ieee754/dbl-64/s_exp2.c similarity index 100% rename from sysdeps/libm-ieee754/s_exp2.c rename to sysdeps/ieee754/dbl-64/s_exp2.c diff --git a/sysdeps/libm-ieee754/s_expm1.c b/sysdeps/ieee754/dbl-64/s_expm1.c similarity index 100% rename from sysdeps/libm-ieee754/s_expm1.c rename to sysdeps/ieee754/dbl-64/s_expm1.c diff --git a/sysdeps/libm-ieee754/s_fabs.c b/sysdeps/ieee754/dbl-64/s_fabs.c similarity index 100% rename from sysdeps/libm-ieee754/s_fabs.c rename to sysdeps/ieee754/dbl-64/s_fabs.c diff --git a/sysdeps/libm-ieee754/s_finite.c b/sysdeps/ieee754/dbl-64/s_finite.c similarity index 100% rename from sysdeps/libm-ieee754/s_finite.c rename to sysdeps/ieee754/dbl-64/s_finite.c diff --git a/sysdeps/libm-ieee754/s_floor.c b/sysdeps/ieee754/dbl-64/s_floor.c similarity index 100% rename from sysdeps/libm-ieee754/s_floor.c rename to sysdeps/ieee754/dbl-64/s_floor.c diff --git a/sysdeps/libm-ieee754/s_fpclassify.c b/sysdeps/ieee754/dbl-64/s_fpclassify.c similarity index 100% rename from sysdeps/libm-ieee754/s_fpclassify.c rename to sysdeps/ieee754/dbl-64/s_fpclassify.c diff --git a/sysdeps/libm-ieee754/s_frexp.c b/sysdeps/ieee754/dbl-64/s_frexp.c similarity index 100% rename from sysdeps/libm-ieee754/s_frexp.c rename to sysdeps/ieee754/dbl-64/s_frexp.c diff --git a/sysdeps/libm-ieee754/s_ilogb.c b/sysdeps/ieee754/dbl-64/s_ilogb.c similarity index 100% rename from sysdeps/libm-ieee754/s_ilogb.c rename to sysdeps/ieee754/dbl-64/s_ilogb.c diff --git a/sysdeps/libm-ieee754/s_isinf.c b/sysdeps/ieee754/dbl-64/s_isinf.c similarity index 100% rename from sysdeps/libm-ieee754/s_isinf.c rename to sysdeps/ieee754/dbl-64/s_isinf.c diff --git a/sysdeps/libm-ieee754/s_isnan.c b/sysdeps/ieee754/dbl-64/s_isnan.c similarity index 96% rename from sysdeps/libm-ieee754/s_isnan.c rename to sysdeps/ieee754/dbl-64/s_isnan.c index 1aed525af1..86301e1531 100644 --- a/sysdeps/libm-ieee754/s_isnan.c +++ b/sysdeps/ieee754/dbl-64/s_isnan.c @@ -34,7 +34,7 @@ static char rcsid[] = "$NetBSD: s_isnan.c,v 1.8 1995/05/10 20:47:36 jtc Exp $"; hx &= 0x7fffffff; hx |= (u_int32_t)(lx|(-lx))>>31; hx = 0x7ff00000 - hx; - return (int)((u_int32_t)(hx))>>31; + return (int)(((u_int32_t)hx)>>31); } weak_alias (__isnan, isnan) #ifdef NO_LONG_DOUBLE diff --git a/sysdeps/libm-ieee754/s_llrint.c b/sysdeps/ieee754/dbl-64/s_llrint.c similarity index 100% rename from sysdeps/libm-ieee754/s_llrint.c rename to sysdeps/ieee754/dbl-64/s_llrint.c diff --git a/sysdeps/libm-ieee754/s_llround.c b/sysdeps/ieee754/dbl-64/s_llround.c similarity index 100% rename from sysdeps/libm-ieee754/s_llround.c rename to sysdeps/ieee754/dbl-64/s_llround.c diff --git a/sysdeps/libm-ieee754/s_log1p.c b/sysdeps/ieee754/dbl-64/s_log1p.c similarity index 100% rename from sysdeps/libm-ieee754/s_log1p.c rename to sysdeps/ieee754/dbl-64/s_log1p.c diff --git a/sysdeps/libm-ieee754/s_log2.c b/sysdeps/ieee754/dbl-64/s_log2.c similarity index 100% rename from sysdeps/libm-ieee754/s_log2.c rename to sysdeps/ieee754/dbl-64/s_log2.c diff --git a/sysdeps/libm-ieee754/s_logb.c b/sysdeps/ieee754/dbl-64/s_logb.c similarity index 100% rename from sysdeps/libm-ieee754/s_logb.c rename to sysdeps/ieee754/dbl-64/s_logb.c diff --git a/sysdeps/libm-ieee754/s_lrint.c b/sysdeps/ieee754/dbl-64/s_lrint.c similarity index 100% rename from sysdeps/libm-ieee754/s_lrint.c rename to sysdeps/ieee754/dbl-64/s_lrint.c diff --git a/sysdeps/libm-ieee754/s_lround.c b/sysdeps/ieee754/dbl-64/s_lround.c similarity index 100% rename from sysdeps/libm-ieee754/s_lround.c rename to sysdeps/ieee754/dbl-64/s_lround.c diff --git a/sysdeps/libm-ieee754/s_modf.c b/sysdeps/ieee754/dbl-64/s_modf.c similarity index 100% rename from sysdeps/libm-ieee754/s_modf.c rename to sysdeps/ieee754/dbl-64/s_modf.c diff --git a/sysdeps/libm-ieee754/s_nearbyint.c b/sysdeps/ieee754/dbl-64/s_nearbyint.c similarity index 100% rename from sysdeps/libm-ieee754/s_nearbyint.c rename to sysdeps/ieee754/dbl-64/s_nearbyint.c diff --git a/sysdeps/ieee754/dbl-64/s_nexttoward.c b/sysdeps/ieee754/dbl-64/s_nexttoward.c new file mode 100644 index 0000000000..c68ba98cb3 --- /dev/null +++ b/sysdeps/ieee754/dbl-64/s_nexttoward.c @@ -0,0 +1 @@ +/* This function is the same as nextafter so we use an alias there. */ diff --git a/sysdeps/libm-ieee754/s_remquo.c b/sysdeps/ieee754/dbl-64/s_remquo.c similarity index 100% rename from sysdeps/libm-ieee754/s_remquo.c rename to sysdeps/ieee754/dbl-64/s_remquo.c diff --git a/sysdeps/libm-ieee754/s_rint.c b/sysdeps/ieee754/dbl-64/s_rint.c similarity index 100% rename from sysdeps/libm-ieee754/s_rint.c rename to sysdeps/ieee754/dbl-64/s_rint.c diff --git a/sysdeps/libm-ieee754/s_round.c b/sysdeps/ieee754/dbl-64/s_round.c similarity index 100% rename from sysdeps/libm-ieee754/s_round.c rename to sysdeps/ieee754/dbl-64/s_round.c diff --git a/sysdeps/libm-ieee754/s_scalbln.c b/sysdeps/ieee754/dbl-64/s_scalbln.c similarity index 100% rename from sysdeps/libm-ieee754/s_scalbln.c rename to sysdeps/ieee754/dbl-64/s_scalbln.c diff --git a/sysdeps/libm-ieee754/s_scalbn.c b/sysdeps/ieee754/dbl-64/s_scalbn.c similarity index 100% rename from sysdeps/libm-ieee754/s_scalbn.c rename to sysdeps/ieee754/dbl-64/s_scalbn.c diff --git a/sysdeps/libm-ieee754/s_signbit.c b/sysdeps/ieee754/dbl-64/s_signbit.c similarity index 100% rename from sysdeps/libm-ieee754/s_signbit.c rename to sysdeps/ieee754/dbl-64/s_signbit.c diff --git a/sysdeps/libm-ieee754/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c similarity index 100% rename from sysdeps/libm-ieee754/s_sin.c rename to sysdeps/ieee754/dbl-64/s_sin.c diff --git a/sysdeps/libm-ieee754/s_sincos.c b/sysdeps/ieee754/dbl-64/s_sincos.c similarity index 100% rename from sysdeps/libm-ieee754/s_sincos.c rename to sysdeps/ieee754/dbl-64/s_sincos.c diff --git a/sysdeps/libm-ieee754/s_tan.c b/sysdeps/ieee754/dbl-64/s_tan.c similarity index 100% rename from sysdeps/libm-ieee754/s_tan.c rename to sysdeps/ieee754/dbl-64/s_tan.c diff --git a/sysdeps/libm-ieee754/s_tanh.c b/sysdeps/ieee754/dbl-64/s_tanh.c similarity index 100% rename from sysdeps/libm-ieee754/s_tanh.c rename to sysdeps/ieee754/dbl-64/s_tanh.c diff --git a/sysdeps/libm-ieee754/s_trunc.c b/sysdeps/ieee754/dbl-64/s_trunc.c similarity index 100% rename from sysdeps/libm-ieee754/s_trunc.c rename to sysdeps/ieee754/dbl-64/s_trunc.c diff --git a/sysdeps/libm-ieee754/t_exp.c b/sysdeps/ieee754/dbl-64/t_exp.c similarity index 100% rename from sysdeps/libm-ieee754/t_exp.c rename to sysdeps/ieee754/dbl-64/t_exp.c diff --git a/sysdeps/libm-ieee754/t_exp2.h b/sysdeps/ieee754/dbl-64/t_exp2.h similarity index 100% rename from sysdeps/libm-ieee754/t_exp2.h rename to sysdeps/ieee754/dbl-64/t_exp2.h diff --git a/sysdeps/libm-ieee754/w_exp.c b/sysdeps/ieee754/dbl-64/w_exp.c similarity index 100% rename from sysdeps/libm-ieee754/w_exp.c rename to sysdeps/ieee754/dbl-64/w_exp.c diff --git a/sysdeps/libm-ieee754/Dist b/sysdeps/ieee754/flt-32/Dist similarity index 52% rename from sysdeps/libm-ieee754/Dist rename to sysdeps/ieee754/flt-32/Dist index 4b085470f5..045ac801f6 100644 --- a/sysdeps/libm-ieee754/Dist +++ b/sysdeps/ieee754/flt-32/Dist @@ -1,2 +1 @@ -t_exp2.h t_exp2f.h diff --git a/sysdeps/libm-ieee754/e_acosf.c b/sysdeps/ieee754/flt-32/e_acosf.c similarity index 100% rename from sysdeps/libm-ieee754/e_acosf.c rename to sysdeps/ieee754/flt-32/e_acosf.c diff --git a/sysdeps/libm-ieee754/e_acoshf.c b/sysdeps/ieee754/flt-32/e_acoshf.c similarity index 100% rename from sysdeps/libm-ieee754/e_acoshf.c rename to sysdeps/ieee754/flt-32/e_acoshf.c diff --git a/sysdeps/libm-ieee754/e_asinf.c b/sysdeps/ieee754/flt-32/e_asinf.c similarity index 100% rename from sysdeps/libm-ieee754/e_asinf.c rename to sysdeps/ieee754/flt-32/e_asinf.c diff --git a/sysdeps/libm-ieee754/e_atan2f.c b/sysdeps/ieee754/flt-32/e_atan2f.c similarity index 100% rename from sysdeps/libm-ieee754/e_atan2f.c rename to sysdeps/ieee754/flt-32/e_atan2f.c diff --git a/sysdeps/libm-ieee754/e_atanhf.c b/sysdeps/ieee754/flt-32/e_atanhf.c similarity index 100% rename from sysdeps/libm-ieee754/e_atanhf.c rename to sysdeps/ieee754/flt-32/e_atanhf.c diff --git a/sysdeps/libm-ieee754/e_coshf.c b/sysdeps/ieee754/flt-32/e_coshf.c similarity index 100% rename from sysdeps/libm-ieee754/e_coshf.c rename to sysdeps/ieee754/flt-32/e_coshf.c diff --git a/sysdeps/libm-ieee754/e_expf.c b/sysdeps/ieee754/flt-32/e_expf.c similarity index 100% rename from sysdeps/libm-ieee754/e_expf.c rename to sysdeps/ieee754/flt-32/e_expf.c diff --git a/sysdeps/libm-ieee754/e_fmodf.c b/sysdeps/ieee754/flt-32/e_fmodf.c similarity index 100% rename from sysdeps/libm-ieee754/e_fmodf.c rename to sysdeps/ieee754/flt-32/e_fmodf.c diff --git a/sysdeps/libm-ieee754/e_gammaf_r.c b/sysdeps/ieee754/flt-32/e_gammaf_r.c similarity index 100% rename from sysdeps/libm-ieee754/e_gammaf_r.c rename to sysdeps/ieee754/flt-32/e_gammaf_r.c diff --git a/sysdeps/libm-ieee754/e_hypotf.c b/sysdeps/ieee754/flt-32/e_hypotf.c similarity index 100% rename from sysdeps/libm-ieee754/e_hypotf.c rename to sysdeps/ieee754/flt-32/e_hypotf.c diff --git a/sysdeps/libm-ieee754/e_j0f.c b/sysdeps/ieee754/flt-32/e_j0f.c similarity index 100% rename from sysdeps/libm-ieee754/e_j0f.c rename to sysdeps/ieee754/flt-32/e_j0f.c diff --git a/sysdeps/libm-ieee754/e_j1f.c b/sysdeps/ieee754/flt-32/e_j1f.c similarity index 100% rename from sysdeps/libm-ieee754/e_j1f.c rename to sysdeps/ieee754/flt-32/e_j1f.c diff --git a/sysdeps/libm-ieee754/e_jnf.c b/sysdeps/ieee754/flt-32/e_jnf.c similarity index 100% rename from sysdeps/libm-ieee754/e_jnf.c rename to sysdeps/ieee754/flt-32/e_jnf.c diff --git a/sysdeps/libm-ieee754/e_lgammaf_r.c b/sysdeps/ieee754/flt-32/e_lgammaf_r.c similarity index 100% rename from sysdeps/libm-ieee754/e_lgammaf_r.c rename to sysdeps/ieee754/flt-32/e_lgammaf_r.c diff --git a/sysdeps/libm-ieee754/e_log10f.c b/sysdeps/ieee754/flt-32/e_log10f.c similarity index 100% rename from sysdeps/libm-ieee754/e_log10f.c rename to sysdeps/ieee754/flt-32/e_log10f.c diff --git a/sysdeps/libm-ieee754/e_logf.c b/sysdeps/ieee754/flt-32/e_logf.c similarity index 100% rename from sysdeps/libm-ieee754/e_logf.c rename to sysdeps/ieee754/flt-32/e_logf.c diff --git a/sysdeps/libm-ieee754/e_powf.c b/sysdeps/ieee754/flt-32/e_powf.c similarity index 100% rename from sysdeps/libm-ieee754/e_powf.c rename to sysdeps/ieee754/flt-32/e_powf.c diff --git a/sysdeps/libm-ieee754/e_rem_pio2f.c b/sysdeps/ieee754/flt-32/e_rem_pio2f.c similarity index 100% rename from sysdeps/libm-ieee754/e_rem_pio2f.c rename to sysdeps/ieee754/flt-32/e_rem_pio2f.c diff --git a/sysdeps/libm-ieee754/e_remainderf.c b/sysdeps/ieee754/flt-32/e_remainderf.c similarity index 100% rename from sysdeps/libm-ieee754/e_remainderf.c rename to sysdeps/ieee754/flt-32/e_remainderf.c diff --git a/sysdeps/libm-ieee754/e_sinhf.c b/sysdeps/ieee754/flt-32/e_sinhf.c similarity index 100% rename from sysdeps/libm-ieee754/e_sinhf.c rename to sysdeps/ieee754/flt-32/e_sinhf.c diff --git a/sysdeps/libm-ieee754/e_sqrtf.c b/sysdeps/ieee754/flt-32/e_sqrtf.c similarity index 100% rename from sysdeps/libm-ieee754/e_sqrtf.c rename to sysdeps/ieee754/flt-32/e_sqrtf.c diff --git a/sysdeps/libm-ieee754/k_cosf.c b/sysdeps/ieee754/flt-32/k_cosf.c similarity index 100% rename from sysdeps/libm-ieee754/k_cosf.c rename to sysdeps/ieee754/flt-32/k_cosf.c diff --git a/sysdeps/libm-ieee754/k_rem_pio2f.c b/sysdeps/ieee754/flt-32/k_rem_pio2f.c similarity index 100% rename from sysdeps/libm-ieee754/k_rem_pio2f.c rename to sysdeps/ieee754/flt-32/k_rem_pio2f.c diff --git a/sysdeps/libm-ieee754/k_sinf.c b/sysdeps/ieee754/flt-32/k_sinf.c similarity index 100% rename from sysdeps/libm-ieee754/k_sinf.c rename to sysdeps/ieee754/flt-32/k_sinf.c diff --git a/sysdeps/libm-ieee754/k_tanf.c b/sysdeps/ieee754/flt-32/k_tanf.c similarity index 100% rename from sysdeps/libm-ieee754/k_tanf.c rename to sysdeps/ieee754/flt-32/k_tanf.c diff --git a/sysdeps/ieee754/mpn2flt.c b/sysdeps/ieee754/flt-32/mpn2flt.c similarity index 100% rename from sysdeps/ieee754/mpn2flt.c rename to sysdeps/ieee754/flt-32/mpn2flt.c diff --git a/sysdeps/libm-ieee754/s_asinhf.c b/sysdeps/ieee754/flt-32/s_asinhf.c similarity index 100% rename from sysdeps/libm-ieee754/s_asinhf.c rename to sysdeps/ieee754/flt-32/s_asinhf.c diff --git a/sysdeps/libm-ieee754/s_atanf.c b/sysdeps/ieee754/flt-32/s_atanf.c similarity index 100% rename from sysdeps/libm-ieee754/s_atanf.c rename to sysdeps/ieee754/flt-32/s_atanf.c diff --git a/sysdeps/libm-ieee754/s_cbrtf.c b/sysdeps/ieee754/flt-32/s_cbrtf.c similarity index 100% rename from sysdeps/libm-ieee754/s_cbrtf.c rename to sysdeps/ieee754/flt-32/s_cbrtf.c diff --git a/sysdeps/libm-ieee754/s_ceilf.c b/sysdeps/ieee754/flt-32/s_ceilf.c similarity index 100% rename from sysdeps/libm-ieee754/s_ceilf.c rename to sysdeps/ieee754/flt-32/s_ceilf.c diff --git a/sysdeps/libm-ieee754/s_copysignf.c b/sysdeps/ieee754/flt-32/s_copysignf.c similarity index 100% rename from sysdeps/libm-ieee754/s_copysignf.c rename to sysdeps/ieee754/flt-32/s_copysignf.c diff --git a/sysdeps/libm-ieee754/s_cosf.c b/sysdeps/ieee754/flt-32/s_cosf.c similarity index 100% rename from sysdeps/libm-ieee754/s_cosf.c rename to sysdeps/ieee754/flt-32/s_cosf.c diff --git a/sysdeps/libm-ieee754/s_erff.c b/sysdeps/ieee754/flt-32/s_erff.c similarity index 100% rename from sysdeps/libm-ieee754/s_erff.c rename to sysdeps/ieee754/flt-32/s_erff.c diff --git a/sysdeps/libm-ieee754/s_exp2f.c b/sysdeps/ieee754/flt-32/s_exp2f.c similarity index 100% rename from sysdeps/libm-ieee754/s_exp2f.c rename to sysdeps/ieee754/flt-32/s_exp2f.c diff --git a/sysdeps/libm-ieee754/s_expm1f.c b/sysdeps/ieee754/flt-32/s_expm1f.c similarity index 100% rename from sysdeps/libm-ieee754/s_expm1f.c rename to sysdeps/ieee754/flt-32/s_expm1f.c diff --git a/sysdeps/libm-ieee754/s_fabsf.c b/sysdeps/ieee754/flt-32/s_fabsf.c similarity index 100% rename from sysdeps/libm-ieee754/s_fabsf.c rename to sysdeps/ieee754/flt-32/s_fabsf.c diff --git a/sysdeps/libm-ieee754/s_finitef.c b/sysdeps/ieee754/flt-32/s_finitef.c similarity index 100% rename from sysdeps/libm-ieee754/s_finitef.c rename to sysdeps/ieee754/flt-32/s_finitef.c diff --git a/sysdeps/libm-ieee754/s_floorf.c b/sysdeps/ieee754/flt-32/s_floorf.c similarity index 100% rename from sysdeps/libm-ieee754/s_floorf.c rename to sysdeps/ieee754/flt-32/s_floorf.c diff --git a/sysdeps/libm-ieee754/s_fpclassifyf.c b/sysdeps/ieee754/flt-32/s_fpclassifyf.c similarity index 100% rename from sysdeps/libm-ieee754/s_fpclassifyf.c rename to sysdeps/ieee754/flt-32/s_fpclassifyf.c diff --git a/sysdeps/libm-ieee754/s_frexpf.c b/sysdeps/ieee754/flt-32/s_frexpf.c similarity index 100% rename from sysdeps/libm-ieee754/s_frexpf.c rename to sysdeps/ieee754/flt-32/s_frexpf.c diff --git a/sysdeps/libm-ieee754/s_ilogbf.c b/sysdeps/ieee754/flt-32/s_ilogbf.c similarity index 100% rename from sysdeps/libm-ieee754/s_ilogbf.c rename to sysdeps/ieee754/flt-32/s_ilogbf.c diff --git a/sysdeps/libm-ieee754/s_isinff.c b/sysdeps/ieee754/flt-32/s_isinff.c similarity index 100% rename from sysdeps/libm-ieee754/s_isinff.c rename to sysdeps/ieee754/flt-32/s_isinff.c diff --git a/sysdeps/libm-ieee754/s_isnanf.c b/sysdeps/ieee754/flt-32/s_isnanf.c similarity index 100% rename from sysdeps/libm-ieee754/s_isnanf.c rename to sysdeps/ieee754/flt-32/s_isnanf.c diff --git a/sysdeps/libm-ieee754/s_llrintf.c b/sysdeps/ieee754/flt-32/s_llrintf.c similarity index 100% rename from sysdeps/libm-ieee754/s_llrintf.c rename to sysdeps/ieee754/flt-32/s_llrintf.c diff --git a/sysdeps/libm-ieee754/s_llroundf.c b/sysdeps/ieee754/flt-32/s_llroundf.c similarity index 100% rename from sysdeps/libm-ieee754/s_llroundf.c rename to sysdeps/ieee754/flt-32/s_llroundf.c diff --git a/sysdeps/libm-ieee754/s_log1pf.c b/sysdeps/ieee754/flt-32/s_log1pf.c similarity index 100% rename from sysdeps/libm-ieee754/s_log1pf.c rename to sysdeps/ieee754/flt-32/s_log1pf.c diff --git a/sysdeps/libm-ieee754/s_log2f.c b/sysdeps/ieee754/flt-32/s_log2f.c similarity index 100% rename from sysdeps/libm-ieee754/s_log2f.c rename to sysdeps/ieee754/flt-32/s_log2f.c diff --git a/sysdeps/libm-ieee754/s_logbf.c b/sysdeps/ieee754/flt-32/s_logbf.c similarity index 100% rename from sysdeps/libm-ieee754/s_logbf.c rename to sysdeps/ieee754/flt-32/s_logbf.c diff --git a/sysdeps/libm-ieee754/s_lrintf.c b/sysdeps/ieee754/flt-32/s_lrintf.c similarity index 100% rename from sysdeps/libm-ieee754/s_lrintf.c rename to sysdeps/ieee754/flt-32/s_lrintf.c diff --git a/sysdeps/libm-ieee754/s_lroundf.c b/sysdeps/ieee754/flt-32/s_lroundf.c similarity index 100% rename from sysdeps/libm-ieee754/s_lroundf.c rename to sysdeps/ieee754/flt-32/s_lroundf.c diff --git a/sysdeps/libm-ieee754/s_modff.c b/sysdeps/ieee754/flt-32/s_modff.c similarity index 100% rename from sysdeps/libm-ieee754/s_modff.c rename to sysdeps/ieee754/flt-32/s_modff.c diff --git a/sysdeps/libm-ieee754/s_nearbyintf.c b/sysdeps/ieee754/flt-32/s_nearbyintf.c similarity index 100% rename from sysdeps/libm-ieee754/s_nearbyintf.c rename to sysdeps/ieee754/flt-32/s_nearbyintf.c diff --git a/sysdeps/libm-ieee754/s_nextafterf.c b/sysdeps/ieee754/flt-32/s_nextafterf.c similarity index 100% rename from sysdeps/libm-ieee754/s_nextafterf.c rename to sysdeps/ieee754/flt-32/s_nextafterf.c diff --git a/sysdeps/libm-ieee754/s_remquof.c b/sysdeps/ieee754/flt-32/s_remquof.c similarity index 100% rename from sysdeps/libm-ieee754/s_remquof.c rename to sysdeps/ieee754/flt-32/s_remquof.c diff --git a/sysdeps/libm-ieee754/s_rintf.c b/sysdeps/ieee754/flt-32/s_rintf.c similarity index 100% rename from sysdeps/libm-ieee754/s_rintf.c rename to sysdeps/ieee754/flt-32/s_rintf.c diff --git a/sysdeps/libm-ieee754/s_roundf.c b/sysdeps/ieee754/flt-32/s_roundf.c similarity index 100% rename from sysdeps/libm-ieee754/s_roundf.c rename to sysdeps/ieee754/flt-32/s_roundf.c diff --git a/sysdeps/libm-ieee754/s_scalblnf.c b/sysdeps/ieee754/flt-32/s_scalblnf.c similarity index 100% rename from sysdeps/libm-ieee754/s_scalblnf.c rename to sysdeps/ieee754/flt-32/s_scalblnf.c diff --git a/sysdeps/libm-ieee754/s_scalbnf.c b/sysdeps/ieee754/flt-32/s_scalbnf.c similarity index 100% rename from sysdeps/libm-ieee754/s_scalbnf.c rename to sysdeps/ieee754/flt-32/s_scalbnf.c diff --git a/sysdeps/libm-ieee754/s_signbitf.c b/sysdeps/ieee754/flt-32/s_signbitf.c similarity index 100% rename from sysdeps/libm-ieee754/s_signbitf.c rename to sysdeps/ieee754/flt-32/s_signbitf.c diff --git a/sysdeps/libm-ieee754/s_sincosf.c b/sysdeps/ieee754/flt-32/s_sincosf.c similarity index 100% rename from sysdeps/libm-ieee754/s_sincosf.c rename to sysdeps/ieee754/flt-32/s_sincosf.c diff --git a/sysdeps/libm-ieee754/s_sinf.c b/sysdeps/ieee754/flt-32/s_sinf.c similarity index 100% rename from sysdeps/libm-ieee754/s_sinf.c rename to sysdeps/ieee754/flt-32/s_sinf.c diff --git a/sysdeps/libm-ieee754/s_tanf.c b/sysdeps/ieee754/flt-32/s_tanf.c similarity index 100% rename from sysdeps/libm-ieee754/s_tanf.c rename to sysdeps/ieee754/flt-32/s_tanf.c diff --git a/sysdeps/libm-ieee754/s_tanhf.c b/sysdeps/ieee754/flt-32/s_tanhf.c similarity index 100% rename from sysdeps/libm-ieee754/s_tanhf.c rename to sysdeps/ieee754/flt-32/s_tanhf.c diff --git a/sysdeps/libm-ieee754/s_truncf.c b/sysdeps/ieee754/flt-32/s_truncf.c similarity index 100% rename from sysdeps/libm-ieee754/s_truncf.c rename to sysdeps/ieee754/flt-32/s_truncf.c diff --git a/sysdeps/libm-ieee754/t_exp2f.h b/sysdeps/ieee754/flt-32/t_exp2f.h similarity index 100% rename from sysdeps/libm-ieee754/t_exp2f.h rename to sysdeps/ieee754/flt-32/t_exp2f.h diff --git a/sysdeps/libm-ieee754/w_expf.c b/sysdeps/ieee754/flt-32/w_expf.c similarity index 100% rename from sysdeps/libm-ieee754/w_expf.c rename to sysdeps/ieee754/flt-32/w_expf.c diff --git a/sysdeps/libm-ieee754/k_standard.c b/sysdeps/ieee754/k_standard.c similarity index 100% rename from sysdeps/libm-ieee754/k_standard.c rename to sysdeps/ieee754/k_standard.c diff --git a/sysdeps/ieee754/ldbl-128/e_acoshl.c b/sysdeps/ieee754/ldbl-128/e_acoshl.c new file mode 100644 index 0000000000..7f7934025a --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/e_acoshl.c @@ -0,0 +1,68 @@ +/* e_acoshl.c -- long double version of e_acosh.c. + * Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __ieee754_acoshl(x) + * Method : + * Based on + * acoshl(x) = logl [ x + sqrtl(x*x-1) ] + * we have + * acoshl(x) := logl(x)+ln2, if x is large; else + * acoshl(x) := logl(2x-1/(sqrtl(x*x-1)+x)) if x>2; else + * acoshl(x) := log1pl(t+sqrtl(2.0*t+t*t)); where t=x-1. + * + * Special cases: + * acoshl(x) is NaN with signal if x<1. + * acoshl(NaN) is NaN without signal. + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +static const long double +#else +static long double +#endif +one = 1.0, +ln2 = 0.6931471805599453094172321214581766L; + +#ifdef __STDC__ + long double __ieee754_acoshl(long double x) +#else + long double __ieee754_acoshl(x) + long double x; +#endif +{ + long double t; + u_int64_t lx; + int64_t hx; + GET_LDOUBLE_WORDS64(hx,lx,x); + if(hx<0x3fff000000000000LL) { /* x < 1 */ + return (x-x)/(x-x); + } else if(hx >=0x401b000000000000LL) { /* x > 2**28 */ + if(hx >=0x7fff000000000000LL) { /* x is inf of NaN */ + return x+x; + } else + return __ieee754_logl(x)+ln2; /* acoshl(huge)=logl(2x) */ + } else if(((hx-0x3fff000000000000LL)|lx)==0) { + return 0.0L; /* acosh(1) = 0 */ + } else if (hx > 0x4000000000000000LL) { /* 2**28 > x > 2 */ + t=x*x; + return __ieee754_logl(2.0L*x-one/(x+__ieee754_sqrtl(t-one))); + } else { /* 1 0, + * ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0, + * + * Special cases: + * + * ATAN2((anything), NaN ) is NaN; + * ATAN2(NAN , (anything) ) is NaN; + * ATAN2(+-0, +(anything but NaN)) is +-0 ; + * ATAN2(+-0, -(anything but NaN)) is +-pi ; + * ATAN2(+-(anything but 0 and NaN), 0) is +-pi/2; + * ATAN2(+-(anything but INF and NaN), +INF) is +-0 ; + * ATAN2(+-(anything but INF and NaN), -INF) is +-pi; + * ATAN2(+-INF,+INF ) is +-pi/4 ; + * ATAN2(+-INF,-INF ) is +-3pi/4; + * ATAN2(+-INF, (anything but,0,NaN, and INF)) is +-pi/2; + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +static const long double +#else +static long double +#endif +tiny = 1.0e-4900L, +zero = 0.0, +pi_o_4 = 7.85398163397448309615660845819875699e-01L, /* 3ffe921fb54442d18469898cc51701b8 */ +pi_o_2 = 1.57079632679489661923132169163975140e+00L, /* 3fff921fb54442d18469898cc51701b8 */ +pi = 3.14159265358979323846264338327950280e+00L, /* 4000921fb54442d18469898cc51701b8 */ +pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74020bbea64 */ + +#ifdef __STDC__ + long double __ieee754_atan2l(long double y, long double x) +#else + long double __ieee754_atan2l(y,x) + long double y,x; +#endif +{ + long double z; + int64_t k,m,hx,hy,ix,iy; + u_int64_t lx,ly; + + GET_LDOUBLE_WORDS64(hx,lx,x); + ix = hx&0x7fffffffffffffffLL; + GET_LDOUBLE_WORDS64(hy,ly,y); + iy = hy&0x7fffffffffffffffLL; + if(((ix|((lx|-lx)>>63))>0x7fff000000000000LL)|| + ((iy|((ly|-ly)>>63))>0x7fff000000000000LL)) /* x or y is NaN */ + return x+y; + if((hx-0x3fff000000000000LL|lx)==0) return __atanl(y); /* x=1.0L */ + m = ((hy>>63)&1)|((hx>>62)&2); /* 2*sign(x)+sign(y) */ + + /* when y = 0 */ + if((iy|ly)==0) { + switch(m) { + case 0: + case 1: return y; /* atan(+-0,+anything)=+-0 */ + case 2: return pi+tiny;/* atan(+0,-anything) = pi */ + case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ + } + } + /* when x = 0 */ + if((ix|lx)==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; + + /* when x is INF */ + if(ix==0x7fff000000000000LL) { + if(iy==0x7fff000000000000LL) { + switch(m) { + case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */ + case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */ + case 2: return 3.0L*pi_o_4+tiny;/*atan(+INF,-INF)*/ + case 3: return -3.0L*pi_o_4-tiny;/*atan(-INF,-INF)*/ + } + } else { + switch(m) { + case 0: return zero ; /* atan(+...,+INF) */ + case 1: return -zero ; /* atan(-...,+INF) */ + case 2: return pi+tiny ; /* atan(+...,-INF) */ + case 3: return -pi-tiny ; /* atan(-...,-INF) */ + } + } + } + /* when y is INF */ + if(iy==0x7fff000000000000LL) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; + + /* compute y/x */ + k = (iy-ix)>>48; + if(k > 120) z=pi_o_2+0.5L*pi_lo; /* |y/x| > 2**120 */ + else if(hx<0&&k<-120) z=0.0L; /* |y|/x < -2**120 */ + else z=__atanl(fabsl(y/x)); /* safe to do y/x */ + switch (m) { + case 0: return z ; /* atan(+,+) */ + case 1: { + u_int64_t zh; + GET_LDOUBLE_MSW64(zh,z); + SET_LDOUBLE_MSW64(z,zh ^ 0x8000000000000000ULL); + } + return z ; /* atan(-,+) */ + case 2: return pi-(z-pi_lo);/* atan(+,-) */ + default: /* case 3 */ + return (z-pi_lo)-pi;/* atan(-,-) */ + } +} diff --git a/sysdeps/ieee754/ldbl-128/e_fmodl.c b/sysdeps/ieee754/ldbl-128/e_fmodl.c new file mode 100644 index 0000000000..1043f69cb3 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/e_fmodl.c @@ -0,0 +1,138 @@ +/* e_fmodl.c -- long double version of e_fmod.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * __ieee754_fmodl(x,y) + * Return x mod y in exact arithmetic + * Method: shift and subtract + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +static const long double one = 1.0, Zero[] = {0.0, -0.0,}; +#else +static long double one = 1.0, Zero[] = {0.0, -0.0,}; +#endif + +#ifdef __STDC__ + long double __ieee754_fmodl(long double x, long double y) +#else + long double __ieee754_fmodl(x,y) + long double x,y; +#endif +{ + int64_t n,hx,hy,hz,ix,iy,sx,i; + u_int64_t lx,ly,lz; + + GET_LDOUBLE_WORDS64(hx,lx,x); + GET_LDOUBLE_WORDS64(hy,ly,y); + sx = hx&0x8000000000000000ULL; /* sign of x */ + hx ^=sx; /* |x| */ + hy &= 0x7fffffffffffffffLL; /* |y| */ + + /* purge off exception values */ + if((hy|ly)==0||(hx>=0x7fff000000000000LL)|| /* y=0,or x not finite */ + ((hy|((ly|-ly)>>63))>0x7fff000000000000LL)) /* or y is NaN */ + return (x*y)/(x*y); + if(hx<=hy) { + if((hx>63]; /* |x|=|y| return x*0*/ + } + + /* determine ix = ilogb(x) */ + if(hx<0x0001000000000000LL) { /* subnormal x */ + if(hx==0) { + for (ix = -16431, i=lx; i>0; i<<=1) ix -=1; + } else { + for (ix = -16382, i=hx<<15; i>0; i<<=1) ix -=1; + } + } else ix = (hx>>48)-0x3fff; + + /* determine iy = ilogb(y) */ + if(hy<0x0001000000000000LL) { /* subnormal y */ + if(hy==0) { + for (iy = -16431, i=ly; i>0; i<<=1) iy -=1; + } else { + for (iy = -16382, i=hy<<15; i>0; i<<=1) iy -=1; + } + } else iy = (hy>>48)-0x3fff; + + /* set up {hx,lx}, {hy,ly} and align y to x */ + if(ix >= -16382) + hx = 0x0001000000000000LL|(0x0000ffffffffffffLL&hx); + else { /* subnormal x, shift x to normal */ + n = -16382-ix; + if(n<=63) { + hx = (hx<>(64-n)); + lx <<= n; + } else { + hx = lx<<(n-64); + lx = 0; + } + } + if(iy >= -16382) + hy = 0x0001000000000000LL|(0x0000ffffffffffffLL&hy); + else { /* subnormal y, shift y to normal */ + n = -16382-iy; + if(n<=63) { + hy = (hy<>(64-n)); + ly <<= n; + } else { + hy = ly<<(n-64); + ly = 0; + } + } + + /* fix point fmod */ + n = ix - iy; + while(n--) { + hz=hx-hy;lz=lx-ly; if(lx>63); lx = lx+lx;} + else { + if((hz|lz)==0) /* return sign(x)*0 */ + return Zero[(u_int64_t)sx>>63]; + hx = hz+hz+(lz>>63); lx = lz+lz; + } + } + hz=hx-hy;lz=lx-ly; if(lx=0) {hx=hz;lx=lz;} + + /* convert back to floating value and restore the sign */ + if((hx|lx)==0) /* return sign(x)*0 */ + return Zero[(u_int64_t)sx>>63]; + while(hx<0x0001000000000000LL) { /* normalize x */ + hx = hx+hx+(lx>>63); lx = lx+lx; + iy -= 1; + } + if(iy>= -16382) { /* normalize output */ + hx = ((hx-0x0001000000000000LL)|((iy+16383)<<48)); + SET_LDOUBLE_WORDS64(x,hx|sx,lx); + } else { /* subnormal output */ + n = -16382 - iy; + if(n<=48) { + lx = (lx>>n)|((u_int64_t)hx<<(64-n)); + hx >>= n; + } else if (n<=63) { + lx = (hx<<(64-n))|(lx>>n); hx = sx; + } else { + lx = hx>>(n-64); hx = sx; + } + SET_LDOUBLE_WORDS64(x,hx|sx,lx); + x *= one; /* create necessary signal */ + } + return x; /* exact output */ +} diff --git a/sysdeps/ieee754/ldbl-128/e_gammal_r.c b/sysdeps/ieee754/ldbl-128/e_gammal_r.c new file mode 100644 index 0000000000..f77350fa5c --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/e_gammal_r.c @@ -0,0 +1,52 @@ +/* Implementation of gamma function according to ISO C. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997 and + Jakub Jelinek +#include + + +long double +__ieee754_gammal_r (long double x, int *signgamp) +{ + /* We don't have a real gamma implementation now. We'll use lgamma + and the exp function. But due to the required boundary + conditions we must check some values separately. */ + int64_t hx; + u_int64_t lx; + + GET_LDOUBLE_WORDS64 (hx, lx, x); + + if (((hx & 0x7fffffffffffffffLL) | lx) == 0) + { + /* Return value for x == 0 is NaN with invalid exception. */ + *signgamp = 0; + return x / x; + } + if (hx < 0 && (u_int64_t) hx < 0xffff000000000000ULL && __rintl (x) == x) + { + /* Return value for integer x < 0 is NaN with invalid exception. */ + *signgamp = 0; + return (x - x) / (x - x); + } + + /* XXX FIXME. */ + return __ieee754_expl (__ieee754_lgammal_r (x, signgamp)); +} diff --git a/sysdeps/ieee754/ldbl-128/e_remainderl.c b/sysdeps/ieee754/ldbl-128/e_remainderl.c new file mode 100644 index 0000000000..81af247b33 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/e_remainderl.c @@ -0,0 +1,78 @@ +/* e_fmodl.c -- long double version of e_fmod.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __ieee754_remainderl(x,p) + * Return : + * returns x REM p = x - [x/p]*p as if in infinite + * precise arithmetic, where [x/p] is the (infinite bit) + * integer nearest x/p (in half way case choose the even one). + * Method : + * Based on fmodl() return x-[x/p]chopped*p exactlp. + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +static const long double zero = 0.0L; +#else +static long double zero = 0.0L; +#endif + + +#ifdef __STDC__ + long double __ieee754_remainderl(long double x, long double p) +#else + long double __ieee754_remainderl(x,p) + long double x,p; +#endif +{ + int64_t hx,hp; + u_int64_t sx,lx,lp; + long double p_half; + + GET_LDOUBLE_WORDS64(hx,lx,x); + GET_LDOUBLE_WORDS64(hp,lp,p); + sx = hx&0x8000000000000000ULL; + hp &= 0x7fffffffffffffffLL; + hx &= 0x7fffffffffffffffLL; + + /* purge off exception values */ + if((hp|lp)==0) return (x*p)/(x*p); /* p = 0 */ + if((hx>=0x7fff000000000000LL)|| /* x not finite */ + ((hp>=0x7fff000000000000LL)&& /* p is NaN */ + (((hp-0x7fff000000000000LL)|lp)!=0))) + return (x*p)/(x*p); + + + if (hp<=0x7ffdffffffffffffLL) x = __ieee754_fmodl(x,p+p); /* now x < 2p */ + if (((hx-hp)|(lx-lp))==0) return zero*x; + x = fabsl(x); + p = fabsl(p); + if (hp<0x0002000000000000LL) { + if(x+x>p) { + x-=p; + if(x+x>=p) x -= p; + } + } else { + p_half = 0.5L*p; + if(x>p_half) { + x-=p; + if(x>=p_half) x -= p; + } + } + GET_LDOUBLE_MSW64(hx,x); + SET_LDOUBLE_MSW64(x,hx^sx); + return x; +} diff --git a/sysdeps/ieee754/ldbl-128/ieee754.h b/sysdeps/ieee754/ldbl-128/ieee754.h new file mode 100644 index 0000000000..c3b2f38916 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/ieee754.h @@ -0,0 +1,171 @@ +/* Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _IEEE754_H + +#define _IEEE754_H 1 +#include + +#include + +__BEGIN_DECLS + +union ieee754_float + { + float f; + + /* This is the IEEE 754 single-precision format. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:8; + unsigned int mantissa:23; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int mantissa:23; + unsigned int exponent:8; + unsigned int negative:1; +#endif /* Little endian. */ + } ieee; + + /* This format makes it easier to see if a NaN is a signalling NaN. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:8; + unsigned int quiet_nan:1; + unsigned int mantissa:22; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int mantissa:22; + unsigned int quiet_nan:1; + unsigned int exponent:8; + unsigned int negative:1; +#endif /* Little endian. */ + } ieee_nan; + }; + +#define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */ + + +union ieee754_double + { + double d; + + /* This is the IEEE 754 double-precision format. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:11; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:20; + unsigned int mantissa1:32; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + /* Together these comprise the mantissa. */ + unsigned int mantissa1:32; + unsigned int mantissa0:20; + unsigned int exponent:11; + unsigned int negative:1; +#endif /* Little endian. */ + } ieee; + + /* This format makes it easier to see if a NaN is a signalling NaN. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:11; + unsigned int quiet_nan:1; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:19; + unsigned int mantissa1:32; +#else + /* Together these comprise the mantissa. */ + unsigned int mantissa1:32; + unsigned int mantissa0:19; + unsigned int quiet_nan:1; + unsigned int exponent:11; + unsigned int negative:1; +#endif + } ieee_nan; + }; + +#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ + + +union ieee854_long_double + { + long double d; + + /* This is the IEEE 854 quad-precision format. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:16; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:16; + unsigned int exponent:15; + unsigned int negative:1; +#endif /* Little endian. */ + } ieee; + + /* This format makes it easier to see if a NaN is a signalling NaN. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + unsigned int quiet_nan:1; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:15; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#else + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:15; + unsigned int quiet_nan:1; + unsigned int exponent:15; + unsigned int negative:1; +#endif + } ieee_nan; + }; + +#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ + +__END_DECLS + +#endif /* ieee754.h */ diff --git a/sysdeps/ieee754/ldbl-128/ldbl2mpn.c b/sysdeps/ieee754/ldbl-128/ldbl2mpn.c new file mode 100644 index 0000000000..68ecea8753 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/ldbl2mpn.c @@ -0,0 +1,137 @@ +/* Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "gmp.h" +#include "gmp-impl.h" +#include "longlong.h" +#include +#include +#include +#include + +/* Convert a `long double' in IEEE854 quad-precision format to a + multi-precision integer representing the significand scaled up by its + number of bits (113 for long double) and an integral power of two + (MPN frexpl). */ + +mp_size_t +__mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size, + int *expt, int *is_neg, + long double value) +{ + union ieee854_long_double u; + u.d = value; + + *is_neg = u.ieee.negative; + *expt = (int) u.ieee.exponent - IEEE854_LONG_DOUBLE_BIAS; + +#if BITS_PER_MP_LIMB == 32 + res_ptr[0] = u.ieee.mantissa3; /* Low-order 32 bits of fraction. */ + res_ptr[1] = u.ieee.mantissa2; + res_ptr[2] = u.ieee.mantissa1; + res_ptr[3] = u.ieee.mantissa0; /* High-order 32 bits. */ + #define N 4 +#elif BITS_PER_MP_LIMB == 64 + /* Hopefully the compiler will combine the two bitfield extracts + and this composition into just the original quadword extract. */ + res_ptr[0] = ((unsigned long int) u.ieee.mantissa2 << 32) | u.ieee.mantissa3; + res_ptr[1] = ((unsigned long int) u.ieee.mantissa0 << 32) | u.ieee.mantissa1; + #define N 2 +#else + #error "mp_limb size " BITS_PER_MP_LIMB "not accounted for" +#endif +/* The format does not fill the last limb. There are some zeros. */ +#define NUM_LEADING_ZEROS (BITS_PER_MP_LIMB \ + - (LDBL_MANT_DIG - ((N - 1) * BITS_PER_MP_LIMB))) + + if (u.ieee.exponent == 0) + { + /* A biased exponent of zero is a special case. + Either it is a zero or it is a denormal number. */ + if (res_ptr[0] == 0 && res_ptr[1] == 0 + && res_ptr[N - 2] == 0 && res_ptr[N - 1] == 0) /* Assumes N<=4. */ + /* It's zero. */ + *expt = 0; + else + { + /* It is a denormal number, meaning it has no implicit leading + one bit, and its exponent is in fact the format minimum. */ + int cnt; + +#if N == 2 + if (res_ptr[N - 1] != 0) + { + count_leading_zeros (cnt, res_ptr[N - 1]); + cnt -= NUM_LEADING_ZEROS; + res_ptr[N - 1] = res_ptr[N - 1] << cnt + | (res_ptr[0] >> (BITS_PER_MP_LIMB - cnt)); + res_ptr[0] <<= cnt; + *expt = LDBL_MIN_EXP - 1 - cnt; + } + else + { + count_leading_zeros (cnt, res_ptr[0]); + if (cnt >= NUM_LEADING_ZEROS) + { + res_ptr[N - 1] = res_ptr[0] << (cnt - NUM_LEADING_ZEROS); + res_ptr[0] = 0; + } + else + { + res_ptr[N - 1] = res_ptr[0] >> (NUM_LEADING_ZEROS - cnt); + res_ptr[0] <<= BITS_PER_MP_LIMB - (NUM_LEADING_ZEROS - cnt); + } + *expt = LDBL_MIN_EXP - 1 + - (BITS_PER_MP_LIMB - NUM_LEADING_ZEROS) - cnt; + } +#else + int j, k, l; + + for (j = N - 1; j > 0; j++) + if (res_ptr[j] != 0) + break; + + count_leading_zeros (cnt, res_ptr[j]); + cnt -= NUM_LEADING_ZEROS; + l = N - 1 - j; + if (cnt < 0) + { + cnt += BITS_PER_MP_LIMB; + l++; + } + if (!cnt) + for (k = N - 1; k >= l; k--) + res_ptr[k] = res_ptr[k-l]; + else + for (k = N - 1; k >= l; k--) + res_ptr[k] = res_ptr[k-l] << cnt + | res_ptr[k-l-1] >> (BITS_PER_MP_LIMB - cnt); + res_ptr[k--] = res_ptr[0] << cnt; + + for (; k >= 0; k--) + res_ptr[k] = 0; + *expt = LDBL_MIN_EXP - 1 - 3 * BITS_PER_MP_LIMB - cnt; +#endif + } + } + else + /* Add the implicit leading one bit for a normalized number. */ + res_ptr[N - 1] |= 1L << (LDBL_MANT_DIG - 1 - ((N - 1) * BITS_PER_MP_LIMB)); + + return N; +} diff --git a/sysdeps/ieee754/ldbl-128/math_ldbl.h b/sysdeps/ieee754/ldbl-128/math_ldbl.h new file mode 100644 index 0000000000..aecb20a972 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/math_ldbl.h @@ -0,0 +1,82 @@ +#ifndef _MATH_PRIVATE_H_ +#error "Never use directly; include instead." +#endif + +/* A union which permits us to convert between a long double and + four 32 bit ints or two 64 bit ints. */ + +#if __FLOAT_WORD_ORDER == BIG_ENDIAN + +typedef union +{ + long double value; + struct + { + u_int64_t msw; + u_int64_t lsw; + } parts64; + struct + { + u_int32_t w0, w1, w2, w3; + } parts32; +} ieee854_long_double_shape_type; + +#endif + +#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN + +typedef union +{ + long double value; + struct + { + u_int64_t lsw; + u_int64_t msw; + } parts64; + struct + { + u_int32_t w3, w2, w1, w0; + } parts32; +} ieee854_long_double_shape_type; + +#endif + +/* Get two 64 bit ints from a long double. */ + +#define GET_LDOUBLE_WORDS64(ix0,ix1,d) \ +do { \ + ieee854_long_double_shape_type qw_u; \ + qw_u.value = (d); \ + (ix0) = qw_u.parts64.msw; \ + (ix1) = qw_u.parts64.lsw; \ +} while (0) + +/* Set a long double from two 64 bit ints. */ + +#define SET_LDOUBLE_WORDS64(d,ix0,ix1) \ +do { \ + ieee854_long_double_shape_type qw_u; \ + qw_u.parts64.msw = (ix0); \ + qw_u.parts64.lsw = (ix1); \ + (d) = qw_u.value; \ +} while (0) + +/* Get the more significant 64 bits of a long double mantissa. */ + +#define GET_LDOUBLE_MSW64(v,d) \ +do { \ + ieee854_long_double_shape_type sh_u; \ + sh_u.value = (d); \ + (v) = sh_u.parts64.msw; \ +} while (0) + +/* Set the more significant 64 bits of a long double mantissa from an int. */ + +#define SET_LDOUBLE_MSW64(d,v) \ +do { \ + ieee854_long_double_shape_type sh_u; \ + sh_u.value = (d); \ + sh_u.parts64.msw = (v); \ + (d) = sh_u.value; \ +} while (0) + diff --git a/sysdeps/ieee754/ldbl-128/mpn2ldbl.c b/sysdeps/ieee754/ldbl-128/mpn2ldbl.c new file mode 100644 index 0000000000..d9cc4521c8 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/mpn2ldbl.c @@ -0,0 +1,51 @@ +/* Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "gmp.h" +#include "gmp-impl.h" +#include +#include +#include + +/* Convert a multi-precision integer of the needed number of bits (113 for + long double) and an integral power of two to a `long double' in IEEE854 + quad-precision format. */ + +long double +__mpn_construct_long_double (mp_srcptr frac_ptr, int expt, int sign) +{ + union ieee854_long_double u; + + u.ieee.negative = sign; + u.ieee.exponent = expt + IEEE854_LONG_DOUBLE_BIAS; +#if BITS_PER_MP_LIMB == 32 + u.ieee.mantissa3 = frac_ptr[0]; + u.ieee.mantissa2 = frac_ptr[1]; + u.ieee.mantissa1 = frac_ptr[2]; + u.ieee.mantissa0 = frac_ptr[3] & ((1 << (LDBL_MANT_DIG - 96)) - 1); +#elif BITS_PER_MP_LIMB == 64 + u.ieee.mantissa3 = frac_ptr[0] & ((1L << 32) - 1); + u.ieee.mantissa2 = frac_ptr[0] >> 32; + u.ieee.mantissa1 = frac_ptr[1] & ((1L << 32) - 1); + u.ieee.mantissa0 = (frac_ptr[1] >> 32) & ((1 << (LDBL_MANT_DIG - 96)) - 1); +#else + #error "mp_limb size " BITS_PER_MP_LIMB "not accounted for" +#endif + + return u.d; +} diff --git a/sysdeps/ieee754/ldbl-128/printf_fphex.c b/sysdeps/ieee754/ldbl-128/printf_fphex.c new file mode 100644 index 0000000000..e25d668d9a --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/printf_fphex.c @@ -0,0 +1,84 @@ +/* Print floating point number in hexadecimal notation according to + ISO C 9X. + Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#define PRINT_FPHEX_LONG_DOUBLE \ +do { \ + /* We have 112 bits of mantissa plus one implicit digit. Since \ + 112 bits are representable without rest using hexadecimal \ + digits we use only the implicit digits for the number before \ + the decimal point. */ \ + unsigned long long int num0, num1; \ + \ + assert (sizeof (long double) == 16); \ + \ + num0 = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \ + | fpnum.ldbl.ieee.mantissa1); \ + num1 = (((unsigned long long int) fpnum.ldbl.ieee.mantissa2) << 32 \ + | fpnum.ldbl.ieee.mantissa3); \ + \ + zero_mantissa = (num0|num1) == 0; \ + \ + if (sizeof (unsigned long int) > 6) \ + numstr = _itoa_word (num1, numbuf + sizeof numbuf, 16, \ + info->spec == 'A'); \ + else \ + numstr = _itoa (num1, numbuf + sizeof numbuf, 16, \ + info->spec == 'A'); \ + \ + while (numstr > numbuf + (sizeof numbuf - 64 / 4)) \ + *--numstr = '0'; \ + \ + if (sizeof (unsigned long int) > 6) \ + numstr = _itoa_word (num0, numstr, 16, info->spec == 'A'); \ + else \ + numstr = _itoa (num0, numstr, 16, info->spec == 'A'); \ + \ + /* Fill with zeroes. */ \ + while (numstr > numbuf + (sizeof numbuf - 112 / 4)) \ + *--numstr = '0'; \ + \ + leading = fpnum.ldbl.ieee.exponent == 0 ? '0' : '1'; \ + \ + exponent = fpnum.ldbl.ieee.exponent; \ + \ + if (exponent == 0) \ + { \ + if (zero_mantissa) \ + expnegative = 0; \ + else \ + { \ + /* This is a denormalized number. */ \ + expnegative = 1; \ + exponent = IEEE854_LONG_DOUBLE_BIAS - 1; \ + } \ + } \ + else if (exponent >= IEEE854_LONG_DOUBLE_BIAS) \ + { \ + expnegative = 0; \ + exponent -= IEEE854_LONG_DOUBLE_BIAS; \ + } \ + else \ + { \ + expnegative = 1; \ + exponent = -(exponent - IEEE854_LONG_DOUBLE_BIAS); \ + } \ +} while (0) + +#include diff --git a/sysdeps/ieee754/ldbl-128/s_ceill.c b/sysdeps/ieee754/ldbl-128/s_ceill.c new file mode 100644 index 0000000000..f241554042 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_ceill.c @@ -0,0 +1,84 @@ +/* s_ceill.c -- long double version of s_ceil.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * ceill(x) + * Return x rounded toward -inf to integral value + * Method: + * Bit twiddling. + * Exception: + * Inexact flag raised if x not equal to ceil(x). + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +static const long double huge = 1.0e4930; +#else +static long double huge = 1.0e4930; +#endif + +#ifdef __STDC__ + long double __ceill(long double x) +#else + long double __ceill(x) + long double x; +#endif +{ + int64_t i0,i1,j0; + u_int64_t i,j; + GET_LDOUBLE_WORDS64(i0,i1,x); + j0 = ((i0>>48)&0x7fff)-0x3fff; + if(j0<48) { + if(j0<0) { /* raise inexact if x != 0 */ + if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */ + if(i0<0) {i0=0x8000000000000000ULL;i1=0;} + else if((i0|i1)!=0) { i0=0x3fff000000000000ULL;i1=0;} + } + } else { + i = (0x7fffffffffffffffULL)>>j0; + if(((i0&i)|i1)==0) return x; /* x is integral */ + if(huge+x>0.0) { /* raise inexact flag */ + if(i0>0) i0 += (0x0001000000000000LL)>>j0; + i0 &= (~i); i1=0; + } + } + } else if (j0>111) { + if(j0==0x4000) return x+x; /* inf or NaN */ + else return x; /* x is integral */ + } else { + i = -1ULL>>(j0-48); + if((i1&i)==0) return x; /* x is integral */ + if(huge+x>0.0) { /* raise inexact flag */ + if(i0>0) { + if(j0==48) i0+=1; + else { + j = i1+(1LL<<(112-j0)); + if(j=0x7fff000000000000LL) return x-x; + + /* argument reduction needed */ + else { + n = __ieee754_rem_pio2l(x,y); + switch(n&3) { + case 0: return __kernel_cosl(y[0],y[1]); + case 1: return -__kernel_sinl(y[0],y[1],1); + case 2: return -__kernel_cosl(y[0],y[1]); + default: + return __kernel_sinl(y[0],y[1],1); + } + } +} +weak_alias (__cosl, cosl) diff --git a/sysdeps/ieee754/ldbl-128/s_fabsl.c b/sysdeps/ieee754/ldbl-128/s_fabsl.c new file mode 100644 index 0000000000..c0fd05af63 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_fabsl.c @@ -0,0 +1,39 @@ +/* s_fabsl.c -- long double version of s_fabs.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * fabsl(x) returns the absolute value of x. + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + long double __fabsl(long double x) +#else + long double __fabsl(x) + long double x; +#endif +{ + u_int64_t hx; + GET_LDOUBLE_MSW64(hx,x); + SET_LDOUBLE_MSW64(x,hx&0x7fffffffffffffffLL); + return x; +} +weak_alias (__fabsl, fabsl) diff --git a/sysdeps/ieee754/ldbl-128/s_finitel.c b/sysdeps/ieee754/ldbl-128/s_finitel.c new file mode 100644 index 0000000000..dd176c1e7a --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_finitel.c @@ -0,0 +1,40 @@ +/* s_finitel.c -- long double version of s_finite.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * finitel(x) returns 1 is x is finite, else 0; + * no branching! + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + int __finitel(long double x) +#else + int __finitel(x) + long double x; +#endif +{ + int64_t hx; + GET_LDOUBLE_MSW64(hx,x); + return (int)((u_int64_t)((hx&0x7fffffffffffffffLL) + -0x7fff000000000000LL)>>63); +} +weak_alias (__finitel, finitel) diff --git a/sysdeps/ieee754/ldbl-128/s_floorl.c b/sysdeps/ieee754/ldbl-128/s_floorl.c new file mode 100644 index 0000000000..c9b8b70dbf --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_floorl.c @@ -0,0 +1,85 @@ +/* s_floorl.c -- long double version of s_floor.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * floorl(x) + * Return x rounded toward -inf to integral value + * Method: + * Bit twiddling. + * Exception: + * Inexact flag raised if x not equal to floor(x). + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +static const long double huge = 1.0e4930; +#else +static long double huge = 1.0e4930; +#endif + +#ifdef __STDC__ + long double __floorl(long double x) +#else + long double __floorl(x) + long double x; +#endif +{ + int64_t i0,i1,j0; + u_int64_t i,j; + GET_LDOUBLE_WORDS64(i0,i1,x); + j0 = ((i0>>48)&0x7fff)-0x3fff; + if(j0<48) { + if(j0<0) { /* raise inexact if x != 0 */ + if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */ + if(i0>=0) {i0=i1=0;} + else if(((i0&0x7fffffffffffffffLL)|i1)!=0) + { i0=0xbfff000000000000ULL;i1=0;} + } + } else { + i = (0x7fffffffffffffffULL)>>j0; + if(((i0&i)|i1)==0) return x; /* x is integral */ + if(huge+x>0.0) { /* raise inexact flag */ + if(i0<0) i0 += (0x0001000000000000LL)>>j0; + i0 &= (~i); i1=0; + } + } + } else if (j0>111) { + if(j0==0x4000) return x+x; /* inf or NaN */ + else return x; /* x is integral */ + } else { + i = -1ULL>>(j0-48); + if((i1&i)==0) return x; /* x is integral */ + if(huge+x>0.0) { /* raise inexact flag */ + if(i0<0) { + if(j0==48) i0+=1; + else { + j = i1+(1LL<<(112-j0)); + if(j, 1997 and + Jakub Jelinek , 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#include "math_private.h" + + +int +__fpclassifyl (long double x) +{ + u_int64_t hx, lx; + int retval = FP_NORMAL; + + GET_LDOUBLE_WORDS64 (hx, lx, x); + lx |= (hx & 0x0000ffffffffffffLL); + hx &= 0x7fff000000000000LL; + if ((hx | lx) == 0) + retval = FP_ZERO; + else if (hx == 0) + retval = FP_SUBNORMAL; + else if (hx == 0x7fff000000000000LL) + retval = lx != 0 ? FP_NAN : FP_INFINITE; + + return retval; +} diff --git a/sysdeps/ieee754/ldbl-128/s_frexpl.c b/sysdeps/ieee754/ldbl-128/s_frexpl.c new file mode 100644 index 0000000000..6dbb60ece0 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_frexpl.c @@ -0,0 +1,63 @@ +/* s_frexpl.c -- long double version of s_frexp.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * for non-zero x + * x = frexpl(arg,&exp); + * return a long double fp quantity x such that 0.5 <= |x| <1.0 + * and the corresponding binary exponent "exp". That is + * arg = x*2^exp. + * If arg is inf, 0.0, or NaN, then frexpl(arg,&exp) returns arg + * with *exp=0. + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +static const long double +#else +static long double +#endif +two114 = 2.0769187434139310514121985316880384E+34L; /* 0x4071000000000000, 0 */ + +#ifdef __STDC__ + long double __frexpl(long double x, int *eptr) +#else + long double __frexpl(x, eptr) + long double x; int *eptr; +#endif +{ + u_int64_t hx, lx, ix; + GET_LDOUBLE_WORDS64(hx,lx,x); + ix = 0x7fffffffffffffffULL&hx; + *eptr = 0; + if(ix>=0x7fff000000000000ULL||((ix|lx)==0)) return x; /* 0,inf,nan */ + if (ix<0x0001000000000000ULL) { /* subnormal */ + x *= two114; + GET_LDOUBLE_MSW64(hx,x); + ix = hx&0x7fffffffffffffffULL; + *eptr = -114; + } + *eptr += (ix>>48)-16382; + hx = (hx&0x8000ffffffffffffULL) | 0x3ffe000000000000ULL; + SET_LDOUBLE_MSW64(x,hx); + return x; +} +weak_alias (__frexpl, frexpl) diff --git a/sysdeps/ieee754/ldbl-128/s_ilogbl.c b/sysdeps/ieee754/ldbl-128/s_ilogbl.c new file mode 100644 index 0000000000..d2acfd3105 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_ilogbl.c @@ -0,0 +1,55 @@ +/* s_ilogbl.c -- long double version of s_ilogb.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* ilogbl(long double x) + * return the binary exponent of non-zero x + * ilogbl(0) = 0x80000001 + * ilogbl(inf/NaN) = 0x7fffffff (no signal is raised) + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + int __ilogbl(long double x) +#else + int __ilogbl(x) + long double x; +#endif +{ + int64_t hx,lx; + int ix; + + GET_LDOUBLE_WORDS64(hx,lx,x); + hx &= 0x7fffffffffffffffLL; + if(hx <= 0x0001000000000000LL) { + if((hx|lx)==0) + return FP_ILOGB0; /* ilogbl(0) = FP_ILOGB0 */ + else /* subnormal x */ + if(hx==0) { + for (ix = -16431; lx>0; lx<<=1) ix -=1; + } else { + for (ix = -16382, hx<<=15; hx>0; hx<<=1) ix -=1; + } + return ix; + } + else if (hx<0x7fff000000000000LL) return (hx>>48)-0x3fff; + else return FP_ILOGBNAN; +} +weak_alias (__ilogbl, ilogbl) diff --git a/sysdeps/ieee754/ldbl-128/s_isinfl.c b/sysdeps/ieee754/ldbl-128/s_isinfl.c new file mode 100644 index 0000000000..038c294c79 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_isinfl.c @@ -0,0 +1,28 @@ +/* + * Written by J.T. Conklin . + * Change for long double by Jakub Jelinek + * Public domain. + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * isinfl(x) returns 1 if x is inf, -1 if x is -inf, else 0; + * no branching! + */ + +#include "math.h" +#include "math_private.h" + +int +__isinfl (long double x) +{ + int64_t hx,lx; + GET_LDOUBLE_WORDS64(hx,lx,x); + lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL; + lx |= -lx; + return ~(lx >> 63) & (hx >> 62); +} +weak_alias (__isinfl, isinfl) diff --git a/sysdeps/ieee754/ldbl-128/s_isnanl.c b/sysdeps/ieee754/ldbl-128/s_isnanl.c new file mode 100644 index 0000000000..d2fb4038ce --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_isnanl.c @@ -0,0 +1,42 @@ +/* s_isnanl.c -- long double version of s_isnan.c. + * Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * isnanl(x) returns 1 is x is nan, else 0; + * no branching! + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + int __isnanl(long double x) +#else + int __isnanl(x) + long double x; +#endif +{ + int64_t hx,lx; + GET_LDOUBLE_WORDS64(hx,lx,x); + hx &= 0x7fffffffffffffffLL; + hx |= (u_int64_t)(lx|(-lx))>>63; + hx = 0x7fff000000000000LL - hx; + return (int)((u_int64_t)hx>>63); +} +weak_alias (__isnanl, isnanl) diff --git a/sysdeps/ieee754/ldbl-128/s_llrintl.c b/sysdeps/ieee754/ldbl-128/s_llrintl.c new file mode 100644 index 0000000000..389a65dc0e --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_llrintl.c @@ -0,0 +1,75 @@ +/* Round argument to nearest integral value according to current rounding + direction. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997 and + Jakub Jelinek , 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#include "math_private.h" + +static const long double two112[2] = +{ + 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */ + -5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */ +}; + +long long int +__llrintl (long double x) +{ + int32_t j0; + u_int64_t i0,i1; + volatile long double w; + long double t; + long long int result; + int sx; + + GET_LDOUBLE_WORDS64 (i0, i1, x); + j0 = ((i0 >> 48) & 0x7fff) - 0x3fff; + sx = i0 >> 63; + i0 &= 0x0000ffffffffffffLL; + i0 |= 0x0001000000000000LL; + + if (j0 < (int32_t) (8 * sizeof (long long int)) - 1) + { + if (j0 < -1) + return 0; + w = two112[sx] + x; + t = w - two112[sx]; + GET_LDOUBLE_WORDS64 (i0, i1, x); + j0 = ((i0 >> 48) & 0x7fff) - 0x3fff; + i0 &= 0x0000ffffffffffffLL; + i0 |= 0x0001000000000000LL; + + if (j0 <= 48) + result = i0 >> (48 - j0); + else + result = ((long long int) i0 << (j0 - 48)) | (i1 >> (112 - j0)); + } + else + { + /* The number is too large. It is left implementation defined + what happens. */ + return (long long int) x; + } + + return sx ? -result : result; +} + +weak_alias (__llrintl, llrintl) diff --git a/sysdeps/ieee754/ldbl-128/s_llroundl.c b/sysdeps/ieee754/ldbl-128/s_llroundl.c new file mode 100644 index 0000000000..82395a7b5a --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_llroundl.c @@ -0,0 +1,74 @@ +/* Round long double value to long long int. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997 and + Jakub Jelinek , 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#include "math_private.h" + + +long long int +__llroundl (long double x) +{ + int64_t j0; + u_int64_t i1, i0; + long long int result; + int sign; + + GET_LDOUBLE_WORDS64 (i0, i1, x); + j0 = ((i0 >> 48) & 0x7fff) - 0x3fff; + sign = (i0 & 0x8000000000000000ULL) != 0 ? -1 : 1; + i0 &= 0x0000ffffffffffffLL; + i0 |= 0x0001000000000000LL; + + if (j0 < 48) + { + if (j0 < 0) + return j0 < -1 ? 0 : sign; + else + { + i0 += 0x0000800000000000LL >> j0; + result = i0 >> (48 - j0); + } + } + else if (j0 < (int32_t) (8 * sizeof (long long int)) - 1) + { + if (j0 >= 112) + result = ((long long int) i0 << (j0 - 48)) | (i1 << (j0 - 112)); + else + { + u_int64_t j = i1 + (0x8000000000000000ULL >> (j0 - 48)); + if (j < i1) + ++i0; + + result = ((long long int) i0 << (j0 - 48)) | (j >> (112 - j0)); + } + } + else + { + /* The number is too large. It is left implementation defined + what happens. */ + return (long long int) x; + } + + return sign * result; +} + +weak_alias (__llroundl, llroundl) diff --git a/sysdeps/ieee754/ldbl-128/s_logbl.c b/sysdeps/ieee754/ldbl-128/s_logbl.c new file mode 100644 index 0000000000..1fda289312 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_logbl.c @@ -0,0 +1,46 @@ +/* s_logbl.c -- long double version of s_logb.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * long double logbl(x) + * IEEE 754 logb. Included to pass IEEE test suite. Not recommend. + * Use ilogb instead. + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + long double __logbl(long double x) +#else + long double __logbl(x) + long double x; +#endif +{ + int64_t lx,hx; + GET_LDOUBLE_WORDS64(hx,lx,x); + hx &= 0x7fffffffffffffffLL; /* high |x| */ + if((hx|lx)==0) return -1.0/fabs(x); + if(hx>=0x7fff000000000000LL) return x*x; + if((hx>>=48)==0) /* IEEE 754 logb */ + return -16382.0; + else + return (long double) (hx-0x3fff); +} +weak_alias (__logbl, logbl) diff --git a/sysdeps/ieee754/ldbl-128/s_lrintl.c b/sysdeps/ieee754/ldbl-128/s_lrintl.c new file mode 100644 index 0000000000..434aa315a7 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_lrintl.c @@ -0,0 +1,91 @@ +/* Round argument to nearest integral value according to current rounding + direction. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997 and + Jakub Jelinek , 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#include "math_private.h" + +static const long double two112[2] = +{ + 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */ + -5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */ +}; + +long int +__lrintl (long double x) +{ + int32_t j0; + u_int64_t i0,i1; + volatile long double w; + long double t; + long int result; + int sx; + + GET_LDOUBLE_WORDS64 (i0, i1, x); + j0 = ((i0 >> 48) & 0x7fff) - 0x3fff; + sx = i0 >> 63; + i0 &= 0x0000ffffffffffffLL; + i0 |= 0x0001000000000000LL; + + if (j0 < 48) + { + if (j0 < -1) + return 0; + else + { + w = two112[sx] + x; + t = w - two112[sx]; + GET_LDOUBLE_WORDS64 (i0, i1, x); + j0 = ((i0 >> 48) & 0x7fff) - 0x3fff; + i0 &= 0x0000ffffffffffffLL; + i0 |= 0x0001000000000000LL; + + result = i0 >> (48 - j0); + } + } + else if (j0 < (int32_t) (8 * sizeof (long int)) - 1) + { + if (j0 >= 112) + result = ((long int) i0 << (j0 - 48)) | (i1 << (j0 - 112)); + else + { + w = two112[sx] + x; + t = w - two112[sx]; + GET_LDOUBLE_WORDS64 (i0, i1, x); + j0 = ((i0 >> 48) & 0x7fff) - 0x3fff; + i0 &= 0x0000ffffffffffffLL; + i0 |= 0x0001000000000000LL; + + result = ((long int) i0 << (j0 - 48)) | (i1 >> (112 - j0)); + } + } + else + { + /* The number is too large. It is left implementation defined + what happens. */ + return (long int) x; + } + + return sx ? -result : result; +} + +weak_alias (__lrintl, lrintl) diff --git a/sysdeps/ieee754/ldbl-128/s_lroundl.c b/sysdeps/ieee754/ldbl-128/s_lroundl.c new file mode 100644 index 0000000000..ea82f4c3f8 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_lroundl.c @@ -0,0 +1,74 @@ +/* Round long double value to long int. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997 and + Jakub Jelinek , 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#include "math_private.h" + + +long int +__lroundl (long double x) +{ + int64_t j0; + u_int64_t i1, i0; + long int result; + int sign; + + GET_LDOUBLE_WORDS64 (i0, i1, x); + j0 = ((i0 >> 48) & 0x7fff) - 0x3fff; + sign = (i0 & 0x8000000000000000ULL) != 0 ? -1 : 1; + i0 &= 0x0000ffffffffffffLL; + i0 |= 0x0001000000000000LL; + + if (j0 < 48) + { + if (j0 < 0) + return j0 < -1 ? 0 : sign; + else + { + i0 += 0x0000800000000000LL >> j0; + result = i0 >> (48 - j0); + } + } + else if (j0 < (int32_t) (8 * sizeof (long int)) - 1) + { + if (j0 >= 112) + result = ((long int) i0 << (j0 - 48)) | (i1 << (j0 - 112)); + else + { + u_int64_t j = i1 + (0x8000000000000000ULL >> (j0 - 48)); + if (j < i1) + ++i0; + + result = ((long int) i0 << (j0 - 48)) | (j >> (112 - j0)); + } + } + else + { + /* The number is too large. It is left implementation defined + what happens. */ + return (long int) x; + } + + return sign * result; +} + +weak_alias (__lroundl, lroundl) diff --git a/sysdeps/ieee754/ldbl-128/s_modfl.c b/sysdeps/ieee754/ldbl-128/s_modfl.c new file mode 100644 index 0000000000..63d66e7114 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_modfl.c @@ -0,0 +1,88 @@ +/* s_modfl.c -- long double version of s_modf.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * modfl(long double x, long double *iptr) + * return fraction part of x, and return x's integral part in *iptr. + * Method: + * Bit twiddling. + * + * Exception: + * No exception. + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +static const long double one = 1.0; +#else +static long double one = 1.0; +#endif + +#ifdef __STDC__ + long double __modfl(long double x, long double *iptr) +#else + long double __modfl(x, iptr) + long double x,*iptr; +#endif +{ + int64_t i0,i1,j0; + u_int64_t i; + GET_LDOUBLE_WORDS64(i0,i1,x); + j0 = ((i0>>48)&0x7fff)-0x3fff; /* exponent of x */ + if(j0<48) { /* integer part in high x */ + if(j0<0) { /* |x|<1 */ + /* *iptr = +-0 */ + SET_LDOUBLE_WORDS64(*iptr,i0&0x8000000000000000ULL,0); + return x; + } else { + i = (0x0000ffffffffffffLL)>>j0; + if(((i0&i)|i1)==0) { /* x is integral */ + *iptr = x; + /* return +-0 */ + SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0); + return x; + } else { + SET_LDOUBLE_WORDS64(*iptr,i0&(~i),0); + return x - *iptr; + } + } + } else if (j0>111) { /* no fraction part */ + *iptr = x*one; + /* We must handle NaNs separately. */ + if (j0 == 0x4000 && ((i0 & 0x0000ffffffffffffLL) | i1)) + return x*one; + /* return +-0 */ + SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0); + return x; + } else { /* fraction part in low x */ + i = -1ULL>>(j0-48); + if((i1&i)==0) { /* x is integral */ + *iptr = x; + /* return +-0 */ + SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0); + return x; + } else { + SET_LDOUBLE_WORDS64(*iptr,i0,i1&(~i)); + return x - *iptr; + } + } +} +weak_alias (__modfl, modfl) diff --git a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c new file mode 100644 index 0000000000..bea3183d39 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c @@ -0,0 +1,93 @@ +/* s_nearbyintl.c -- long double version of s_nearbyint.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * nearbyintl(x) + * Return x rounded to integral value according to the prevailing + * rounding mode. + * Method: + * Using floating addition. + * Exception: + * Inexact flag raised if x not equal to rintl(x). + */ + +#include +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +static const long double +#else +static long double +#endif +TWO112[2]={ + 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */ + -5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */ +}; + +#ifdef __STDC__ + long double __nearbyintl(long double x) +#else + long double __nearbyintl(x) + long double x; +#endif +{ + fenv_t env; + int64_t i0,j0,sx; + u_int64_t i,i1; + long double w,t; + GET_LDOUBLE_WORDS64(i0,i1,x); + sx = (((u_int64_t)i0)>>63); + j0 = ((i0>>48)&0x7fff)-0x3fff; + if(j0<48) { + if(j0<0) { + if(((i0&0x7fffffffffffffffLL)|i1)==0) return x; + i1 |= (i0&0x0000ffffffffffffLL); + i0 &= 0xffffe00000000000ULL; + i0 |= ((i1|-i1)>>16)&0x0000800000000000LL; + SET_LDOUBLE_MSW64(x,i0); + feholdexcept (&env); + w = TWO112[sx]+x; + t = w-TWO112[sx]; + fesetenv (&env); + GET_LDOUBLE_MSW64(i0,t); + SET_LDOUBLE_MSW64(t,(i0&0x7fffffffffffffffLL)|(sx<<63)); + return t; + } else { + i = (0x0000ffffffffffffLL)>>j0; + if(((i0&i)|i1)==0) return x; /* x is integral */ + i>>=1; + if(((i0&i)|i1)!=0) { + if(j0==47) i1 = 0x4000000000000000ULL; else + i0 = (i0&(~i))|((0x0000200000000000LL)>>j0); + } + } + } else if (j0>111) { + if(j0==0x4000) return x+x; /* inf or NaN */ + else return x; /* x is integral */ + } else { + i = -1ULL>>(j0-48); + if((i1&i)==0) return x; /* x is integral */ + i>>=1; + if((i1&i)!=0) i1 = (i1&(~i))|((0x4000000000000000LL)>>(j0-48)); + } + SET_LDOUBLE_WORDS64(x,i0,i1); + feholdexcept (&env); + w = TWO112[sx]+x; + t = w-TWO112[sx]; + fesetenv (&env); + return t; +} +weak_alias (__nearbyintl, nearbyintl) diff --git a/sysdeps/ieee754/ldbl-128/s_nextafterl.c b/sysdeps/ieee754/ldbl-128/s_nextafterl.c new file mode 100644 index 0000000000..d3df668178 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_nextafterl.c @@ -0,0 +1,85 @@ +/* s_nextafterl.c -- long double version of s_nextafter.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* IEEE functions + * nextafterl(x,y) + * return the next machine floating-point number of x in the + * direction toward y. + * Special cases: + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + long double __nextafterl(long double x, long double y) +#else + long double __nextafterl(x,y) + long double x,y; +#endif +{ + int64_t hx,hy,ix,iy; + u_int64_t lx,ly; + + GET_LDOUBLE_WORDS64(hx,lx,x); + GET_LDOUBLE_WORDS64(hy,ly,y); + ix = hx&0x7fffffffffffffffLL; /* |x| */ + iy = hy&0x7fffffffffffffffLL; /* |y| */ + + if(((ix>=0x7fff000000000000LL)&&((ix-0x7fff000000000000LL)|lx)!=0) || /* x is nan */ + ((iy>=0x7fff000000000000LL)&&((iy-0x7fff000000000000LL)|ly)!=0)) /* y is nan */ + return x+y; + if(x==y) return y; /* x=y, return y */ + if((ix|lx)==0) { /* x == 0 */ + SET_LDOUBLE_WORDS64(x,hy&0x8000000000000000ULL,1);/* return +-minsubnormal */ + y = x*x; + if(y==x) return y; else return x; /* raise underflow flag */ + } + if(hx>=0) { /* x > 0 */ + if(hx>hy||((hx==hy)&&(lx>ly))) { /* x > y, x -= ulp */ + if(lx==0) hx--; + lx--; + } else { /* x < y, x += ulp */ + lx++; + if(lx==0) hx++; + } + } else { /* x < 0 */ + if(hy>=0||hx>hy||((hx==hy)&&(lx>ly))){/* x < y, x -= ulp */ + if(lx==0) hx--; + lx--; + } else { /* x > y, x += ulp */ + lx++; + if(lx==0) hx++; + } + } + hy = hx&0x7fff000000000000LL; + if(hy==0x7fff000000000000LL) return x+x;/* overflow */ + if(hy==0) { /* underflow */ + y = x*x; + if(y!=x) { /* raise underflow flag */ + SET_LDOUBLE_WORDS64(y,hx,lx); + return y; + } + } + SET_LDOUBLE_WORDS64(x,hx,lx); + return x; +} +weak_alias (__nextafterl, nextafterl) +strong_alias (__nextafterl, __nexttowardl) +weak_alias (__nextafterl, nexttowardl) diff --git a/sysdeps/ieee754/ldbl-128/s_nexttoward.c b/sysdeps/ieee754/ldbl-128/s_nexttoward.c new file mode 100644 index 0000000000..f121be2fac --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_nexttoward.c @@ -0,0 +1,97 @@ +/* s_nexttoward.c + * Conversion from s_nextafter.c by Ulrich Drepper, Cygnus Support, + * drepper@cygnus.com and Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* IEEE functions + * nexttoward(x,y) + * return the next machine floating-point number of x in the + * direction toward y. + * Special cases: + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + double __nexttoward(double x, long double y) +#else + double __nexttoward(x,y) + double x; + long double y; +#endif +{ + int32_t hx,ix; + int64_t hy,iy; + u_int32_t lx; + u_int64_t ly; + + EXTRACT_WORDS(hx,lx,x); + GET_LDOUBLE_WORDS64(hy,ly,y); + ix = hx&0x7fffffff; /* |x| */ + iy = hy&0x7fffffffffffffffLL; /* |y| */ + + if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || /* x is nan */ + ((iy>=0x7fff000000000000LL)&&((iy-0x7fff000000000000LL)|ly)!=0)) + /* y is nan */ + return x+y; + if((long double) x==y) return x; /* x=y, return x */ + if((ix|lx)==0) { /* x == 0 */ + double x2; + INSERT_WORDS(x,(u_int32_t)((hy>>32)&0x80000000),1);/* return +-minsub */ + x2 = x*x; + if(x2==x) return x2; else return x; /* raise underflow flag */ + } + if(hx>=0) { /* x > 0 */ + if (hy<0||(ix>>20)>(iy>>48)-0x3c00 + || ((ix>>20)==(iy>>48)-0x3c00 + && (((((int64_t)hx)<<28)|(lx>>4))>(hy&0x0000ffffffffffffLL) + || (((((int64_t)hx)<<28)|(lx>>4))==(hy&0x0000ffffffffffffLL) + && (lx&0xf)>(ly>>60))))) { /* x > y, x -= ulp */ + if(lx==0) hx -= 1; + lx -= 1; + } else { /* x < y, x += ulp */ + lx += 1; + if(lx==0) hx += 1; + } + } else { /* x < 0 */ + if (hy>=0||(ix>>20)>(iy>>48)-0x3c00 + || ((ix>>20)==(iy>>48)-0x3c00 + && (((((int64_t)hx)<<28)|(lx>>4))>(hy&0x0000ffffffffffffLL) + || (((((int64_t)hx)<<28)|(lx>>4))==(hy&0x0000ffffffffffffLL) + && (lx&0xf)>(ly>>60))))) { /* x < y, x -= ulp */ + if(lx==0) hx -= 1; + lx -= 1; + } else { /* x > y, x += ulp */ + lx += 1; + if(lx==0) hx += 1; + } + } + hy = hx&0x7ff00000; + if(hy>=0x7ff00000) return x+x; /* overflow */ + if(hy<0x00100000) { /* underflow */ + double x2 = x*x; + if(x2!=x) { /* raise underflow flag */ + INSERT_WORDS(x2,hx,lx); + return x2; + } + } + INSERT_WORDS(x,hx,lx); + return x; +} +weak_alias (__nexttoward, nexttoward) diff --git a/sysdeps/ieee754/ldbl-128/s_nexttowardf.c b/sysdeps/ieee754/ldbl-128/s_nexttowardf.c new file mode 100644 index 0000000000..1a22e0102c --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_nexttowardf.c @@ -0,0 +1,81 @@ +/* s_nexttowardf.c -- float version of s_nextafter.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com + * and Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + float __nexttowardf(float x, long double y) +#else + float __nexttowardf(x,y) + float x; + long double y; +#endif +{ + int32_t hx,ix; + int64_t hy,iy; + u_int64_t ly; + + GET_FLOAT_WORD(hx,x); + GET_LDOUBLE_WORDS64(hy,ly,y); + ix = hx&0x7fffffff; /* |x| */ + iy = hy&0x7fffffffffffffffLL; /* |y| */ + + if((ix>0x7f800000) || /* x is nan */ + ((iy>=0x7fff000000000000LL)&&((iy-0x7fff000000000000LL)|ly)!=0)) + /* y is nan */ + return x+y; + if((long double) x==y) return y; /* x=y, return y */ + if(ix==0) { /* x == 0 */ + float x2; + SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/ + x2 = x*x; + if(x2==x) return x2; else return x; /* raise underflow flag */ + } + if(hx>=0) { /* x > 0 */ + if(hy<0||(ix>>23)>(iy>>48)-0x3f80 + || ((ix>>23)==(iy>>48)-0x3f80 + && (ix&0x7fffff)>((hy>>25)&0x7fffff))) {/* x > y, x -= ulp */ + hx -= 1; + } else { /* x < y, x += ulp */ + hx += 1; + } + } else { /* x < 0 */ + if(hy>=0||(ix>>23)>(iy>>48)-0x3f80 + || ((ix>>23)==(iy>>48)-0x3f80 + && (ix&0x7fffff)>((hy>>25)&0x7fffff))) {/* x < y, x -= ulp */ + hx -= 1; + } else { /* x > y, x += ulp */ + hx += 1; + } + } + hy = hx&0x7f800000; + if(hy>=0x7f800000) return x+x; /* overflow */ + if(hy<0x00800000) { /* underflow */ + float x2 = x*x; + if(x2!=x) { /* raise underflow flag */ + SET_FLOAT_WORD(x2,hx); + return x2; + } + } + SET_FLOAT_WORD(x,hx); + return x; +} +weak_alias (__nexttowardf, nexttowardf) diff --git a/sysdeps/ieee754/ldbl-128/s_remquol.c b/sysdeps/ieee754/ldbl-128/s_remquol.c new file mode 100644 index 0000000000..0d2695844b --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_remquol.c @@ -0,0 +1,110 @@ +/* Compute remainder and a congruent to the quotient. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997 and + Jakub Jelinek , 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#include "math_private.h" + + +static const long double zero = 0.0; + + +long double +__remquol (long double x, long double y, int *quo) +{ + int64_t hx,hy; + u_int64_t sx,lx,ly; + int cquo,qs; + + GET_LDOUBLE_WORDS64 (hx, lx, x); + GET_LDOUBLE_WORDS64 (hy, ly, y); + sx = hx & 0x8000000000000000ULL; + qs = sx ^ (hy & 0x8000000000000000ULL); + hy &= 0x7fffffffffffffffLL; + hx &= 0x7fffffffffffffffLL; + + /* Purge off exception values. */ + if ((hy | ly) == 0) + return (x * y) / (x * y); /* y = 0 */ + if ((hx >= 0x7fff000000000000LL) /* x not finite */ + || ((hy >= 0x7fff000000000000LL) /* y is NaN */ + && (((hy - 0x7fff000000000000LL) | ly) != 0))) + return (x * y) / (x * y); + + if (hy <= 0x7ffbffffffffffffLL) + x = __ieee754_fmodl (x, 8 * y); /* now x < 8y */ + + if (((hx - hy) | (lx - ly)) == 0) + { + *quo = qs ? -1 : 1; + return zero * x; + } + + x = fabsl (x); + y = fabsl (y); + cquo = 0; + + if (x >= 4 * y) + { + x -= 4 * y; + cquo += 4; + } + if (x >= 2 * y) + { + x -= 2 * y; + cquo += 2; + } + + if (hy < 0x0002000000000000LL) + { + if (x + x > y) + { + x -= y; + ++cquo; + if (x + x >= y) + { + x -= y; + ++cquo; + } + } + } + else + { + long double y_half = 0.5L * y; + if (x > y_half) + { + x -= y; + ++cquo; + if (x >= y_half) + { + x -= y; + ++cquo; + } + } + } + + *quo = qs ? -cquo : cquo; + + if (sx) + x = -x; + return x; +} +weak_alias (__remquol, remquol) diff --git a/sysdeps/ieee754/ldbl-128/s_rintl.c b/sysdeps/ieee754/ldbl-128/s_rintl.c new file mode 100644 index 0000000000..c3fc3ba193 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_rintl.c @@ -0,0 +1,90 @@ +/* s_rintl.c -- long double version of s_rint.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * rintl(x) + * Return x rounded to integral value according to the prevailing + * rounding mode. + * Method: + * Using floating addition. + * Exception: + * Inexact flag raised if x not equal to rintl(x). + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +static const long double +#else +static long double +#endif +TWO112[2]={ + 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */ + -5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */ +}; + +#ifdef __STDC__ + long double __rintl(long double x) +#else + long double __rintl(x) + long double x; +#endif +{ + int64_t i0,j0,sx; + u_int64_t i,i1; + long double w,t; + GET_LDOUBLE_WORDS64(i0,i1,x); + sx = (((u_int64_t)i0)>>63); + j0 = ((i0>>48)&0x7fff)-0x3fff; + if(j0<48) { + if(j0<0) { + if(((i0&0x7fffffffffffffffLL)|i1)==0) return x; + i1 |= (i0&0x0000ffffffffffffLL); + i0 &= 0xffffe00000000000ULL; + i0 |= ((i1|-i1)>>16)&0x0000800000000000LL; + SET_LDOUBLE_MSW64(x,i0); + w = TWO112[sx]+x; + t = w-TWO112[sx]; + GET_LDOUBLE_MSW64(i0,t); + SET_LDOUBLE_MSW64(t,(i0&0x7fffffffffffffffLL)|(sx<<63)); + return t; + } else { + i = (0x0000ffffffffffffLL)>>j0; + if(((i0&i)|i1)==0) return x; /* x is integral */ + i>>=1; + if(((i0&i)|i1)!=0) { + if(j0==47) i1 = 0x4000000000000000ULL; else + i0 = (i0&(~i))|((0x0000200000000000LL)>>j0); + } + } + } else if (j0>111) { + if(j0==0x4000) return x+x; /* inf or NaN */ + else return x; /* x is integral */ + } else { + i = -1ULL>>(j0-48); + if((i1&i)==0) return x; /* x is integral */ + i>>=1; + if((i1&i)!=0) i1 = (i1&(~i))|((0x4000000000000000LL)>>(j0-48)); + } + SET_LDOUBLE_WORDS64(x,i0,i1); + w = TWO112[sx]+x; + return w-TWO112[sx]; +} +weak_alias (__rintl, rintl) diff --git a/sysdeps/ieee754/ldbl-128/s_roundl.c b/sysdeps/ieee754/ldbl-128/s_roundl.c new file mode 100644 index 0000000000..f9fff48f6c --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_roundl.c @@ -0,0 +1,94 @@ +/* Round long double to integer away from zero. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997 and + Jakub Jelinek , 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#include "math_private.h" + + +static const long double huge = 1.0E4930L; + + +long double +__roundl (long double x) +{ + int32_t j0; + u_int64_t se, i1, i0; + + GET_LDOUBLE_WORDS64 (i0, i1, x); + j0 = ((i0 >> 48) & 0x7fff) - 0x3fff; + if (j0 < 31) + { + if (j0 < 0) + { + if (huge + x > 0.0) + { + i0 &= 0x8000000000000000ULL; + if (j0 == -1) + i0 |= 0x3fff000000000000LL; + i1 = 0; + } + } + else + { + u_int64_t i = 0x0000ffffffffffffLL >> j0; + if (((i0 & i) | i1) == 0) + /* X is integral. */ + return x; + if (huge + x > 0.0) + { + /* Raise inexact if x != 0. */ + i0 += 0x0000800000000000LL >> j0; + i0 &= ~i; + i1 = 0; + } + } + } + else if (j0 > 111) + { + if (j0 == 0x4000) + /* Inf or NaN. */ + return x + x; + else + return x; + } + else + { + u_int64_t i = -1ULL >> (j0 - 48); + if ((i1 & i) == 0) + /* X is integral. */ + return x; + + if (huge + x > 0.0) + { + /* Raise inexact if x != 0. */ + u_int64_t j = i1 + (1LL << (111 - j0)); + if (j < i1) + i0 += 1; + i1 = j; + } + i1 &= ~i; + } + + SET_LDOUBLE_WORDS64 (x, i0, i1); + return x; +} +weak_alias (__roundl, roundl) diff --git a/sysdeps/ieee754/ldbl-128/s_scalblnl.c b/sysdeps/ieee754/ldbl-128/s_scalblnl.c new file mode 100644 index 0000000000..5e8b58b733 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_scalblnl.c @@ -0,0 +1,70 @@ +/* s_scalblnl.c -- long double version of s_scalbn.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* @(#)s_scalbn.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * scalblnl (long double x, long int n) + * scalblnl(x,n) returns x* 2**n computed by exponent + * manipulation rather than by actually performing an + * exponentiation or a multiplication. + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +static const long double +#else +static long double +#endif +two114 = 2.0769187434139310514121985316880384E+34L, /* 0x4071000000000000, 0 */ +twom114 = 4.8148248609680896326399448564623183E-35L, /* 0x3F8D000000000000, 0 */ +huge = 1.0E+4900L, +tiny = 1.0E-4900L; + +#ifdef __STDC__ + long double __scalblnl (long double x, long int n) +#else + long double __scalblnl (x,n) + long double x; long int n; +#endif +{ + int64_t k,hx,lx; + GET_LDOUBLE_WORDS64(hx,lx,x); + k = (hx>>48)&0x7fff; /* extract exponent */ + if (k==0) { /* 0 or subnormal x */ + if ((lx|(hx&0x7fffffffffffffffULL))==0) return x; /* +-0 */ + x *= two114; + GET_LDOUBLE_MSW64(hx,x); + k = ((hx>>48)&0x7fff) - 114; + } + if (k==0x7fff) return x+x; /* NaN or Inf */ + k = k+n; + if (n> 50000 || k > 0x7ffe) + return huge*__copysignl(huge,x); /* overflow */ + if (n< -50000) return tiny*__copysignl(tiny,x); /*underflow*/ + if (k > 0) /* normal result */ + {SET_LDOUBLE_MSW64(x,(hx&0x8000ffffffffffffULL)|(k<<48)); return x;} + if (k <= -114) + return tiny*__copysignl(tiny,x); /*underflow*/ + k += 114; /* subnormal result */ + SET_LDOUBLE_MSW64(x,(hx&0x8000ffffffffffffULL)|(k<<48)); + return x*twom114; +} +weak_alias (__scalblnl, scalblnl) diff --git a/sysdeps/ieee754/ldbl-128/s_scalbnl.c b/sysdeps/ieee754/ldbl-128/s_scalbnl.c new file mode 100644 index 0000000000..c54f064c0c --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_scalbnl.c @@ -0,0 +1,70 @@ +/* s_scalbnl.c -- long double version of s_scalbn.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* @(#)s_scalbn.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * scalbnl (long double x, int n) + * scalbnl(x,n) returns x* 2**n computed by exponent + * manipulation rather than by actually performing an + * exponentiation or a multiplication. + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +static const long double +#else +static long double +#endif +two114 = 2.0769187434139310514121985316880384E+34L, /* 0x4071000000000000, 0 */ +twom114 = 4.8148248609680896326399448564623183E-35L, /* 0x3F8D000000000000, 0 */ +huge = 1.0E+4900L, +tiny = 1.0E-4900L; + +#ifdef __STDC__ + long double __scalbnl (long double x, int n) +#else + long double __scalbnl (x,n) + long double x; int n; +#endif +{ + int64_t k,hx,lx; + GET_LDOUBLE_WORDS64(hx,lx,x); + k = (hx>>48)&0x7fff; /* extract exponent */ + if (k==0) { /* 0 or subnormal x */ + if ((lx|(hx&0x7fffffffffffffffULL))==0) return x; /* +-0 */ + x *= two114; + GET_LDOUBLE_MSW64(hx,x); + k = ((hx>>48)&0x7fff) - 114; + } + if (k==0x7fff) return x+x; /* NaN or Inf */ + k = k+n; + if (n> 50000 || k > 0x7ffe) + return huge*__copysignl(huge,x); /* overflow */ + if (n< -50000) return tiny*__copysignl(tiny,x); /*underflow*/ + if (k > 0) /* normal result */ + {SET_LDOUBLE_MSW64(x,(hx&0x8000ffffffffffffULL)|(k<<48)); return x;} + if (k <= -114) + return tiny*__copysignl(tiny,x); /*underflow*/ + k += 114; /* subnormal result */ + SET_LDOUBLE_MSW64(x,(hx&0x8000ffffffffffffULL)|(k<<48)); + return x*twom114; +} +weak_alias (__scalbnl, scalbnl) diff --git a/sysdeps/ieee754/ldbl-128/s_signbitl.c b/sysdeps/ieee754/ldbl-128/s_signbitl.c new file mode 100644 index 0000000000..52a0afbe6a --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_signbitl.c @@ -0,0 +1,32 @@ +/* Return nonzero value if number is negative. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#include "math_private.h" + +int +__signbitl (long double x) +{ + int64_t e; + + GET_LDOUBLE_MSW64 (e, x); + return e < 0; +} diff --git a/sysdeps/ieee754/ldbl-128/s_sincosl.c b/sysdeps/ieee754/ldbl-128/s_sincosl.c new file mode 100644 index 0000000000..2d74e72a50 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_sincosl.c @@ -0,0 +1,77 @@ +/* Compute sine and cosine of argument. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997 and + Jakub Jelinek . + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#include "math_private.h" + +/* Note: We should probably introduce __kernel_sincosl to speed things up, + because __kernel_{cos,sin}l sometimes compute both sine and cosine. */ + +void +__sincosl (long double x, long double *sinx, long double *cosx) +{ + int64_t ix; + + /* High word of x. */ + GET_LDOUBLE_MSW64 (ix, x); + + /* |x| ~< pi/4 */ + ix &= 0x7fffffffffffffffLL; + if (ix <= 0x3ffe921fb54442d1LL) + { + *sinx = __kernel_sinl (x, 0.0, 0); + *cosx = __kernel_cosl (x, 0.0); + } + else if (ix >= 0x7fff000000000000LL) + { + /* sin(Inf or NaN) is NaN */ + *sinx = *cosx = x - x; + } + else + { + /* Argument reduction needed. */ + long double y[2]; + int n; + + n = __ieee754_rem_pio2l (x, y); + switch (n & 3) + { + case 0: + *sinx = __kernel_sinl (y[0], y[1], 1); + *cosx = __kernel_cosl (y[0], y[1]); + break; + case 1: + *sinx = __kernel_cosl (y[0], y[1]); + *cosx = -__kernel_sinl (y[0], y[1], 1); + break; + case 2: + *sinx = -__kernel_sinl (y[0], y[1], 1); + *cosx = -__kernel_cosl (y[0], y[1]); + break; + default: + *sinx = -__kernel_cosl (y[0], y[1]); + *cosx = __kernel_sinl (y[0], y[1], 1); + break; + } + } +} +weak_alias (__sincosl, sincosl) diff --git a/sysdeps/ieee754/ldbl-128/s_sinl.c b/sysdeps/ieee754/ldbl-128/s_sinl.c new file mode 100644 index 0000000000..446a75f126 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_sinl.c @@ -0,0 +1,83 @@ +/* s_sinl.c -- long double version of s_sin.c. + * Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* sinl(x) + * Return sine function of x. + * + * kernel function: + * __kernel_sinl ... sine function on [-pi/4,pi/4] + * __kernel_cosl ... cose function on [-pi/4,pi/4] + * __ieee754_rem_pio2l ... argument reduction routine + * + * Method. + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * in [-pi/4 , +pi/4], and let n = k mod 4. + * We have + * + * n sin(x) cos(x) tan(x) + * ---------------------------------------------------------- + * 0 S C T + * 1 C -S -1/T + * 2 -S -C T + * 3 -C S -1/T + * ---------------------------------------------------------- + * + * Special cases: + * Let trig be any of sin, cos, or tan. + * trig(+-INF) is NaN, with signals; + * trig(NaN) is that NaN; + * + * Accuracy: + * TRIG(x) returns trig(x) nearly rounded + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + long double __sinl(long double x) +#else + long double __sinl(x) + long double x; +#endif +{ + long double y[2],z=0.0L; + int64_t n, ix; + + /* High word of x. */ + GET_LDOUBLE_MSW64(ix,x); + + /* |x| ~< pi/4 */ + ix &= 0x7fffffffffffffffLL; + if(ix <= 0x3ffe921fb54442d1LL) + return __kernel_sinl(x,z,0); + + /* sin(Inf or NaN) is NaN */ + else if (ix>=0x7fff000000000000LL) return x-x; + + /* argument reduction needed */ + else { + n = __ieee754_rem_pio2l(x,y); + switch(n&3) { + case 0: return __kernel_sinl(y[0],y[1],1); + case 1: return __kernel_cosl(y[0],y[1]); + case 2: return -__kernel_sinl(y[0],y[1],1); + default: + return -__kernel_cosl(y[0],y[1]); + } + } +} +weak_alias (__sinl, sinl) diff --git a/sysdeps/ieee754/ldbl-128/s_tanl.c b/sysdeps/ieee754/ldbl-128/s_tanl.c new file mode 100644 index 0000000000..ea9d053d9b --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_tanl.c @@ -0,0 +1,77 @@ +/* s_tanl.c -- long double version of s_tan.c. + * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. + */ + +/* @(#)s_tan.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* tanl(x) + * Return tangent function of x. + * + * kernel function: + * __kernel_tanl ... tangent function on [-pi/4,pi/4] + * __ieee754_rem_pio2l ... argument reduction routine + * + * Method. + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * in [-pi/4 , +pi/4], and let n = k mod 4. + * We have + * + * n sin(x) cos(x) tan(x) + * ---------------------------------------------------------- + * 0 S C T + * 1 C -S -1/T + * 2 -S -C T + * 3 -C S -1/T + * ---------------------------------------------------------- + * + * Special cases: + * Let trig be any of sin, cos, or tan. + * trig(+-INF) is NaN, with signals; + * trig(NaN) is that NaN; + * + * Accuracy: + * TRIG(x) returns trig(x) nearly rounded + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + long double __tanl(long double x) +#else + long double __tanl(x) + long double x; +#endif +{ + long double y[2],z=0.0L; + int64_t n, ix; + + /* High word of x. */ + GET_LDOUBLE_MSW64(ix,x); + + /* |x| ~< pi/4 */ + ix &= 0x7fffffffffffffffLL; + if(ix <= 0x3ffe921fb54442d1LL) return __kernel_tanl(x,z,1); + + /* tanl(Inf or NaN) is NaN */ + else if (ix>=0x7fff000000000000LL) return x-x; /* NaN */ + + /* argument reduction needed */ + else { + n = __ieee754_rem_pio2l(x,y); + return __kernel_tanl(y[0],y[1],1-((n&1)<<1)); /* 1 -- n even + -1 -- n odd */ + } +} +weak_alias (__tanl, tanl) diff --git a/sysdeps/ieee754/ldbl-128/s_truncl.c b/sysdeps/ieee754/ldbl-128/s_truncl.c new file mode 100644 index 0000000000..bbff5a42cf --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_truncl.c @@ -0,0 +1,57 @@ +/* Truncate argument to nearest integral value not larger than the argument. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997 and + Jakub Jelinek , 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#include "math_private.h" + + +long double +__truncl (long double x) +{ + int32_t j0; + u_int64_t i0, i1, sx; + + GET_LDOUBLE_WORDS64 (i0, i1, x); + sx = i0 & 0x8000000000000000ULL; + j0 = ((i0 >> 48) & 0x7fff) - 0x3fff; + if (j0 < 48) + { + if (j0 < 0) + /* The magnitude of the number is < 1 so the result is +-0. */ + SET_LDOUBLE_WORDS64 (x, sx, 0); + else + SET_LDOUBLE_WORDS64 (x, i0 & ~(0x0000ffffffffffffLL >> j0), 0); + } + else if (j0 > 111) + { + if (j0 == 0x4000) + /* x is inf or NaN. */ + return x + x; + } + else + { + SET_LDOUBLE_WORDS64 (x, i0, i1 & ~(0xffffffffffffffffULL >> (j0 - 48))); + } + + return x; +} +weak_alias (__truncl, truncl) diff --git a/sysdeps/ieee754/ldbl-128/strtold.c b/sysdeps/ieee754/ldbl-128/strtold.c new file mode 100644 index 0000000000..32049fc83d --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/strtold.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1999 Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +/* The actual implementation for all floating point sizes is in strtod.c. + These macros tell it to produce the `long double' version, `strtold'. */ + +# define FLOAT long double +# define FLT LDBL +# ifdef USE_IN_EXTENDED_LOCALE_MODEL +# define STRTOF __strtold_l +# else +# define STRTOF strtold +# endif +# define MPN2FLOAT __mpn_construct_long_double +# define FLOAT_HUGE_VAL HUGE_VALL +# define SET_MANTISSA(flt, mant) \ + do { union ieee854_long_double u; \ + u.d = (flt); \ + u.ieee.mantissa0 = 0x8000; \ + u.ieee.mantissa1 = 0; \ + u.ieee.mantissa2 = ((mant) >> 32); \ + u.ieee.mantissa3 = (mant) & 0xffffffff; \ + (flt) = u.d; \ + } while (0) + +# include "strtod.c" diff --git a/sysdeps/libm-ieee754/e_acoshl.c b/sysdeps/ieee754/ldbl-96/e_acoshl.c similarity index 100% rename from sysdeps/libm-ieee754/e_acoshl.c rename to sysdeps/ieee754/ldbl-96/e_acoshl.c diff --git a/sysdeps/libm-ieee754/e_atan2l.c b/sysdeps/ieee754/ldbl-96/e_atan2l.c similarity index 100% rename from sysdeps/libm-ieee754/e_atan2l.c rename to sysdeps/ieee754/ldbl-96/e_atan2l.c diff --git a/sysdeps/libm-ieee754/e_atanhl.c b/sysdeps/ieee754/ldbl-96/e_atanhl.c similarity index 100% rename from sysdeps/libm-ieee754/e_atanhl.c rename to sysdeps/ieee754/ldbl-96/e_atanhl.c diff --git a/sysdeps/libm-ieee754/e_coshl.c b/sysdeps/ieee754/ldbl-96/e_coshl.c similarity index 100% rename from sysdeps/libm-ieee754/e_coshl.c rename to sysdeps/ieee754/ldbl-96/e_coshl.c diff --git a/sysdeps/libm-ieee754/e_gammal_r.c b/sysdeps/ieee754/ldbl-96/e_gammal_r.c similarity index 100% rename from sysdeps/libm-ieee754/e_gammal_r.c rename to sysdeps/ieee754/ldbl-96/e_gammal_r.c diff --git a/sysdeps/libm-ieee754/e_hypotl.c b/sysdeps/ieee754/ldbl-96/e_hypotl.c similarity index 100% rename from sysdeps/libm-ieee754/e_hypotl.c rename to sysdeps/ieee754/ldbl-96/e_hypotl.c diff --git a/sysdeps/libm-ieee754/e_remainderl.c b/sysdeps/ieee754/ldbl-96/e_remainderl.c similarity index 100% rename from sysdeps/libm-ieee754/e_remainderl.c rename to sysdeps/ieee754/ldbl-96/e_remainderl.c diff --git a/sysdeps/libm-ieee754/e_sinhl.c b/sysdeps/ieee754/ldbl-96/e_sinhl.c similarity index 100% rename from sysdeps/libm-ieee754/e_sinhl.c rename to sysdeps/ieee754/ldbl-96/e_sinhl.c diff --git a/sysdeps/ieee754/ldbl2mpn.c b/sysdeps/ieee754/ldbl-96/ldbl2mpn.c similarity index 97% rename from sysdeps/ieee754/ldbl2mpn.c rename to sysdeps/ieee754/ldbl-96/ldbl2mpn.c index e95895c0af..78e0b7097f 100644 --- a/sysdeps/ieee754/ldbl2mpn.c +++ b/sysdeps/ieee754/ldbl-96/ldbl2mpn.c @@ -24,8 +24,6 @@ #include #include -#ifndef __NO_LONG_DOUBLE_MATH - /* Convert a `long double' in IEEE854 standard double-precision format to a multi-precision integer representing the significand scaled up by its number of bits (64 for long double) and an integral power of two @@ -95,5 +93,3 @@ __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size, return N; } - -#endif /* __NO_LONG_DOUBLE_MATH */ diff --git a/sysdeps/ieee754/ldbl-96/math_ldbl.h b/sysdeps/ieee754/ldbl-96/math_ldbl.h new file mode 100644 index 0000000000..dccc4a1240 --- /dev/null +++ b/sysdeps/ieee754/ldbl-96/math_ldbl.h @@ -0,0 +1,98 @@ +#ifndef _MATH_PRIVATE_H_ +#error "Never use directly; include instead." +#endif + +/* A union which permits us to convert between a long double and + three 32 bit ints. */ + +#if __FLOAT_WORD_ORDER == BIG_ENDIAN + +typedef union +{ + long double value; + struct + { + unsigned int sign_exponent:16; + unsigned int empty:16; + u_int32_t msw; + u_int32_t lsw; + } parts; +} ieee_long_double_shape_type; + +#endif + +#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN + +typedef union +{ + long double value; + struct + { + u_int32_t lsw; + u_int32_t msw; + unsigned int sign_exponent:16; + unsigned int empty:16; + } parts; +} ieee_long_double_shape_type; + +#endif + +/* Get three 32 bit ints from a double. */ + +#define GET_LDOUBLE_WORDS(exp,ix0,ix1,d) \ +do { \ + ieee_long_double_shape_type ew_u; \ + ew_u.value = (d); \ + (exp) = ew_u.parts.sign_exponent; \ + (ix0) = ew_u.parts.msw; \ + (ix1) = ew_u.parts.lsw; \ +} while (0) + +/* Set a double from two 32 bit ints. */ + +#define SET_LDOUBLE_WORDS(d,exp,ix0,ix1) \ +do { \ + ieee_long_double_shape_type iw_u; \ + iw_u.parts.sign_exponent = (exp); \ + iw_u.parts.msw = (ix0); \ + iw_u.parts.lsw = (ix1); \ + (d) = iw_u.value; \ +} while (0) + +/* Get the more significant 32 bits of a long double mantissa. */ + +#define GET_LDOUBLE_MSW(v,d) \ +do { \ + ieee_long_double_shape_type sh_u; \ + sh_u.value = (d); \ + (v) = sh_u.parts.msw; \ +} while (0) + +/* Set the more significant 32 bits of a long double mantissa from an int. */ + +#define SET_LDOUBLE_MSW(d,v) \ +do { \ + ieee_long_double_shape_type sh_u; \ + sh_u.value = (d); \ + sh_u.parts.msw = (v); \ + (d) = sh_u.value; \ +} while (0) + +/* Get int from the exponent of a long double. */ + +#define GET_LDOUBLE_EXP(exp,d) \ +do { \ + ieee_long_double_shape_type ge_u; \ + ge_u.value = (d); \ + (exp) = ge_u.parts.sign_exponent; \ +} while (0) + +/* Set exponent of a long double from an int. */ + +#define SET_LDOUBLE_EXP(d,exp) \ +do { \ + ieee_long_double_shape_type se_u; \ + se_u.value = (d); \ + se_u.parts.sign_exponent = (exp); \ + (d) = se_u.value; \ +} while (0) diff --git a/sysdeps/ieee754/mpn2ldbl.c b/sysdeps/ieee754/ldbl-96/mpn2ldbl.c similarity index 96% rename from sysdeps/ieee754/mpn2ldbl.c rename to sysdeps/ieee754/ldbl-96/mpn2ldbl.c index 7802355eba..1f049ba12e 100644 --- a/sysdeps/ieee754/mpn2ldbl.c +++ b/sysdeps/ieee754/ldbl-96/mpn2ldbl.c @@ -22,8 +22,6 @@ #include #include -#ifndef __NO_LONG_DOUBLE_MATH - /* Convert a multi-precision integer of the needed number of bits (64 for long double) and an integral power of two to a `long double' in IEEE854 extended-precision format. */ @@ -47,5 +45,3 @@ __mpn_construct_long_double (mp_srcptr frac_ptr, int expt, int sign) return u.d; } - -#endif /* __NO_LONG_DOUBLE_MATH */ diff --git a/sysdeps/ieee754/ldbl-96/printf_fphex.c b/sysdeps/ieee754/ldbl-96/printf_fphex.c new file mode 100644 index 0000000000..8dfa387df5 --- /dev/null +++ b/sysdeps/ieee754/ldbl-96/printf_fphex.c @@ -0,0 +1,61 @@ +#ifndef LONG_DOUBLE_DENORM_BIAS +# define LONG_DOUBLE_DENORM_BIAS (IEEE854_LONG_DOUBLE_BIAS - 1) +#endif + +#define PRINT_FPHEX_LONG_DOUBLE \ +do { \ + /* The "strange" 80 bit format on ix86 and m68k has an explicit \ + leading digit in the 64 bit mantissa. */ \ + unsigned long long int num; \ + \ + assert (sizeof (long double) == 12); \ + \ + num = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \ + | fpnum.ldbl.ieee.mantissa1); \ + \ + zero_mantissa = num == 0; \ + \ + if (sizeof (unsigned long int) > 6) \ + numstr = _itoa_word (num, numbuf + sizeof numbuf, 16, \ + info->spec == 'A'); \ + else \ + numstr = _itoa (num, numbuf + sizeof numbuf, 16, info->spec == 'A'); \ + \ + /* Fill with zeroes. */ \ + while (numstr > numbuf + (sizeof numbuf - 64 / 4)) \ + *--numstr = '0'; \ + \ + /* We use a full nibble for the leading digit. */ \ + leading = *numstr++; \ + \ + /* We have 3 bits from the mantissa in the leading nibble. \ + Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \ + exponent = fpnum.ldbl.ieee.exponent; \ + \ + if (exponent == 0) \ + { \ + if (zero_mantissa) \ + expnegative = 0; \ + else \ + { \ + /* This is a denormalized number. */ \ + expnegative = 1; \ + /* This is a hook for the m68k long double format, where the \ + exponent bias is the same for normalized and denormalized \ + numbers. */ \ + exponent = LONG_DOUBLE_DENORM_BIAS + 3; \ + } \ + } \ + else if (exponent >= IEEE854_LONG_DOUBLE_BIAS + 3) \ + { \ + expnegative = 0; \ + exponent -= IEEE854_LONG_DOUBLE_BIAS + 3; \ + } \ + else \ + { \ + expnegative = 1; \ + exponent = -(exponent - (IEEE854_LONG_DOUBLE_BIAS + 3)); \ + } \ +} while (0) + +#include diff --git a/sysdeps/libm-ieee754/s_asinhl.c b/sysdeps/ieee754/ldbl-96/s_asinhl.c similarity index 100% rename from sysdeps/libm-ieee754/s_asinhl.c rename to sysdeps/ieee754/ldbl-96/s_asinhl.c diff --git a/sysdeps/libm-ieee754/s_cbrtl.c b/sysdeps/ieee754/ldbl-96/s_cbrtl.c similarity index 100% rename from sysdeps/libm-ieee754/s_cbrtl.c rename to sysdeps/ieee754/ldbl-96/s_cbrtl.c diff --git a/sysdeps/libm-ieee754/s_ceill.c b/sysdeps/ieee754/ldbl-96/s_ceill.c similarity index 100% rename from sysdeps/libm-ieee754/s_ceill.c rename to sysdeps/ieee754/ldbl-96/s_ceill.c diff --git a/sysdeps/libm-ieee754/s_copysignl.c b/sysdeps/ieee754/ldbl-96/s_copysignl.c similarity index 100% rename from sysdeps/libm-ieee754/s_copysignl.c rename to sysdeps/ieee754/ldbl-96/s_copysignl.c diff --git a/sysdeps/libm-ieee754/s_cosl.c b/sysdeps/ieee754/ldbl-96/s_cosl.c similarity index 100% rename from sysdeps/libm-ieee754/s_cosl.c rename to sysdeps/ieee754/ldbl-96/s_cosl.c diff --git a/sysdeps/libm-ieee754/s_fabsl.c b/sysdeps/ieee754/ldbl-96/s_fabsl.c similarity index 100% rename from sysdeps/libm-ieee754/s_fabsl.c rename to sysdeps/ieee754/ldbl-96/s_fabsl.c diff --git a/sysdeps/libm-ieee754/s_finitel.c b/sysdeps/ieee754/ldbl-96/s_finitel.c similarity index 100% rename from sysdeps/libm-ieee754/s_finitel.c rename to sysdeps/ieee754/ldbl-96/s_finitel.c diff --git a/sysdeps/libm-ieee754/s_floorl.c b/sysdeps/ieee754/ldbl-96/s_floorl.c similarity index 100% rename from sysdeps/libm-ieee754/s_floorl.c rename to sysdeps/ieee754/ldbl-96/s_floorl.c diff --git a/sysdeps/libm-ieee754/s_fpclassifyl.c b/sysdeps/ieee754/ldbl-96/s_fpclassifyl.c similarity index 100% rename from sysdeps/libm-ieee754/s_fpclassifyl.c rename to sysdeps/ieee754/ldbl-96/s_fpclassifyl.c diff --git a/sysdeps/libm-ieee754/s_frexpl.c b/sysdeps/ieee754/ldbl-96/s_frexpl.c similarity index 100% rename from sysdeps/libm-ieee754/s_frexpl.c rename to sysdeps/ieee754/ldbl-96/s_frexpl.c diff --git a/sysdeps/libm-ieee754/s_ilogbl.c b/sysdeps/ieee754/ldbl-96/s_ilogbl.c similarity index 100% rename from sysdeps/libm-ieee754/s_ilogbl.c rename to sysdeps/ieee754/ldbl-96/s_ilogbl.c diff --git a/sysdeps/libm-ieee754/s_isinfl.c b/sysdeps/ieee754/ldbl-96/s_isinfl.c similarity index 100% rename from sysdeps/libm-ieee754/s_isinfl.c rename to sysdeps/ieee754/ldbl-96/s_isinfl.c diff --git a/sysdeps/libm-ieee754/s_isnanl.c b/sysdeps/ieee754/ldbl-96/s_isnanl.c similarity index 96% rename from sysdeps/libm-ieee754/s_isnanl.c rename to sysdeps/ieee754/ldbl-96/s_isnanl.c index ba53faa1fd..0a7ff38433 100644 --- a/sysdeps/libm-ieee754/s_isnanl.c +++ b/sysdeps/ieee754/ldbl-96/s_isnanl.c @@ -39,6 +39,6 @@ static char rcsid[] = "$NetBSD: $"; lx |= hx & 0x7fffffff; se |= (u_int32_t)(lx|(-lx))>>31; se = 0xfffe - se; - return (int)((u_int32_t)(se))>>16; + return (int)(((u_int32_t)(se))>>31); } weak_alias (__isnanl, isnanl) diff --git a/sysdeps/libm-ieee754/s_llrintl.c b/sysdeps/ieee754/ldbl-96/s_llrintl.c similarity index 100% rename from sysdeps/libm-ieee754/s_llrintl.c rename to sysdeps/ieee754/ldbl-96/s_llrintl.c diff --git a/sysdeps/libm-ieee754/s_llroundl.c b/sysdeps/ieee754/ldbl-96/s_llroundl.c similarity index 100% rename from sysdeps/libm-ieee754/s_llroundl.c rename to sysdeps/ieee754/ldbl-96/s_llroundl.c diff --git a/sysdeps/libm-ieee754/s_logbl.c b/sysdeps/ieee754/ldbl-96/s_logbl.c similarity index 100% rename from sysdeps/libm-ieee754/s_logbl.c rename to sysdeps/ieee754/ldbl-96/s_logbl.c diff --git a/sysdeps/libm-ieee754/s_lrintl.c b/sysdeps/ieee754/ldbl-96/s_lrintl.c similarity index 100% rename from sysdeps/libm-ieee754/s_lrintl.c rename to sysdeps/ieee754/ldbl-96/s_lrintl.c diff --git a/sysdeps/libm-ieee754/s_lroundl.c b/sysdeps/ieee754/ldbl-96/s_lroundl.c similarity index 100% rename from sysdeps/libm-ieee754/s_lroundl.c rename to sysdeps/ieee754/ldbl-96/s_lroundl.c diff --git a/sysdeps/libm-ieee754/s_modfl.c b/sysdeps/ieee754/ldbl-96/s_modfl.c similarity index 97% rename from sysdeps/libm-ieee754/s_modfl.c rename to sysdeps/ieee754/ldbl-96/s_modfl.c index ad16ef65ec..fb1b3acf30 100644 --- a/sysdeps/libm-ieee754/s_modfl.c +++ b/sysdeps/ieee754/ldbl-96/s_modfl.c @@ -74,7 +74,7 @@ static long double one = 1.0; i = ((u_int32_t)(0xffffffff))>>(j0-32); if((i1&i)==0) { /* x is integral */ *iptr = x; - INSERT_WORDS(x,se&0x8000,0); /* return +-0 */ + SET_LDOUBLE_WORDS(x,se&0x8000,0,0); /* return +-0 */ return x; } else { SET_LDOUBLE_WORDS(*iptr,se,i0,i1&(~i)); diff --git a/sysdeps/libm-ieee754/s_nearbyintl.c b/sysdeps/ieee754/ldbl-96/s_nearbyintl.c similarity index 89% rename from sysdeps/libm-ieee754/s_nearbyintl.c rename to sysdeps/ieee754/ldbl-96/s_nearbyintl.c index 3b0715e5a5..92c3ebf368 100644 --- a/sysdeps/libm-ieee754/s_nearbyintl.c +++ b/sysdeps/ieee754/ldbl-96/s_nearbyintl.c @@ -72,13 +72,8 @@ TWO63[2]={ if(((i0&i)|i1)==0) return x; /* x is integral */ i>>=1; if(((i0&i)|i1)!=0) { - if(j0==31) i1 = 0x40000000; else + if (j0==30) i1 = 0x40000000; else i0 = (i0&(~i))|((0x20000000)>>j0); - /* Shouldn't this be - if (j0 >= 30) i1 = 0x80000000 >> (j0 - 30); - i0 = (i0&(~i))|((0x20000000)>>j0); - If yes, this should be correct in s_rint and - s_rintf, too. -- drepper@cygnus.com */ } } } else if (j0>62) { diff --git a/sysdeps/libm-ieee754/s_nextafterl.c b/sysdeps/ieee754/ldbl-96/s_nextafterl.c similarity index 100% rename from sysdeps/libm-ieee754/s_nextafterl.c rename to sysdeps/ieee754/ldbl-96/s_nextafterl.c diff --git a/sysdeps/libm-ieee754/s_nexttoward.c b/sysdeps/ieee754/ldbl-96/s_nexttoward.c similarity index 93% rename from sysdeps/libm-ieee754/s_nexttoward.c rename to sysdeps/ieee754/ldbl-96/s_nexttoward.c index 0bb57d8465..debbb86a3c 100644 --- a/sysdeps/libm-ieee754/s_nexttoward.c +++ b/sysdeps/ieee754/ldbl-96/s_nexttoward.c @@ -55,8 +55,8 @@ static char rcsid[] = "$NetBSD: $"; if(x2==x) return x2; else return x; /* raise underflow flag */ } if(hx>=0) { /* x > 0 */ - if (esy>=0x8000||((ix>>20)&0x7ff)>iy - || (((ix>>20)&0x7ff)==iy + if (esy>=0x8000||((ix>>20)&0x7ff)>iy-0x3c00 + || (((ix>>20)&0x7ff)==iy-0x3c00 && (((hx<<11)|(lx>>21))>(hy&0x7fffffff) || (((hx<<11)|(lx>>21))==(hy&0x7fffffff) && (lx<<11)>ly)))) { /* x > y, x -= ulp */ @@ -67,8 +67,8 @@ static char rcsid[] = "$NetBSD: $"; if(lx==0) hx += 1; } } else { /* x < 0 */ - if (esy<0x8000||((ix>>20)&0x7ff)>iy - || (((ix>>20)&0x7ff)==iy + if (esy<0x8000||((ix>>20)&0x7ff)>iy-0x3c00 + || (((ix>>20)&0x7ff)==iy-0x3c00 && (((hx<<11)|(lx>>21))>(hy&0x7fffffff) || (((hx<<11)|(lx>>21))==(hy&0x7fffffff) && (lx<<11)>ly)))) {/* x < y, x -= ulp */ diff --git a/sysdeps/libm-ieee754/s_nexttowardf.c b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c similarity index 91% rename from sysdeps/libm-ieee754/s_nexttowardf.c rename to sysdeps/ieee754/ldbl-96/s_nexttowardf.c index 71a28987ec..b7e9f00185 100644 --- a/sysdeps/libm-ieee754/s_nexttowardf.c +++ b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c @@ -47,16 +47,16 @@ static char rcsid[] = "$NetBSD: $"; if(x2==x) return x2; else return x; /* raise underflow flag */ } if(hx>=0) { /* x > 0 */ - if(esy>=0x8000||((ix>>23)&0xff)>iy - || (((ix>>23)&0xff)==iy + if(esy>=0x8000||((ix>>23)&0xff)>iy-0x3f80 + || (((ix>>23)&0xff)==iy-0x3f80 && ((ix&0x7fffff)<<8)>(hy&0x7fffffff))) {/* x > y, x -= ulp */ hx -= 1; } else { /* x < y, x += ulp */ hx += 1; } } else { /* x < 0 */ - if(esy<0x8000||((ix>>23)&0xff)>iy - || (((ix>>23)&0xff)==iy + if(esy<0x8000||((ix>>23)&0xff)>iy-0x3f80 + || (((ix>>23)&0xff)==iy-0x3f80 && ((ix&0x7fffff)<<8)>(hy&0x7fffffff))) {/* x < y, x -= ulp */ hx -= 1; } else { /* x > y, x += ulp */ diff --git a/sysdeps/libm-ieee754/s_remquol.c b/sysdeps/ieee754/ldbl-96/s_remquol.c similarity index 100% rename from sysdeps/libm-ieee754/s_remquol.c rename to sysdeps/ieee754/ldbl-96/s_remquol.c diff --git a/sysdeps/libm-ieee754/s_rintl.c b/sysdeps/ieee754/ldbl-96/s_rintl.c similarity index 89% rename from sysdeps/libm-ieee754/s_rintl.c rename to sysdeps/ieee754/ldbl-96/s_rintl.c index 4e957d8373..9d4777dcc4 100644 --- a/sysdeps/libm-ieee754/s_rintl.c +++ b/sysdeps/ieee754/ldbl-96/s_rintl.c @@ -71,13 +71,8 @@ TWO63[2]={ if(((i0&i)|i1)==0) return x; /* x is integral */ i>>=1; if(((i0&i)|i1)!=0) { - if(j0==31) i1 = 0x40000000; else + if(j0==30) i1 = 0x40000000; else i0 = (i0&(~i))|((0x20000000)>>j0); - /* Shouldn't this be - if (j0 >= 30) i1 = 0x80000000 >> (j0 - 30); - i0 = (i0&(~i))|((0x20000000)>>j0); - If yes, this should be correct in s_rint and - s_rintf, too. -- drepper@cygnus.com */ } } } else if (j0>62) { diff --git a/sysdeps/libm-ieee754/s_roundl.c b/sysdeps/ieee754/ldbl-96/s_roundl.c similarity index 100% rename from sysdeps/libm-ieee754/s_roundl.c rename to sysdeps/ieee754/ldbl-96/s_roundl.c diff --git a/sysdeps/libm-ieee754/s_scalblnl.c b/sysdeps/ieee754/ldbl-96/s_scalblnl.c similarity index 97% rename from sysdeps/libm-ieee754/s_scalblnl.c rename to sysdeps/ieee754/ldbl-96/s_scalblnl.c index b885fbcadb..8e556fabe1 100644 --- a/sysdeps/libm-ieee754/s_scalblnl.c +++ b/sysdeps/ieee754/ldbl-96/s_scalblnl.c @@ -64,7 +64,7 @@ tiny = 1.0e-4900L; {SET_LDOUBLE_EXP(x,(es&0x8000)|k); return x;} if (k <= -63) return tiny*__copysignl(tiny,x); /*underflow*/ - k += 54; /* subnormal result */ + k += 63; /* subnormal result */ SET_LDOUBLE_EXP(x,(es&0x8000)|k); return x*twom63; } diff --git a/sysdeps/libm-ieee754/s_scalbnl.c b/sysdeps/ieee754/ldbl-96/s_scalbnl.c similarity index 97% rename from sysdeps/libm-ieee754/s_scalbnl.c rename to sysdeps/ieee754/ldbl-96/s_scalbnl.c index 32e4fb8cea..34c52e773a 100644 --- a/sysdeps/libm-ieee754/s_scalbnl.c +++ b/sysdeps/ieee754/ldbl-96/s_scalbnl.c @@ -64,7 +64,7 @@ tiny = 1.0e-4900L; {SET_LDOUBLE_EXP(x,(es&0x8000)|k); return x;} if (k <= -63) return tiny*__copysignl(tiny,x); /*underflow*/ - k += 54; /* subnormal result */ + k += 63; /* subnormal result */ SET_LDOUBLE_EXP(x,(es&0x8000)|k); return x*twom63; } diff --git a/sysdeps/libm-ieee754/s_signbitl.c b/sysdeps/ieee754/ldbl-96/s_signbitl.c similarity index 100% rename from sysdeps/libm-ieee754/s_signbitl.c rename to sysdeps/ieee754/ldbl-96/s_signbitl.c diff --git a/sysdeps/libm-ieee754/s_sincosl.c b/sysdeps/ieee754/ldbl-96/s_sincosl.c similarity index 100% rename from sysdeps/libm-ieee754/s_sincosl.c rename to sysdeps/ieee754/ldbl-96/s_sincosl.c diff --git a/sysdeps/libm-ieee754/s_sinl.c b/sysdeps/ieee754/ldbl-96/s_sinl.c similarity index 100% rename from sysdeps/libm-ieee754/s_sinl.c rename to sysdeps/ieee754/ldbl-96/s_sinl.c diff --git a/sysdeps/libm-ieee754/s_tanhl.c b/sysdeps/ieee754/ldbl-96/s_tanhl.c similarity index 100% rename from sysdeps/libm-ieee754/s_tanhl.c rename to sysdeps/ieee754/ldbl-96/s_tanhl.c diff --git a/sysdeps/libm-ieee754/s_tanl.c b/sysdeps/ieee754/ldbl-96/s_tanl.c similarity index 100% rename from sysdeps/libm-ieee754/s_tanl.c rename to sysdeps/ieee754/ldbl-96/s_tanl.c diff --git a/sysdeps/libm-ieee754/s_truncl.c b/sysdeps/ieee754/ldbl-96/s_truncl.c similarity index 100% rename from sysdeps/libm-ieee754/s_truncl.c rename to sysdeps/ieee754/ldbl-96/s_truncl.c diff --git a/sysdeps/ieee754/ldbl-96/strtold.c b/sysdeps/ieee754/ldbl-96/strtold.c new file mode 100644 index 0000000000..cabb787d4e --- /dev/null +++ b/sysdeps/ieee754/ldbl-96/strtold.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1999 Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +/* The actual implementation for all floating point sizes is in strtod.c. + These macros tell it to produce the `long double' version, `strtold'. */ + +# define FLOAT long double +# define FLT LDBL +# ifdef USE_IN_EXTENDED_LOCALE_MODEL +# define STRTOF __strtold_l +# else +# define STRTOF strtold +# endif +# define MPN2FLOAT __mpn_construct_long_double +# define FLOAT_HUGE_VAL HUGE_VALL +# define SET_MANTISSA(flt, mant) \ + do { union ieee854_long_double u; \ + u.d = (flt); \ + if ((mant & 0x7fffffffffffffffULL) == 0) \ + mant = 0x4000000000000000ULL; \ + u.ieee.mantissa0 = (((mant) >> 32) & 0x7fffffff) | 0x80000000; \ + u.ieee.mantissa1 = (mant) & 0xffffffff; \ + (flt) = u.d; \ + } while (0) + +# include "strtod.c" diff --git a/sysdeps/libm-ieee754/w_expl.c b/sysdeps/ieee754/ldbl-96/w_expl.c similarity index 100% rename from sysdeps/libm-ieee754/w_expl.c rename to sysdeps/ieee754/ldbl-96/w_expl.c diff --git a/sysdeps/libm-ieee754/s_lib_version.c b/sysdeps/ieee754/s_lib_version.c similarity index 100% rename from sysdeps/libm-ieee754/s_lib_version.c rename to sysdeps/ieee754/s_lib_version.c diff --git a/sysdeps/libm-ieee754/s_matherr.c b/sysdeps/ieee754/s_matherr.c similarity index 100% rename from sysdeps/libm-ieee754/s_matherr.c rename to sysdeps/ieee754/s_matherr.c diff --git a/sysdeps/libm-ieee754/s_signgam.c b/sysdeps/ieee754/s_signgam.c similarity index 100% rename from sysdeps/libm-ieee754/s_signgam.c rename to sysdeps/ieee754/s_signgam.c diff --git a/sysdeps/m68k/Implies b/sysdeps/m68k/Implies index 09dd873973..b64e753525 100644 --- a/sysdeps/m68k/Implies +++ b/sysdeps/m68k/Implies @@ -1,3 +1,5 @@ wordsize-32 # 68k uses IEEE 754 floating point. -ieee754 +ieee754/flt-32 +ieee754/dbl-64 +ieee754/ldbl-96 diff --git a/sysdeps/m68k/printf_fphex.c b/sysdeps/m68k/printf_fphex.c index 0e68b16b77..d021a090ab 100644 --- a/sysdeps/m68k/printf_fphex.c +++ b/sysdeps/m68k/printf_fphex.c @@ -1,2 +1,2 @@ #define LONG_DOUBLE_DENORM_BIAS IEEE854_LONG_DOUBLE_BIAS -#include +#include diff --git a/sysdeps/m68k/strtold.c b/sysdeps/m68k/strtold.c index dd7fbce195..f756488275 100644 --- a/sysdeps/m68k/strtold.c +++ b/sysdeps/m68k/strtold.c @@ -1,2 +1,2 @@ #define DENORM_EXP (MIN_EXP - 1) -#include +#include diff --git a/sysdeps/mips/Implies b/sysdeps/mips/Implies index 5aeb9ae460..9f60963329 100644 --- a/sysdeps/mips/Implies +++ b/sysdeps/mips/Implies @@ -1,3 +1,4 @@ wordsize-32 # MIPS uses IEEE 754 floating point. -ieee754 +ieee754/flt-32 +ieee754/dbl-64 diff --git a/sysdeps/mips/mips64/Implies b/sysdeps/mips/mips64/Implies index 06b9091f3b..25106df989 100644 --- a/sysdeps/mips/mips64/Implies +++ b/sysdeps/mips/mips64/Implies @@ -1,3 +1,4 @@ wordsize-64 # MIPS uses IEEE 754 floating point. -ieee754 +ieee754/flt-32 +ieee754/dbl-64 diff --git a/sysdeps/powerpc/Implies b/sysdeps/powerpc/Implies index d6acf04a82..780c4e2467 100644 --- a/sysdeps/powerpc/Implies +++ b/sysdeps/powerpc/Implies @@ -1,2 +1,3 @@ wordsize-32 -ieee754 +ieee754/flt-32 +ieee754/dbl-64 diff --git a/sysdeps/sparc/Implies b/sysdeps/sparc/Implies deleted file mode 100644 index da719e1707..0000000000 --- a/sysdeps/sparc/Implies +++ /dev/null @@ -1,2 +0,0 @@ -# SPARC uses IEEE 754 floating point. -ieee754 diff --git a/sysdeps/sparc/fpu/bits/mathdef.h b/sysdeps/sparc/fpu/bits/mathdef.h index c1727b66bb..5294ad4720 100644 --- a/sysdeps/sparc/fpu/bits/mathdef.h +++ b/sysdeps/sparc/fpu/bits/mathdef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,6 +20,8 @@ # error "Never use directly; include instead" #endif +#include + /* FIXME! This file describes properties of the compiler, not the machine; it should not be part of libc! */ @@ -74,7 +76,12 @@ typedef double double_t; #endif /* ISO C 9X */ #ifndef __NO_LONG_DOUBLE_MATH -/* Signal that we do not really have a `long double'. The disables the - declaration of all the `long double' function variants. */ -# define __NO_LONG_DOUBLE_MATH 1 + +# if __WORDSIZE == 32 +/* Signal that in 32bit ABI we do not really have a `long double'. + The disables the declaration of all the `long double' function + variants. */ +# define __NO_LONG_DOUBLE_MATH 1 +# endif + #endif diff --git a/sysdeps/sparc/fpu/bits/mathinline.h b/sysdeps/sparc/fpu/bits/mathinline.h new file mode 100644 index 0000000000..9017be3544 --- /dev/null +++ b/sysdeps/sparc/fpu/bits/mathinline.h @@ -0,0 +1,211 @@ +/* Inline math functions for SPARC. + Copyright (C) 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek . + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +# error "Never use directly; include instead." +#endif + +#include + +#if defined __GNUC__ + +#ifdef __USE_ISOC9X + +#if __WORDSIZE == 32 + +# define __unordered_cmp(x, y) \ + (__extension__ \ + ({ unsigned __r; \ + if (sizeof(x) == 4 && sizeof(y) == 4) \ + { \ + float __x = (x); float __y = (y); \ + __asm__("fcmps %1,%2; st %%fsr, %0" : "=m" (__r) : "f" (__x), \ + "f" (__y) : "cc"); \ + } \ + else \ + { \ + double __x = (x); double __y = (y); \ + __asm__("fcmpd\t%1,%2\n\tst\t%%fsr,%0" : "=m" (__r) : "f" (__x), \ + "f" (__y) : "cc"); \ + } \ + __r; })) + +# define isgreater(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (2 << 10)) +# define isgreaterequal(x, y) ((__unordered_cmp (x, y) & (1 << 10)) == 0) +# define isless(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (1 << 10)) +# define islessequal(x, y) ((__unordered_cmp (x, y) & (2 << 10)) == 0) +# define islessgreater(x, y) (((__unordered_cmp (x, y) + (1 << 10)) & (2 << 10)) != 0) +# define isunordered(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (3 << 10)) + +#else /* sparc64 */ + +# define __unordered_v9cmp(x, y, op, qop) \ + (__extension__ \ + ({ unsigned __r; \ + if (sizeof(x) == 4 && sizeof(y) == 4) \ + { \ + float __x = (x); float __y = (y); \ + __asm__("fcmps\t%%fcc3,%1,%2\n\tmov" ## op ## "\t%%fcc3,1,%0" \ + : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc"); \ + } \ + else if (sizeof(x) <= 8 && sizeof(y) <= 8) \ + { \ + double __x = (x); double __y = (y); \ + __asm__("fcmpd\t%%fcc3,%1,%2\n\tmov" ## op ## "\t%%fcc3,1,%0" \ + : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc"); \ + } \ + else \ + { \ + long double __x = (x); long double __y = (y); \ + extern int _Qp_cmp(const long double *a, const long double *b); \ + __r = qop; \ + } \ + __r; })) + +# define isgreater(x, y) __unordered_v9cmp(x, y, "g", _Qp_cmp (&__x, &__y) == 2) +# define isgreaterequal(x, y) __unordered_v9cmp(x, y, "ge", (_Qp_cmp (&__x, &__y) & 1) == 0) +# define isless(x, y) __unordered_v9cmp(x, y, "l", _Qp_cmp (&__x, &__y) == 1) +# define islessequal(x, y) __unordered_v9cmp(x, y, "le", (_Qp_cmp (&__x, &__y) & 2) == 0) +# define islessgreater(x, y) __unordered_v9cmp(x, y, "lg", ((_Qp_cmp (&__x, &__y) + 1) & 2) != 0) +# define isunordered(x, y) __unordered_v9cmp(x, y, "u", _Qp_cmp (&__x, &__y) == 3) + +#endif /* sparc64 */ + +#endif /* __USE_ISOC9X */ + +#if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) && defined __OPTIMIZE__ + +#ifdef __cplusplus +# define __MATH_INLINE __inline +#else +# define __MATH_INLINE extern __inline +#endif /* __cplusplus */ + +/* The gcc, version 2.7 or below, has problems with all this inlining + code. So disable it for this version of the compiler. */ + +# if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7)) + /* Test for negative number. Used in the signbit() macro. */ +__MATH_INLINE int +__signbitf (float __x) +{ + __extension__ union { float __f; int __i; } __u = { __f: __x }; + return __u.__i < 0; +} + +__MATH_INLINE int +__signbit (double __x) +{ + __extension__ union { double __d; int __i[2]; } __u = { __d: __x }; + return __u.__i[0] < 0; +} + +__MATH_INLINE int +__signbitl (long double __x) +{ + if (sizeof(long double) == 8) + { + __extension__ union { long double __l; int __i[2]; } __u = { __l: __x }; + return __u.__i[0] < 0; + } + else + { + __extension__ union { long double __l; int __i[4]; } __u = { __l: __x }; + return __u.__i[0] < 0; + } +} + +__MATH_INLINE double +sqrt(double __x) +{ + register double __r; + __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x)); + return __r; +} + +__MATH_INLINE float +sqrtf(float __x) +{ + register float __r; + __asm ("fsqrts %1,%0" : "=f" (__r) : "f" (__x)); + return __r; +} + +#if __WORDSIZE == 64 +__MATH_INLINE long double +sqrtl(long double __x) +{ + long double __r; + extern void _Qp_sqrt(long double *, __const__ long double *); + _Qp_sqrt(&__r, &__x); + return __r; +} +#endif /* sparc64 */ + +/* This code is used internally in the GNU libc. */ +#ifdef __LIBC_INTERNAL_MATH_INLINES +__MATH_INLINE double +__ieee754_sqrt(double __x) +{ + register double __r; + __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x)); + return __r; +} + +__MATH_INLINE float +__ieee754_sqrtf(float __x) +{ + register float __r; + __asm ("fsqrts %1,%0" : "=f" (__r) : "f" (__x)); + return __r; +} + +#if __WORDSIZE == 64 +__MATH_INLINE long double +__ieee754_sqrtl(long double __x) +{ + long double __r; + extern void _Qp_sqrt(long double *, __const__ long double *); + _Qp_sqrt(&__r, &__x); + return __r; +} +#endif /* sparc64 */ +#endif /* __LIBC_INTERNAL_MATH_INLINES */ +#endif /* gcc 2.8+ */ + +#ifdef __USE_ISOC9X + +__MATH_INLINE double fdim (double __x, double __y); +__MATH_INLINE double +fdim (double __x, double __y) +{ + return __x < __y ? 0 : __x - __y; +} + +__MATH_INLINE float fdimf (float __x, float __y); +__MATH_INLINE float +fdimf (float __x, float __y) +{ + return __x < __y ? 0 : __x - __y; +} + +#endif /* __USE_ISOC9X */ +#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */ +#endif /* __GNUC__ */ diff --git a/sysdeps/sparc/sparc32/Implies b/sysdeps/sparc/sparc32/Implies index 39a34c5f57..ae984a8257 100644 --- a/sysdeps/sparc/sparc32/Implies +++ b/sysdeps/sparc/sparc32/Implies @@ -1 +1,4 @@ wordsize-32 +# SPARC uses IEEE 754 floating point. +ieee754/flt-32 +ieee754/dbl-64 diff --git a/sysdeps/sparc/bits/wordsize.h b/sysdeps/sparc/sparc32/bits/wordsize.h similarity index 100% rename from sysdeps/sparc/bits/wordsize.h rename to sysdeps/sparc/sparc32/bits/wordsize.h diff --git a/sysdeps/sparc/sparc32/fpu/bits/huge_val.h b/sysdeps/sparc/sparc32/fpu/bits/huge_val.h new file mode 100644 index 0000000000..673d6f0532 --- /dev/null +++ b/sysdeps/sparc/sparc32/fpu/bits/huge_val.h @@ -0,0 +1,100 @@ +/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity). + Used by and functions for overflow. + Copyright (C) 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +# error "Never use directly; include instead." +#endif + +#include +#include + +/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ + +#ifdef __GNUC__ + +# define HUGE_VAL \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ + { __l: 0x7ff0000000000000ULL }).__d) + +#else /* not GCC */ + +typedef union { unsigned char __c[8]; double __d; } __huge_val_t; + +# define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } + +static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; +# define HUGE_VAL (__huge_val.__d) + +#endif /* GCC. */ + + +/* ISO C 9X extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ + +#ifdef __USE_ISOC9X + +# ifdef __GNUC__ + +# define HUGE_VALF \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ + { __l: 0x7f800000UL }).__d) + +# else /* not GCC */ + +typedef union { unsigned char __c[4]; float __f; } __huge_valf_t; + +# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } + +static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; +# define HUGE_VALF (__huge_valf.__f) + +# endif /* GCC. */ + +#if __WORDSIZE == 32 + +/* Sparc32 has IEEE 754 64bit long double */ +# define HUGE_VALL HUGE_VAL + +#else + +/* Sparc64 uses IEEE 754 128bit long double */ + +#ifdef __GNUC__ + +# define HUGE_VALL \ + (__extension__ \ + ((union { struct { unsigned long __h, __l; } __i; long double __d; }) \ + { __i: { __h: 0x7fff000000000000UL, __l: 0 } }).__d) + +#else /* not GCC */ + +typedef union { unsigned char __c[16]; long double __d; } __huge_vall_t; + +# define __HUGE_VALL_bytes { 0x7f, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + +static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes }; +# define HUGE_VALL (__huge_vall.__d) + +#endif /* GCC. */ + +#endif + +#endif /* __USE_ISOC9X. */ diff --git a/sysdeps/sparc/sparc64/Implies b/sysdeps/sparc/sparc64/Implies index a8cae95f9d..5b293ba87d 100644 --- a/sysdeps/sparc/sparc64/Implies +++ b/sysdeps/sparc/sparc64/Implies @@ -1 +1,5 @@ wordsize-64 +# SPARC uses IEEE 754 floating point. +ieee754/flt-32 +ieee754/dbl-64 +ieee754/ldbl-128 diff --git a/sysdeps/sparc/sparc64/Makefile b/sysdeps/sparc/sparc64/Makefile index 656274d75c..312e59ea21 100644 --- a/sysdeps/sparc/sparc64/Makefile +++ b/sysdeps/sparc/sparc64/Makefile @@ -1,11 +1,2 @@ -# The Sparc`long double' is a distinct type we support. -#long-double-fcts = yes - -# But the support for ieee quads is so bad we just skip the whole thing. -# XXX This is only a temporary hack. -omit-long-double-fcts = yes - -# But we do need these few functions to even link stdio proggies -ifeq ($(subdir),math) -sysdep_routines += s_isinfl s_isnanl s_finitel s_signbitl -endif +# The Sparc `long double' is a distinct type we support. +long-double-fcts = yes diff --git a/sysdeps/sparc/sparc64/addmul_1.S b/sysdeps/sparc/sparc64/addmul_1.S index 6782db77df..db8f53656e 100644 --- a/sysdeps/sparc/sparc64/addmul_1.S +++ b/sysdeps/sparc/sparc64/addmul_1.S @@ -1,7 +1,7 @@ /* SPARC v9 __mpn_addmul_1 -- Multiply a limb vector with a single limb and add the product to a second limb vector. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1999 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -31,29 +31,26 @@ ENTRY(__mpn_addmul_1) - !#PROLOGUE# 0 save %sp,-192,%sp - !#PROLOGUE# 1 sub %g0,%i2,%o7 - sllx %o7,3,%g5 - sub %i1,%g5,%o3 - sub %i0,%g5,%o4 mov 0,%o0 ! zero cy_limb - + sllx %o7,3,%o7 + sethi %hi(0x80000000),%o2 srl %i3,0,%o1 ! extract low 32 bits of s2_limb + sub %i1,%o7,%o3 srlx %i3,32,%i3 ! extract high 32 bits of s2_limb - mov 1,%o2 - sllx %o2,32,%o2 ! o2 = 0x100000000 + sub %i0,%o7,%o4 + add %o2,%o2,%o2 ! o2 = 0x100000000 ! hi ! ! mid-1 ! ! mid-2 ! ! lo ! 1: - sllx %o7,3,%g1 - ldx [%o3+%g1],%g5 + ldx [%o3+%o7],%g5 srl %g5,0,%i0 ! zero hi bits + ldx [%o4+%o7],%l1 srlx %g5,32,%g5 mulx %o1,%i0,%i4 ! lo product mulx %i3,%i0,%i1 ! mid-1 product @@ -64,25 +61,24 @@ ENTRY(__mpn_addmul_1) addcc %i1,%l2,%i1 ! add mid products mov 0,%l0 ! we need the carry from that add... movcs %xcc,%o2,%l0 ! ...compute it and... + sllx %i1,32,%i0 ! align low bits of mid product add %i5,%l0,%i5 ! ...add to bit 32 of the hi product - sllx %i1,32,%i0 ! align low bits of mid product srl %i4,0,%g5 ! zero high 32 bits of lo product add %i0,%g5,%i0 ! combine into low 64 bits of result srlx %i1,32,%i1 ! extract high bits of mid product... + addcc %i0,%o0,%i0 ! add cy_limb to low 64 bits of result add %i5,%i1,%i1 ! ...and add them to the high result - addcc %i0,%o0,%i0 ! add cy_limb to low 64 bits of result mov 0,%g5 movcs %xcc,1,%g5 - add %o7,1,%o7 - ldx [%o4+%g1],%l1 addcc %l1,%i0,%i0 - movcs %xcc,1,%g5 - stx %i0,[%o4+%g1] - brnz %o7,1b + stx %i0,[%o4+%o7] + add %g5,1,%l1 + movcs %xcc,%l1,%g5 + addcc %o7,8,%o7 + bne,pt %xcc,1b add %i1,%g5,%o0 ! compute new cy_limb - mov %o0,%i0 jmpl %i7+8, %g0 - restore + restore %o0,%g0,%o0 END(__mpn_addmul_1) diff --git a/sysdeps/sparc/sparc64/bits/wordsize.h b/sysdeps/sparc/sparc64/bits/wordsize.h new file mode 100644 index 0000000000..2ad12e1e7f --- /dev/null +++ b/sysdeps/sparc/sparc64/bits/wordsize.h @@ -0,0 +1,7 @@ +/* Determine the wordsize from the preprocessor defines. */ + +#if defined __sparc_v9__ || defined __arch64__ || defined __sparcv9 +# define __WORDSIZE 64 +#else +# define __WORDSIZE 32 +#endif diff --git a/sysdeps/sparc/sparc64/fpu/bits/huge_val.h b/sysdeps/sparc/sparc64/fpu/bits/huge_val.h new file mode 100644 index 0000000000..673d6f0532 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/bits/huge_val.h @@ -0,0 +1,100 @@ +/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity). + Used by and functions for overflow. + Copyright (C) 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +# error "Never use directly; include instead." +#endif + +#include +#include + +/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ + +#ifdef __GNUC__ + +# define HUGE_VAL \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ + { __l: 0x7ff0000000000000ULL }).__d) + +#else /* not GCC */ + +typedef union { unsigned char __c[8]; double __d; } __huge_val_t; + +# define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } + +static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; +# define HUGE_VAL (__huge_val.__d) + +#endif /* GCC. */ + + +/* ISO C 9X extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ + +#ifdef __USE_ISOC9X + +# ifdef __GNUC__ + +# define HUGE_VALF \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ + { __l: 0x7f800000UL }).__d) + +# else /* not GCC */ + +typedef union { unsigned char __c[4]; float __f; } __huge_valf_t; + +# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } + +static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; +# define HUGE_VALF (__huge_valf.__f) + +# endif /* GCC. */ + +#if __WORDSIZE == 32 + +/* Sparc32 has IEEE 754 64bit long double */ +# define HUGE_VALL HUGE_VAL + +#else + +/* Sparc64 uses IEEE 754 128bit long double */ + +#ifdef __GNUC__ + +# define HUGE_VALL \ + (__extension__ \ + ((union { struct { unsigned long __h, __l; } __i; long double __d; }) \ + { __i: { __h: 0x7fff000000000000UL, __l: 0 } }).__d) + +#else /* not GCC */ + +typedef union { unsigned char __c[16]; long double __d; } __huge_vall_t; + +# define __HUGE_VALL_bytes { 0x7f, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + +static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes }; +# define HUGE_VALL (__huge_vall.__d) + +#endif /* GCC. */ + +#endif + +#endif /* __USE_ISOC9X. */