libm: Sync with FreeBSD (~50 math functions added)
authorJohn Marino <draco@marino.st>
Wed, 21 Dec 2011 17:10:04 +0000 (18:10 +0100)
committerJohn Marino <draco@marino.st>
Thu, 22 Dec 2011 07:21:23 +0000 (08:21 +0100)
commit1a3b704c5cf3ce3034c25a0318f2ceaaf0eea361
tree8f4b5ebc413001656d53c22b8305845fc8812b3c
parent70e34eb24a22146387d9d5fab19ae39ea9225a1d
libm: Sync with FreeBSD (~50 math functions added)

The main purpose of syncing with FreeBSD is to obtain numerous "long double"
functions which are required for C99 compliance.  There are still many
functions missing.  According to g++ testsuite, the following 10 functions
still must be implemented at least:
        coshl           logl            expl
        sinhl           log2l           expm1l
        acoshl          log10l
        asinhl          log1pl

Also known missing are nexttowardl, tgammal, and the long double version of
most of several complex functions.

A few years ago the freebsd-based math library was thrown out in favor of
the NetBSD version.  It may be time to reverse that and sync the entire
libm with FreeBSD.  Right now the DragonFly libm is a mixture between the
two and it doesn't divide nicely.  All the rounding and rint functions from
NetBSD had to be thrown out as well as the "kernel" functions.  For the
short term this is okay, but in the long term it would be a good idea to
start tracking FreeBSD again.  They are maintaining this library more
frequently and adding more functions more rapidly than NetBSD, so it would
be good to piggy-back on that effort.

The man page will be committed separately.
95 files changed:
include/complex.h
include/math.h
lib/libm/arch/i386/Makefile.inc
lib/libm/arch/i386/e_remainderl.S [copied from lib/libm/src/s_roundf.c with 57% similarity]
lib/libm/arch/i386/e_sqrtl.S [copied from lib/libm/src/s_roundf.c with 62% similarity]
lib/libm/arch/i386/lrint.S [deleted file]
lib/libm/arch/i386/s_lrint.S [copied from lib/libm/src/s_copysignl.c with 72% similarity]
lib/libm/arch/i386/s_lrintf.S [copied from lib/libm/src/s_copysignl.c with 72% similarity]
lib/libm/arch/i386/s_lrintl.S [copied from lib/libm/src/s_copysignl.c with 71% similarity]
lib/libm/arch/i386/s_remquol.S [new file with mode: 0644]
lib/libm/arch/i386/s_scalbnf.S
lib/libm/arch/i386/s_scalbnl.S
lib/libm/complex/Makefile.inc
lib/libm/complex/s_cargl.c [copied from lib/libm/src/s_copysignl.c with 77% similarity]
lib/libm/complex/s_csqrtl.c [new file with mode: 0644]
lib/libm/complex/w_cabsl.c [new file with mode: 0644]
lib/libm/src/Makefile.inc
lib/libm/src/b_exp.c [new file with mode: 0644]
lib/libm/src/b_log.c [new file with mode: 0644]
lib/libm/src/b_tgamma.c [new file with mode: 0644]
lib/libm/src/e_acosl.c [new file with mode: 0644]
lib/libm/src/e_asinl.c [new file with mode: 0644]
lib/libm/src/e_atan2l.c [new file with mode: 0644]
lib/libm/src/e_fmodl.c [new file with mode: 0644]
lib/libm/src/e_hypotl.c [new file with mode: 0644]
lib/libm/src/e_lgamma_r.c
lib/libm/src/e_lgammaf_r.c
lib/libm/src/e_log2.c
lib/libm/src/e_log2f.c
lib/libm/src/e_rem_pio2.c
lib/libm/src/e_rem_pio2f.c
lib/libm/src/e_rem_pio2l.h [new file with mode: 0644]
lib/libm/src/e_remainderl.c [copied from lib/libm/src/s_copysignl.c with 77% similarity]
lib/libm/src/e_sqrtl.c [new file with mode: 0644]
lib/libm/src/invtrig.c [new file with mode: 0644]
lib/libm/src/invtrig.h [new file with mode: 0644]
lib/libm/src/k_cosf.c
lib/libm/src/k_cosl.c [new file with mode: 0644]
lib/libm/src/k_rem_pio2.c
lib/libm/src/k_sinf.c
lib/libm/src/k_sinl.c [new file with mode: 0644]
lib/libm/src/k_tanf.c
lib/libm/src/k_tanl.c [new file with mode: 0644]
lib/libm/src/llrint.c [deleted file]
lib/libm/src/llrintf.c [deleted file]
lib/libm/src/llround.c [deleted file]
lib/libm/src/llroundf.c [deleted file]
lib/libm/src/lrint.c [deleted file]
lib/libm/src/lrintf.c [deleted file]
lib/libm/src/math_private.h
lib/libm/src/mathimpl.h [new file with mode: 0644]
lib/libm/src/s_atanl.c [new file with mode: 0644]
lib/libm/src/s_cbrtl.c [new file with mode: 0644]
lib/libm/src/s_ceill.c [new file with mode: 0644]
lib/libm/src/s_copysignl.c
lib/libm/src/s_cosf.c
lib/libm/src/s_cosl.c [copied from lib/libm/src/s_roundf.c with 57% similarity]
lib/libm/src/s_exp2.c
lib/libm/src/s_exp2f.c
lib/libm/src/s_exp2l.c [new file with mode: 0644]
lib/libm/src/s_fabs.c [moved from lib/libm/src/s_ldexpf.c with 52% similarity]
lib/libm/src/s_floorl.c [new file with mode: 0644]
lib/libm/src/s_fma.c [new file with mode: 0644]
lib/libm/src/s_fmaf.c [moved from lib/libm/src/lroundf.c with 52% similarity]
lib/libm/src/s_fmal.c [new file with mode: 0644]
lib/libm/src/s_llrint.c [new file with mode: 0644]
lib/libm/src/s_llrintf.c [new file with mode: 0644]
lib/libm/src/s_llrintl.c [new file with mode: 0644]
lib/libm/src/s_llround.c [new file with mode: 0644]
lib/libm/src/s_llroundf.c [new file with mode: 0644]
lib/libm/src/s_llroundl.c [new file with mode: 0644]
lib/libm/src/s_lrint.c [copied from lib/libm/src/s_nearbyint.c with 65% similarity]
lib/libm/src/s_lrintf.c [new file with mode: 0644]
lib/libm/src/s_lrintl.c [new file with mode: 0644]
lib/libm/src/s_lround.c [copied from lib/libm/src/s_nearbyint.c with 56% similarity]
lib/libm/src/s_lroundf.c [new file with mode: 0644]
lib/libm/src/s_lroundl.c [new file with mode: 0644]
lib/libm/src/s_modf.c [new file with mode: 0644]
lib/libm/src/s_modfl.c [new file with mode: 0644]
lib/libm/src/s_nearbyint.c
lib/libm/src/s_nexttowardf.c [new file with mode: 0644]
lib/libm/src/s_remquo.c
lib/libm/src/s_remquof.c
lib/libm/src/s_remquol.c [new file with mode: 0644]
lib/libm/src/s_rintl.c [moved from lib/libm/src/lround.c with 50% similarity]
lib/libm/src/s_round.c
lib/libm/src/s_roundf.c
lib/libm/src/s_roundl.c [copied from lib/libm/src/s_round.c with 85% similarity]
lib/libm/src/s_scalbln.c [copied from lib/libm/src/s_nearbyint.c with 69% similarity]
lib/libm/src/s_sinf.c
lib/libm/src/s_sinl.c [copied from lib/libm/src/s_roundf.c with 59% similarity]
lib/libm/src/s_tanf.c
lib/libm/src/s_tanl.c [copied from lib/libm/src/s_round.c with 56% similarity]
lib/libm/src/s_tgammaf.c [copied from lib/libm/src/s_copysignl.c with 69% similarity]
lib/libm/src/s_truncl.c [new file with mode: 0644]