Bring in FreeBSD's msun code for our libm.
authorPeter Avalos <pavalos@dragonflybsd.org>
Mon, 8 Apr 2013 22:04:50 +0000 (15:04 -0700)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 2 Jun 2013 08:20:07 +0000 (01:20 -0700)
Our current libm is a mix of NetBSD and FreeBSD.  To ease
maintainability, sync with FreeBSD as requested by John Marino.

Obtained-from:   FreeBSD

579 files changed:
Makefile_upgrade.inc
include/Makefile
include/complex.h [deleted file]
include/float.h [moved from sys/cpu/x86_64/include/float.h with 77% similarity]
include/ieeefp.h
include/math.h [deleted file]
lib/libc/gen/Makefile.inc
lib/libc/gen/fpclassify.3
lib/libc/gen/fpclassify.c [moved from lib/libm/src/s_rintl.c with 52% similarity]
lib/libc/gen/fpclassifyd.c [deleted file]
lib/libc/gen/fpclassifyf.c [deleted file]
lib/libc/gen/frexp.3
lib/libc/gen/frexp.c
lib/libc/gen/infinity.c [deleted file]
lib/libc/gen/infinityf.c [deleted file]
lib/libc/gen/infinityl_dbl.c [deleted file]
lib/libc/gen/isfinite.3 [deleted file]
lib/libc/gen/isfinited.c [deleted file]
lib/libc/gen/isfinitef.c [deleted file]
lib/libc/gen/isinf.3 [deleted file]
lib/libc/gen/isinf.c [copied from lib/libc/gen/frexp.c with 70% similarity]
lib/libc/gen/isinfd.c [deleted file]
lib/libc/gen/isinff.c [deleted file]
lib/libc/gen/isnan.3 [deleted file]
lib/libc/gen/isnan.c [copied from lib/libc/gen/frexp.c with 65% similarity]
lib/libc/gen/isnand.c [deleted file]
lib/libc/gen/isnanf.c [deleted file]
lib/libc/gen/isnormal.3 [deleted file]
lib/libc/gen/ldexp.3
lib/libc/gen/ldexp.c [new file with mode: 0644]
lib/libc/gen/modf.3
lib/libc/gen/modf.c [copied from lib/libm/src/s_modf.c with 60% similarity]
lib/libc/gen/signbit.3 [deleted file]
lib/libc/gen/signbitd.c [deleted file]
lib/libc/gen/signbitf.c [deleted file]
lib/libc/i386/gen/Makefile.inc
lib/libc/i386/gen/fabs.S
lib/libc/i386/gen/flt_rounds.S [deleted file]
lib/libc/i386/gen/flt_rounds.c [copied from lib/libc/x86_64/gen/flt_rounds.c with 72% similarity]
lib/libc/i386/gen/fpclassifyl.c [deleted file]
lib/libc/i386/gen/fpgetmask.S [deleted file]
lib/libc/i386/gen/fpgetround.S [deleted file]
lib/libc/i386/gen/fpgetsticky.S [deleted file]
lib/libc/i386/gen/fpsetmask.S [deleted file]
lib/libc/i386/gen/fpsetround.S [deleted file]
lib/libc/i386/gen/fpsetsticky.S [deleted file]
lib/libc/i386/gen/infinity.c [new file with mode: 0644]
lib/libc/i386/gen/infinityl.c [deleted file]
lib/libc/i386/gen/isfinitel.c [deleted file]
lib/libc/i386/gen/isinfl.c [deleted file]
lib/libc/i386/gen/isnanl.c [deleted file]
lib/libc/i386/gen/ldexp.c [deleted file]
lib/libc/i386/gen/modf.S [deleted file]
lib/libc/i386/gen/nanf.c [deleted file]
lib/libc/i386/gen/signbitl.c [deleted file]
lib/libc/x86_64/gen/Makefile.inc
lib/libc/x86_64/gen/fabs.S
lib/libc/x86_64/gen/flt_rounds.c
lib/libc/x86_64/gen/fpclassifyl.c [deleted file]
lib/libc/x86_64/gen/fpgetmask.S [deleted file]
lib/libc/x86_64/gen/fpgetmask.c [new file with mode: 0644]
lib/libc/x86_64/gen/fpgetprec.c [new file with mode: 0644]
lib/libc/x86_64/gen/fpgetround.S [deleted file]
lib/libc/x86_64/gen/fpgetround.c [new file with mode: 0644]
lib/libc/x86_64/gen/fpgetsticky.S [deleted file]
lib/libc/x86_64/gen/fpgetsticky.c [new file with mode: 0644]
lib/libc/x86_64/gen/fpsetmask.S [deleted file]
lib/libc/x86_64/gen/fpsetmask.c [new file with mode: 0644]
lib/libc/x86_64/gen/fpsetprec.c [new file with mode: 0644]
lib/libc/x86_64/gen/fpsetround.S [deleted file]
lib/libc/x86_64/gen/fpsetround.c [new file with mode: 0644]
lib/libc/x86_64/gen/fpsetsticky.S [deleted file]
lib/libc/x86_64/gen/infinity.c [new file with mode: 0644]
lib/libc/x86_64/gen/infinityl.c [deleted file]
lib/libc/x86_64/gen/isfinitel.c [deleted file]
lib/libc/x86_64/gen/isinfl.c [deleted file]
lib/libc/x86_64/gen/isnanl.c [deleted file]
lib/libc/x86_64/gen/ldexp.c [deleted file]
lib/libc/x86_64/gen/modf.S [deleted file]
lib/libc/x86_64/gen/nanf.c [deleted file]
lib/libc/x86_64/gen/signbitl.c [deleted file]
lib/libm/Makefile
lib/libm/arch/i386/Makefile.inc [deleted file]
lib/libm/arch/i386/abi.h [deleted file]
lib/libm/arch/i386/e_acos.S [deleted file]
lib/libm/arch/i386/e_asin.S [deleted file]
lib/libm/arch/i386/e_atan2.S [deleted file]
lib/libm/arch/i386/e_atan2f.S [deleted file]
lib/libm/arch/i386/e_expf.S [deleted file]
lib/libm/arch/i386/e_fmod.S [deleted file]
lib/libm/arch/i386/e_log.S [deleted file]
lib/libm/arch/i386/e_log10.S [deleted file]
lib/libm/arch/i386/e_log10f.S [deleted file]
lib/libm/arch/i386/e_log2.S [deleted file]
lib/libm/arch/i386/e_log2f.S [deleted file]
lib/libm/arch/i386/e_logf.S [deleted file]
lib/libm/arch/i386/e_remainder.S [deleted file]
lib/libm/arch/i386/e_remainderf.S [deleted file]
lib/libm/arch/i386/e_scalb.S [deleted file]
lib/libm/arch/i386/e_scalbf.S [deleted file]
lib/libm/arch/i386/e_sqrt.S [deleted file]
lib/libm/arch/i386/e_sqrtf.S [deleted file]
lib/libm/arch/i386/s_atan.S [deleted file]
lib/libm/arch/i386/s_atanf.S [deleted file]
lib/libm/arch/i386/s_ceil.S [deleted file]
lib/libm/arch/i386/s_copysign.S [deleted file]
lib/libm/arch/i386/s_copysignf.S [deleted file]
lib/libm/arch/i386/s_cos.S [deleted file]
lib/libm/arch/i386/s_cosf.S [deleted file]
lib/libm/arch/i386/s_finite.S [deleted file]
lib/libm/arch/i386/s_finitef.S [deleted file]
lib/libm/arch/i386/s_ilogb.S [deleted file]
lib/libm/arch/i386/s_ilogbf.S [deleted file]
lib/libm/arch/i386/s_ilogbl.S [deleted file]
lib/libm/arch/i386/s_log1p.S [deleted file]
lib/libm/arch/i386/s_log1pf.S [deleted file]
lib/libm/arch/i386/s_logb.S [deleted file]
lib/libm/arch/i386/s_logbf.S [deleted file]
lib/libm/arch/i386/s_logbl.S [deleted file]
lib/libm/arch/i386/s_modf.S [deleted file]
lib/libm/arch/i386/s_rint.S [deleted file]
lib/libm/arch/i386/s_rintf.S [deleted file]
lib/libm/arch/i386/s_scalbn.S [deleted file]
lib/libm/arch/i386/s_scalbnf.S [deleted file]
lib/libm/arch/i386/s_significand.S [deleted file]
lib/libm/arch/i386/s_significandf.S [deleted file]
lib/libm/arch/i386/s_sin.S [deleted file]
lib/libm/arch/i386/s_sinf.S [deleted file]
lib/libm/arch/i386/s_tan.S [deleted file]
lib/libm/arch/i386/s_tanf.S [deleted file]
lib/libm/arch/x86_64/Makefile.inc [deleted file]
lib/libm/arch/x86_64/fenv.h [deleted file]
lib/libm/bsdsrc/b_exp.c [moved from lib/libm/src/b_exp.c with 91% similarity]
lib/libm/bsdsrc/b_log.c [moved from lib/libm/src/b_log.c with 86% similarity]
lib/libm/bsdsrc/b_tgamma.c [moved from lib/libm/src/b_tgamma.c with 95% similarity]
lib/libm/bsdsrc/mathimpl.h [moved from lib/libm/src/mathimpl.h with 86% similarity]
lib/libm/complex/Makefile.inc [deleted file]
lib/libm/complex/cabs.c [deleted file]
lib/libm/complex/cabsf.c [deleted file]
lib/libm/complex/cacos.3 [deleted file]
lib/libm/complex/cacos.c [deleted file]
lib/libm/complex/cacosf.c [deleted file]
lib/libm/complex/cacosh.3 [deleted file]
lib/libm/complex/cacosh.c [deleted file]
lib/libm/complex/cacoshf.c [deleted file]
lib/libm/complex/carg.3 [deleted file]
lib/libm/complex/carg.c [deleted file]
lib/libm/complex/cargf.c [deleted file]
lib/libm/complex/casin.3 [deleted file]
lib/libm/complex/casin.c [deleted file]
lib/libm/complex/casinf.c [deleted file]
lib/libm/complex/casinh.3 [deleted file]
lib/libm/complex/casinh.c [deleted file]
lib/libm/complex/casinhf.c [deleted file]
lib/libm/complex/catan.3 [deleted file]
lib/libm/complex/catan.c [deleted file]
lib/libm/complex/catanf.c [deleted file]
lib/libm/complex/catanh.3 [deleted file]
lib/libm/complex/catanh.c [deleted file]
lib/libm/complex/catanhf.c [deleted file]
lib/libm/complex/ccos.3 [deleted file]
lib/libm/complex/ccos.c [deleted file]
lib/libm/complex/ccosf.c [deleted file]
lib/libm/complex/ccosh.3 [deleted file]
lib/libm/complex/ccosh.c [deleted file]
lib/libm/complex/ccoshf.c [deleted file]
lib/libm/complex/cephes_subr.c [deleted file]
lib/libm/complex/cephes_subr.h [deleted file]
lib/libm/complex/cephes_subrf.c [deleted file]
lib/libm/complex/cephes_subrf.h [deleted file]
lib/libm/complex/cexp.3 [deleted file]
lib/libm/complex/cexp.c [deleted file]
lib/libm/complex/cexpf.c [deleted file]
lib/libm/complex/cimag.3 [deleted file]
lib/libm/complex/cimag.c [deleted file]
lib/libm/complex/cimagf.c [deleted file]
lib/libm/complex/cimagl.c [deleted file]
lib/libm/complex/clog.3 [deleted file]
lib/libm/complex/clog.c [deleted file]
lib/libm/complex/clogf.c [deleted file]
lib/libm/complex/conj.3 [deleted file]
lib/libm/complex/conj.c [deleted file]
lib/libm/complex/conjf.c [deleted file]
lib/libm/complex/conjl.c [deleted file]
lib/libm/complex/cpow.3 [deleted file]
lib/libm/complex/cpow.c [deleted file]
lib/libm/complex/cpowf.c [deleted file]
lib/libm/complex/cproj.3 [deleted file]
lib/libm/complex/cproj.c [deleted file]
lib/libm/complex/cprojf.c [deleted file]
lib/libm/complex/cprojl.c [deleted file]
lib/libm/complex/creal.3 [deleted file]
lib/libm/complex/creal.c [deleted file]
lib/libm/complex/crealf.c [deleted file]
lib/libm/complex/creall.c [deleted file]
lib/libm/complex/csin.3 [deleted file]
lib/libm/complex/csin.c [deleted file]
lib/libm/complex/csinf.c [deleted file]
lib/libm/complex/csinh.3 [deleted file]
lib/libm/complex/csinh.c [deleted file]
lib/libm/complex/csinhf.c [deleted file]
lib/libm/complex/csqrt.3 [deleted file]
lib/libm/complex/csqrt.c [deleted file]
lib/libm/complex/csqrtf.c [deleted file]
lib/libm/complex/ctan.3 [deleted file]
lib/libm/complex/ctan.c [deleted file]
lib/libm/complex/ctanf.c [deleted file]
lib/libm/complex/ctanh.3 [deleted file]
lib/libm/complex/ctanh.c [deleted file]
lib/libm/complex/ctanhf.c [deleted file]
lib/libm/gen/Makefile.inc [deleted file]
lib/libm/gen/nan.3 [deleted file]
lib/libm/gen/nan.c [deleted file]
lib/libm/gen/nanf.c [deleted file]
lib/libm/gen/nanl.c [deleted file]
lib/libm/i386/Makefile.inc [new file with mode: 0644]
lib/libm/i386/e_exp.S [moved from lib/libm/arch/i386/e_exp.S with 70% similarity]
lib/libm/i386/e_fmod.S [copied from lib/libm/arch/i386/e_sqrtl.S with 91% similarity]
lib/libm/i386/e_log.S [copied from lib/libm/arch/i386/e_sqrtl.S with 93% similarity]
lib/libm/i386/e_log10.S [copied from lib/libm/arch/i386/e_sqrtl.S with 93% similarity]
lib/libm/i386/e_log10f.S [new file with mode: 0644]
lib/libm/i386/e_logf.S [new file with mode: 0644]
lib/libm/i386/e_remainder.S [copied from lib/libm/arch/i386/e_sqrtl.S with 90% similarity]
lib/libm/i386/e_remainderf.S [new file with mode: 0644]
lib/libm/i386/e_remainderl.S [copied from lib/libm/arch/i386/e_remainderl.S with 92% similarity]
lib/libm/i386/e_sqrt.S [copied from lib/libm/arch/i386/e_sqrtl.S with 94% similarity]
lib/libm/i386/e_sqrtf.S [new file with mode: 0644]
lib/libm/i386/e_sqrtl.S [copied from lib/libm/arch/i386/e_sqrtl.S with 95% similarity]
lib/libm/i386/fenv.c [moved from lib/libm/arch/i386/fenv.c with 86% similarity]
lib/libm/i386/invtrig.c [new file with mode: 0644]
lib/libm/i386/s_ceil.S [copied from lib/libm/arch/i386/e_sqrtl.S with 80% similarity]
lib/libm/i386/s_ceilf.S [copied from lib/libm/arch/i386/s_ceilf.S with 57% similarity]
lib/libm/i386/s_ceill.S [moved from lib/libm/arch/i386/s_ceilf.S with 50% similarity]
lib/libm/i386/s_copysign.S [copied from lib/libm/arch/i386/e_sqrtl.S with 87% similarity]
lib/libm/i386/s_copysignf.S [new file with mode: 0644]
lib/libm/i386/s_copysignl.S [new file with mode: 0644]
lib/libm/i386/s_cos.S [copied from lib/libm/arch/i386/e_sqrtl.S with 86% similarity]
lib/libm/i386/s_finite.S [copied from lib/libm/arch/i386/e_sqrtl.S with 89% similarity]
lib/libm/i386/s_floor.S [copied from lib/libm/arch/i386/e_remainderl.S with 80% similarity]
lib/libm/i386/s_floorf.S [moved from lib/libm/arch/i386/s_floorf.S with 57% similarity]
lib/libm/i386/s_floorl.S [moved from lib/libm/arch/i386/s_floor.S with 50% similarity]
lib/libm/i386/s_llrint.S [copied from lib/libm/arch/i386/s_lrint.S with 91% similarity]
lib/libm/i386/s_llrintf.S [copied from lib/libm/arch/i386/s_lrintf.S with 90% similarity]
lib/libm/i386/s_llrintl.S [copied from lib/libm/arch/i386/s_lrint.S with 90% similarity]
lib/libm/i386/s_logb.S [copied from lib/libm/arch/i386/e_sqrtl.S with 92% similarity]
lib/libm/i386/s_logbf.S [new file with mode: 0644]
lib/libm/i386/s_logbl.S [copied from lib/libm/arch/i386/e_sqrtl.S with 93% similarity]
lib/libm/i386/s_lrint.S [copied from lib/libm/arch/i386/s_lrint.S with 94% similarity]
lib/libm/i386/s_lrintf.S [copied from lib/libm/arch/i386/s_lrintf.S with 94% similarity]
lib/libm/i386/s_lrintl.S [copied from lib/libm/arch/i386/s_lrintl.S with 92% similarity]
lib/libm/i386/s_remquo.S [copied from lib/libm/arch/i386/s_remquol.S with 70% similarity]
lib/libm/i386/s_remquof.S [copied from lib/libm/arch/i386/s_remquol.S with 70% similarity]
lib/libm/i386/s_remquol.S [copied from lib/libm/arch/i386/s_remquol.S with 77% similarity]
lib/libm/i386/s_rint.S [copied from lib/libm/arch/i386/e_sqrtl.S with 93% similarity]
lib/libm/i386/s_rintf.S [new file with mode: 0644]
lib/libm/i386/s_rintl.S [copied from lib/libm/arch/i386/e_sqrtl.S with 94% similarity]
lib/libm/i386/s_scalbn.S [copied from lib/libm/arch/i386/e_sqrtl.S with 89% similarity]
lib/libm/i386/s_scalbnf.S [new file with mode: 0644]
lib/libm/i386/s_scalbnl.S [new file with mode: 0644]
lib/libm/i386/s_significand.S [copied from lib/libm/arch/i386/e_sqrtl.S with 91% similarity]
lib/libm/i386/s_significandf.S [new file with mode: 0644]
lib/libm/i386/s_sin.S [copied from lib/libm/arch/i386/e_sqrtl.S with 86% similarity]
lib/libm/i386/s_tan.S [copied from lib/libm/arch/i386/e_remainderl.S with 86% similarity]
lib/libm/i386/s_trunc.S [new file with mode: 0644]
lib/libm/i386/s_truncf.S [new file with mode: 0644]
lib/libm/i386/s_truncl.S [new file with mode: 0644]
lib/libm/ld80/e_rem_pio2l.h [moved from lib/libm/src/e_rem_pio2l.h with 89% similarity]
lib/libm/ld80/invtrig.c [moved from lib/libm/src/invtrig.c with 97% similarity]
lib/libm/ld80/invtrig.h [moved from lib/libm/src/invtrig.h with 97% similarity]
lib/libm/ld80/k_cosl.c [moved from lib/libm/src/k_cosl.c with 93% similarity]
lib/libm/ld80/k_sinl.c [moved from lib/libm/src/k_sinl.c with 90% similarity]
lib/libm/ld80/k_tanl.c [moved from lib/libm/src/k_tanl.c with 96% similarity]
lib/libm/ld80/s_exp2l.c [moved from lib/libm/src/s_exp2l.c with 86% similarity]
lib/libm/ld80/s_expl.c [new file with mode: 0644]
lib/libm/ld80/s_nanl.c [copied from lib/libm/src/s_copysignl.c with 79% similarity]
lib/libm/man/Makefile.inc [deleted file]
lib/libm/man/acos.3
lib/libm/man/acosh.3
lib/libm/man/asin.3
lib/libm/man/asinh.3
lib/libm/man/atan.3
lib/libm/man/atan2.3
lib/libm/man/atanh.3
lib/libm/man/cacos.3 [new file with mode: 0644]
lib/libm/man/ccos.3 [copied from lib/libm/man/trunc.3 with 62% similarity]
lib/libm/man/ccosh.3 [copied from lib/libm/man/trunc.3 with 61% similarity]
lib/libm/man/ceil.3
lib/libm/man/cexp.3 [copied from lib/libm/man/log.3 with 52% similarity]
lib/libm/man/cimag.3 [copied from lib/libm/man/fmax.3 with 50% similarity]
lib/libm/man/complex.3 [new file with mode: 0644]
lib/libm/man/copysign.3
lib/libm/man/cos.3
lib/libm/man/cosh.3
lib/libm/man/csqrt.3 [new file with mode: 0644]
lib/libm/man/erf.3
lib/libm/man/exp.3
lib/libm/man/fabs.3
lib/libm/man/fdim.3
lib/libm/man/feclearexcept.3
lib/libm/man/feenableexcept.3
lib/libm/man/fegetenv.3
lib/libm/man/fegetround.3
lib/libm/man/fenv.3
lib/libm/man/finite.3 [deleted file]
lib/libm/man/floor.3
lib/libm/man/fma.3
lib/libm/man/fmax.3
lib/libm/man/fmod.3
lib/libm/man/frexp.3 [deleted file]
lib/libm/man/hypot.3
lib/libm/man/ieee.3 [new file with mode: 0644]
lib/libm/man/ieee_test.3
lib/libm/man/ilogb.3
lib/libm/man/j0.3
lib/libm/man/lgamma.3
lib/libm/man/log.3
lib/libm/man/lrint.3
lib/libm/man/lround.3
lib/libm/man/math.3
lib/libm/man/nan.3 [new file with mode: 0644]
lib/libm/man/nextafter.3
lib/libm/man/remainder.3
lib/libm/man/rint.3
lib/libm/man/round.3
lib/libm/man/scalbn.3
lib/libm/man/signbit.3 [copied from lib/libm/man/trunc.3 with 64% similarity]
lib/libm/man/sin.3
lib/libm/man/sinh.3
lib/libm/man/sqrt.3
lib/libm/man/tan.3
lib/libm/man/tanh.3
lib/libm/man/trunc.3
lib/libm/src/Makefile.inc [deleted file]
lib/libm/src/catrig.c [new file with mode: 0644]
lib/libm/src/catrigf.c [new file with mode: 0644]
lib/libm/src/complex.h [new file with mode: 0644]
lib/libm/src/e_acos.c
lib/libm/src/e_acosf.c
lib/libm/src/e_acosh.c
lib/libm/src/e_acoshf.c
lib/libm/src/e_acosl.c
lib/libm/src/e_asin.c
lib/libm/src/e_asinf.c
lib/libm/src/e_asinl.c
lib/libm/src/e_atan2.c
lib/libm/src/e_atan2f.c
lib/libm/src/e_atan2l.c
lib/libm/src/e_atanh.c
lib/libm/src/e_atanhf.c
lib/libm/src/e_cosh.c
lib/libm/src/e_coshf.c
lib/libm/src/e_exp.c
lib/libm/src/e_expf.c
lib/libm/src/e_fmod.c
lib/libm/src/e_fmodf.c
lib/libm/src/e_fmodl.c
lib/libm/src/e_gamma.c [new file with mode: 0644]
lib/libm/src/e_gamma_r.c [new file with mode: 0644]
lib/libm/src/e_gammaf.c [moved from lib/libm/src/w_gammaf.c with 59% similarity]
lib/libm/src/e_gammaf_r.c [copied from lib/libm/src/w_gammaf_r.c with 54% similarity]
lib/libm/src/e_hypot.c
lib/libm/src/e_hypotf.c
lib/libm/src/e_hypotl.c
lib/libm/src/e_j0.c
lib/libm/src/e_j0f.c
lib/libm/src/e_j1.c
lib/libm/src/e_j1f.c
lib/libm/src/e_jn.c
lib/libm/src/e_jnf.c
lib/libm/src/e_lgamma.c [new file with mode: 0644]
lib/libm/src/e_lgamma_r.c
lib/libm/src/e_lgammaf.c [moved from lib/libm/src/w_gammaf_r.c with 59% similarity]
lib/libm/src/e_lgammaf_r.c
lib/libm/src/e_log.c
lib/libm/src/e_log10.c
lib/libm/src/e_log10f.c
lib/libm/src/e_log2.c
lib/libm/src/e_log2f.c
lib/libm/src/e_logf.c
lib/libm/src/e_pow.c
lib/libm/src/e_powf.c
lib/libm/src/e_rem_pio2.c
lib/libm/src/e_rem_pio2f.c
lib/libm/src/e_remainder.c [deleted file]
lib/libm/src/e_remainderf.c [deleted file]
lib/libm/src/e_scalb.c
lib/libm/src/e_scalbf.c
lib/libm/src/e_sinh.c
lib/libm/src/e_sinhf.c
lib/libm/src/e_sqrt.c [deleted file]
lib/libm/src/e_sqrtf.c [deleted file]
lib/libm/src/e_sqrtl.c [deleted file]
lib/libm/src/fenv.h [moved from lib/libm/arch/i386/fenv.h with 69% similarity]
lib/libm/src/k_cos.c
lib/libm/src/k_cosf.c
lib/libm/src/k_exp.c [new file with mode: 0644]
lib/libm/src/k_expf.c [copied from lib/libm/src/s_fmaf.c with 50% similarity]
lib/libm/src/k_log.h [copied from lib/libm/src/e_log.c with 51% similarity]
lib/libm/src/k_logf.h [new file with mode: 0644]
lib/libm/src/k_rem_pio2.c
lib/libm/src/k_rem_pio2f.c [deleted file]
lib/libm/src/k_sin.c
lib/libm/src/k_sinf.c
lib/libm/src/k_tan.c
lib/libm/src/k_tanf.c
lib/libm/src/math.h [new file with mode: 0644]
lib/libm/src/math_private.h
lib/libm/src/s_asinh.c
lib/libm/src/s_asinhf.c
lib/libm/src/s_atan.c
lib/libm/src/s_atanf.c
lib/libm/src/s_atanl.c
lib/libm/src/s_carg.c [copied from lib/libm/complex/s_cargl.c with 87% similarity]
lib/libm/src/s_cargf.c [copied from lib/libm/complex/s_cargl.c with 87% similarity]
lib/libm/src/s_cargl.c [copied from lib/libm/complex/s_cargl.c with 95% similarity]
lib/libm/src/s_cbrt.c
lib/libm/src/s_cbrtf.c
lib/libm/src/s_cbrtl.c
lib/libm/src/s_ccosh.c [new file with mode: 0644]
lib/libm/src/s_ccoshf.c [new file with mode: 0644]
lib/libm/src/s_ceil.c
lib/libm/src/s_ceilf.c
lib/libm/src/s_ceill.c
lib/libm/src/s_cexp.c [new file with mode: 0644]
lib/libm/src/s_cexpf.c [new file with mode: 0644]
lib/libm/src/s_cimag.c [copied from lib/libm/src/s_copysignl.c with 86% similarity]
lib/libm/src/s_cimagf.c [copied from lib/libm/src/s_copysignl.c with 86% similarity]
lib/libm/src/s_cimagl.c [copied from lib/libm/src/s_copysignl.c with 86% similarity]
lib/libm/src/s_conj.c [copied from lib/libm/src/s_copysignl.c with 86% similarity]
lib/libm/src/s_conjf.c [copied from lib/libm/src/s_copysignl.c with 86% similarity]
lib/libm/src/s_conjl.c [copied from lib/libm/src/s_copysignl.c with 86% similarity]
lib/libm/src/s_copysign.c
lib/libm/src/s_copysignf.c
lib/libm/src/s_copysignl.c
lib/libm/src/s_cos.c
lib/libm/src/s_cosf.c
lib/libm/src/s_cosl.c
lib/libm/src/s_cproj.c [copied from lib/libm/src/s_tgammaf.c with 80% similarity]
lib/libm/src/s_cprojf.c [copied from lib/libm/src/e_remainderl.c with 83% similarity]
lib/libm/src/s_cprojl.c [copied from lib/libm/src/e_remainderl.c with 82% similarity]
lib/libm/src/s_creal.c [copied from lib/libm/src/s_copysignl.c with 85% similarity]
lib/libm/src/s_crealf.c [copied from lib/libm/src/s_copysignl.c with 85% similarity]
lib/libm/src/s_creall.c [copied from lib/libm/src/s_copysignl.c with 86% similarity]
lib/libm/src/s_csinh.c [new file with mode: 0644]
lib/libm/src/s_csinhf.c [new file with mode: 0644]
lib/libm/src/s_csqrt.c [copied from lib/libm/complex/s_csqrtl.c with 68% similarity]
lib/libm/src/s_csqrtf.c [copied from lib/libm/complex/s_csqrtl.c with 56% similarity]
lib/libm/src/s_csqrtl.c [moved from lib/libm/complex/s_csqrtl.c with 95% similarity]
lib/libm/src/s_ctanh.c [new file with mode: 0644]
lib/libm/src/s_ctanhf.c [copied from lib/libm/src/s_tanl.c with 55% similarity]
lib/libm/src/s_erf.c
lib/libm/src/s_erff.c
lib/libm/src/s_exp2.c
lib/libm/src/s_exp2f.c
lib/libm/src/s_expm1.c
lib/libm/src/s_expm1f.c
lib/libm/src/s_fabs.c
lib/libm/src/s_fabsf.c
lib/libm/src/s_fabsl.c
lib/libm/src/s_fdim.c
lib/libm/src/s_finite.c
lib/libm/src/s_finitef.c
lib/libm/src/s_floor.c
lib/libm/src/s_floorf.c
lib/libm/src/s_floorl.c
lib/libm/src/s_fma.c
lib/libm/src/s_fmaf.c
lib/libm/src/s_fmal.c
lib/libm/src/s_fmax.c
lib/libm/src/s_fmaxf.c
lib/libm/src/s_fmaxl.c
lib/libm/src/s_fmin.c
lib/libm/src/s_fminf.c
lib/libm/src/s_fminl.c
lib/libm/src/s_frexp.c
lib/libm/src/s_frexpf.c
lib/libm/src/s_frexpl.c
lib/libm/src/s_ilogb.c
lib/libm/src/s_ilogbf.c
lib/libm/src/s_ilogbl.c
lib/libm/src/s_isfinite.c [copied from lib/libm/src/s_fdim.c with 78% similarity]
lib/libm/src/s_isnan.c [copied from lib/libc/gen/frexp.c with 73% similarity]
lib/libm/src/s_isnormal.c [copied from lib/libm/src/s_fdim.c with 76% similarity]
lib/libm/src/s_llrint.c [deleted file]
lib/libm/src/s_llrintf.c [deleted file]
lib/libm/src/s_llrintl.c [deleted file]
lib/libm/src/s_llround.c
lib/libm/src/s_llroundf.c
lib/libm/src/s_llroundl.c
lib/libm/src/s_log1p.c
lib/libm/src/s_log1pf.c
lib/libm/src/s_logb.c
lib/libm/src/s_logbf.c
lib/libm/src/s_logbl.c [deleted file]
lib/libm/src/s_lrint.c [deleted file]
lib/libm/src/s_lrintf.c [deleted file]
lib/libm/src/s_lrintl.c [deleted file]
lib/libm/src/s_lround.c
lib/libm/src/s_lroundf.c
lib/libm/src/s_lroundl.c
lib/libm/src/s_modf.c
lib/libm/src/s_modff.c
lib/libm/src/s_modfl.c
lib/libm/src/s_nan.c [new file with mode: 0644]
lib/libm/src/s_nearbyint.c
lib/libm/src/s_nextafter.c
lib/libm/src/s_nextafterf.c
lib/libm/src/s_nextafterl.c
lib/libm/src/s_nexttoward.c
lib/libm/src/s_nexttowardf.c
lib/libm/src/s_remquo.c [deleted file]
lib/libm/src/s_remquof.c [deleted file]
lib/libm/src/s_remquol.c [deleted file]
lib/libm/src/s_rint.c
lib/libm/src/s_rintf.c
lib/libm/src/s_round.c
lib/libm/src/s_roundf.c
lib/libm/src/s_roundl.c
lib/libm/src/s_scalbln.c
lib/libm/src/s_scalbn.c [deleted file]
lib/libm/src/s_scalbnf.c [deleted file]
lib/libm/src/s_scalbnl.c [deleted file]
lib/libm/src/s_signbit.c [moved from lib/libm/complex/s_cargl.c with 76% similarity]
lib/libm/src/s_signgam.c
lib/libm/src/s_significand.c
lib/libm/src/s_significandf.c
lib/libm/src/s_sin.c
lib/libm/src/s_sinf.c
lib/libm/src/s_sinl.c
lib/libm/src/s_tan.c
lib/libm/src/s_tanf.c
lib/libm/src/s_tanh.c
lib/libm/src/s_tanhf.c
lib/libm/src/s_tanl.c
lib/libm/src/s_tgammaf.c
lib/libm/src/s_trunc.c
lib/libm/src/s_truncf.c
lib/libm/src/s_truncl.c
lib/libm/src/w_cabs.c [new file with mode: 0644]
lib/libm/src/w_cabsf.c [new file with mode: 0644]
lib/libm/src/w_cabsl.c [moved from lib/libm/complex/w_cabsl.c with 80% similarity]
lib/libm/src/w_drem.c
lib/libm/src/w_dremf.c
lib/libm/src/w_gamma.c [deleted file]
lib/libm/src/w_gamma_r.c [deleted file]
lib/libm/src/w_lgamma.c [deleted file]
lib/libm/src/w_lgammaf.c [deleted file]
lib/libm/x86_64/Makefile.inc [new file with mode: 0644]
lib/libm/x86_64/e_remainder.S [copied from lib/libm/arch/i386/e_remainderl.S with 86% similarity]
lib/libm/x86_64/e_remainderf.S [new file with mode: 0644]
lib/libm/x86_64/e_remainderl.S [moved from lib/libm/arch/i386/e_remainderl.S with 92% similarity]
lib/libm/x86_64/e_sqrt.S [copied from lib/libm/arch/i386/s_lrint.S with 89% similarity]
lib/libm/x86_64/e_sqrtf.S [copied from lib/libm/arch/i386/s_lrint.S with 89% similarity]
lib/libm/x86_64/e_sqrtl.S [moved from lib/libm/src/e_remainderl.c with 87% similarity]
lib/libm/x86_64/fenv.c [moved from lib/libm/arch/x86_64/fenv.c with 83% similarity]
lib/libm/x86_64/s_llrint.S [new file with mode: 0644]
lib/libm/x86_64/s_llrintf.S [new file with mode: 0644]
lib/libm/x86_64/s_llrintl.S [copied from lib/libm/arch/i386/s_lrint.S with 89% similarity]
lib/libm/x86_64/s_logbl.S [copied from lib/libm/arch/i386/e_sqrtl.S with 93% similarity]
lib/libm/x86_64/s_lrint.S [copied from lib/libm/arch/i386/s_lrint.S with 91% similarity]
lib/libm/x86_64/s_lrintf.S [moved from lib/libm/arch/i386/s_lrintf.S with 91% similarity]
lib/libm/x86_64/s_lrintl.S [moved from lib/libm/arch/i386/s_lrintl.S with 92% similarity]
lib/libm/x86_64/s_remquo.S [copied from lib/libm/arch/i386/s_remquol.S with 70% similarity]
lib/libm/x86_64/s_remquof.S [copied from lib/libm/arch/i386/s_remquol.S with 70% similarity]
lib/libm/x86_64/s_remquol.S [moved from lib/libm/arch/i386/s_remquol.S with 77% similarity]
lib/libm/x86_64/s_rintl.S [moved from lib/libm/arch/i386/e_sqrtl.S with 94% similarity]
lib/libm/x86_64/s_scalbn.S [copied from lib/libm/arch/i386/s_lrint.S with 85% similarity]
lib/libm/x86_64/s_scalbnf.S [moved from lib/libm/arch/i386/s_lrint.S with 83% similarity]
lib/libm/x86_64/s_scalbnl.S [moved from lib/libm/arch/i386/s_scalbnl.S with 54% similarity]
sys/cpu/i386/include/float.h [deleted file]
sys/cpu/i386/include/floatingpoint.h [deleted file]
sys/cpu/i386/include/ieee.h [deleted file]
sys/cpu/i386/include/ieeefp.h
sys/cpu/i386/include/math.h [deleted file]
sys/cpu/x86_64/include/floatingpoint.h [deleted file]
sys/cpu/x86_64/include/ieee.h [deleted file]
sys/cpu/x86_64/include/ieeefp.h
sys/cpu/x86_64/include/math.h [deleted file]
sys/sys/param.h

index 4b51edd..5e2c516 100644 (file)
@@ -1742,8 +1742,6 @@ TO_REMOVE+=/usr/share/man/cat9/MALLOC.9.gz
 TO_REMOVE+=/usr/share/man/man9/MALLOC.9.gz
 TO_REMOVE+=/usr/share/man/cat9/FREE.9.gz
 TO_REMOVE+=/usr/share/man/man9/FREE.9.gz
-TO_REMOVE+=/usr/share/man/cat3/ieee.3.gz
-TO_REMOVE+=/usr/share/man/man3/ieee.3.gz
 TO_REMOVE+=/usr/share/man/cat3/expmlf.3.gz
 TO_REMOVE+=/usr/share/man/man3/expmlf.3.gz
 TO_REMOVE+=/usr/share/man/man3/archive.3.gz
@@ -2125,6 +2123,14 @@ TO_REMOVE+=/usr/sbin/spkrtest
 TO_REMOVE+=/usr/share/man/cat8/spkrtest.8.gz
 TO_REMOVE+=/usr/share/man/man8/spkrtest.8.gz
 TO_REMOVE+=/usr/include/machine/uvparam.h
+TO_REMOVE+=/usr/include/cpu/float.h
+TO_REMOVE+=/usr/include/machine/float.h
+TO_REMOVE+=/usr/include/cpu/floatingpoint.h
+TO_REMOVE+=/usr/include/machine/floatingpoint.h
+TO_REMOVE+=/usr/include/cpu/ieee.h
+TO_REMOVE+=/usr/include/machine/ieee.h
+TO_REMOVE+=/usr/include/cpu/math.h
+TO_REMOVE+=/usr/include/machine/math.h
 
 .if ${MACHINE_ARCH} == "x86_64"
 TO_REMOVE+=/usr/sbin/stlstats
index 675ec5c..9e6272a 100644 (file)
@@ -8,12 +8,12 @@
 
 CLEANFILES= osreldate.h version vers.c vers.txt
 SUBDIR= arpa protocols rpc rpcsvc
-INCS=  a.out.h ar.h assert.h bitstring.h complex.h cpio.h ctype.h db.h \
+INCS=  a.out.h ar.h assert.h bitstring.h cpio.h ctype.h db.h \
        dirent.h disktab.h \
-       dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \
+       dlfcn.h elf.h elf-hints.h err.h float.h fmtmsg.h fnmatch.h fstab.h \
        fts.h ftw.h getopt.h glob.h grp.h histedit.h \
        iconv.h ieeefp.h ifaddrs.h iso646.h inttypes.h \
-       langinfo.h libgen.h limits.h link.h locale.h malloc.h math.h memory.h \
+       langinfo.h libgen.h limits.h link.h locale.h malloc.h memory.h \
        mntopts.h mpool.h mqueue.h monetary.h ndbm.h netconfig.h \
        netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h \
        paths.h printf.h pthread.h pthread_np.h pwd.h \
@@ -22,7 +22,8 @@ INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h ctype.h db.h \
        search.h setjmp.h sgtty.h \
        signal.h spawn.h stab.h stdarg.h stdbool.h \
        stddef.h stdint.h stdio.h stdlib.h \
-       string.h stringlist.h strings.h struct.h sysexits.h tar.h time.h \
+       string.h stringlist.h strings.h struct.h sysexits.h \
+       tar.h time.h \
        timeconv.h \
        timers.h ttyent.h tzfile.h unistd.h ulimit.h utime.h utmp.h utmpx.h \
        uuid.h vis.h \
@@ -32,7 +33,7 @@ INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h ctype.h db.h \
 INCS+= hesiod.h
 .endif
 
-MHDRS= float.h floatingpoint.h varargs.h
+MHDRS= varargs.h
 
 # Only for default SHARED=copies case
 SHDRS= soundcard.h joystick.h
@@ -150,6 +151,8 @@ INCSLINKS+= netproto/natm ${INCLUDEDIR}/netnatm
 INCSLINKS+=    netproto/ncp ${INCLUDEDIR}/netncp
 INCSLINKS+=    netproto/smb ${INCLUDEDIR}/netsmb
 INCSLINKS+=    bus/pccard ${INCLUDEDIR}/pccard
+# Some 3rd party software looks for <floatingpoint.h>
+INCSLINKS+=    ieeefp.h ${INCLUDEDIR}/floatingpoint.h
 
 # NOTE!
 #
diff --git a/include/complex.h b/include/complex.h
deleted file mode 100644 (file)
index cc842ee..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*-
- * Copyright (c) 2001 The FreeBSD Project.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/include/complex.h,v 1.1.2.1 2001/11/23 16:16:18 dd Exp $
- * $DragonFly: src/include/complex.h,v 1.3 2003/11/14 01:01:43 dillon Exp $
- */
-
-#ifndef _COMPLEX_H
-#define _COMPLEX_H
-
-#ifdef __GNUC__
-#if __STDC_VERSION__ < 199901L
-#define _Complex       __complex__
-#endif
-#define _Complex_I     1.0fi
-#endif /* !__GNUC__ */
-
-/* 7.3 Complex arithmetic <complex.h> */
-/* 7.3.1 */
-#define complex                _Complex
-#define I              _Complex_I
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-
-/* 7.3.5 Trigonometric functions */
-/* 7.3.5.1 The cacos functions */
-double complex cacos(double complex);
-float complex cacosf(float complex);
-
-/* 7.3.5.2 The casin functions */
-double complex casin(double complex);
-float complex casinf(float complex);
-
-/* 7.3.5.3 The catan functions */
-double complex catan(double complex);
-float complex catanf(float complex);
-
-/* 7.3.5.4 The ccos functions */
-double complex ccos(double complex);
-float complex ccosf(float complex);
-
-/* 7.3.5.5 The csin functions */
-double complex csin(double complex);
-float complex csinf(float complex);
-
-/* 7.3.5.6 The ctan functions */
-double complex ctan(double complex);
-float complex ctanf(float complex);
-
-/* 7.3.6 Hyperbolic functions */
-/* 7.3.6.1 The cacosh functions */
-double complex cacosh(double complex);
-float complex cacoshf(float complex);
-
-/* 7.3.6.2 The casinh functions */
-double complex casinh(double complex);
-float complex casinhf(float complex);
-
-/* 7.3.6.3 The catanh functions */
-double complex catanh(double complex);
-float complex catanhf(float complex);
-
-/* 7.3.6.4 The ccosh functions */
-double complex ccosh(double complex);
-float complex ccoshf(float complex);
-
-/* 7.3.6.5 The csinh functions */
-double complex csinh(double complex);
-float complex csinhf(float complex);
-
-/* 7.3.6.6 The ctanh functions */
-double complex ctanh(double complex);
-float complex ctanhf(float complex);
-
-/* 7.3.7 Exponential and logarithmic functions */
-/* 7.3.7.1 The cexp functions */
-double complex cexp(double complex);
-float complex cexpf(float complex);
-
-/* 7.3.7.2 The clog functions */
-double complex clog(double complex);
-float complex clogf(float complex);
-
-/* 7.3.8 Power and absolute-value functions */
-/* 7.3.8.1 The cabs functions */
-double cabs(double complex);
-float cabsf(float complex);
-long double cabsl (long double complex);
-
-/* 7.3.8.2 The cpow functions */
-double complex cpow(double complex, double complex);
-float complex cpowf(float complex, float complex);
-
-/* 7.3.8.3 The csqrt functions */
-double complex csqrt(double complex);
-float complex csqrtf(float complex);
-long double complex csqrtl(long double complex);
-
-/* 7.3.9 Manipulation functions */
-/* 7.3.9.1 The carg functions */
-double carg(double complex);
-float cargf(float complex);
-long double cargl(long double complex);
-
-/* 7.3.9.2 The cimag functions */
-double cimag(double complex);
-float cimagf(float complex);
-long double cimagl(long double complex);
-
-/* 7.3.9.3 The conj functions */
-double complex conj(double complex);
-float complex conjf(float complex);
-long double complex conjl(long double complex);
-
-/* 7.3.9.4 The cproj functions */
-double complex cproj(double complex);
-float complex cprojf(float complex);
-long double complex cprojl(long double complex);
-
-/* 7.3.9.5 The creal functions */
-double creal(double complex);
-float crealf(float complex);
-long double creall(long double complex);
-
-__END_DECLS
-
-#endif /* _COMPLEX_H */
similarity index 77%
rename from sys/cpu/x86_64/include/float.h
rename to include/float.h
index b2d89bb..a699e55 100644 (file)
  * SUCH DAMAGE.
  *
  *     from: @(#)float.h       7.1 (Berkeley) 5/8/90
- * $FreeBSD: src/sys/amd64/include/float.h,v 1.16 2008/01/17 13:12:46 bde Exp $
+ * $FreeBSD: head/sys/x86/include/float.h 235939 2012-05-24 21:44:46Z obrien $
  */
 
-#ifndef _CPU_FLOAT_H_
-#define _CPU_FLOAT_H_
+#ifndef _FLOAT_H_
+#define _FLOAT_H_
 
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
-extern int     __flt_rounds(void);
+extern int __flt_rounds(void);
 __END_DECLS
 
 #define FLT_RADIX      2               /* b */
-#define        FLT_ROUNDS      __flt_rounds()
+#define FLT_ROUNDS     __flt_rounds()
 #if __ISO_C_VISIBLE >= 1999
+#ifdef __LP64__
 #define        FLT_EVAL_METHOD 0               /* no promotions */
+#else
+#define        FLT_EVAL_METHOD (-1)            /* i387 semantics are...interesting */
+#endif
 #define        DECIMAL_DIG     21              /* max precision in decimal digits */
 #endif
 
@@ -55,6 +59,11 @@ __END_DECLS
 #define FLT_MAX_EXP    128             /* emax */
 #define FLT_MAX                3.40282347E+38F /* (1-b**(-p))*b**emax */
 #define FLT_MAX_10_EXP 38              /* floor(log10((1-b**(-p))*b**emax)) */
+#if __ISO_C_VISIBLE >= 2011
+#define        FLT_TRUE_MIN    1.40129846E-45F /* b**(emin-p) */
+#define        FLT_DECIMAL_DIG 9               /* ceil(1+p*log10(b)) */
+#define        FLT_HAS_SUBNORM 1
+#endif /* __ISO_C_VISIBLE >= 2011 */
 
 #define DBL_MANT_DIG   53
 #define DBL_EPSILON    2.2204460492503131E-16
@@ -65,6 +74,11 @@ __END_DECLS
 #define DBL_MAX_EXP    1024
 #define DBL_MAX                1.7976931348623157E+308
 #define DBL_MAX_10_EXP 308
+#if __ISO_C_VISIBLE >= 2011
+#define        DBL_TRUE_MIN    4.9406564584124654E-324
+#define        DBL_DECIMAL_DIG 17
+#define        DBL_HAS_SUBNORM 1
+#endif /* __ISO_C_VISIBLE >= 2011 */
 
 #define LDBL_MANT_DIG  64
 #define LDBL_EPSILON   1.0842021724855044340E-19L
@@ -75,4 +89,10 @@ __END_DECLS
 #define LDBL_MAX_EXP   16384
 #define LDBL_MAX       1.1897314953572317650E+4932L
 #define LDBL_MAX_10_EXP        4932
-#endif /* _CPU_FLOAT_H_ */
+#if __ISO_C_VISIBLE >= 2011
+#define        LDBL_TRUE_MIN   3.6451995318824746025E-4951L
+#define        LDBL_DECIMAL_DIG 21
+#define        LDBL_HAS_SUBNORM 1
+#endif /* __ISO_C_VISIBLE >= 2011 */
+
+#endif /* _FLOAT_H_ */
index 981deea..8081d4f 100644 (file)
@@ -1,5 +1,5 @@
 /*     $NetBSD: ieeefp.h,v 1.4 1998/01/09 08:03:43 perry Exp $ */
-/* $FreeBSD: src/include/ieeefp.h,v 1.7 2003/01/19 06:01:32 marcel Exp $ */
+/* $FreeBSD: head/include/ieeefp.h 226607 2011-10-21 06:41:46Z das $ */
 
 /* 
  * Written by J.T. Conklin, Apr 6, 1995
 #include <sys/cdefs.h>
 #include <machine/ieeefp.h>
 
-#if !defined(_IEEEFP_INLINED_)
-__BEGIN_DECLS
-extern fp_rnd_t    fpgetround(void);
-extern fp_rnd_t    fpsetround(fp_rnd_t);
-extern fp_except_t fpgetmask(void);
-extern fp_except_t fpsetmask(fp_except_t);
-extern fp_except_t fpgetsticky(void);
-extern fp_except_t fpsetsticky(fp_except_t);
-__END_DECLS
-#endif /* !_IEEEFP_INLINED_ */
-
 #endif /* _IEEEFP_H_ */
diff --git a/include/math.h b/include/math.h
deleted file mode 100644 (file)
index 52ba5ec..0000000
+++ /dev/null
@@ -1,521 +0,0 @@
-/*
- * ====================================================
- * 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.
- * ====================================================
- *
- * $NetBSD: math.h,v 1.46 2007/02/22 22:08:19 drochner Exp $
- */
-
-/*
- * @(#)fdlibm.h 5.1 93/09/24
- */
-
-#ifndef _MATH_H_
-#define _MATH_H_
-
-#include <sys/cdefs.h>
-#include <machine/limits.h>
-
-#if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
-#define        __MATH_BUILTIN_CONSTANTS
-#endif
-
-#if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER)
-#define        __MATH_BUILTIN_RELOPS
-#endif
-
-union __float_u {
-       unsigned char __dummy[sizeof(float)];
-       float __val;
-};
-
-union __double_u {
-       unsigned char __dummy[sizeof(double)];
-       double __val;
-};
-
-union __long_double_u {
-       unsigned char __dummy[sizeof(long double)];
-       long double __val;
-};
-
-#include <machine/math.h>
-
-#ifdef __HAVE_LONG_DOUBLE
-#define        __fpmacro_unary_floating(__name, __arg0)                        \
-       /* LINTED */                                                    \
-       ((sizeof (__arg0) == sizeof (float))                            \
-       ?       __ ## __name ## f (__arg0)                              \
-       : (sizeof (__arg0) == sizeof (double))                          \
-       ?       __ ## __name ## d (__arg0)                              \
-       :       __ ## __name ## l (__arg0))
-#else
-#define        __fpmacro_unary_floating(__name, __arg0)                        \
-       /* LINTED */                                                    \
-       ((sizeof (__arg0) == sizeof (float))                            \
-       ?       __ ## __name ## f (__arg0)                              \
-       :       __ ## __name ## d (__arg0))
-#endif /* __HAVE_LONG_DOUBLE */
-
-/*
- * ANSI/POSIX
- */
-/* 7.12#3 HUGE_VAL, HUGELF, HUGE_VALL */
-extern const union __double_u __infinity;
-#ifdef __MATH_BUILTIN_CONSTANTS
-#define        HUGE_VAL        __builtin_huge_val()
-#else
-#define        HUGE_VAL        __infinity.__val
-#endif
-
-/*
- * ISO C99
- */
-#if __ISO_C_VISIBLE >= 1999
-/* 7.12#3 HUGE_VAL, HUGELF, HUGE_VALL */
-extern const union __float_u __infinityf;
-#ifdef __MATH_BUILTIN_CONSTANTS
-#define        HUGE_VALF       __builtin_huge_valf()
-#else
-#define        HUGE_VALF       __infinityf.__val
-#endif
-
-extern const union __long_double_u __infinityl;
-#ifdef __MATH_BUILTIN_CONSTANTS
-#define        HUGE_VALL       __builtin_huge_vall()
-#else
-#define        HUGE_VALL       __infinityl.__val
-#endif
-
-/* 7.12#4 INFINITY */
-#ifdef __MATH_BUILTIN_CONSTANTS
-#define        INFINITY        __builtin_inf()
-#elif defined(__INFINITY)
-#define        INFINITY        __INFINITY      /* float constant which overflows */
-#else
-#define        INFINITY        HUGE_VALF       /* positive infinity */
-#endif /* __INFINITY */
-
-/* 7.12#5 NAN: a quiet NaN, if supported */
-#ifdef __MATH_BUILTIN_CONSTANTS
-#define        NAN             __builtin_nan("")
-#elif defined(__HAVE_NANF)
-extern const union __float_u __nanf;
-#define        NAN             __nanf.__val
-#endif /* __HAVE_NANF */
-
-/* 7.12#6 number classification macros */
-#define        FP_INFINITE     0x00
-#define        FP_NAN          0x01
-#define        FP_NORMAL       0x02
-#define        FP_SUBNORMAL    0x03
-#define        FP_ZERO         0x04
-/* NetBSD extensions */
-#define        _FP_LOMD        0x80            /* range for machine-specific classes */
-#define        _FP_HIMD        0xff
-
-/* 7.12#8 values returned by ilogb(0) or ilogb(NAN), respectively */
-#define        FP_ILOGB0       INT_MIN
-#define        FP_ILOGBNAN     INT_MIN
-
-#endif /* ISO C99 */
-
-/*
- * XOPEN/SVID
- */
-#if __XSI_VISIBLE > 0
-#define        M_E             2.7182818284590452354   /* e */
-#define        M_LOG2E         1.4426950408889634074   /* log 2e */
-#define        M_LOG10E        0.43429448190325182765  /* log 10e */
-#define        M_LN2           0.69314718055994530942  /* log e2 */
-#define        M_LN10          2.30258509299404568402  /* log e10 */
-#define        M_PI            3.14159265358979323846  /* pi */
-#define        M_PI_2          1.57079632679489661923  /* pi/2 */
-#define        M_PI_4          0.78539816339744830962  /* pi/4 */
-#define        M_1_PI          0.31830988618379067154  /* 1/pi */
-#define        M_2_PI          0.63661977236758134308  /* 2/pi */
-#define        M_2_SQRTPI      1.12837916709551257390  /* 2/sqrt(pi) */
-#define        M_SQRT2         1.41421356237309504880  /* sqrt(2) */
-#define        M_SQRT1_2       0.70710678118654752440  /* 1/sqrt(2) */
-
-#define        MAXFLOAT        ((float)3.40282346638528860e+38)
-extern int signgam;
-#endif /* _XSI_VISIBLE */
-
-#if __DF_VISIBLE
-#define        HUGE            MAXFLOAT
-
-/*
- * set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
- * (one may replace the following line by "#include <values.h>")
- */
-
-#define X_TLOSS                1.41484755040568800000e+16
-
-#define        DOMAIN          1
-#define        SING            2
-#define        OVERFLOW        3
-#define        UNDERFLOW       4
-#define        TLOSS           5
-#define        PLOSS           6
-
-#endif /* __DF_VISIBLE */
-
-__BEGIN_DECLS
-/*
- * ANSI/POSIX
- */
-double acos(double);
-double asin(double);
-double atan(double);
-double atan2(double, double);
-double cos(double);
-double sin(double);
-double tan(double);
-
-double cosh(double);
-double sinh(double);
-double tanh(double);
-
-double exp(double);
-double  exp2(double);
-double frexp(double, int *);
-double ldexp(double, int);
-double log(double);
-double log2(double);
-double log10(double);
-double modf(double, double *);
-
-double pow(double, double);
-double sqrt(double);
-
-double ceil(double);
-double fabs(double);
-double floor(double);
-double fmod(double, double);
-
-#if __XSI_VISIBLE > 0
-double erf(double);
-double erfc(double);
-double gamma(double);
-double hypot(double, double);
-int    finite(double);
-double j0(double);
-double j1(double);
-double jn(int, double);
-double lgamma(double);
-double tgamma(double);
-double y0(double);
-double y1(double);
-double yn(int, double);
-#endif /* __XSI_VISIBLE */
-
-#if __XSI_VISIBLE >= 500
-double acosh(double);
-double asinh(double);
-double atanh(double);
-double cbrt(double);
-double expm1(double);
-int    ilogb(double);
-double log1p(double);
-double logb(double);
-double nextafter(double, double);
-double remainder(double, double);
-double rint(double);
-double scalb(double, double);
-#endif /* __XSI_VISIBLE >= 500 */
-
-/*
- * ISO C99
- */
-#if __ISO_C_VISIBLE >= 1999
-/* 7.12.3.1 int fpclassify(real-floating x) */
-#define        fpclassify(__x) __fpmacro_unary_floating(fpclassify, __x)
-
-/* 7.12.3.2 int isfinite(real-floating x) */
-#define        isfinite(__x)   __fpmacro_unary_floating(isfinite, __x)
-
-/* 7.12.3.5 int isnormal(real-floating x) */
-#define        isnormal(__x)   (fpclassify(__x) == FP_NORMAL)
-
-/* 7.12.3.6 int signbit(real-floating x) */
-#define        signbit(__x)    __fpmacro_unary_floating(signbit, __x)
-
-/* 7.12.4 trigonometric */
-
-float  acosf(float);
-float  asinf(float);
-float  atanf(float);
-float  atan2f(float, float);
-float  cosf(float);
-float  sinf(float);
-float  tanf(float);
-
-/* 7.12.5 hyperbolic */
-
-float  acoshf(float);
-float  asinhf(float);
-float  atanhf(float);
-float  coshf(float);
-float  sinhf(float);
-float  tanhf(float);
-
-/* 7.12.6 exp / log */
-
-float  expf(float);
-float   exp2f(float);
-float  expm1f(float);
-float  frexpf(float, int *);
-int    ilogbf(float);
-float  ldexpf(float, int);
-float  logf(float);
-float  log2f(float);
-float  log10f(float);
-float  log1pf(float);
-float  logbf(float);
-float  modff(float, float *);
-float  scalblnf(float, long);
-float  scalbnf(float, int);
-
-/* 7.12.7 power / absolute */
-
-float  cbrtf(float);
-float  fabsf(float);
-float  hypotf(float, float);
-float  powf(float, float);
-float  sqrtf(float);
-
-/* 7.12.8 error / gamma */
-
-float  erff(float);
-float  erfcf(float);
-float  lgammaf(float);
-float  tgammaf(float);
-
-/* 7.12.9 nearest integer */
-
-float  ceilf(float);
-float  floorf(float);
-float  nearbyintf(float);
-double nearbyint(double);
-float  rintf(float);
-double round(double);
-float  roundf(float);
-double trunc(double);
-float  truncf(float);
-long int       lrint(double);
-long int       lrintf(float);
-/* LONGLONG */
-long long int  llrint(double);
-/* LONGLONG */
-long long int  llrintf(float);
-long int       lround(double);
-long int       lroundf(float);
-/* LONGLONG */
-long long int  llround(double);
-/* LONGLONG */
-long long int  llroundf(float);
-
-/* 7.12.10 remainder */
-
-float  fmodf(float, float);
-float  remainderf(float, float);
-
-/* 7.12.10.3 The remquo functions */
-double remquo(double, double, int *);
-float  remquof(float, float, int *);
-
-/* 7.12.11 manipulation */
-
-float  copysignf(float, float);
-double nan(const char *);
-float  nanf(const char *);
-float  nextafterf(float, float);
-
-/* 7.12.12 maximum, minimum, positive difference */
-double fdim(double, double);
-float  fdimf(float, float);
-
-double fmax(double, double);
-float  fmaxf(float, float);
-
-double  fmin(double, double);
-float   fminf(float, float);
-
-
-/* isoC99 */
-double fma  (double, double, double);
-float  fmaf (float,  float,  float);
-
-
-
-
-#endif /* __ISO_C_VISIBLE >= 1999 */
-
-#if __ISO_C_VISIBLE >= 1999
-/* 7.12.3.3 int isinf(real-floating x) */
-#ifdef __isinf
-#define        isinf(__x)      __isinf(__x)
-#else
-#define        isinf(__x)      __fpmacro_unary_floating(isinf, __x)
-#endif
-
-/* 7.12.3.4 int isnan(real-floating x) */
-#ifdef __isnan
-#define        isnan(__x)      __isnan(__x)
-#else
-#define        isnan(__x)      __fpmacro_unary_floating(isnan, __x)
-#endif
-
-/* 7.12.14 Comparision macros */
-#ifdef __MATH_BUILTIN_RELOPS
-#define        isgreater(x, y)         __builtin_isgreater((x), (y))
-#define        isgreaterequal(x, y)    __builtin_isgreaterequal((x), (y))
-#define        isless(x, y)            __builtin_isless((x), (y))
-#define        islessequal(x, y)       __builtin_islessequal((x), (y))
-#define        islessgreater(x, y)     __builtin_islessgreater((x), (y))
-#define        isunordered(x, y)       __builtin_isunordered((x), (y))
-#else
-#define        isgreater(x, y)         (!isunordered((x), (y)) && (x) > (y))
-#define        isgreaterequal(x, y)    (!isunordered((x), (y)) && (x) >= (y))
-#define        isless(x, y)            (!isunordered((x), (y)) && (x) < (y))
-#define        islessequal(x, y)       (!isunordered((x), (y)) && (x) <= (y))
-#define        islessgreater(x, y)     (!isunordered((x), (y)) && \
-                                       ((x) > (y) || (y) > (x)))
-#define        isunordered(x, y)       (isnan(x) || isnan(y))
-#endif /* __MATH_BUILTIN_RELOPS */
-
-#endif /* __ISO_C_VISIBLE >= 1999 */
-
-#if __DF_VISIBLE
-/*
- * IEEE Test Vector
- */
-double significand(double);
-
-/*
- * Functions callable from C, intended to support IEEE arithmetic.
- */
-double copysign(double, double);
-double scalbln(double, long);
-double scalbn(double, int);
-
-/*
- * BSD math library entry points
- */
-double drem(double, double);
-
-/*
- * Reentrant version of gamma & lgamma; passes signgam back by reference
- * as the second argument; user must allocate space for signgam.
- */
-double gamma_r(double, int *);
-double lgamma_r(double, int *);
-#endif /* __DF_VISIBLE */
-
-
-#if __DF_VISIBLE
-
-/* float versions of ANSI/POSIX functions */
-
-float  gammaf(float);
-int    finitef(float);
-float  j0f(float);
-float  j1f(float);
-float  jnf(int, float);
-float  y0f(float);
-float  y1f(float);
-float  ynf(int, float);
-
-float  scalbf(float, float);
-
-/*
- * float version of IEEE Test Vector
- */
-float  significandf(float);
-
-/*
- * float versions of BSD math library entry points
- */
-float  dremf(float, float);
-
-/*
- * Float versions of reentrant version of gamma & lgamma; passes
- * signgam back by reference as the second argument; user must
- * allocate space for signgam.
- */
-float  gammaf_r(float, int *);
-float  lgammaf_r(float, int *);
-#endif /* __DF_VISIBLE */
-
-/*
- * Library implementation
- */
-int    __fpclassifyf(float);
-int    __fpclassifyd(double);
-int    __isfinitef(float);
-int    __isfinited(double);
-int    __isinff(float);
-int    __isinfd(double);
-int    __isnanf(float);
-int    __isnand(double);
-int    __signbitf(float);
-int    __signbitd(double);
-
-#ifdef __HAVE_LONG_DOUBLE
-int    __fpclassifyl       (long double);
-int    __isfinitel         (long double);
-int    __isinfl            (long double);
-int    __isnanl            (long double);
-int    __signbitl          (long double);
-
-long double    acosl       (long double);
-long double    asinl       (long double);
-long double    atan2l      (long double, long double);
-long double    atanl       (long double);
-long double    ceill       (long double);
-long double    cosl        (long double);
-long double    cbrtl       (long double);
-long double    copysignl   (long double, long double);
-long double    fdiml       (long double, long double);
-long double    exp2l       (long double);
-long double    fabsl       (long double);
-long double    floorl      (long double);
-long double    fmal        (long double, long double, long double);
-long double    frexpl      (long double, int *);
-long double    fmaxl       (long double, long double);
-long double    fminl       (long double, long double);
-long double    fmodl       (long double, long double);
-long double    hypotl      (long double, long double);
-int            ilogbl      (long double);
-long double    ldexpl      (long double, int);
-long long      llrintl     (long double);
-long long              llroundl    (long double);
-long double    logbl       (long double);
-long           lrintl      (long double);
-long           lroundl     (long double);
-long double    modfl       (long double, long double *);
-long double    nanl        (const char *);
-long double    nearbyintl  (long double);
-long double    nextafterl  (long double, long double);
-double         nexttoward  (double,      long double);
-float          nexttowardf (float,       long double);
-long double    remainderl  (long double, long double);
-long double    remquol     (long double, long double, int *);
-long double    rintl       (long double);
-long double    roundl      (long double);
-long double    scalblnl    (long double, long);
-long double    scalbnl     (long double, int);
-long double    sinl        (long double);
-long double    sqrtl       (long double);
-long double    tanl        (long double);
-long double    truncl      (long double);
-#endif
-__END_DECLS
-
-#endif /* _MATH_H_ */
index 3313c97..1b78437 100644 (file)
@@ -9,7 +9,7 @@ SRCS+=  _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \
        clock.c closedir.c confstr.c \
        ctermid.c ctype.c daemon.c devname.c dirname.c disklabel.c disktab.c \
        dlfcn.c drand48.c elf_utils.c erand48.c err.c errlst.c exec.c \
-       fdevname.c fmtcheck.c fmtmsg.c fnmatch.c fpclassifyd.c fpclassifyf.c \
+       fdevname.c fmtcheck.c fmtmsg.c fnmatch.c fpclassify.c \
        frexp.c fstab.c ftok.c fts.c ftw.c getbootfile.c getbsize.c \
        getcap.c getcwd.c getdevpath.c getdomainname.c \
        getgrent.c getgrouplist.c \
@@ -17,10 +17,9 @@ SRCS+=  _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \
        getnetgrent.c getobjformat.c getosreldate.c getpagesize.c \
        getpeereid.c getprogname.c getpwent.c getttyent.c \
        getusershell.c getvfsbyname.c getvfsent.c glob.c \
-       infinity.c infinityf.c initgroups.c isascii.c \
-       isatty.c isctype.c isfinited.c isfinitef.c isinfd.c isinff.c \
-       isnand.c isnanf.c jrand48.c lcong48.c \
-       lockf.c lrand48.c mrand48.c msgctl.c \
+       initgroups.c isascii.c isatty.c isctype.c isinf.c isnan.c \
+       jrand48.c lcong48.c ldexp.c \
+       lockf.c lrand48.c modf.c mrand48.c msgctl.c \
        msgget.c msgrcv.c msgsnd.c nftw.c nice.c \
        nlist.c nrand48.c ntp_gettime.c opendir.c \
        pause.c pmadvise.c popen.c posix_spawn.c posixshm.c \
@@ -30,7 +29,7 @@ SRCS+=  _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \
        setdomainname.c sethostname.c setjmperr.c setmode.c setprogname.c \
        setproctitle.c \
        siginterrupt.c siglist.c signal.c \
-       signbitd.c signbitf.c sigsetops.c sigwait.c sleep.c srand48.c \
+       sigsetops.c sigwait.c sleep.c srand48.c \
        stringlist.c strtofflags.c sysconf.c sysctl.c sysctlbyname.c \
        sysctlnametomib.c syslog.c telldir.c termios.c time.c times.c \
        toascii.c tolower.c toupper.c ttyname.c ttyslot.c \
@@ -63,7 +62,7 @@ MAN+= alarm.3 arc4random.3 clock.3 \
        getttyent.3 getusershell.3 getvfsbyname.3 getvfsent.3 \
        glob.3 initgroups.3 isalnum.3 isalpha.3 isascii.3 isblank.3 \
        iscntrl.3 isdigit.3 isgraph.3 islower.3 isprint.3 ispunct.3 \
-       isspace.3 isupper.3 isxdigit.3 isinf.3 isfinite.3 isnan.3 isnormal.3 \
+       isspace.3 isupper.3 isxdigit.3 \
        ldexp.3 lockf.3 makecontext.3 modf.3 msgctl.3 msgget.3 msgrcv.3 msgsnd.3 \
        nice.3 nlist.3 pause.3 popen.3 posix_spawn.3 \
        posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_init.3 \
@@ -73,7 +72,7 @@ MAN+= alarm.3 arc4random.3 clock.3 \
        posix_spawnattr_init.3 psignal.3 pwcache.3 \
        raise.3 rand48.3 readpassphrase.3 rfork_thread.3 \
        scandir.3 setjmp.3 setmode.3 setproctitle.3 shm_open.3 \
-       siginterrupt.3 signal.3 signbit.3 sigsetops.3 sleep.3 stringlist.3 \
+       siginterrupt.3 signal.3 sigsetops.3 sleep.3 stringlist.3 \
        strtofflags.3 sysconf.3 sysctl.3 syslog.3 tcgetpgrp.3 tcgetsid.3 \
        tcsendbreak.3 tcsetattr.3 tcsetpgrp.3 time.3 times.3 \
        toascii.3 tolower.3 toupper.3 ttyname.3 tzset.3 ualarm.3 \
@@ -97,6 +96,12 @@ MLINKS+=err.3 err_set_exit.3 err.3 err_set_file.3 err.3 errc.3 err.3 errx.3 \
        err.3 vwarnx.3 err.3 warnc.3 err.3 warn.3 err.3 warnx.3
 MLINKS+=exec.3 execl.3 exec.3 execle.3 exec.3 execlp.3 exec.3 exect.3 \
        exec.3 execv.3 exec.3 execvP.3 exec.3 execvp.3
+MLINKS+=fpclassify.3 finite.3 \
+       fpclassify.3 finitef.3 \
+       fpclassify.3 isfinite.3 \
+       fpclassify.3 isinf.3 \
+       fpclassify.3 isnan.3 \
+       fpclassify.3 isnormal.3
 MLINKS+=frexp.3 frexpf.3 frexp.3 frexpl.3
 MLINKS+=fts.3 fts_children.3 fts.3 fts_close.3 fts.3 fts_get_clientptr.3 \
        fts.3 fts_get_stream.3 fts.3 fts_open.3 fts.3 fts_read.3 \
@@ -136,7 +141,11 @@ MLINKS+=getvfsent.3 endvfsent.3 getvfsent.3 getvfsbytype.3 \
        getvfsent.3 vfsload.3
 MLINKS+=glob.3 globfree.3
 MLINKS+=getcontext.3 setcontext.3
+MLINKS+=ldexp.3 ldexpf.3 \
+       ldexp.3 ldexpl.3
 MLINKS+=makecontext.3 swapcontext.3
+MLINKS+=modf.3 modff.3 \
+       modf.3 modfl.3
 MLINKS+=popen.3 pclose.3
 MLINKS+=posix_spawn.3 posix_spawnp.3
 MLINKS+=posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addclose.3 \
index 4098085..2340f6c 100644 (file)
@@ -1,12 +1,6 @@
-.\"    $NetBSD: fpclassify.3,v 1.2 2004/01/15 19:43:45 kleink Exp $
-.\"    $DragonFly: src/lib/libc/gen/fpclassify.3,v 1.1 2005/07/26 21:15:19 joerg Exp $
-.\"
-.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
+.\" Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org>
 .\" All rights reserved.
 .\"
-.\" This code is derived from software contributed to The NetBSD Foundation
-.\" by Klaus Klein.
-.\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
 .\" are met:
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"    must display the following acknowledgement:
-.\"        This product includes software developed by the NetBSD
-.\"        Foundation, Inc. and its contributors.
-.\" 4. Neither the name of The NetBSD Foundation nor the names of its
-.\"    contributors may be used to endorse or promote products derived
-.\"    from this software without specific prior written permission.
 .\"
-.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-.\" POSSIBILITY OF SUCH DAMAGE.
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD: head/lib/libc/gen/fpclassify.3 140890 2005-01-27 05:46:17Z das $
 .\"
-.Dd January 14, 2004
+.Dd January 26, 2005
 .Dt FPCLASSIFY 3
 .Os
 .Sh NAME
-.Nm fpclassify
-.Nd classify real floating type
+.Nm fpclassify , isfinite , isinf , isnan , isnormal
+.Nd "classify a floating-point number"
 .Sh LIBRARY
-.Lb libc
+.Lb libm
 .Sh SYNOPSIS
 .In math.h
 .Ft int
 .Fn fpclassify "real-floating x"
+.Ft int
+.Fn isfinite "real-floating x"
+.Ft int
+.Fn isinf "real-floating x"
+.Ft int
+.Fn isnan "real-floating x"
+.Ft int
+.Fn isnormal "real-floating x"
 .Sh DESCRIPTION
 The
 .Fn fpclassify
-macro performs classification of its argument
-.Fa x .
-An argument represented in a format wider than its semantic type is
-converted to its semantic type first.
-The classification is then based on the type of the argument.
-.Ss IEEE 754
-.Bl -tag -width "FP_SUBNORMALXXX" -compact -offset indent
+macro takes an argument of
+.Fa x
+and returns one of the following manifest constants.
+.Bl -tag -width ".Dv FP_SUBNORMAL"
 .It Dv FP_INFINITE
-infinity, either positive or negative
+Indicates that
+.Fa x
+is an infinite number.
 .It Dv FP_NAN
-not-a-number
-.Pq Dq NaN
+Indicates that
+.Fa x
+is not a number (NaN).
 .It Dv FP_NORMAL
-normal
+Indicates that
+.Fa x
+is a normalized number.
 .It Dv FP_SUBNORMAL
-subnormal
+Indicates that
+.Fa x
+is a denormalized number.
 .It Dv FP_ZERO
-zero
+Indicates that
+.Fa x
+is zero (0 or \-0).
 .El
-.Sh RETURN VALUES
+.Pp
 The
-.Fn fpclassify
-macro returns the value of the number classification macro appropriate
-to its argument
+.Fn isfinite
+macro returns a non-zero value if and only if its argument has
+a finite (zero, subnormal, or normal) value.
+The
+.Fn isinf ,
+.Fn isnan ,
+and
+.Fn isnormal
+macros return non-zero if and only if
 .Fa x
-as described above.
-.Sh ERRORS
-No errors are defined.
+is an infinity, NaN,
+or a non-zero normalized number, respectively.
+.Pp
+The symbol
+.Fn isnanf
+is provided as an alias to
+.Fn isnan
+for compatibility, and its use is deprecated.
+Similarly,
+.Fn finite
+and
+.Fn finitef
+are deprecated versions of
+.Fn isfinite .
 .Sh SEE ALSO
-.Xr isfinite 3 ,
-.Xr isnormal 3 ,
+.Xr isgreater 3 ,
 .Xr math 3 ,
 .Xr signbit 3
 .Sh STANDARDS
 The
-.Fn fpclassify
-macro conforms to
+.Fn fpclassify ,
+.Fn isfinite ,
+.Fn isinf ,
+.Fn isnan ,
+and
+.Fn isnormal
+macros conform to
 .St -isoC-99 .
+.Sh HISTORY
+The
+.Fn fpclassify ,
+.Fn isfinite ,
+.Fn isinf ,
+.Fn isnan ,
+and
+.Fn isnormal
+macros were added in
+.Dx 1.3 .
+.Bx 3
+introduced
+.Fn isinf
+and
+.Fn isnan
+functions, which accepted
+.Vt double
+arguments; these have been superseded by the macros
+described above.
similarity index 52%
rename from lib/libm/src/s_rintl.c
rename to lib/libc/gen/fpclassify.c
index e1ab92d..203cb89 100644 (file)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2008 David Schultz <das@FreeBSD.ORG>
+ * Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org>
+ * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * FreeBSD SVN: 176461 (2008-02-22)
+ * $FreeBSD: head/lib/libc/gen/fpclassify.c 141379 2005-02-06 03:23:31Z das $
  */
 
-#include <float.h>
+#include <sys/endian.h>
+
 #include <math.h>
+#include <stdint.h>
 
 #include "fpmath.h"
 
-#if LDBL_MAX_EXP != 0x4000
-/* We also require the usual bias, min exp and expsign packing. */
-#error "Unsupported long double format"
-#endif
-
-#define        BIAS    (LDBL_MAX_EXP - 1)
+int
+__fpclassifyf(float f)
+{
+       union IEEEf2bits u;
 
-static const float
-shift[2] = {
-       0x1.0p63, -0x1.0p63
-};
-static const float zero[2] = { 0.0, -0.0 };
+       u.f = f;
+       if (u.bits.exp == 0) {
+               if (u.bits.man == 0)
+                       return (FP_ZERO);
+               return (FP_SUBNORMAL);
+       }
+       if (u.bits.exp == 255) {
+               if (u.bits.man == 0)
+                       return (FP_INFINITE);
+               return (FP_NAN);
+       }
+       return (FP_NORMAL);
+}
 
-long double
-rintl(long double x)
+int
+__fpclassifyd(double d)
 {
-       union IEEEl2bits u;
-       uint32_t expsign;
-       int ex, sign;
-
-       u.e = x;
-       expsign = u.xbits.expsign;
-       ex = expsign & 0x7fff;
+       union IEEEd2bits u;
 
-       if (ex >= BIAS + LDBL_MANT_DIG - 1) {
-               if (ex == BIAS + LDBL_MAX_EXP)
-                       return (x + x); /* Inf, NaN, or unsupported format */
-               return (x);             /* finite and already an integer */
+       u.d = d;
+       if (u.bits.exp == 0) {
+               if ((u.bits.manl | u.bits.manh) == 0)
+                       return (FP_ZERO);
+               return (FP_SUBNORMAL);
        }
-       sign = expsign >> 15;
-
-       /*
-        * The following code assumes that intermediate results are
-        * evaluated in long double precision. If they are evaluated in
-        * greater precision, double rounding may occur, and if they are
-        * evaluated in less precision (as on i386), results will be
-        * wildly incorrect.
-        */
-       x += shift[sign];
-       x -= shift[sign];
+       if (u.bits.exp == 2047) {
+               if ((u.bits.manl | u.bits.manh) == 0)
+                       return (FP_INFINITE);
+               return (FP_NAN);
+       }
+       return (FP_NORMAL);
+}
 
-       /*
-        * If the result is +-0, then it must have the same sign as x, but
-        * the above calculation doesn't always give this.  Fix up the sign.
-        */
-       if (ex < BIAS && x == 0.0L)
-               return (zero[sign]);
+int
+__fpclassifyl(long double e)
+{
+       union IEEEl2bits u;
 
-       return (x);
+       u.e = e;
+       if (u.bits.exp == 0) {
+               if ((u.bits.manl | u.bits.manh) == 0)
+                       return (FP_ZERO);
+               return (FP_SUBNORMAL);
+       }
+       mask_nbit_l(u);         /* Mask normalization bit if applicable. */
+       if (u.bits.exp == 32767) {
+               if ((u.bits.manl | u.bits.manh) == 0)
+                       return (FP_INFINITE);
+               return (FP_NAN);
+       }
+       return (FP_NORMAL);
 }
diff --git a/lib/libc/gen/fpclassifyd.c b/lib/libc/gen/fpclassifyd.c
deleted file mode 100644 (file)
index 50f0841..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*     $NetBSD: fpclassifyd_ieee754.c,v 1.1 2003/10/28 22:50:42 kleink Exp $   */
-/*     $DragonFly: src/lib/libc/gen/fpclassifyd.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.1 fpclassify - classify real floating type
- *          IEEE 754 double-precision version
- */
-int
-__fpclassifyd(double x)
-{
-       union ieee_double_u u;
-
-       u.dblu_d = x;
-
-       if (u.dblu_dbl.dbl_exp == 0) {
-               if (u.dblu_dbl.dbl_frach == 0 && u.dblu_dbl.dbl_fracl == 0)
-                       return FP_ZERO;
-               else
-                       return FP_SUBNORMAL;
-       } else if (u.dblu_dbl.dbl_exp == DBL_EXP_INFNAN) {
-               if (u.dblu_dbl.dbl_frach == 0 && u.dblu_dbl.dbl_fracl == 0)
-                       return FP_INFINITE;
-               else
-                       return FP_NAN;
-       }
-
-       return FP_NORMAL;
-}
diff --git a/lib/libc/gen/fpclassifyf.c b/lib/libc/gen/fpclassifyf.c
deleted file mode 100644 (file)
index 948da0e..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*     $NetBSD: fpclassifyf_ieee754.c,v 1.2 2003/10/29 19:34:11 kleink Exp $   */
-/*     $DragonFly: src/lib/libc/gen/fpclassifyf.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.1 fpclassify - classify real floating type
- *          IEEE 754 single-precision version
- */
-int
-__fpclassifyf(float x)
-{
-       union ieee_single_u u;
-
-       u.sngu_f = x;
-
-       if (u.sngu_sng.sng_exp == 0) {
-               if (u.sngu_sng.sng_frac == 0)
-                       return FP_ZERO;
-               else
-                       return FP_SUBNORMAL;
-       } else if (u.sngu_sng.sng_exp == SNG_EXP_INFNAN) {
-               if (u.sngu_sng.sng_frac == 0)
-                       return FP_INFINITE;
-               else
-                       return FP_NAN;
-       }
-
-       return FP_NORMAL;
-}
index 2b4aae0..3801832 100644 (file)
@@ -30,8 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)frexp.3    8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/gen/frexp.3,v 1.13 2007/01/09 00:27:53 imp Exp $
-.\" $DragonFly: src/lib/libc/gen/frexp.3,v 1.3 2006/02/28 02:25:10 swildner Exp $
+.\" $FreeBSD: head/lib/libc/gen/frexp.3 206616 2010-04-14 18:29:34Z uqs $
 .\"
 .Dd March 4, 2005
 .Dt FREXP 3
@@ -71,7 +70,7 @@ such that
 is a
 .Vt double
 with magnitude in the interval
-.Eo [ \(12 , 1 Ec )
+.Eo [ 1/2 , 1 Ec )
 or zero, and
 .Fa value
 equals
index 24e1069..bd9c66b 100644 (file)
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/gen/frexp.c,v 1.1 2004/07/18 21:23:39 das Exp $
+ * $FreeBSD: head/lib/libc/gen/frexp.c 132366 2004-07-18 21:23:39Z das $
  */
 
 #include <math.h>
diff --git a/lib/libc/gen/infinity.c b/lib/libc/gen/infinity.c
deleted file mode 100644 (file)
index 9700101..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*     $NetBSD: infinity_ieee754.c,v 1.3 2005/06/12 05:21:27 lukem Exp $       */
-/*     $DragonFly: src/lib/libc/gen/infinity.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*
- * IEEE-compatible infinity.c -- public domain.
- */
-
-#include <sys/endian.h>
-#include <math.h>
-
-const union __double_u __infinity =
-#if BYTE_ORDER == BIG_ENDIAN
-       { { 0x7f, 0xf0, 0, 0, 0, 0,    0,    0 } };
-#else
-       { {    0,    0, 0, 0, 0, 0, 0xf0, 0x7f } };
-#endif
diff --git a/lib/libc/gen/infinityf.c b/lib/libc/gen/infinityf.c
deleted file mode 100644 (file)
index f95f3f9..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*     $NetBSD: infinityf_ieee754.c,v 1.2 2005/06/12 05:21:27 lukem Exp $      */
-/*     $DragonFly: src/lib/libc/gen/infinityf.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*
- * IEEE-compatible infinityf.c -- public domain.
- */
-
-#include <sys/endian.h>
-#include <math.h>
-
-const union __float_u __infinityf =
-#if BYTE_ORDER == BIG_ENDIAN
-       { { 0x7f, 0x80,     0,    0 } };
-#else
-       { {    0,    0,  0x80, 0x7f } };
-#endif
diff --git a/lib/libc/gen/infinityl_dbl.c b/lib/libc/gen/infinityl_dbl.c
deleted file mode 100644 (file)
index 6122b58..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*     $NetBSD: infinityl_dbl_ieee754.c,v 1.1 2003/10/25 22:31:20 kleink Exp $ */
-/*     $DragonFly: src/lib/libc/gen/infinityl_dbl.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*
- * IEEE-compatible infinityl.c -- public domain.
- * For platforms where long double == double.
- */
-
-#include <sys/endian.h>
-#include <float.h>
-#include <math.h>
-
-#if LDBL_MANT_DIG != DBL_MANT_DIG
-#error double / long double mismatch
-#endif
-
-const union __long_double_u __infinityl =
-#if BYTE_ORDER == BIG_ENDIAN
-       { { 0x7f, 0xf0, 0, 0, 0, 0,    0,    0 } };
-#else
-       { {    0,    0, 0, 0, 0, 0, 0xf0, 0x7f } };
-#endif
diff --git a/lib/libc/gen/isfinite.3 b/lib/libc/gen/isfinite.3
deleted file mode 100644 (file)
index 7e43f5c..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-.\"    $NetBSD: isfinite.3,v 1.2 2004/01/15 19:43:45 kleink Exp $
-.\"    $DragonFly: src/lib/libc/gen/isfinite.3,v 1.1 2005/07/26 21:15:19 joerg Exp $
-.\"
-.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
-.\" All rights reserved.
-.\"
-.\" This code is derived from software contributed to The NetBSD Foundation
-.\" by Klaus Klein.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"    must display the following acknowledgement:
-.\"        This product includes software developed by the NetBSD
-.\"        Foundation, Inc. and its contributors.
-.\" 4. Neither the name of The NetBSD Foundation nor the names of its
-.\"    contributors may be used to endorse or promote products derived
-.\"    from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-.\" POSSIBILITY OF SUCH DAMAGE.
-.\"
-.Dd October 29, 2003
-.Dt ISFINITE 3
-.Os
-.Sh NAME
-.Nm isfinite
-.Nd test for finite value
-.Sh LIBRARY
-.Lb libc
-.Sh SYNOPSIS
-.In math.h
-.Ft int
-.Fn isfinite "real-floating x"
-.Sh DESCRIPTION
-The
-.Fn isfinite
-determines whether its argument
-.Fa x
-has a finite value.
-An argument represented in a format wider than its semantic type is
-converted to its semantic type first.
-The determination is then based on the type of the argument.
-.Sh RETURN VALUES
-The
-.Fn isfinite
-macro returns a non-zero value if the value of
-.Fa x
-is finite.
-Otherwise 0 is returned.
-.Sh ERRORS
-No errors are defined.
-.Sh SEE ALSO
-.Xr fpclassify 3 ,
-.Xr isnormal 3 ,
-.Xr math 3 ,
-.Xr signbit 3
-.Sh STANDARDS
-The
-.Fn isfinite
-macro conforms to
-.St -isoC-99 .
diff --git a/lib/libc/gen/isfinited.c b/lib/libc/gen/isfinited.c
deleted file mode 100644 (file)
index 6cfacd7..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*     $NetBSD: isfinited_ieee754.c,v 1.1 2003/10/29 20:03:51 kleink Exp $     */
-/*     $DragonFly: src/lib/libc/gen/isfinited.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.2 isfinite - determine whether an argument has finite value
- *          IEEE 754 double-precision version
- */
-int
-__isfinited(double x)
-{
-       union ieee_double_u u;
-
-       u.dblu_d = x;
-
-       if (u.dblu_dbl.dbl_exp == DBL_EXP_INFNAN)
-               return 0;
-
-       return 1;
-}
diff --git a/lib/libc/gen/isfinitef.c b/lib/libc/gen/isfinitef.c
deleted file mode 100644 (file)
index 6bbbb9e..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*     $NetBSD: isfinitef_ieee754.c,v 1.1 2003/10/29 20:03:51 kleink Exp $     */
-/*     $DragonFly: src/lib/libc/gen/isfinitef.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.2 isfinite - determine whether an argument has finite value
- *          IEEE 754 single-precision version
- */
-int
-__isfinitef(float x)
-{
-       union ieee_single_u u;
-
-       u.sngu_f = x;
-
-       if (u.sngu_sng.sng_exp == SNG_EXP_INFNAN)
-               return 0;
-
-       return 1;
-}
diff --git a/lib/libc/gen/isinf.3 b/lib/libc/gen/isinf.3
deleted file mode 100644 (file)
index f046ad8..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-.\" Copyright (c) 1991, 1993
-.\"    The Regents of the University of California.  All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the University nor the names of its contributors
-.\"    may be used to endorse or promote products derived from this software
-.\"    without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\"     @(#)isinf.3    8.2 (Berkeley) 1/29/94
-.\"    $NetBSD: isinf.3,v 1.12 2004/03/04 23:47:56 wiz Exp $
-.\"    $DragonFly: src/lib/libc/gen/isinf.3,v 1.4 2006/05/17 14:06:37 swildner Exp $
-.\"
-.Dd March 5, 2004
-.Dt ISINF 3
-.Os
-.Sh NAME
-.Nm isinf
-.Nd test for infinity
-.Sh LIBRARY
-.Lb libc
-.Sh SYNOPSIS
-.In math.h
-.Ft int
-.Fn isinf "real-floating x"
-.Sh DESCRIPTION
-The
-.Fn isinf
-macro determines whether its argument
-.Fa x
-is an infinity (positive or negative).
-An argument represented in a format wider than its semantic type is
-converted to its semantic type first.
-The determination is then based on the type of the argument.
-.Ss IEEE 754
-It is determined whether the value of
-.Fa x
-is an infinity.
-.Ss VAX
-Infinities are not supported.
-.Sh RETURN VALUES
-The
-.Fn isinf
-macro returns a non-zero value if the value of
-.Fa x
-is an infinity.
-Otherwise 0 is returned.
-.Sh SEE ALSO
-.Xr fpclassify 3 ,
-.Xr isfinite 3 ,
-.Xr isnan 3 ,
-.Xr isnormal 3 ,
-.Xr math 3 ,
-.Xr signbit 3
-.Rs
-.%T "IEEE Standard for Binary Floating-Point Arithmetic"
-.%Q ANSI
-.%R Std 754-1985
-.Re
-.Sh STANDARDS
-The
-.Fn isinf
-macro conforms to
-.St -isoC-99 .
similarity index 70%
copy from lib/libc/gen/frexp.c
copy to lib/libc/gen/isinf.c
index 24e1069..10eded1 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/gen/frexp.c,v 1.1 2004/07/18 21:23:39 das Exp $
+ * $FreeBSD: head/lib/libc/gen/isinf.c 131898 2004-07-10 15:52:26Z marcel $
  */
 
 #include <math.h>
 
 #include "fpmath.h"
 
-double
-frexp(double d, int *ex)
+/*
+ * XXX These routines belong in libm, but they must remain in libc for
+ *     binary compat until we can bump libm's major version number.
+ */
+
+__weak_reference(__isinf, isinf);
+
+int
+__isinf(double d)
 {
        union IEEEd2bits u;
 
        u.d = d;
-       switch (u.bits.exp) {
-       case 0:         /* 0 or subnormal */
-               if ((u.bits.manl | u.bits.manh) == 0) {
-                       *ex = 0;
-               } else {
-                       u.d *= 0x1.0p514;
-                       *ex = u.bits.exp - 1536;
-                       u.bits.exp = 1022;
-               }
-               break;
-       case 2047:      /* infinity or NaN; value of *ex is unspecified */
-               break;
-       default:        /* normal */
-               *ex = u.bits.exp - 1022;
-               u.bits.exp = 1022;
-               break;
-       }
-       return (u.d);
+       return (u.bits.exp == 2047 && u.bits.manl == 0 && u.bits.manh == 0);
+}
+
+int
+__isinff(float f)
+{
+       union IEEEf2bits u;
+
+       u.f = f;
+       return (u.bits.exp == 255 && u.bits.man == 0);
+}
+
+int
+__isinfl(long double e)
+{
+       union IEEEl2bits u;
+
+       u.e = e;
+       mask_nbit_l(u);
+       return (u.bits.exp == 32767 && u.bits.manl == 0 && u.bits.manh == 0);
 }
diff --git a/lib/libc/gen/isinfd.c b/lib/libc/gen/isinfd.c
deleted file mode 100644 (file)
index be01f0b..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*     $NetBSD: isinfd_ieee754.c,v 1.1 2004/03/04 23:42:39 kleink Exp $        */
-/*     $DragonFly: src/lib/libc/gen/isinfd.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*
- * Copyright (c) 1992, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.3 isinf - test for infinity
- *          IEEE 754 double-precision version
- */
-int
-__isinfd(double x)
-{
-       union ieee_double_u u;
-
-       u.dblu_d = x;
-
-       return (u.dblu_dbl.dbl_exp == DBL_EXP_INFNAN &&
-           (u.dblu_dbl.dbl_frach == 0 && u.dblu_dbl.dbl_fracl == 0));
-}
diff --git a/lib/libc/gen/isinff.c b/lib/libc/gen/isinff.c
deleted file mode 100644 (file)
index 871cefb..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*     $NetBSD: isinff_ieee754.c,v 1.1 2004/03/04 23:42:39 kleink Exp $        */
-/*     $DragonFly: src/lib/libc/gen/isinff.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*
- * Copyright (c) 1992, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.3 isinf - test for infinity
- *          IEEE 754 single-precision version
- */
-int
-__isinff(float x)
-{
-       union ieee_single_u u;
-
-       u.sngu_f = x;
-
-       return (u.sngu_sng.sng_exp == SNG_EXP_INFNAN &&
-           u.sngu_sng.sng_frac == 0);
-}
diff --git a/lib/libc/gen/isnan.3 b/lib/libc/gen/isnan.3
deleted file mode 100644 (file)
index d615918..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-.\"    $NetBSD: isnan.3,v 1.2 2004/03/04 23:49:31 wiz Exp $
-.\"    $DragonFly: src/lib/libc/gen/isnan.3,v 1.2 2006/05/17 14:06:37 swildner Exp $
-.\"
-.\" Copyright (c) 1991, 1993
-.\"    The Regents of the University of California.  All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the University nor the names of its contributors
-.\"    may be used to endorse or promote products derived from this software
-.\"    without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\"     From: @(#)isinf.3      8.2 (Berkeley) 1/29/94
-.\"    from: NetBSD: isinf.3,v 1.10 2003/08/07 16:42:52 agc Exp
-.\"
-.Dd March 5, 2004
-.Dt ISNAN 3
-.Os
-.Sh NAME
-.Nm isnan
-.Nd test for not-a-number
-.Sh LIBRARY
-.Lb libc
-.Sh SYNOPSIS
-.In math.h
-.Ft int
-.Fn isnan "real-floating x"
-.Sh DESCRIPTION
-The
-.Fn isnan
-macro determines whether its argument
-.Fa x
-is not-a-number
-.Pq Dq NaN .
-An argument represented in a format wider than its semantic type is
-converted to its semantic type first.
-The determination is then based on the type of the argument.
-.Sh RETURN VALUES
-The
-.Fn isnan
-macro returns a non-zero value if the value of
-.Fa x
-is a NaN.
-Otherwise 0 is returned.
-.Sh SEE ALSO
-.Xr fpclassify 3 ,
-.Xr isfinite 3 ,
-.Xr isinf 3 ,
-.Xr isnormal 3 ,
-.Xr math 3 ,
-.Xr signbit 3
-.Rs
-.%T "IEEE Standard for Binary Floating-Point Arithmetic"
-.%Q ANSI
-.%R Std 754-1985
-.Re
-.Sh STANDARDS
-The
-.Fn isnan
-macro conforms to
-.St -isoC-99 .
similarity index 65%
copy from lib/libc/gen/frexp.c
copy to lib/libc/gen/isnan.c
index 24e1069..2a21e22 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/gen/frexp.c,v 1.1 2004/07/18 21:23:39 das Exp $
+ * $FreeBSD: head/lib/libc/gen/isnan.c 242894 2012-11-11 13:28:04Z dim $
  */
 
 #include <math.h>
 
 #include "fpmath.h"
 
-double
-frexp(double d, int *ex)
+/*
+ * XXX These routines belong in libm, but they must remain in libc for
+ *     binary compat until we can bump libm's major version number.
+ *
+ * Note this only applies to the dynamic versions of libm and libc, so
+ * for the static and profiled versions we stub out the definitions.
+ * Otherwise you cannot link statically to libm and libc at the same
+ * time, when calling both functions.
+ */
+
+#ifdef PIC
+__weak_reference(__isnan, isnan);
+__weak_reference(__isnanf, isnanf);
+
+int
+__isnan(double d)
 {
        union IEEEd2bits u;
 
        u.d = d;
-       switch (u.bits.exp) {
-       case 0:         /* 0 or subnormal */
-               if ((u.bits.manl | u.bits.manh) == 0) {
-                       *ex = 0;
-               } else {
-                       u.d *= 0x1.0p514;
-                       *ex = u.bits.exp - 1536;
-                       u.bits.exp = 1022;
-               }
-               break;
-       case 2047:      /* infinity or NaN; value of *ex is unspecified */
-               break;
-       default:        /* normal */
-               *ex = u.bits.exp - 1022;
-               u.bits.exp = 1022;
-               break;
-       }
-       return (u.d);
+       return (u.bits.exp == 2047 && (u.bits.manl != 0 || u.bits.manh != 0));
+}
+
+int
+__isnanf(float f)
+{
+       union IEEEf2bits u;
+
+       u.f = f;
+       return (u.bits.exp == 255 && u.bits.man != 0);
 }
+#endif /* PIC */
diff --git a/lib/libc/gen/isnand.c b/lib/libc/gen/isnand.c
deleted file mode 100644 (file)
index f5b7db7..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*     $NetBSD: isnand_ieee754.c,v 1.1 2004/03/04 23:42:39 kleink Exp $        */
-/*     $DragonFly: src/lib/libc/gen/isnand.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*
- * Copyright (c) 1992, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.4 isnan - test for a NaN
- *          IEEE 754 double-precision version
- */
-int
-__isnand(double x)
-{
-       union ieee_double_u u;
-
-       u.dblu_d = x;
-
-       return (u.dblu_dbl.dbl_exp == DBL_EXP_INFNAN &&
-           (u.dblu_dbl.dbl_frach != 0 || u.dblu_dbl.dbl_fracl != 0));
-}
diff --git a/lib/libc/gen/isnanf.c b/lib/libc/gen/isnanf.c
deleted file mode 100644 (file)
index d34d456..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*     $NetBSD: isnanf_ieee754.c,v 1.1 2004/03/04 23:42:39 kleink Exp $        */
-/*     $DragonFly: src/lib/libc/gen/isnanf.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*
- * Copyright (c) 1992, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.4 isnan - test for a NaN
- *          IEEE 754 single-precision version
- */
-int
-__isnanf(float x)
-{
-       union ieee_single_u u;
-
-       u.sngu_f = x;
-
-       return (u.sngu_sng.sng_exp == SNG_EXP_INFNAN &&
-           u.sngu_sng.sng_frac != 0);
-}
diff --git a/lib/libc/gen/isnormal.3 b/lib/libc/gen/isnormal.3
deleted file mode 100644 (file)
index a71d670..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-.\"    $NetBSD: isnormal.3,v 1.2 2004/01/15 20:30:46 wiz Exp $
-.\"    $DragonFly: src/lib/libc/gen/isnormal.3,v 1.1 2006/04/08 14:12:36 swildner Exp $
-.\"
-.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
-.\" All rights reserved.
-.\"
-.\" This code is derived from software contributed to The NetBSD Foundation
-.\" by Klaus Klein.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"    must display the following acknowledgement:
-.\"        This product includes software developed by the NetBSD
-.\"        Foundation, Inc. and its contributors.
-.\" 4. Neither the name of The NetBSD Foundation nor the names of its
-.\"    contributors may be used to endorse or promote products derived
-.\"    from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-.\" POSSIBILITY OF SUCH DAMAGE.
-.\"
-.Dd October 29, 2003
-.Dt ISNORMAL 3
-.Os
-.Sh NAME
-.Nm isnormal
-.Nd test for normal value
-.Sh LIBRARY
-.Lb libc
-.Sh SYNOPSIS
-.In math.h
-.Ft int
-.Fn isnormal "real-floating x"
-.Sh DESCRIPTION
-The
-.Fn isnormal
-macro determines whether its argument
-.Fa x
-has a normal value.
-An argument represented in a format wider than its semantic type is
-converted to its semantic type first.
-The determination is then based on the type of the argument.
-.Sh RETURN VALUES
-The
-.Fn isnormal
-macro returns a non-zero value if the value of
-.Fa x
-is finite.
-Otherwise 0 is returned.
-.Sh ERRORS
-No errors are defined.
-.Sh SEE ALSO
-.Xr fpclassify 3 ,
-.Xr isfinite 3 ,
-.Xr math 3 ,
-.Xr signbit 3
-.Sh STANDARDS
-The
-.Fn isnormal
-macro conforms to
-.St -isoC-99 .
index 389fb75..aebc831 100644 (file)
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)ldexp.3    8.2 (Berkeley) 4/19/94
-.\" $FreeBSD: src/lib/libc/gen/ldexp.3,v 1.5.2.3 2001/12/14 18:33:51 ru Exp $
-.\" $DragonFly: src/lib/libc/gen/ldexp.3,v 1.2 2003/06/17 04:26:42 dillon Exp $
+.\" $FreeBSD: head/lib/libc/gen/ldexp.3 165903 2007-01-09 00:28:16Z imp $
 .\"
-.Dd April 19, 1994
+.Dd March 4, 2005
 .Dt LDEXP 3
 .Os
 .Sh NAME
-.Nm ldexp
+.Nm ldexp ,
+.Nm ldexpf ,
+.Nm ldexpl
 .Nd multiply floating-point number by integral power of 2
 .Sh LIBRARY
-.Lb libc
+.Lb libm
 .Sh SYNOPSIS
 .In math.h
 .Ft double
 .Fn ldexp "double x" "int exp"
+.Ft float
+.Fn ldexpf "float x" "int exp"
+.Ft long double
+.Fn ldexpl "long double x" "int exp"
 .Sh DESCRIPTION
 The
-.Fn ldexp
-function multiplies a floating-point number by an integral
+.Fn ldexp ,
+.Fn ldexpf ,
+and
+.Fn ldexpl
+functions multiply a floating-point number by an integral
 power of 2.
 .Sh RETURN VALUES
-The
-.Fn ldexp
-function returns the value of
+These functions return the value of
 .Fa x
 times 2 raised to the power
 .Fa exp .
-.Pp
-If the resultant value would cause an overflow,
-the global variable
-.Va errno
-is set to
-.Er ERANGE
-and the value
-.Dv HUGE
-is returned.
 .Sh SEE ALSO
 .Xr frexp 3 ,
 .Xr math 3 ,
 .Xr modf 3
 .Sh STANDARDS
 The
-.Fn ldexp
-function conforms to
-.St -isoC .
+.Fn ldexp ,
+.Fn ldexpf ,
+and
+.Fn ldexpl
+functions conform to
+.St -isoC-99 .
diff --git a/lib/libc/gen/ldexp.c b/lib/libc/gen/ldexp.c
new file mode 100644 (file)
index 0000000..87d3dd8
--- /dev/null
@@ -0,0 +1,121 @@
+/* @(#)s_scalbn.c 5.1 93/09/24 */
+/* @(#)fdlibm.h 5.1 93/09/24 */
+/* $FreeBSD: head/lib/libc/gen/ldexp.c 140607 2005-01-22 06:03:40Z das $ */
+/*
+ * ====================================================
+ * 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.
+ * ====================================================
+ */
+
+#include <sys/types.h>
+#include <machine/endian.h>
+#include <math.h>
+
+/* Bit fiddling routines copied from msun/src/math_private.h,v 1.15 */
+
+#if BYTE_ORDER == BIG_ENDIAN
+
+typedef union
+{
+  double value;
+  struct
+  {
+    u_int32_t msw;
+    u_int32_t lsw;
+  } parts;
+} ieee_double_shape_type;
+
+#endif
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+
+typedef union
+{
+  double value;
+  struct
+  {
+    u_int32_t lsw;
+    u_int32_t msw;
+  } parts;
+} ieee_double_shape_type;
+
+#endif
+
+/* Get two 32 bit ints from a double.  */
+
+#define EXTRACT_WORDS(ix0,ix1,d)                               \
+do {                                                           \
+  ieee_double_shape_type ew_u;                                 \
+  ew_u.value = (d);                                            \
+  (ix0) = ew_u.parts.msw;                                      \
+  (ix1) = ew_u.parts.lsw;                                      \
+} while (0)
+
+/* Get the more significant 32 bit int from a double.  */
+
+#define GET_HIGH_WORD(i,d)                                     \
+do {                                                           \
+  ieee_double_shape_type gh_u;                                 \
+  gh_u.value = (d);                                            \
+  (i) = gh_u.parts.msw;                                                \
+} while (0)
+
+/* Set the more significant 32 bits of a double from an int.  */
+
+#define SET_HIGH_WORD(d,v)                                     \
+do {                                                           \
+  ieee_double_shape_type sh_u;                                 \
+  sh_u.value = (d);                                            \
+  sh_u.parts.msw = (v);                                                \
+  (d) = sh_u.value;                                            \
+} while (0)
+
+
+static const double
+two54   =  1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
+twom54  =  5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
+huge   = 1.0e+300,
+tiny   = 1.0e-300;
+
+static double
+_copysign(double x, double y)
+{
+       u_int32_t hx,hy;
+       GET_HIGH_WORD(hx,x);
+       GET_HIGH_WORD(hy,y);
+       SET_HIGH_WORD(x,(hx&0x7fffffff)|(hy&0x80000000));
+       return x;
+}
+
+double
+ldexp(double x, int n)
+{
+       int32_t k,hx,lx;
+       EXTRACT_WORDS(hx,lx,x);
+        k = (hx&0x7ff00000)>>20;               /* extract exponent */
+        if (k==0) {                            /* 0 or subnormal x */
+            if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
+           x *= two54;
+           GET_HIGH_WORD(hx,x);
+           k = ((hx&0x7ff00000)>>20) - 54;
+            if (n< -50000) return tiny*x;      /*underflow*/
+           }
+        if (k==0x7ff) return x+x;              /* NaN or Inf */
+        k = k+n;
+        if (k >  0x7fe) return huge*_copysign(huge,x); /* overflow  */
+        if (k > 0)                             /* normal result */
+           {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
+        if (k <= -54) {
+            if (n > 50000)     /* in case integer overflow in n+k */
+               return huge*_copysign(huge,x);  /*overflow*/
+           else return tiny*_copysign(tiny,x);         /*underflow*/
+       }
+        k += 54;                               /* subnormal result */
+       SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
+        return x*twom54;
+}
index 692d2a3..7f662c0 100644 (file)
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)modf.3     8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/gen/modf.3,v 1.3.2.4 2003/03/13 18:05:37 trhodes Exp $
-.\" $DragonFly: src/lib/libc/gen/modf.3,v 1.2 2003/06/17 04:26:42 dillon Exp $
+.\" $FreeBSD: head/lib/libc/gen/modf.3 177710 2008-03-29 16:19:35Z das $
 .\"
-.Dd June 4, 1993
+.Dd March 29, 2008
 .Dt MODF 3
 .Os
 .Sh NAME
-.Nm modf
+.Nm modf ,
+.Nm modff ,
+.Nm modfl
 .Nd extract signed integral and fractional values from floating-point number
 .Sh LIBRARY
-.Lb libc
+.Lb libm
 .Sh SYNOPSIS
 .In math.h
 .Ft double
 .Fn modf "double value" "double *iptr"
+.Ft float
+.Fn modff "float value" "float *iptr"
+.Ft long double
+.Fn modfl "long double value" "long double *iptr"
 .Sh DESCRIPTION
 The
-.Fn modf
-function breaks the argument
+.Fn modf ,
+.Fn modff ,
+and
+.Fn modfl
+functions break the argument
 .Fa value
 into integral and fractional parts, each of which has the
 same sign as the argument.
 It stores the integral part as a
-.Vt double
+floating point number
 in the object pointed to by
 .Fa iptr .
 .Sh RETURN VALUES
-The
-.Fn modf
-function returns the signed fractional part of
+These functions return the signed fractional part of
 .Fa value .
 .Sh SEE ALSO
 .Xr frexp 3 ,
@@ -67,6 +73,9 @@ function returns the signed fractional part of
 .Xr math 3
 .Sh STANDARDS
 The
-.Fn modf
-function conforms to
-.St -isoC .
+.Fn modf ,
+.Fn modff ,
+and
+.Fn modfl
+functions conform to
+.St -isoC-99 .
similarity index 60%
copy from lib/libm/src/s_modf.c
copy to lib/libc/gen/modf.c
index aab8d0a..4e1b805 100644 (file)
@@ -1,4 +1,5 @@
 /* @(#)s_modf.c 5.1 93/09/24 */
+/* $FreeBSD: head/lib/libc/gen/modf.c 226606 2011-10-21 06:40:36Z das $ */
 /*
  * ====================================================
  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -8,8 +9,6 @@
  * software is freely granted, provided that this notice
  * is preserved.
  * ====================================================
- *
- * FreeBSD SVN: 165838 (2007-01-06)
  */
 
 /*
  *     No exception.
  */
 
+#include <sys/types.h>
+#include <machine/endian.h>
 #include <math.h>
-#include "math_private.h"
+
+/* Bit fiddling routines copied from msun/src/math_private.h,v 1.15 */
+
+#if BYTE_ORDER == BIG_ENDIAN
+
+typedef union
+{
+  double value;
+  struct
+  {
+    u_int32_t msw;
+    u_int32_t lsw;
+  } parts;
+} ieee_double_shape_type;
+
+#endif
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+
+typedef union
+{
+  double value;
+  struct
+  {
+    u_int32_t lsw;
+    u_int32_t msw;
+  } parts;
+} ieee_double_shape_type;
+
+#endif
+
+/* Get two 32 bit ints from a double.  */
+
+#define EXTRACT_WORDS(ix0,ix1,d)                               \
+do {                                                           \
+  ieee_double_shape_type ew_u;                                 \
+  ew_u.value = (d);                                            \
+  (ix0) = ew_u.parts.msw;                                      \
+  (ix1) = ew_u.parts.lsw;                                      \
+} while (0)
+
+/* Get the more significant 32 bit int from a double.  */
+
+#define GET_HIGH_WORD(i,d)                                     \
+do {                                                           \
+  ieee_double_shape_type gh_u;                                 \
+  gh_u.value = (d);                                            \
+  (i) = gh_u.parts.msw;                                                \
+} while (0)
+
+/* Set a double from two 32 bit ints.  */
+
+#define INSERT_WORDS(d,ix0,ix1)                                        \
+do {                                                           \
+  ieee_double_shape_type iw_u;                                 \
+  iw_u.parts.msw = (ix0);                                      \
+  iw_u.parts.lsw = (ix1);                                      \
+  (d) = iw_u.value;                                            \
+} while (0)
 
 static const double one = 1.0;
 
diff --git a/lib/libc/gen/signbit.3 b/lib/libc/gen/signbit.3
deleted file mode 100644 (file)
index a8ecf93..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-.\"    $NetBSD: signbit.3,v 1.2 2004/01/15 20:31:40 wiz Exp $
-.\"    $DragonFly: src/lib/libc/gen/signbit.3,v 1.1 2005/07/26 21:15:19 joerg Exp $
-.\"
-.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
-.\" All rights reserved.
-.\"
-.\" This code is derived from software contributed to The NetBSD Foundation
-.\" by Klaus Klein.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"    must display the following acknowledgement:
-.\"        This product includes software developed by the NetBSD
-.\"        Foundation, Inc. and its contributors.
-.\" 4. Neither the name of The NetBSD Foundation nor the names of its
-.\"    contributors may be used to endorse or promote products derived
-.\"    from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-.\" POSSIBILITY OF SUCH DAMAGE.
-.\"
-.Dd October 29, 2003
-.Dt SIGNBIT 3
-.Os
-.Sh NAME
-.Nm signbit
-.Nd test sign
-.Sh LIBRARY
-.Lb libc
-.Sh SYNOPSIS
-.In math.h
-.Ft int
-.Fn signbit "real-floating x"
-.Sh DESCRIPTION
-The
-.Fn signbit
-macro determines whether the sign of its argument value
-.Fa x
-is negative.
-An argument represented in a format wider than its semantic type is
-converted to its semantic type first.
-The determination is then based on the type of the argument.
-.Sh RETURN VALUES
-The
-.Fn signbit
-macro returns a non-zero value if the sign of its value
-.Fa x
-is negative.
-Otherwise 0 is returned.
-.Sh ERRORS
-No errors are defined.
-.Sh SEE ALSO
-.Xr fpclassify 3 ,
-.Xr isfinite 3 ,
-.Xr isnormal 3 ,
-.Xr math 3
-.Sh STANDARDS
-The
-.Fn signbit
-macro conforms to
-.St -isoC-99 .
diff --git a/lib/libc/gen/signbitd.c b/lib/libc/gen/signbitd.c
deleted file mode 100644 (file)
index 9110a65..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * $NetBSD: signbitd_ieee754.c,v 1.1 2004/01/15 19:43:45 kleink Exp $
- * $DragonFly: src/lib/libc/gen/signbitd.c,v 1.1 2005/07/26 21:15:19 joerg Exp $
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.6 signbit - determine whether the sign of an argument is negative
- *          IEEE 754 double-precision version
- */
-int
-__signbitd(double x)
-{
-       union ieee_double_u u;
-
-       u.dblu_d = x;
-
-       return (u.dblu_dbl.dbl_sign == 1);
-}
diff --git a/lib/libc/gen/signbitf.c b/lib/libc/gen/signbitf.c
deleted file mode 100644 (file)
index 4f8b69e..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * $NetBSD: signbitf_ieee754.c,v 1.1 2004/01/15 19:43:45 kleink Exp $
- * $DragonFly: src/lib/libc/gen/signbitf.c,v 1.1 2005/07/26 21:15:19 joerg Exp $
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.6 signbit - determine whether the sign of an argument is negative
- *          IEEE 754 single-precision version
- */
-int
-__signbitf(float x)
-{
-       union ieee_single_u u;
-
-       u.sngu_f = x;
-
-       return (u.sngu_sng.sng_sign == 1);
-}
index 9d0fbbd..3c29621 100644 (file)
@@ -1,10 +1,8 @@
 #      @(#)Makefile.inc        8.1 (Berkeley) 6/4/93
 # $FreeBSD: src/lib/libc/i386/gen/Makefile.inc,v 1.10.2.1 2001/02/07 00:12:45 peter Exp $
 
-SRCS+= fpclassifyl.c infinityl.c isfinitel.c isinfl.c isnanl.c \
-       ldexp.c makecontext.c nanf.c signbitl.c \
-       _ctx_start.S _setjmp.S alloca.S fabs.S flt_rounds.S fpgetmask.S \
-       fpgetround.S \
-       fpgetsticky.S fpsetmask.S fpsetround.S fpsetsticky.S mcontext.S modf.S \
+SRCS+= fabs.S flt_rounds.c infinity.c \
+       makecontext.c \
+       _ctx_start.S _setjmp.S alloca.S \
+       mcontext.S \
        rfork_thread.S setjmp.S sigsetjmp.S
-
index a86a5b7..a91d976 100644 (file)
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
  * 4. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/i386/gen/fabs.S,v 1.5 1999/08/27 23:59:20 peter Exp $
- * $DragonFly: src/lib/libc/i386/gen/fabs.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $
+ * @(#)fabs.s  5.2 (Berkeley) 12/17/90
+ * $FreeBSD: head/lib/libc/i386/gen/fabs.S 217106 2011-01-07 16:08:40Z kib $
  */
 
-#include "DEFS.h"
+#include <machine/asm.h>
 
 ENTRY(fabs)
        fldl    4(%esp)
        fabs
        ret
+END(fabs)
+
+       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/i386/gen/flt_rounds.S b/lib/libc/i386/gen/flt_rounds.S
deleted file mode 100644 (file)
index 4f49c3e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Written by J.T. Conklin, Apr 4, 1995
- * Public domain.
- *
- * $NetBSD: flt_rounds.S,v 1.6 1999/08/23 08:45:09 kleink Exp $
- * $DragonFly: src/lib/libc/i386/gen/flt_rounds.S,v 1.1 2005/07/26 21:15:19 joerg Exp $
- */
-
-#include <machine/asm.h>
-
-_START_ENTRY
-_map:
-       .byte 1         /* round to nearest */
-       .byte 3         /* round to negative infinity */
-       .byte 2         /* round to positive infinity */
-       .byte 0         /* round to zero */
-
-ENTRY(__flt_rounds)
-       subl $4,%esp
-       fnstcw (%esp)
-       movl (%esp),%eax
-       shrl $10,%eax
-       andl $3,%eax
-#ifdef PIC
-       PIC_PROLOGUE
-       leal PIC_GOTOFF(_map),%ecx
-       PIC_EPILOGUE
-       movb (%ecx,%eax,1),%al
-#else
-       movb _map(,%eax,1),%al
-#endif
-       addl $4,%esp
-       ret
similarity index 72%
copy from lib/libc/x86_64/gen/flt_rounds.c
copy to lib/libc/i386/gen/flt_rounds.c
index cd7e501..b965e5d 100644 (file)
@@ -1,6 +1,8 @@
 /*
  * Written by J.T. Conklin, Apr 10, 1995
  * Public domain.
+ *
+ * $FreeBSD: head/lib/libc/i386/gen/flt_rounds.c 132383 2004-07-19 08:17:25Z das $
  */
 
 #include <float.h>
@@ -17,7 +19,6 @@ __flt_rounds(void)
 {
        int x;
 
-        /* Assume that the x87 and the SSE unit agree on the rounding mode. */
        __asm("fnstcw %0" : "=m" (x));
-        return (map[(x >> 10) & 0x03]);
+       return (map[(x >> 10) & 0x03]);
 }
diff --git a/lib/libc/i386/gen/fpclassifyl.c b/lib/libc/i386/gen/fpclassifyl.c
deleted file mode 100644 (file)
index c39106c..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*     $NetBSD: fpclassifyl.c,v 1.1 2003/10/28 22:05:37 kleink Exp $   */
-/*     $DragonFly: src/lib/libc/i386/gen/fpclassifyl.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/ieee.h>
-#include <assert.h>
-#include <math.h>
-
-/*
- * 7.12.3.1 fpclassify - classify real floating type
- *          IEEE 754 compatible 80-bit extended-precision Intel 386 version
- */
-int
-__fpclassifyl(long double x)
-{
-       union ieee_ext_u u;
-
-       u.extu_ld = x;
-
-       _DIAGASSERT(u.extu_ext.ext_exp == 0 || u.extu_ext.ext_int == 1);
-
-       if (u.extu_ext.ext_exp == 0) {
-               if (u.extu_ext.ext_frach == 0 && u.extu_ext.ext_fracl == 0)
-                       return FP_ZERO;
-               else
-                       return FP_SUBNORMAL;
-       } else if (u.extu_ext.ext_exp == EXT_EXP_INFNAN) {
-               if (u.extu_ext.ext_frach == 0 && u.extu_ext.ext_fracl == 0)
-                       return FP_INFINITE;
-               else
-                       return FP_NAN;
-       }
-
-       return FP_NORMAL;
-}
diff --git a/lib/libc/i386/gen/fpgetmask.S b/lib/libc/i386/gen/fpgetmask.S
deleted file mode 100644 (file)
index aa9c432..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Written by J.T. Conklin, Apr 4, 1995
- * Public domain.
- *
- * $NetBSD: fpgetmask.S,v 1.4 2002/01/13 21:45:42 thorpej Exp $
- * $DragonFly: src/lib/libc/i386/gen/fpgetmask.S,v 1.1 2005/07/26 21:15:19 joerg Exp $
- */
-
-#include <machine/asm.h>
-
-#ifdef WEAK_ALIAS
-WEAK_ALIAS(fpgetmask, _fpgetmask)
-ENTRY(_fpgetmask)
-#else
-ENTRY(fpgetmask)
-#endif
-       subl $4,%esp
-       fnstcw (%esp)
-       movl (%esp),%eax
-       notl %eax
-       andl $63,%eax
-       addl $4,%esp
-       ret
diff --git a/lib/libc/i386/gen/fpgetround.S b/lib/libc/i386/gen/fpgetround.S
deleted file mode 100644 (file)
index 3a7f9a7..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Written by J.T. Conklin, Apr 4, 1995
- * Public domain.
- *
- * $NetBSD: fpgetround.S,v 1.5 2002/01/13 21:45:43 thorpej Exp $
- * $DragonFly: src/lib/libc/i386/gen/fpgetround.S,v 1.1 2005/07/26 21:15:19 joerg Exp $
- */
-
-#include <machine/asm.h>
-
-#ifdef WEAK_ALIAS
-WEAK_ALIAS(fpgetround, _fpgetround)
-ENTRY(_fpgetround)
-#else
-ENTRY(fpgetround)
-#endif
-       subl $4,%esp
-       fnstcw (%esp)
-       movl (%esp),%eax
-       rorl $10,%eax
-       andl $3,%eax
-       addl $4,%esp
-       ret
diff --git a/lib/libc/i386/gen/fpgetsticky.S b/lib/libc/i386/gen/fpgetsticky.S
deleted file mode 100644 (file)
index a6285dc..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Written by J.T. Conklin, Apr 4, 1995
- * Public domain.
- * $NetBSD: fpgetsticky.S,v 1.6 2002/01/13 21:45:43 thorpej Exp $
- * $DragonFly: src/lib/libc/i386/gen/fpgetsticky.S,v 1.1 2005/07/26 21:15:19 joerg Exp $
- */
-
-#include <machine/asm.h>
-
-#ifdef WEAK_ALIAS
-WEAK_ALIAS(fpgetsticky, _fpgetsticky)
-ENTRY(_fpgetsticky)
-#else
-ENTRY(fpgetsticky)
-#endif
-       subl $4,%esp
-       fnstsw (%esp)
-       movl (%esp),%eax
-       andl $63,%eax
-       addl $4,%esp
-       ret
diff --git a/lib/libc/i386/gen/fpsetmask.S b/lib/libc/i386/gen/fpsetmask.S
deleted file mode 100644 (file)
index ad8278c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Written by Charles M. Hannum, Apr 9, 1995
- * Public domain.
- *
- * $NetBSD: fpsetmask.S,v 1.4 2002/01/13 21:45:43 thorpej Exp $
- * $DragonFly: src/lib/libc/i386/gen/fpsetmask.S,v 1.1 2005/07/26 21:15:19 joerg Exp $
- */
-
-#include <machine/asm.h>
-
-#ifdef WEAK_ALIAS
-WEAK_ALIAS(fpsetmask, _fpsetmask)
-ENTRY(_fpsetmask)
-#else
-ENTRY(fpsetmask)
-#endif
-       subl $4,%esp
-
-       fnstcw (%esp)
-       movl (%esp),%eax
-       movl %eax,%edx
-
-       notl %eax
-       andl $63,%eax
-
-       addl %eax,%edx
-       movl 8(%esp),%ecx
-       andl $63,%ecx
-       subl %ecx,%edx
-       movl %edx,(%esp)
-       fldcw (%esp)
-
-       addl $4,%esp
-       ret
diff --git a/lib/libc/i386/gen/fpsetround.S b/lib/libc/i386/gen/fpsetround.S
deleted file mode 100644 (file)
index 24f63d8..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Written by Charles M. Hannum, Apr 9, 1995
- * Public domain.
- *
- * $NetBSD: fpsetround.S,v 1.3 2002/01/13 21:45:43 thorpej Exp $
- * $DragonFly: src/lib/libc/i386/gen/fpsetround.S,v 1.1 2005/07/26 21:15:19 joerg Exp $
- */
-
-#include <machine/asm.h>
-
-#ifdef WEAK_ALIAS
-WEAK_ALIAS(fpsetround, _fpsetround)
-ENTRY(_fpsetround)
-#else
-ENTRY(fpsetround)
-#endif
-       subl $4,%esp
-
-       fnstcw (%esp)
-       movl (%esp),%eax
-
-       rorl $10,%eax
-       movl %eax,%edx
-       andl $3,%eax
-
-       subl %eax,%edx
-       movl 8(%esp),%ecx
-       andl $3,%ecx
-       orl %ecx,%edx
-       roll $10,%edx
-       movl %edx,(%esp)
-       fldcw (%esp)
-
-       addl $4,%esp
-       ret
diff --git a/lib/libc/i386/gen/fpsetsticky.S b/lib/libc/i386/gen/fpsetsticky.S
deleted file mode 100644 (file)
index 58b7b7e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Written by Charles M. Hannum, Apr 9, 1995
- * Public domain.
- *
- * $NetBSD: fpsetsticky.S,v 1.6 2002/01/13 21:45:43 thorpej Exp $
- * $DragonFly: src/lib/libc/i386/gen/fpsetsticky.S,v 1.1 2005/07/26 21:15:19 joerg Exp $
- */
-
-#include <machine/asm.h>
-
-#ifdef WEAK_ALIAS
-WEAK_ALIAS(fpsetsticky, _fpsetsticky)
-ENTRY(_fpsetsticky)
-#else
-ENTRY(fpsetsticky)
-#endif
-       subl $28,%esp
-
-       fnstenv (%esp)
-       movl 4(%esp),%eax
-       movl %eax,%edx
-
-       andl $63,%eax
-
-       subl %eax,%edx
-       movl 32(%esp),%ecx
-       andl $63,%ecx
-       addl %ecx,%edx
-       movl %edx,4(%esp)
-       fldenv (%esp)
-
-       addl $28,%esp
-       ret
diff --git a/lib/libc/i386/gen/infinity.c b/lib/libc/i386/gen/infinity.c
new file mode 100644 (file)
index 0000000..cd765b9
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * infinity.c
+ * $FreeBSD: head/lib/libc/i386/gen/infinity.c 110566 2003-02-08 20:37:55Z mike $
+ */
+
+#include <math.h>
+
+/* bytes for +Infinity on a 387 */
+const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
+
+/* bytes for NaN */
+const union __nan_un __nan = { { 0, 0, 0xc0, 0xff } };
diff --git a/lib/libc/i386/gen/infinityl.c b/lib/libc/i386/gen/infinityl.c
deleted file mode 100644 (file)
index 08b868b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*     $NetBSD: infinityl.c,v 1.2 2005/06/12 05:21:26 lukem Exp $      */
-/*     $DragonFly: src/lib/libc/i386/gen/infinityl.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*
- * IEEE-compatible infinityl.c for little-endian 80-bit format -- public domain.
- * Note that the representation includes 16 bits of tail padding per i386 ABI.
- */
-
-#include <math.h>
-
-const union __long_double_u __infinityl =
-       { { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 } };
diff --git a/lib/libc/i386/gen/isfinitel.c b/lib/libc/i386/gen/isfinitel.c
deleted file mode 100644 (file)
index a6c09a0..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*     $NetBSD: isfinitel.c,v 1.1 2003/10/29 20:03:51 kleink Exp $     */
-/*     $DragonFly: src/lib/libc/i386/gen/isfinitel.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/ieee.h>
-#include <assert.h>
-#include <math.h>
-
-/*
- * 7.12.3.2 isfinite - determine whether an argument has finite value
- *          IEEE 754 compatible 80-bit extended-precision Intel 386 version
- */
-int
-__isfinitel(long double x)
-{
-       union ieee_ext_u u;
-
-       u.extu_ld = x;
-
-       _DIAGASSERT(u.extu_ext.ext_exp == 0 || u.extu_ext.ext_int == 1);
-
-       if (u.extu_ext.ext_exp == EXT_EXP_INFNAN)
-               return 0;
-
-       return 1;
-}
diff --git a/lib/libc/i386/gen/isinfl.c b/lib/libc/i386/gen/isinfl.c
deleted file mode 100644 (file)
index 4482c45..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*     $NetBSD: isinfl.c,v 1.5 2004/03/04 23:42:38 kleink Exp $        */
-/*     $DragonFly: src/lib/libc/i386/gen/isinfl.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*
- * Copyright (c) 1992, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.3 isinf - test for infinity
- *          IEEE 754 compatible 80-bit extended-precision Intel 386 version
- */
-int
-__isinfl(long double x)
-{
-       union ieee_ext_u u;
-
-       u.extu_ld = x;
-
-       return (u.extu_ext.ext_exp == EXT_EXP_INFNAN &&
-           (u.extu_ext.ext_int == 1 &&
-            u.extu_ext.ext_frach == 0 && u.extu_ext.ext_fracl == 0));
-}
diff --git a/lib/libc/i386/gen/isnanl.c b/lib/libc/i386/gen/isnanl.c
deleted file mode 100644 (file)
index ca5e930..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*     $NetBSD: isnanl.c,v 1.5 2004/03/04 23:42:38 kleink Exp $        */
-/*     $DragonFly: src/lib/libc/i386/gen/isnanl.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*
- * Copyright (c) 1992, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.4 isnan - test for a NaN
- *          IEEE 754 compatible 80-bit extended-precision Intel 386 version
- */
-int
-__isnanl(long double x)
-{
-       union ieee_ext_u u;
-
-       u.extu_ld = x;
-
-       return (u.extu_ext.ext_exp == EXT_EXP_INFNAN &&
-           u.extu_ext.ext_int == 1 &&
-           (u.extu_ext.ext_frach != 0 || u.extu_ext.ext_fracl != 0));
-}
diff --git a/lib/libc/i386/gen/ldexp.c b/lib/libc/i386/gen/ldexp.c
deleted file mode 100644 (file)
index 0b00bab..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Sean Eric Fagan.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/i386/gen/ldexp.c,v 1.6 1999/08/27 23:59:21 peter Exp $
- * $DragonFly: src/lib/libc/i386/gen/ldexp.c,v 1.5 2005/11/20 09:18:36 swildner Exp $
- */
-
-#include <math.h>
-
-/*
- * ldexp(value, exp): return value * (2 ** exp).
- *
- * Written by Sean Eric Fagan (sef@kithrup.COM)
- * Sun Mar 11 20:27:09 PST 1990
- */
-
-/*
- * We do the conversion in C to let gcc optimize it away, if possible.
- * The "fxch ; fstp" stuff is because value is still on the stack
- * (stupid 8087!).
- */
-double
-ldexp (double value, int expo)
-{
-       double temp;
-#ifdef __GNUC__
-       __asm ("fscale"
-               : "=t" (temp)
-               : "0" (value), "u" ((double)expo));
-#else
-#error "Compiler not supported"
-#endif
-       return (temp);
-}
diff --git a/lib/libc/i386/gen/modf.S b/lib/libc/i386/gen/modf.S
deleted file mode 100644 (file)
index 98d44a7..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Sean Eric Fagan.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/i386/gen/modf.S,v 1.6 1999/08/27 23:59:22 peter Exp $
- * $DragonFly: src/lib/libc/i386/gen/modf.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $
- */
-
-/*
- * modf(value, iptr): return fractional part of value, and stores the
- * integral part into iptr (a pointer to double).
- *
- * Written by Sean Eric Fagan (sef@kithrup.COM)
- * Sun Mar 11 20:27:30 PST 1990
- */
-
-/* With CHOP mode on, frndint behaves as TRUNC does.  Useful. */
-
-#include "DEFS.h"
-
-ENTRY(modf)
-       pushl %ebp
-       movl %esp,%ebp
-       subl $16,%esp
-       fnstcw -12(%ebp)
-       movw -12(%ebp),%dx
-       orw $3072,%dx
-       movw %dx,-16(%ebp)
-       fldcw -16(%ebp)
-       fldl 8(%ebp)
-       frndint
-       fstpl -8(%ebp)
-       fldcw -12(%ebp)
-       movl 16(%ebp),%eax
-       movl -8(%ebp),%edx
-       movl -4(%ebp),%ecx
-       movl %edx,(%eax)
-       movl %ecx,4(%eax)
-       fldl 8(%ebp)
-       fsubl -8(%ebp)
-       jmp L1
-L1:
-       leave
-       ret
diff --git a/lib/libc/i386/gen/nanf.c b/lib/libc/i386/gen/nanf.c
deleted file mode 100644 (file)
index 730b6d9..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/*     $NetBSD: nanf.c,v 1.3 2005/04/15 22:39:11 kleink Exp $  */
-/*     $DragonFly: src/lib/libc/i386/gen/nanf.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-#include <math.h>
-#include <machine/endian.h>
-
-/* bytes for quiet NaN (IEEE single precision) */
-const union __float_u __nanf =
-               { {    0,    0, 0xc0, 0x7f } };
diff --git a/lib/libc/i386/gen/signbitl.c b/lib/libc/i386/gen/signbitl.c
deleted file mode 100644 (file)
index ba5ede6..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*     $NetBSD: signbitl.c,v 1.1 2004/01/15 19:43:45 kleink Exp $      */
-/*     $DragonFly: src/lib/libc/i386/gen/signbitl.c,v 1.1 2005/07/26 21:15:19 joerg Exp $ */
-
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.6 signbit - determine whether the sign of an argument is negative
- *          IEEE 754 compatible 80-bit extended-precision Intel 386 version
- */
-int
-__signbitl(long double x)
-{
-       union ieee_ext_u u;
-
-       u.extu_ld = x;
-
-       return (u.extu_ext.ext_sign == 1);
-}
index f379caa..3338f21 100644 (file)
@@ -2,9 +2,6 @@
 # $FreeBSD: src/lib/libc/amd64/gen/Makefile.inc,v 1.24 2003/10/13 20:32:33 alc Exp $
 
 SRCS+= _setjmp.S rfork_thread.S setjmp.S sigsetjmp.S \
-       fabs.S modf.S mcontext.S\
-       fpclassifyl.c nanf.c signbitl.c flt_rounds.c \
-       infinityl.c isinfl.c isfinitel.c isnanl.c \
-       ldexp.c makecontext.c \
-       fpgetmask.S fpsetmask.S fpgetround.S fpsetround.S \
-       fpgetsticky.S fpsetsticky.S
+       mcontext.S makecontext.c \
+       fabs.S flt_rounds.c fpgetmask.c fpgetprec.c fpgetround.c \
+       fpgetsticky.c fpsetmask.c fpsetprec.c fpsetround.c infinity.c
index 171e3e0..fd8feff 100644 (file)
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/amd64/gen/fabs.S,v 1.4 2008/11/02 01:10:54 peter Exp $
+ * $FreeBSD: head/lib/libc/amd64/gen/fabs.S 217106 2011-01-07 16:08:40Z kib $
  */
 
 #include <machine/asm.h>
@@ -43,3 +43,5 @@ END(fabs)
        .data
 signbit:
        .quad   0x8000000000000000
+
+       .section .note.GNU-stack,"",%progbits
index cd7e501..d24a470 100644 (file)
@@ -1,6 +1,8 @@
 /*
  * Written by J.T. Conklin, Apr 10, 1995
  * Public domain.
+ *
+ * $FreeBSD: head/lib/libc/amd64/gen/flt_rounds.c 132383 2004-07-19 08:17:25Z das $
  */
 
 #include <float.h>
@@ -17,7 +19,7 @@ __flt_rounds(void)
 {
        int x;
 
-        /* Assume that the x87 and the SSE unit agree on the rounding mode. */
+       /* Assume that the x87 and the SSE unit agree on the rounding mode. */
        __asm("fnstcw %0" : "=m" (x));
-        return (map[(x >> 10) & 0x03]);
+       return (map[(x >> 10) & 0x03]);
 }
diff --git a/lib/libc/x86_64/gen/fpclassifyl.c b/lib/libc/x86_64/gen/fpclassifyl.c
deleted file mode 100644 (file)
index b235c7e..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * $NetBSD: fpclassifyl.c,v 1.2 2004/01/18 19:33:01 matt Exp $
- */
-
-#include <machine/ieee.h>
-#include <assert.h>
-#include <math.h>
-
-/*
- * 7.12.3.1 fpclassify - classify real floating type
- *          IEEE 754 compatible 80-bit extended-precision Intel 386 version
- */
-int
-__fpclassifyl(long double x)
-{
-       union ieee_ext_u u;
-
-       u.extu_ld = x;
-
-       _DIAGASSERT(u.extu_ext.ext_exp == 0 || u.extu_ext.ext_int == 1);
-
-       if (u.extu_ext.ext_exp == 0) {
-               if (u.extu_ext.ext_frach == 0 && u.extu_ext.ext_fracl == 0)
-                       return FP_ZERO;
-               else
-                       return FP_SUBNORMAL;
-       } else if (u.extu_ext.ext_exp == EXT_EXP_INFNAN) {
-               if (u.extu_ext.ext_frach == 0 && u.extu_ext.ext_fracl == 0)
-                       return FP_INFINITE;
-               else
-                       return FP_NAN;
-       }
-
-       return FP_NORMAL;
-}
diff --git a/lib/libc/x86_64/gen/fpgetmask.S b/lib/libc/x86_64/gen/fpgetmask.S
deleted file mode 100644 (file)
index 589818e..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Written by J.T. Conklin, Apr 4, 1995
- * Public domain.
- *
- * $NetBSD: fpgetmask.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $
- */
-
-#include <machine/asm.h>
-
-/*
- * XXX only read x87 control word here. If an application only
- * uses the fp* interface to manipulate FP bits, it should
- * always remain in sync with the SSE mxcsr register.
- */
-
-#ifdef WEAK_ALIAS
-WEAK_ALIAS(fpgetmask, _fpgetmask)
-ENTRY(_fpgetmask)
-#else
-ENTRY(fpgetmask)
-#endif
-       fnstcw -4(%rsp)
-       movl -4(%rsp),%eax
-       notl %eax
-       andl $63,%eax
-       ret
diff --git a/lib/libc/x86_64/gen/fpgetmask.c b/lib/libc/x86_64/gen/fpgetmask.c
new file mode 100644 (file)
index 0000000..bae64a3
--- /dev/null
@@ -0,0 +1,8 @@
+/* $FreeBSD: head/lib/libc/amd64/gen/fpgetmask.c 117864 2003-07-22 06:46:17Z peter $ */
+#define __IEEEFP_NOINLINES__ 1
+#include <ieeefp.h>
+
+fp_except_t fpgetmask(void)
+{
+       return __fpgetmask();
+}
diff --git a/lib/libc/x86_64/gen/fpgetprec.c b/lib/libc/x86_64/gen/fpgetprec.c
new file mode 100644 (file)
index 0000000..8565d0e
--- /dev/null
@@ -0,0 +1,8 @@
+/* $FreeBSD: head/lib/libc/amd64/gen/fpgetprec.c 117864 2003-07-22 06:46:17Z peter $ */
+#define __IEEEFP_NOINLINES__ 1
+#include <ieeefp.h>
+
+fp_prec_t fpgetprec(void)
+{
+       return __fpgetprec();
+}
diff --git a/lib/libc/x86_64/gen/fpgetround.S b/lib/libc/x86_64/gen/fpgetround.S
deleted file mode 100644 (file)
index 1a08850..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Written by J.T. Conklin, Apr 4, 1995
- * Public domain.
- *
- * $NetBSD: fpgetround.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $
- */
-
-#include <machine/asm.h>
-
-/*
- * XXX store only x87 state. If an application only uses the fp*
- * interface, this should be in sync with the SSE mxcsr register.
- */
-
-#ifdef WEAK_ALIAS
-WEAK_ALIAS(fpgetround, _fpgetround)
-ENTRY(_fpgetround)
-#else
-ENTRY(fpgetround)
-#endif
-       fnstcw -4(%rsp)
-       movl -4(%rsp),%eax
-       rorl $10,%eax
-       andl $3,%eax
-       ret
diff --git a/lib/libc/x86_64/gen/fpgetround.c b/lib/libc/x86_64/gen/fpgetround.c
new file mode 100644 (file)
index 0000000..26feee4
--- /dev/null
@@ -0,0 +1,8 @@
+/* $FreeBSD: head/lib/libc/amd64/gen/fpgetround.c 117864 2003-07-22 06:46:17Z peter $ */
+#define __IEEEFP_NOINLINES__ 1
+#include <ieeefp.h>
+
+fp_rnd_t fpgetround(void)
+{
+       return __fpgetround();
+}
diff --git a/lib/libc/x86_64/gen/fpgetsticky.S b/lib/libc/x86_64/gen/fpgetsticky.S
deleted file mode 100644 (file)
index 76ffeb3..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Written by Frank van der Linden at Wasabi Systems for NetBSD.
- * Public domain.
- *
- * $NetBSD: fpgetsticky.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $
- */
-
-#include <machine/asm.h>
-
-/*
- * XXX read both the x87 and SSE status words here, and OR
- * them to get a complete picture of exceptions.
- */
-
-#ifdef WEAK_ALIAS
-WEAK_ALIAS(fpgetsticky, _fpgetsticky)
-ENTRY(_fpgetsticky)
-#else
-ENTRY(fpgetsticky)
-#endif
-       fnstsw  -4(%rsp)
-       stmxcsr -8(%rsp)
-       movl    -4(%rsp),%eax
-       orl     -8(%rsp),%eax
-       andl    $63,%eax
-       ret
diff --git a/lib/libc/x86_64/gen/fpgetsticky.c b/lib/libc/x86_64/gen/fpgetsticky.c
new file mode 100644 (file)
index 0000000..6598773
--- /dev/null
@@ -0,0 +1,8 @@
+/* $FreeBSD: head/lib/libc/amd64/gen/fpgetsticky.c 117864 2003-07-22 06:46:17Z peter $ */
+#define __IEEEFP_NOINLINES__ 1
+#include <ieeefp.h>
+
+fp_except_t fpgetsticky(void)
+{
+       return __fpgetsticky();
+}
diff --git a/lib/libc/x86_64/gen/fpsetmask.S b/lib/libc/x86_64/gen/fpsetmask.S
deleted file mode 100644 (file)
index 42476f9..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Written by Frank van der Linden at Wasabi Systems for NetBSD.
- * Public domain.
- *
- * $NetBSD: fpsetmask.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $
- */
-
-#include <machine/asm.h>
-
-/*
- * XXX set both the x87 control word and the SSE mxcsr register.
- * Applications should only set exception and round flags
- * via the fp*() interface, otherwise the status words
- * will get our of sync.
- */
-
-#ifdef WEAK_ALIAS
-WEAK_ALIAS(fpsetmask, _fpsetmask)
-ENTRY(_fpsetmask)
-#else
-ENTRY(fpsetmask)
-#endif
-       fnstcw  -4(%rsp)
-       stmxcsr -8(%rsp)
-       andl    $63,%edi
-       notl    %edi
-
-       movl    -4(%rsp),%edx
-       movl    %edx,%eax
-       andl    %edi,%edx
-       movl    %edx,-4(%rsp)
-
-       movl    -8(%rsp),%edx
-       roll    $7,%edi
-       andl    %edi,%edx
-       movl    %edx,-8(%rsp)
-
-       fldcw   -4(%rsp)
-       ldmxcsr -8(%rsp)
-       andl    $63,%eax
-       ret
diff --git a/lib/libc/x86_64/gen/fpsetmask.c b/lib/libc/x86_64/gen/fpsetmask.c
new file mode 100644 (file)
index 0000000..6660d29
--- /dev/null
@@ -0,0 +1,8 @@
+/* $FreeBSD: head/lib/libc/amd64/gen/fpsetmask.c 117864 2003-07-22 06:46:17Z peter $ */
+#define __IEEEFP_NOINLINES__ 1
+#include <ieeefp.h>
+
+fp_except_t fpsetmask(fp_except_t m)
+{
+       return (__fpsetmask(m));
+}
diff --git a/lib/libc/x86_64/gen/fpsetprec.c b/lib/libc/x86_64/gen/fpsetprec.c
new file mode 100644 (file)
index 0000000..d144952
--- /dev/null
@@ -0,0 +1,8 @@
+/* $FreeBSD: head/lib/libc/amd64/gen/fpsetprec.c 117864 2003-07-22 06:46:17Z peter $ */
+#define __IEEEFP_NOINLINES__ 1
+#include <ieeefp.h>
+
+fp_prec_t fpsetprec(fp_prec_t m)
+{
+       return (__fpsetprec(m));
+}
diff --git a/lib/libc/x86_64/gen/fpsetround.S b/lib/libc/x86_64/gen/fpsetround.S
deleted file mode 100644 (file)
index 43d7e50..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Written by Frank van der Linden at Wasabi Systems for NetBSD.
- * Public domain.
- *
- * $NetBSD: fpsetround.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $
- */
-
-#include <machine/asm.h>
-
-/*
- * XXX set both the x87 control word and the SSE mxcsr register.
- * Applications should only set exception and round flags
- * via the fp*() interface, otherwise the status words
- * will get our of sync.
- */ 
-
-
-#ifdef WEAK_ALIAS
-WEAK_ALIAS(fpsetround, _fpsetround)
-ENTRY(_fpsetround)
-#else
-ENTRY(fpsetround)
-#endif
-       fnstcw  -4(%rsp)
-       stmxcsr -8(%rsp)
-
-       andl    $3,%edi
-
-       movl    -4(%rsp),%edx
-       rorl    $10,%edx
-       movl    %edx,%eax
-       andl    $3,%eax
-
-       andl    $~3,%edx
-       orl     %edi,%edx
-       roll    $10,%edx
-       movl    %edx,-4(%rsp)
-
-       movl    -8(%rsp),%edx
-       rorl    $13,%edx
-       andl    $~3,%edx
-       orl     %edi,%edx
-       roll    $13,%edx
-       movl    %edx,-8(%rsp)
-
-       ldmxcsr -8(%rsp)
-       fldcw   -4(%rsp)
-       ret
diff --git a/lib/libc/x86_64/gen/fpsetround.c b/lib/libc/x86_64/gen/fpsetround.c
new file mode 100644 (file)
index 0000000..d963910
--- /dev/null
@@ -0,0 +1,8 @@
+/* $FreeBSD: head/lib/libc/amd64/gen/fpsetround.c 117864 2003-07-22 06:46:17Z peter $ */
+#define __IEEEFP_NOINLINES__ 1
+#include <ieeefp.h>
+
+fp_rnd_t fpsetround(fp_rnd_t m)
+{
+       return (__fpsetround(m));
+}
diff --git a/lib/libc/x86_64/gen/fpsetsticky.S b/lib/libc/x86_64/gen/fpsetsticky.S
deleted file mode 100644 (file)
index 1659045..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Written by Frank van der Linden at Wasabi Systems for NetBSD
- * Public domain.
- *
- * $NetBSD: fpsetsticky.S,v 1.5 2004/03/09 17:16:13 drochner Exp $
- */
-
-#include <machine/asm.h>
-
-/*
- * XXX set both the x87 status word and the SSE mxcsr register.
- * Applications should only set exception and round flags
- * via the fp*() interface, otherwise the status words
- * will get our of sync.
- */ 
-
-
-#ifdef WEAK_ALIAS
-WEAK_ALIAS(fpsetsticky, _fpsetsticky)
-ENTRY(_fpsetsticky)
-#else
-ENTRY(fpsetsticky)
-#endif
-       fnstenv -28(%rsp)
-       stmxcsr -32(%rsp)
-
-       andl    $63,%edi
-
-       movl    -24(%rsp),%eax
-       movl    %eax,%edx
-       andb    $0xc0,%dl
-
-       orl     %edi,%edx
-       movl    %edx,-24(%rsp)
-
-       movl    -32(%rsp),%edx
-       orl     %edx,%eax
-       andl    $63,%eax
-       andb    $0xc0,%dl
-       orl     %edi,%edx
-       movl    %edx,-32(%rsp)
-
-       ldmxcsr -32(%rsp)
-       fldenv  -28(%rsp)
-       ret
diff --git a/lib/libc/x86_64/gen/infinity.c b/lib/libc/x86_64/gen/infinity.c
new file mode 100644 (file)
index 0000000..561f1a8
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * infinity.c
+ * $FreeBSD: head/lib/libc/amd64/gen/infinity.c 110566 2003-02-08 20:37:55Z mike $
+ */
+
+#include <math.h>
+
+/* bytes for +Infinity on a 387 */
+const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
+
+/* bytes for NaN */
+const union __nan_un __nan = { { 0, 0, 0xc0, 0xff } };
diff --git a/lib/libc/x86_64/gen/infinityl.c b/lib/libc/x86_64/gen/infinityl.c
deleted file mode 100644 (file)
index d31464e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * IEEE-compatible infinityl.c for little-endian 80-bit format -- public domain.
- * Note that the representation includes 48 bits of tail padding per x86_64 ABI.
- *
- * $NetBSD: infinityl.c,v 1.2 2005/06/12 05:21:27 lukem Exp $
- */
-
-#include <math.h>
-
-const union __long_double_u __infinityl =
-       { { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0, 0, 0, 0, 0 } };
diff --git a/lib/libc/x86_64/gen/isfinitel.c b/lib/libc/x86_64/gen/isfinitel.c
deleted file mode 100644 (file)
index ca3744c..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * $NetBSD: isfinitel.c,v 1.1 2003/10/29 20:03:51 kleink Exp $
- */
-
-#include <machine/ieee.h>
-#include <assert.h>
-#include <math.h>
-
-/*
- * 7.12.3.2 isfinite - determine whether an argument has finite value
- *          IEEE 754 compatible 80-bit extended-precision Intel 386 version
- */
-int
-__isfinitel(long double x)
-{
-       union ieee_ext_u u;
-
-       u.extu_ld = x;
-
-       _DIAGASSERT(u.extu_ext.ext_exp == 0 || u.extu_ext.ext_int == 1);
-
-       if (u.extu_ext.ext_exp == EXT_EXP_INFNAN)
-               return 0;
-
-       return 1;
-}
diff --git a/lib/libc/x86_64/gen/isinfl.c b/lib/libc/x86_64/gen/isinfl.c
deleted file mode 100644 (file)
index c94d9a1..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1992, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
- * $NetBSD: isinfl.c,v 1.5 2004/03/04 23:42:39 kleink Exp $
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.3 isinf - test for infinity
- *          IEEE 754 compatible 80-bit extended-precision Intel 386 version
- */
-int
-__isinfl(long double x)
-{
-       union ieee_ext_u u;
-
-       u.extu_ld = x;
-
-       return (u.extu_ext.ext_exp == EXT_EXP_INFNAN &&
-           (u.extu_ext.ext_int == 1 &&
-            u.extu_ext.ext_frach == 0 && u.extu_ext.ext_fracl == 0));
-}
diff --git a/lib/libc/x86_64/gen/isnanl.c b/lib/libc/x86_64/gen/isnanl.c
deleted file mode 100644 (file)
index 91e915d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1992, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
- * $NetBSD: isnanl.c,v 1.5 2004/03/04 23:42:39 kleink Exp $
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.4 isnan - test for a NaN
- *          IEEE 754 compatible 80-bit extended-precision Intel 386 version
- */
-int
-__isnanl(long double x)
-{
-       union ieee_ext_u u;
-
-       u.extu_ld = x;
-
-       return (u.extu_ext.ext_exp == EXT_EXP_INFNAN &&
-           u.extu_ext.ext_int == 1 &&
-           (u.extu_ext.ext_frach != 0 || u.extu_ext.ext_fracl != 0));
-}
diff --git a/lib/libc/x86_64/gen/ldexp.c b/lib/libc/x86_64/gen/ldexp.c
deleted file mode 100644 (file)
index 272da6e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Sean Eric Fagan.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)ldexp.c 8.1 (Berkeley) 6/4/93
- * $FreeBSD: src/lib/libc/amd64/gen/ldexp.c,v 1.14 2007/01/09 00:38:24 imp Exp $
- */
-
-/*
- * ldexp(value, exp): return value * (2 ** exp).
- *
- * Written by Sean Eric Fagan (sef@kithrup.COM)
- * Sun Mar 11 20:27:09 PST 1990
- */
-
-/*
- * We do the conversion in C to let gcc optimize it away, if possible.
- */
-double
-ldexp(double value, int exp)
-{
-       double temp, texp, temp2;
-       texp = exp;
-#ifdef __GNUC__
-       __asm ("fscale "
-               : "=u" (temp2), "=t" (temp)
-               : "0" (texp), "1" (value));
-#else
-#error unknown asm
-#endif
-       return (temp);
-}
diff --git a/lib/libc/x86_64/gen/modf.S b/lib/libc/x86_64/gen/modf.S
deleted file mode 100644 (file)
index 42895d0..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Sean Eric Fagan.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *     from: @(#)modf.s        5.5 (Berkeley) 3/18/91
- * $NetBSD: modf.S,v 1.5 1997/07/16 14:37:18 christos Exp $
- * $FreeBSD: src/lib/libc/amd64/gen/modf.S,v 1.4 2008/11/02 01:10:54 peter Exp $
- */
-
-#include <machine/asm.h>
-
-/*
- * modf(value, iptr): return fractional part of value, and stores the
- * integral part into iptr (a pointer to double).
- *
- * Written by Sean Eric Fagan (sef@kithrup.COM)
- * Sun Mar 11 20:27:30 PST 1990
- */
-
-/* With CHOP mode on, frndint behaves as TRUNC does.  Useful. */
-ENTRY(modf)
-
-       /*
-        * Set chop mode.
-        */
-       fnstcw  -12(%rsp)
-       movw    -12(%rsp),%dx
-       orw     $3072,%dx
-       movw    %dx,-16(%rsp)
-       fldcw   -16(%rsp)
-
-       /*
-        * Get integral part.
-        */
-       movsd   %xmm0,-24(%rsp)
-       fldl    -24(%rsp)
-       frndint
-       fstpl   -8(%rsp)
-
-       /*
-        * Restore control word.
-        */
-       fldcw   -12(%rsp)
-
-       /*
-        * Store integral part.
-        */
-       movsd   -8(%rsp),%xmm0
-       movsd   %xmm0,(%rdi)
-
-       /*
-        * Get fractional part and return it.
-        */
-       fldl    -24(%rsp)
-       fsubl   -8(%rsp)
-       fstpl   -8(%rsp)
-       movsd   -8(%rsp),%xmm0
-
-       ret
-END(modf)
diff --git a/lib/libc/x86_64/gen/nanf.c b/lib/libc/x86_64/gen/nanf.c
deleted file mode 100644 (file)
index efc1906..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math.h>
-#include <machine/endian.h>
-
-/* bytes for quiet NaN (IEEE single precision) */
-const union __float_u __nanf =
-               { {    0,    0, 0xc0, 0x7f } };
diff --git a/lib/libc/x86_64/gen/signbitl.c b/lib/libc/x86_64/gen/signbitl.c
deleted file mode 100644 (file)
index 504a2ed..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * $NetBSD: signbitl.c,v 1.1 2004/01/15 19:43:45 kleink Exp $
- */
-
-#include <machine/ieee.h>
-#include <math.h>
-
-/*
- * 7.12.3.6 signbit - determine whether the sign of an argument is negative
- *          IEEE 754 compatible 80-bit extended-precision Intel 386 version
- */
-int
-__signbitl(long double x)
-{
-       union ieee_ext_u u;
-
-       u.extu_ld = x;
-
-       return (u.extu_ext.ext_sign == 1);
-}
index 156fea4..3f3390a 100644 (file)
-# $DragonFly: src/lib/libm/Makefile,v 1.8 2008/11/03 00:25:44 pavalos Exp $
+#  @(#)Makefile 5.1beta 93/09/24
+# $FreeBSD: head/lib/msun/Makefile 238724 2012-07-23 19:23:49Z kargl $
+#
+#  ====================================================
+#  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.
+#  ====================================================
+#
+#
 
-LIB=           m
-SHLIB_MAJOR=   3
-WARNS?=                2
+.include "${MACHINE_ARCH}/Makefile.inc"
 
-.include "arch/${MACHINE_ARCH}/Makefile.inc"
-.include "gen/Makefile.inc"
-.include "man/Makefile.inc"
-.include "src/Makefile.inc"
+.PATH: ${.CURDIR}/${MACHINE_ARCH}
 
-# Complex arithmentic
-.include "complex/Makefile.inc"
+.PATH:  ${.CURDIR}/ld80
+CFLAGS+=       -I${.CURDIR}/ld80
+
+.PATH: ${.CURDIR}/bsdsrc
+.PATH: ${.CURDIR}/src
+.PATH: ${.CURDIR}/man
+
+LIB=   m
+SHLIB_MAJOR= 3
+WARNS?=        1
+COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \
+       e_acos.c e_acosf.c e_acosh.c e_acoshf.c e_asin.c e_asinf.c \
+       e_atan2.c e_atan2f.c e_atanh.c e_atanhf.c e_cosh.c e_coshf.c e_exp.c \
+       e_expf.c e_fmod.c e_fmodf.c e_gamma.c e_gamma_r.c e_gammaf.c \
+       e_gammaf_r.c e_hypot.c e_hypotf.c e_j0.c e_j0f.c e_j1.c e_j1f.c \
+       e_jn.c e_jnf.c e_lgamma.c e_lgamma_r.c e_lgammaf.c e_lgammaf_r.c \
+       e_log.c e_log10.c e_log10f.c e_log2.c e_log2f.c e_logf.c \
+       e_pow.c e_powf.c e_rem_pio2.c \
+       e_rem_pio2f.c e_scalb.c e_scalbf.c \
+       e_sinh.c e_sinhf.c fenv.c \
+       k_cos.c k_cosf.c k_exp.c k_expf.c k_rem_pio2.c k_sin.c k_sinf.c \
+       k_tan.c k_tanf.c \
+       s_asinh.c s_asinhf.c s_atan.c s_atanf.c s_carg.c s_cargf.c s_cargl.c \
+       s_cbrt.c s_cbrtf.c s_ceil.c s_ceilf.c \
+       s_copysign.c s_copysignf.c s_cos.c s_cosf.c \
+       s_csqrt.c s_csqrtf.c s_erf.c s_erff.c \
+       s_exp2.c s_exp2f.c s_expm1.c s_expm1f.c s_fabsf.c s_fdim.c \
+       s_finite.c s_finitef.c \
+       s_floor.c s_floorf.c s_fma.c s_fmaf.c \
+       s_fmax.c s_fmaxf.c s_fmaxl.c s_fmin.c \
+       s_fminf.c s_fminl.c s_frexp.c s_frexpf.c s_ilogb.c s_ilogbf.c \
+       s_ilogbl.c s_isfinite.c s_isnan.c s_isnormal.c \
+       s_llround.c s_llroundf.c s_llroundl.c \
+       s_log1p.c s_log1pf.c s_logb.c s_logbf.c \
+       s_lround.c s_lroundf.c s_lroundl.c s_modff.c \
+       s_nan.c s_nearbyint.c s_nextafter.c s_nextafterf.c \
+       s_nexttowardf.c \
+       s_rint.c s_rintf.c s_round.c s_roundf.c s_roundl.c \
+       s_scalbln.c s_signbit.c \
+       s_signgam.c s_significand.c s_significandf.c s_sin.c s_sinf.c \
+       s_tan.c s_tanf.c s_tanh.c s_tanhf.c s_tgammaf.c s_trunc.c s_truncf.c \
+       w_cabs.c w_cabsf.c w_drem.c w_dremf.c
+
+# Location of fpmath.h and _fpmath.h
+LIBCDIR=${.CURDIR}/../libc
+CFLAGS+=-I${.CURDIR}/src -I${LIBCDIR}/include -I${LIBCDIR}/${MACHINE_ARCH}
+
+# C99 long double functions
+COMMON_SRCS+=  s_copysignl.c s_fabsl.c s_modfl.c
+# If long double != double use these; otherwise, we alias the double versions.
+COMMON_SRCS+=  e_acosl.c e_asinl.c e_atan2l.c e_fmodl.c \
+       e_hypotl.c \
+       invtrig.c k_cosl.c k_sinl.c k_tanl.c \
+       s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \
+       s_csqrtl.c s_exp2l.c s_expl.c s_floorl.c s_fmal.c \
+       s_frexpl.c s_nanl.c s_nextafterl.c s_nexttoward.c \
+       s_sinl.c s_tanl.c s_truncl.c w_cabsl.c
+
+# C99 complex functions
+COMMON_SRCS+=  catrig.c catrigf.c \
+       s_ccosh.c s_ccoshf.c s_cexp.c s_cexpf.c \
+       s_cimag.c s_cimagf.c s_cimagl.c \
+       s_conj.c s_conjf.c s_conjl.c \
+       s_cproj.c s_cprojf.c s_creal.c s_crealf.c s_creall.c \
+       s_csinh.c s_csinhf.c s_ctanh.c s_ctanhf.c
+
+# libc supplies these functions:
+#COMMON_SRCS+= s_fabs.c s_frexp.c s_isnan.c s_ldexp.c s_modf.c
+
+# Exclude the generic versions of what we provide in the MD area.
+.if defined(ARCH_SRCS)
+.for i in ${ARCH_SRCS}
+COMMON_SRCS:=  ${COMMON_SRCS:N${i:R}.c}
+.endfor
+.endif
+
+SRCS=  ${COMMON_SRCS} ${ARCH_SRCS}
+
+INCS+= complex.h fenv.h math.h
+
+MAN=   acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 \
+       ceil.3 cacos.3 ccos.3 ccosh.3 cexp.3 cimag.3 complex.3 copysign.3 \
+       cos.3 cosh.3 csqrt.3 erf.3 exp.3 fabs.3 fdim.3 \
+       feclearexcept.3 feenableexcept.3 fegetenv.3 fegetround.3 fenv.3 \
+       floor.3 fma.3 fmax.3 fmod.3 hypot.3 ieee.3 ieee_test.3 ilogb.3 \
+       j0.3 lgamma.3 log.3 lrint.3 lround.3 math.3 nan.3 nextafter.3 \
+       remainder.3 rint.3 round.3 scalbn.3 signbit.3 sin.3 sinh.3 sqrt.3 \
+       tan.3 tanh.3 trunc.3
+
+MLINKS+=acos.3 acosf.3 \
+       acos.3 acosl.3
+MLINKS+=acosh.3 acoshf.3
+MLINKS+=asin.3 asinf.3 \
+       asin.3 asinl.3
+MLINKS+=asinh.3 asinhf.3
+MLINKS+=atan.3 atanf.3 \
+       atan.3 atanl.3
+MLINKS+=atan2.3 atan2f.3 \
+       atan2.3 atan2l.3 \
+       atan2.3 carg.3 \
+       atan2.3 cargf.3 \
+       atan2.3 cargl.3
+MLINKS+=atanh.3 atanhf.3
+MLINKS+=cacos.3 cacosf.3 \
+       cacos.3 cacosh.3 \
+       cacos.3 cacoshf.3 \
+       cacos.3 casin.3 \
+       cacos.3 casinf.3 \
+       cacos.3 casinh.3 \
+       cacos.3 casinhf \
+       cacos.3 catan.3 \
+       cacos.3 catanf.3 \
+       cacos.3 catanh.3 \
+       cacos.3 catanhf.3
+MLINKS+=ccos.3 ccosf.3 \
+       ccos.3 csin.3 \
+       ccos.3 csinf.3 \
+       ccos.3 ctan.3 \
+       ccos.3 ctanf.3
+MLINKS+=ccosh.3 ccoshf.3 \
+       ccosh.3 csinh.3 \
+       ccosh.3 csinhf.3 \
+       ccosh.3 ctanh.3 \
+       ccosh.3 ctanhf.3
+MLINKS+=ceil.3 ceilf.3 \
+       ceil.3 ceill.3
+MLINKS+=cexp.3 cexpf.3
+MLINKS+=cimag.3 cimagf.3 \
+       cimag.3 cimagl.3 \
+       cimag.3 conj.3 \
+       cimag.3 conjf.3 \
+       cimag.3 conjl.3 \
+       cimag.3 cproj.3 \
+       cimag.3 cprojf.3 \
+       cimag.3 cprojl.3 \
+       cimag.3 creal.3 \
+       cimag.3 crealf.3 \
+       cimag.3 creall.3
+MLINKS+=copysign.3 copysignf.3 \
+       copysign.3 copysignl.3
+MLINKS+=cos.3 cosf.3 \
+       cos.3 cosl.3
+MLINKS+=cosh.3 coshf.3
+MLINKS+=csqrt.3 csqrtf.3 \
+       csqrt.3 csqrtl.3
+MLINKS+=erf.3 erff.3 \
+       erf.3 erfc.3 \
+       erf.3 erfcf.3
+MLINKS+=exp.3 expf.3 \
+       exp.3 expl.3 \
+       exp.3 exp2.3 \
+       exp.3 exp2f.3 \
+       exp.3 exp2l.3 \
+       exp.3 expm1.3 \
+       exp.3 expm1f.3 \
+       exp.3 pow.3 \
+       exp.3 powf.3
+MLINKS+=fabs.3 fabsf.3 \
+       fabs.3 fabsl.3
+MLINKS+=fdim.3 fdimf.3 \
+       fdim.3 fdiml.3
+MLINKS+=feclearexcept.3 fegetexceptflag.3 \
+       feclearexcept.3 feraiseexcept.3 \
+       feclearexcept.3 fesetexceptflag.3 \
+       feclearexcept.3 fetestexcept.3
+MLINKS+=feenableexcept.3 fedisableexcept.3 \
+       feenableexcept.3 fegetexcept.3
+MLINKS+=fegetenv.3 feholdexcept.3 \
+       fegetenv.3 fesetenv.3 \
+       fegetenv.3 feupdateenv.3
+MLINKS+=fegetround.3 fesetround.3
+MLINKS+=floor.3 floorf.3 \
+       floor.3 floorl.3
+MLINKS+=fma.3 fmaf.3 \
+       fma.3 fmal.3
+MLINKS+=fmax.3 fmaxf.3 \
+       fmax.3 fmaxl.3 \
+       fmax.3 fmin.3 \
+       fmax.3 fminf.3 \
+       fmax.3 fminl.3
+MLINKS+=fmod.3 fmodf.3 \
+       fmod.3 fmodl.3
+MLINKS+=hypot.3 cabs.3 \
+       hypot.3 cabsf.3 \
+       hypot.3 cabsl.3 \
+       hypot.3 hypotf.3 \
+       hypot.3 hypotl.3
+MLINKS+=ieee.3 libm.3
+MLINKS+=ieee_test.3 scalb.3 \
+       ieee_test.3 scalbf.3 \
+       ieee_test.3 significand.3 \
+       ieee_test.3 significandf.3
+MLINKS+=ilogb.3 ilogbf.3 \
+       ilogb.3 ilogbl.3 \
+       ilogb.3 logb.3 \
+       ilogb.3 logbf.3 \
+       ilogb.3 logbl.3
+MLINKS+=j0.3 j0f.3 \
+       j0.3 j1.3 \
+       j0.3 j1f.3 \
+       j0.3 jn.3 \
+       j0.3 jnf.3 \
+       j0.3 y0.3 \
+       j0.3 y0f.3 \
+       j0.3 y1.3 \
+       j0.3 y1f.3 \
+       j0.3 yn.3 \
+       j0.3 ynf.3
+MLINKS+=lgamma.3 lgamma_r.3 \
+       lgamma.3 lgammaf.3 \
+       lgamma.3 lgammaf_r.3 \
+       lgamma.3 gamma.3 \
+       lgamma.3 gamma_r.3 \
+       lgamma.3 gammaf.3 \
+       lgamma.3 gammaf_r.3 \
+       lgamma.3 tgamma.3 \
+       lgamma.3 tgammaf.3
+MLINKS+=log.3 logf.3 \
+       log.3 logl.3 \
+       log.3 log10.3 \
+       log.3 log10f.3 \
+       log.3 log2.3 \
+       log.3 log2f.3 \
+       log.3 log1p.3 \
+       log.3 log1pf.3
+MLINKS+=lrint.3 llrint.3 \
+       lrint.3 llrintf.3 \
+       lrint.3 llrintl.3 \
+       lrint.3 lrintf.3 \
+       lrint.3 lrintl.3
+MLINKS+=lround.3 llround.3 \
+       lround.3 llroundf.3 \
+       lround.3 llroundl.3 \
+       lround.3 lroundf.3 \
+       lround.3 lroundl.3
+MLINKS+=nan.3 nanf.3 \
+       nan.3 nanl.3
+MLINKS+=nextafter.3 nextafterf.3 \
+       nextafter.3 nextafterl.3 \
+       nextafter.3 nexttoward.3 \
+       nextafter.3 nexttowardf.3 \
+       nextafter.3 nexttowardl.3
+MLINKS+=remainder.3 remainderf.3 \
+       remainder.3 remainderl.3 \
+       remainder.3 remquo.3 \
+       remainder.3 remquof.3 \
+       remainder.3 remquol.3
+MLINKS+=rint.3 rintf.3 \
+       rint.3 rintl.3 \
+       rint.3 nearbyint.3 \
+       rint.3 nearbyintf.3 \
+       rint.3 nearbyintl.3
+MLINKS+=round.3 roundf.3 \
+       round.3 roundl.3
+MLINKS+=scalbn.3 scalbln.3 \
+       scalbn.3 scalblnf.3 \
+       scalbn.3 scalblnl.3 \
+       scalbn.3 scalbnf.3 \
+       scalbn.3 scalbnl.3
+MLINKS+=sin.3 sinf.3 \
+       sin.3 sinl.3
+MLINKS+=sinh.3 sinhf.3
+MLINKS+=sqrt.3 cbrt.3 \
+       sqrt.3 cbrtf.3 \
+       sqrt.3 cbrtl.3 \
+       sqrt.3 sqrtf.3 \
+       sqrt.3 sqrtl.3
+MLINKS+=tan.3 tanf.3 \
+       tan.3 tanl.3
+MLINKS+=tanh.3 tanhf.3
+MLINKS+=trunc.3 truncf.3 \
+       trunc.3 truncl.3
 
 .include <bsd.lib.mk>
diff --git a/lib/libm/arch/i386/Makefile.inc b/lib/libm/arch/i386/Makefile.inc
deleted file mode 100644 (file)
index 12fe3c7..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# $DragonFly: src/lib/libm/arch/i386/Makefile.inc,v 1.2 2007/06/16 22:26:53 pavalos Exp $
-
-.PATH: ${.CURDIR}/arch/i386
-
-SRCS+= e_acos.S e_asin.S e_atan2.S e_atan2f.S e_exp.S e_expf.S e_fmod.S \
-       e_log.S e_log10.S e_log10f.S e_log2.S e_log2f.S e_logf.S \
-       e_scalb.S e_scalbf.S e_sqrt.S e_sqrtf.S s_lrint.S s_atan.S s_atanf.S \
-       s_ceil.S s_ceilf.S s_copysign.S s_copysignf.S s_cos.S s_cosf.S \
-       s_finite.S s_finitef.S s_floor.S s_floorf.S s_ilogb.S s_ilogbf.S \
-       s_log1p.S s_log1pf.S s_logb.S s_logbf.S s_rint.S s_rintf.S \
-       s_scalbn.S s_scalbnf.S s_significand.S s_significandf.S s_sin.S \
-       s_sinf.S s_tan.S s_tanf.S e_remainder.S e_remainderf.S
-SRCS+=  s_ilogbl.S s_logbl.S s_modf.S s_scalbnl.S
-SRCS+=  s_remquol.S e_remainderl.S s_lrintf.S s_lrintl.S
-
-# This file is included by arch/x86_64/Makefile.inc, so pull in the right
-# fenv.[ch].
-#
-.if ${MACHINE_ARCH} == "i386"
-SRCS+= fenv.c
-INCS=  fenv.h
-.endif
diff --git a/lib/libm/arch/i386/abi.h b/lib/libm/arch/i386/abi.h
deleted file mode 100644 (file)
index 38edf95..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*     $NetBSD: abi.h,v 1.7 2011/06/18 22:19:52 joerg Exp $    */
-
-/*
- * Written by Frank van der Linden (fvdl@wasabisystems.com)
- */
-
-/*
- * The x86-64 ABI specifies that float and double arguments
- * are passed in SSE2 (xmm) registers. Unfortunately,
- * there is no way to push those on to the FP stack, which is
- * where the fancier instructions get their arguments from.
- *
- * Define some prologues and epilogues to store and retrieve
- * xmm regs to local variables.
- */
-
-#ifdef __x86_64__
-
-#define ARG_LONG_DOUBLE_ONE    8(%rsp)
-#define ARG_LONG_DOUBLE_TWO    24(%rsp)
-#define ARG_DOUBLE_ONE         -8(%rsp)
-#define ARG_DOUBLE_ONE_LSW     -8(%rsp)
-#define ARG_DOUBLE_ONE_MSW     -4(%rsp)
-#define ARG_DOUBLE_TWO         -16(%rsp)
-#define ARG_FLOAT_ONE          -4(%rsp)
-#define ARG_FLOAT_TWO          -8(%rsp)
-
-#define XMM_ONE_ARG_DOUBLE_PROLOGUE \
-       movsd   %xmm0, ARG_DOUBLE_ONE
-       
-#define XMM_TWO_ARG_DOUBLE_PROLOGUE \
-       movsd   %xmm0, ARG_DOUBLE_ONE ; \
-       movsd   %xmm1, ARG_DOUBLE_TWO
-
-#define XMM_ONE_ARG_FLOAT_PROLOGUE \
-       movss   %xmm0, ARG_FLOAT_ONE
-
-#define XMM_TWO_ARG_FLOAT_PROLOGUE \
-       movss   %xmm0, ARG_FLOAT_ONE ; \
-       movss   %xmm1, ARG_FLOAT_TWO
-
-#define XMM_DOUBLE_EPILOGUE \
-       fstpl ARG_DOUBLE_ONE ; \
-       movsd ARG_DOUBLE_ONE, %xmm0
-
-#define XMM_FLOAT_EPILOGUE \
-       fstps ARG_FLOAT_ONE ; \
-       movss ARG_FLOAT_ONE, %xmm0
-
-#define FLDL_VAR(x)    fldl x(%rip)
-
-#else
-
-#define ARG_LONG_DOUBLE_ONE    4(%esp)
-#define ARG_LONG_DOUBLE_TWO    16(%esp)
-#define ARG_DOUBLE_ONE         4(%esp)
-#define ARG_DOUBLE_ONE_LSW     4(%esp)
-#define ARG_DOUBLE_ONE_MSW     8(%esp)
-#define ARG_DOUBLE_TWO         12(%esp)
-#define ARG_FLOAT_ONE          4(%esp)
-#define ARG_FLOAT_TWO          8(%esp)
-
-#define XMM_ONE_ARG_DOUBLE_PROLOGUE
-#define XMM_TWO_ARG_DOUBLE_PROLOGUE
-#define XMM_ONE_ARG_FLOAT_PROLOGUE
-#define XMM_TWO_ARG_FLOAT_PROLOGUE
-
-#define XMM_DOUBLE_EPILOGUE
-#define XMM_FLOAT_EPILOGUE
-
-#ifdef PIC
-#define FLDL_VAR(x) \
-       PIC_PROLOGUE ; \
-       fldl PIC_GOTOFF(x) ; \
-       PIC_EPILOGUE
-#else
-#define FLDL_VAR(x) \
-       fldl x
-
-#endif
-#endif
diff --git a/lib/libm/arch/i386/e_acos.S b/lib/libm/arch/i386/e_acos.S
deleted file mode 100644 (file)
index 8864d12..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_acos.S,v 1.8 2003/07/26 19:24:57 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-/* acos = atan (sqrt(1 - x^2) / x) */
-ENTRY(acos)
-       XMM_ONE_ARG_DOUBLE_PROLOGUE
-       fldl    ARG_DOUBLE_ONE          /* x */
-       fld     %st(0)
-       fmul    %st(0)                  /* x^2 */
-       fld1
-       fsubp                           /* 1 - x^2 */
-       fsqrt                           /* sqrt (1 - x^2) */
-       fxch    %st(1)
-       fpatan
-       XMM_DOUBLE_EPILOGUE
-       ret
-END(acos)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_asin.S b/lib/libm/arch/i386/e_asin.S
deleted file mode 100644 (file)
index 5268c07..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_asin.S,v 1.7 2003/07/26 19:24:58 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-/* asin = atan (x / sqrt(1 - x^2)) */
-ENTRY(asin)
-       XMM_ONE_ARG_DOUBLE_PROLOGUE
-       fldl    ARG_DOUBLE_ONE          /* x */
-       fld     %st(0)
-       fmul    %st(0)                  /* x^2 */
-       fld1
-       fsubp                           /* 1 - x^2 */
-       fsqrt                           /* sqrt (1 - x^2) */
-       fpatan
-       XMM_DOUBLE_EPILOGUE
-       ret
-END(asin)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_atan2.S b/lib/libm/arch/i386/e_atan2.S
deleted file mode 100644 (file)
index 594c798..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_atan2.S,v 1.6 2003/07/26 19:24:58 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(atan2)
-       XMM_TWO_ARG_DOUBLE_PROLOGUE
-       fldl    ARG_DOUBLE_ONE
-       fldl    ARG_DOUBLE_TWO
-       fpatan
-       XMM_DOUBLE_EPILOGUE
-       ret
-END(atan2)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_atan2f.S b/lib/libm/arch/i386/e_atan2f.S
deleted file mode 100644 (file)
index cd5e420..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_atan2f.S,v 1.3 2003/07/26 19:24:58 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(atan2f)
-       XMM_TWO_ARG_FLOAT_PROLOGUE
-       flds    ARG_FLOAT_ONE
-       flds    ARG_FLOAT_TWO
-       fpatan
-       XMM_FLOAT_EPILOGUE
-       ret
-END(atan2f)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_expf.S b/lib/libm/arch/i386/e_expf.S
deleted file mode 100644 (file)
index f50337e..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_expf.S,v 1.6 2008/06/24 17:27:56 drochner Exp $ $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-/* e^x = 2^(x * log2(e)) */
-ENTRY(expf)
-       XMM_ONE_ARG_FLOAT_PROLOGUE
-
-       /*
-        * catch +/-Inf and NaN arguments
-        */
-       movl    ARG_FLOAT_ONE,%eax
-       andl    $0x7fffffff,%eax
-       cmpl    $0x7f800000,%eax
-       jae     x_Inf_or_NaN
-
-       flds    ARG_FLOAT_ONE
-       fldl2e
-       fmulp                           /* x * log2(e) */
-       fld     %st(0)
-       frndint                         /* int(x * log2(e)) */
-       fsubr   %st(0),%st(1)           /* fract(x * log2(e)) */
-       fxch
-       f2xm1                           /* 2^(fract(x * log2(e))) - 1 */
-       fld1
-       faddp                           /* 2^(fract(x * log2(e))) */
-       fscale                          /* e^x */
-       fstp    %st(1)
-       XMM_FLOAT_EPILOGUE
-       ret
-
-x_Inf_or_NaN:
-       /*
-        * Return 0 if x is -Inf.  Otherwise just return x, although the
-        * C version would return (x + x) (Real Indefinite) if x is a NaN.
-        */
-       movl    ARG_FLOAT_ONE,%eax
-       cmpl    $0xff800000,%eax
-       jne     x_not_minus_Inf
-       fldz
-       XMM_FLOAT_EPILOGUE
-       ret
-
-x_not_minus_Inf:
-       flds    ARG_FLOAT_ONE
-       XMM_FLOAT_EPILOGUE
-       ret
-END(expf)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_fmod.S b/lib/libm/arch/i386/e_fmod.S
deleted file mode 100644 (file)
index 1620c32..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_fmod.S,v 1.7 2003/07/26 19:24:58 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(fmod)
-       XMM_TWO_ARG_DOUBLE_PROLOGUE
-       fldl    ARG_DOUBLE_TWO
-       fldl    ARG_DOUBLE_ONE
-1:     fprem
-       fstsw   %ax
-       btw     $10,%ax
-       jc      1b
-       fstp    %st(1)
-       XMM_DOUBLE_EPILOGUE
-       ret
-END(fmod)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_log.S b/lib/libm/arch/i386/e_log.S
deleted file mode 100644 (file)
index 9fb08b1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_log.S,v 1.6 2003/07/26 19:24:58 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(log)
-       XMM_ONE_ARG_DOUBLE_PROLOGUE
-       fldln2
-       fldl    ARG_DOUBLE_ONE
-       fyl2x
-       XMM_DOUBLE_EPILOGUE
-       ret
-END(log)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_log10.S b/lib/libm/arch/i386/e_log10.S
deleted file mode 100644 (file)
index 581c778..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_log10.S,v 1.6 2003/07/26 19:24:59 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(log10)
-       XMM_ONE_ARG_DOUBLE_PROLOGUE
-       fldlg2
-       fldl    ARG_DOUBLE_ONE
-       fyl2x
-       XMM_DOUBLE_EPILOGUE
-       ret
-END(log10)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_log10f.S b/lib/libm/arch/i386/e_log10f.S
deleted file mode 100644 (file)
index 81a0d8e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_log10f.S,v 1.3 2003/07/26 19:24:59 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(log10f)
-       XMM_ONE_ARG_FLOAT_PROLOGUE
-       fldlg2
-       flds    ARG_FLOAT_ONE
-       fyl2x
-       XMM_FLOAT_EPILOGUE
-       ret
-END(log10f)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_log2.S b/lib/libm/arch/i386/e_log2.S
deleted file mode 100644 (file)
index 877fef4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Written by Rui Paulo <rpaulo@NetBSD.org>, based on e_log.S.
- * Public domain.
- * $NetBSD: e_log2.S,v 1.1 2005/07/21 20:58:21 rpaulo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(log2)
-       XMM_ONE_ARG_DOUBLE_PROLOGUE
-       fld1
-       fldl    ARG_DOUBLE_ONE
-       fyl2x
-       XMM_DOUBLE_EPILOGUE
-       ret
-END(log2)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_log2f.S b/lib/libm/arch/i386/e_log2f.S
deleted file mode 100644 (file)
index dc7d818..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Written by Rui Paulo <rpaulo@NetBSD.org>, based on e_logf.S.
- * Public domain.
- * $NetBSD: e_log2f.S,v 1.1 2005/07/21 20:58:21 rpaulo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(log2f)
-       XMM_ONE_ARG_FLOAT_PROLOGUE
-       fld1
-       flds    ARG_FLOAT_ONE
-       fyl2x
-       XMM_FLOAT_EPILOGUE
-       ret
-END(log2f)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_logf.S b/lib/libm/arch/i386/e_logf.S
deleted file mode 100644 (file)
index 5517bed..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_logf.S,v 1.4 2003/07/26 19:24:59 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(logf)
-       XMM_ONE_ARG_FLOAT_PROLOGUE
-       fldln2
-       flds    ARG_FLOAT_ONE
-       fyl2x
-       XMM_FLOAT_EPILOGUE
-       ret
-END(logf)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_remainder.S b/lib/libm/arch/i386/e_remainder.S
deleted file mode 100644 (file)
index 8cbc968..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_remainder.S,v 1.7 2003/07/26 19:24:59 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(remainder)
-       XMM_TWO_ARG_DOUBLE_PROLOGUE
-       fldl    ARG_DOUBLE_TWO
-       fldl    ARG_DOUBLE_ONE
-1:     fprem1
-       fstsw   %ax
-       btw     $10,%ax
-       jc      1b
-       fstp    %st(1)
-       XMM_DOUBLE_EPILOGUE
-       ret
-END(remainder)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_remainderf.S b/lib/libm/arch/i386/e_remainderf.S
deleted file mode 100644 (file)
index a58df3b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_remainderf.S,v 1.5 2003/07/26 19:24:59 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(remainderf)
-       XMM_TWO_ARG_FLOAT_PROLOGUE
-       flds    ARG_FLOAT_TWO
-       flds    ARG_FLOAT_ONE
-1:     fprem1
-       fstsw   %ax
-       btw     $10,%ax
-       jc      1b
-       fstp    %st(1)
-       XMM_FLOAT_EPILOGUE
-       ret
-END(remainderf)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_scalb.S b/lib/libm/arch/i386/e_scalb.S
deleted file mode 100644 (file)
index 03c57c9..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_scalb.S,v 1.7 2003/07/26 19:25:00 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(scalb)
-       XMM_TWO_ARG_DOUBLE_PROLOGUE
-       fldl    ARG_DOUBLE_TWO
-       fldl    ARG_DOUBLE_ONE
-       fscale
-       fstp    %st(1)                  /* bug fix for fp stack overflow */
-       XMM_DOUBLE_EPILOGUE
-       ret
-END(scalb)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_scalbf.S b/lib/libm/arch/i386/e_scalbf.S
deleted file mode 100644 (file)
index a5fc150..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_scalbf.S,v 1.3 2003/07/26 19:25:00 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(scalbf)
-       XMM_TWO_ARG_FLOAT_PROLOGUE
-       flds    ARG_FLOAT_TWO
-       flds    ARG_FLOAT_ONE
-       fscale
-       XMM_FLOAT_EPILOGUE
-       ret
-END(scalbf)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_sqrt.S b/lib/libm/arch/i386/e_sqrt.S
deleted file mode 100644 (file)
index 5a2928f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_sqrt.S,v 1.6 2003/07/26 19:25:00 salo Exp $
- */
-
-#include <machine/asm.h>
-
-ENTRY(sqrt)
-#ifdef __i386__
-       fldl    4(%esp)
-       fsqrt
-#else
-       sqrtsd  %xmm0,%xmm0
-#endif
-       ret
-END(sqrt)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/e_sqrtf.S b/lib/libm/arch/i386/e_sqrtf.S
deleted file mode 100644 (file)
index cfc89c1..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: e_sqrtf.S,v 1.4 2003/07/26 19:25:00 salo Exp $
- */
-
-#include <machine/asm.h>
-
-ENTRY(sqrtf)
-#ifdef __i386__
-       flds    4(%esp)
-       fsqrt
-#else
-       sqrtss  %xmm0,%xmm0
-#endif
-       ret
-END(sqrtf)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_atan.S b/lib/libm/arch/i386/s_atan.S
deleted file mode 100644 (file)
index 15216d2..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_atan.S,v 1.6 2003/07/26 19:25:00 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(atan)
-       XMM_ONE_ARG_DOUBLE_PROLOGUE
-       fldl    ARG_DOUBLE_ONE
-       fld1
-       fpatan
-       XMM_DOUBLE_EPILOGUE
-       ret
-END(atan)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_atanf.S b/lib/libm/arch/i386/s_atanf.S
deleted file mode 100644 (file)
index 56a566e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_atanf.S,v 1.5 2003/07/26 19:25:00 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(atanf)
-       XMM_ONE_ARG_FLOAT_PROLOGUE
-       flds    ARG_FLOAT_ONE
-       fld1
-       fpatan
-       XMM_FLOAT_EPILOGUE
-       ret
-END(atanf)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_ceil.S b/lib/libm/arch/i386/s_ceil.S
deleted file mode 100644 (file)
index 5280c39..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_ceil.S,v 1.8 2011/06/18 21:24:51 joerg Exp
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(ceil)
-#ifdef __i386__
-       pushl   %ebp
-       movl    %esp,%ebp
-       subl    $8,%esp
-
-       fstcw   -4(%ebp)                /* store fpu control word */
-       movw    -4(%ebp),%dx
-       orw     $0x0800,%dx             /* round towards +oo */
-       andw    $0xfbff,%dx
-       movw    %dx,-8(%ebp)
-       fldcw   -8(%ebp)                /* load modfied control word */
-
-       fldl    8(%ebp)                 /* round */
-       frndint
-
-       fldcw   -4(%ebp)                /* restore original control word */
-
-       leave
-#else
-       fstcw   -12(%rsp)
-       movw    -12(%rsp),%dx
-       orw     $0x0800,%dx
-       andw    $0xfbff,%dx
-       movw    %dx,-16(%rsp)
-       fldcw   -16(%rsp)
-       movsd   %xmm0,-8(%rsp)
-       fldl    -8(%rsp)
-       frndint
-       fldcw   -12(%rsp)
-       fstpl   -8(%rsp)
-       movsd   -8(%rsp),%xmm0
-#endif
-       ret
-END(ceil)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_copysign.S b/lib/libm/arch/i386/s_copysign.S
deleted file mode 100644 (file)
index 2367439..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_copysign.S,v 1.7 2011/06/18 20:49:26 joerg Exp
- */
-
-/*
- * XXXfvdl might as well split this file.
- */
-
-#include <machine/asm.h>
-
-#ifdef __x86_64__
-.Lpos:
-       .quad   0x8000000000000000
-.Lneg:
-       .quad   0x7fffffffffffffff
-#endif
-
-
-ENTRY(copysign)
-#ifdef __i386__
-       movl    16(%esp),%edx
-       andl    $0x80000000,%edx
-       movl    8(%esp),%eax
-       andl    $0x7fffffff,%eax
-       orl     %edx,%eax
-       movl    %eax,8(%esp)
-       fldl    4(%esp)
-#else
-       movq    .Lpos(%rip),%xmm2
-       movq    .Lneg(%rip),%xmm3
-       pand    %xmm2,%xmm1
-       pand    %xmm3,%xmm0
-       por     %xmm1,%xmm0
-#endif
-       ret
-END(copysign)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_copysignf.S b/lib/libm/arch/i386/s_copysignf.S
deleted file mode 100644 (file)
index 838d352..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_copysignf.S,v 1.7 2011/06/21 21:52:49 joerg Exp
- */
-
-#include <machine/asm.h>
-
-/*
- * XXXfvdl split this file.
- */
-
-#ifdef __x86_64__
-.Lneg:
-       .long 0x7fffffff
-.Lpos:
-       .long 0x80000000
-#endif
-
-ENTRY(copysignf)
-#ifdef __i386__
-       movl    8(%esp),%edx
-       andl    $0x80000000,%edx
-       movl    4(%esp),%eax
-       andl    $0x7fffffff,%eax
-       orl     %edx,%eax
-       movl    %eax,4(%esp)
-       flds    4(%esp)
-#else
-       movss   .Lpos(%rip),%xmm2
-       movss   .Lneg(%rip),%xmm3
-       pand    %xmm2,%xmm1
-       pand    %xmm3,%xmm0
-       por     %xmm1,%xmm0
-#endif
-       ret
-END(copysignf)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_cos.S b/lib/libm/arch/i386/s_cos.S
deleted file mode 100644 (file)
index 20f3e04..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_cos.S,v 1.8 2003/07/26 19:25:01 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(cos)
-       XMM_ONE_ARG_DOUBLE_PROLOGUE
-       fldl    ARG_DOUBLE_ONE
-       fcos
-       fnstsw  %ax
-       andw    $0x400,%ax
-       jnz     1f
-       XMM_DOUBLE_EPILOGUE
-       ret
-1:     fldpi
-       fadd    %st(0)
-       fxch    %st(1)
-2:     fprem1
-       fnstsw  %ax
-       andw    $0x400,%ax
-       jnz     2b
-       fstp    %st(1)
-       fcos
-       XMM_DOUBLE_EPILOGUE
-       ret
-END(cos)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_cosf.S b/lib/libm/arch/i386/s_cosf.S
deleted file mode 100644 (file)
index 09d106d..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_cosf.S,v 1.6 2003/07/26 19:25:01 salo Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-/* A float's domain isn't large enough to require argument reduction. */
-ENTRY(cosf)
-       XMM_ONE_ARG_FLOAT_PROLOGUE
-       flds    ARG_FLOAT_ONE
-       fcos
-       XMM_FLOAT_EPILOGUE
-       ret
-END(cosf)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_finite.S b/lib/libm/arch/i386/s_finite.S
deleted file mode 100644 (file)
index 3be7c9a..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_finite.S,v 1.7 2003/07/26 19:25:01 salo Exp $
- */
-
-#include <machine/asm.h>
-
-ENTRY(finite)
-#ifdef __i386__
-       movl    8(%esp),%eax
-       andl    $0x7ff00000, %eax
-       cmpl    $0x7ff00000, %eax
-       setne   %al
-       andl    $0x000000ff, %eax
-#else
-       xorl    %eax,%eax
-       movq    $0x7ff0000000000000,%rsi
-       movq    %rsi,%rdi
-       movsd   %xmm0,-8(%rsp)
-       andq    -8(%rsp),%rsi
-       cmpq    %rdi,%rsi
-       setne   %al
-#endif
-       ret
-END(finite)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_finitef.S b/lib/libm/arch/i386/s_finitef.S
deleted file mode 100644 (file)
index c977eba..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_finitef.S,v 1.6 2003/07/26 19:25:01 salo Exp $
- */
-
-#include <machine/asm.h>
-
-ENTRY(finitef)
-#ifdef __i386__
-       movl    4(%esp),%eax
-       andl    $0x7f800000, %eax
-       cmpl    $0x7f800000, %eax
-       setne   %al
-       andl    $0x000000ff, %eax
-#else
-       xorl    %eax,%eax
-       movl    $0x7ff00000,%esi
-       movss   %xmm0,-4(%rsp)
-       andl    -4(%rsp),%esi
-       cmpl    $0x7ff00000,%esi
-       setne   %al
-#endif
-       ret
-END(finitef)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_ilogb.S b/lib/libm/arch/i386/s_ilogb.S
deleted file mode 100644 (file)
index 3ac9bc2..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_ilogb.S,v 1.7 2003/07/26 19:25:02 salo Exp $
- */
-
-#include <machine/asm.h>
-
-ENTRY(ilogb)
-#ifdef __i386__
-       pushl   %ebp
-       movl    %esp,%ebp
-       subl    $4,%esp
-
-       fldl    8(%ebp)
-       fxtract
-       fstp    %st
-
-       fistpl  -4(%ebp)
-       movl    -4(%ebp),%eax
-
-       leave
-#else
-       movsd   %xmm0,-8(%rsp)
-       fldl    -8(%rsp)
-       fxtract
-       fstp    %st
-       fistpl  -8(%rsp)
-       movl    -8(%rsp),%eax
-#endif
-       ret
-END(ilogb)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_ilogbf.S b/lib/libm/arch/i386/s_ilogbf.S
deleted file mode 100644 (file)
index 72e79f7..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_ilogbf.S,v 1.6 2003/07/26 19:25:02 salo Exp $
- */
-
-#include <machine/asm.h>
-
-ENTRY(ilogbf)
-#ifdef __i386__
-       pushl   %ebp
-       movl    %esp,%ebp
-       subl    $4,%esp
-
-       flds    8(%ebp)
-       fxtract
-       fstp    %st
-
-       fistpl  -4(%ebp)
-       movl    -4(%ebp),%eax
-
-       leave
-#else
-       movss   %xmm0,-4(%rsp)
-       flds    -4(%rsp)
-       fxtract
-       fstp    %st
-       fistpl  -4(%rsp)
-       movl    -4(%rsp),%eax
-#endif
-       ret
-END(ilogbf)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_ilogbl.S b/lib/libm/arch/i386/s_ilogbl.S
deleted file mode 100644 (file)
index 727b297..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_ilogbl.S,v 1.1 2011/07/28 22:32:28 joerg Exp $
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-ENTRY(ilogbl)
-       fldt    ARG_LONG_DOUBLE_ONE
-       fxtract
-       fstp    %st
-#ifdef __i386__
-       pushl   %eax
-       fistpl  0(%esp)
-       popl    %eax
-#else
-       fistpl  -4(%rsp)
-       movl    -4(%rsp), %eax
-#endif
-       ret
-END(ilogbl)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_log1p.S b/lib/libm/arch/i386/s_log1p.S
deleted file mode 100644 (file)
index 1a57762..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_log1p.S,v 1.13 2003/09/16 18:17:11 wennmach Exp $
- */
-
-/*
- * Modified by Lex Wennmacher <wennmach@NetBSD.org>
- * Still public domain.
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-/*
- * The log1p() function is provided to compute an accurate value of
- * log(1 + x), even for tiny values of x. The i387 FPU provides the
- * fyl2xp1 instruction for this purpose. However, the range of this
- * instruction is limited to:
- *             -(1 - (sqrt(2) / 2)) <= x <= sqrt(2) - 1
- *                         -0.292893 <= x <= 0.414214
- * at least on older processor versions.
- *
- * log1p() is implemented by testing the range of the argument.
- * If it is appropriate for fyl2xp1, this instruction is used.
- * Else, we compute log1p(x) = ln(2)*ld(1 + x) the traditional way
- * (using fyl2x).
- *
- * The range testing costs speed, but as the rationale for the very
- * existence of this function is accuracy, we accept that.
- *
- * In order to reduce the cost for testing the range, we check if
- * the argument is in the range
- *                             -0.25 <= x <= 0.25
- * which can be done with just one conditional branch. If x is
- * inside this range, we use fyl2xp1. Outside of this range,
- * the use of fyl2x is accurate enough.
- * 
- */
-
-.text
-       .align  4
-ENTRY(log1p)
-       XMM_ONE_ARG_DOUBLE_PROLOGUE
-       fldl    ARG_DOUBLE_ONE
-       fabs
-       fld1                            /* ... x 1 */
-       fadd    %st(0)                  /* ... x 2 */
-       fadd    %st(0)                  /* ... x 4 */
-       fld1                            /* ... 4 1 */
-       fdivp                           /* ... x 0.25 */
-       fcompp
-       fnstsw  %ax
-       andb    $69,%ah
-       jne     use_fyl2x
-       jmp     use_fyl2xp1
-
-       .align  4
-use_fyl2x:
-       fldln2
-        fldl   ARG_DOUBLE_ONE
-        fld1
-        faddp
-        fyl2x
-       XMM_DOUBLE_EPILOGUE
-        ret
-
-       .align  4
-use_fyl2xp1:
-       fldln2
-       fldl    ARG_DOUBLE_ONE
-       fyl2xp1
-       XMM_DOUBLE_EPILOGUE
-       ret
-END(log1p)
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libm/arch/i386/s_log1pf.S b/lib/libm/arch/i386/s_log1pf.S
deleted file mode 100644 (file)
index 31f62a5..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@NetBSD.org>.
- * Public domain.
- *
- * $NetBSD: s_log1pf.S,v 1.10 2003/09/16 18:17:11 wennmach Exp $
- */
-
-/*
- * Modified by Lex Wennmacher <wennmach@NetBSD.org>
- * Still public domain.
- */
-
-#include <machine/asm.h>
-
-#include "abi.h"
-
-/*
- * The log1pf() function is provided to compute an accurate value of
- * log(1 + x), even for tiny values of x. The i387 FPU provides the
- * fyl2xp1 instructio