glibc/sysdeps/i386/fpu
Szabolcs Nagy 3e08ff544b Add new log2 implementation
Similar algorithm is used as in log: log2(2^k x) = k + log2(c) + log2(x/c)
where the last term is approximated by a polynomial of x/c - 1, the first
order coefficient is about 1/ln2 in this case.

There is separate code path when fma instruction is not available for
computing x/c - 1 precisely, for which the table size is doubled.

The worst case error is 0.547 ULP (0.55 without fma), the read only
global data size is 1168 bytes (2192 without fma) on aarch64.  The
non-nearest rounding error is less than 1 ULP.

Improvements on Cortex-A72 compared to current glibc master:
log2 thruput: 2.00x in [0.01 11.1]
log2 latency: 2.04x in [0.01 11.1]
log2 thruput: 2.17x in [0.999 1.001]
log2 latency: 2.88x in [0.999 1.001]

Tested on
aarch64-linux-gnu (defined __FP_FAST_FMA)
arm-linux-gnueabihf (!defined __FP_FAST_FMA)
x86_64-linux-gnu (!defined __FP_FAST_FMA)
powerpc64le-linxu-gnu (defined __FP_FAST_FMA)
targets.

	* NEWS: Mention log2 improvements.
	* math/Makefile (type-double-routines): Add e_log2_data.
	* sysdeps/i386/fpu/e_log2_data.c: New file.
	* sysdeps/ia64/fpu/e_log2_data.c: New file.
	* sysdeps/ieee754/dbl-64/e_log2.c: Rewrite.
	* sysdeps/ieee754/dbl-64/e_log2_data.c: New file.
	* sysdeps/ieee754/dbl-64/math_config.h (__log2_data): Add.
	* sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c: Remove.
	* sysdeps/m68k/m680x0/fpu/e_log2_data.c: New file.
2018-09-12 17:36:33 +01:00
..
doasin.c
e_acos.S
e_acosf.S
e_acosh.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_acoshf.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_acoshl.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_acosl.c
e_asin.S
e_asinf.S
e_atan2.S
e_atan2f.S
e_atan2l.c
e_atanh.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_atanhf.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_atanhl.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_exp2.S
e_exp2l.S
e_exp10.S
e_exp10f.S
e_exp10l.S
e_exp_data.c Add new exp and exp2 implementations 2018-09-05 16:22:00 +01:00
e_exp.S
e_expl.S Use libm_alias_ldouble in sysdeps/i386/fpu. 2017-11-17 22:54:39 +00:00
e_fmod.S
e_fmodf.S
e_fmodl.c
e_hypot.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_hypotf.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_ilogb.S
e_ilogbf.S
e_ilogbl.S
e_log2_data.c Add new log2 implementation 2018-09-12 17:36:33 +01:00
e_log2.S
e_log2l.S Fix i386/x86_64 log2l (sNaN) (bug 20235). 2016-06-09 18:04:30 +00:00
e_log10.S
e_log10f.S
e_log10l.S Fix i386/x86_64 log10l (sNaN) (bug 20228). 2016-06-08 22:59:18 +00:00
e_log_data.c Add new log implementation 2018-09-12 17:33:30 +01:00
e_log.S Fix i386/x86_64 log* (1) zero sign for -ffinite-math-only (bug 19213). 2015-11-05 21:56:31 +00:00
e_logl.S Fix i386/x86_64 logl (sNaN) (bug 20227). 2016-06-08 22:24:06 +00:00
e_pow.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_powl.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_remainder.S
e_remainderf.S
e_remainderl.S
e_scalb.S
e_scalbf.S
e_scalbl.S Fix i386/x86_64 scalbl with sNaN input (bug 20296). 2016-06-23 22:17:41 +00:00
e_sqrt.S
e_sqrtf.S
e_sqrtl.c
fclrexcpt.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fedisblxcpt.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
feenablxcpt.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fegetenv.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fegetexcept.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fegetmode.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fegetround.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
feholdexcpt.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fesetenv.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fesetexcept.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fesetmode.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fesetround.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
feupdateenv.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fgetexcptflg.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fraiseexcpt.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fsetexcptflg.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
ftestexcept.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
i386-math-asm.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
Implies
libm-test-ulps math: Update i686 ulps (--disable-multi-arch configuration) 2018-06-01 22:37:55 +02:00
libm-test-ulps-name Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00
math_err.c Add new exp and exp2 implementations 2018-09-05 16:22:00 +01:00
math-tests-snan.h Move SNAN_TESTS_* out of math-tests.h. 2018-08-10 19:22:01 +00:00
mpatan2.c
mpatan.c
mpsqrt.c
s_asinh.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_asinhf.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_asinhl.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_atan.S Use libm_alias_double for i386. 2017-11-28 18:15:44 +00:00
s_atanf.S Use libm_alias_float for i386. 2017-11-29 00:10:35 +00:00
s_atanl.c Use libm_alias_ldouble in sysdeps/i386/fpu. 2017-11-17 22:54:39 +00:00
s_cbrt.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_cbrtf.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_cbrtl.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_ceil.S Use libm_alias_double for i386. 2017-11-28 18:15:44 +00:00
s_ceilf.S Use libm_alias_float for i386. 2017-11-29 00:10:35 +00:00
s_ceill.S Use libm_alias_ldouble in sysdeps/i386/fpu. 2017-11-17 22:54:39 +00:00
s_copysign.S Use libm_alias_double for i386. 2017-11-28 18:15:44 +00:00
s_copysignf.S Use libm_alias_float for i386. 2017-11-29 00:10:35 +00:00
s_copysignl.S Use libm_alias_ldouble in sysdeps/i386/fpu. 2017-11-17 22:54:39 +00:00
s_expm1.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_expm1f.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_expm1l.S
s_f32xaddf64.c Move math_narrow_eval to separate math-narrow-eval.h. 2018-05-09 00:15:10 +00:00
s_f32xdivf64.c Add narrowing divide functions. 2018-05-17 00:40:52 +00:00
s_f32xmulf64.c Add narrowing multiply functions. 2018-05-16 00:05:28 +00:00
s_f32xsubf64.c Move math_narrow_eval to separate math-narrow-eval.h. 2018-05-09 00:15:10 +00:00
s_fabs.S Use libm_alias_double for i386. 2017-11-28 18:15:44 +00:00
s_fabsf.S Use libm_alias_float for i386. 2017-11-29 00:10:35 +00:00
s_fabsl.S Use libm_alias_ldouble in sysdeps/i386/fpu. 2017-11-17 22:54:39 +00:00
s_fdim.c Move math_narrow_eval to separate math-narrow-eval.h. 2018-05-09 00:15:10 +00:00
s_finite.S
s_finitef.S
s_finitel.S
s_floor.S Use libm_alias_double for i386. 2017-11-28 18:15:44 +00:00
s_floorf.S Use libm_alias_float for i386. 2017-11-29 00:10:35 +00:00
s_floorl.S Use libm_alias_ldouble in sysdeps/i386/fpu. 2017-11-17 22:54:39 +00:00
s_fmax.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_fmaxf.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_fmaxl.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_fmin.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_fminf.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_fminl.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_fpclassifyl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_frexp.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_frexpf.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_frexpl.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_isinfl.c
s_isnanl.c Consistently use uintN_t not u_intN_t in libm. 2017-08-03 19:55:04 +00:00
s_llrint.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_llrintf.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_llrintl.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_log1p.S
s_log1pf.S
s_log1pl.S Fix i386/x86_64 log1pl (sNaN) (bug 20229). 2016-06-08 23:11:42 +00:00
s_logb.S Use libm_alias_double for i386. 2017-11-28 18:15:44 +00:00
s_logbf.S Use libm_alias_float for i386. 2017-11-29 00:10:35 +00:00
s_logbl.c Use libm_alias_ldouble in sysdeps/i386/fpu. 2017-11-17 22:54:39 +00:00
s_lrint.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_lrintf.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_lrintl.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_nearbyint.S Use libm_alias_double for i386. 2017-11-28 18:15:44 +00:00
s_nearbyintf.S Use libm_alias_float for i386. 2017-11-29 00:10:35 +00:00
s_nearbyintl.S Use libm_alias_ldouble in sysdeps/i386/fpu. 2017-11-17 22:54:39 +00:00
s_nextafterl.c Do not include math-barriers.h in math_private.h. 2018-05-11 15:11:38 +00:00
s_nexttoward.c Do not include math-barriers.h in math_private.h. 2018-05-11 15:11:38 +00:00
s_nexttowardf.c Do not include math-barriers.h in math_private.h. 2018-05-11 15:11:38 +00:00
s_remquo.S Use libm_alias_double for i386. 2017-11-28 18:15:44 +00:00
s_remquof.S Use libm_alias_float for i386. 2017-11-29 00:10:35 +00:00
s_remquol.S Use libm_alias_ldouble in sysdeps/i386/fpu. 2017-11-17 22:54:39 +00:00
s_rint.S Use libm_alias_double for i386. 2017-11-28 18:15:44 +00:00
s_rintf.S Use libm_alias_float for i386. 2017-11-29 00:10:35 +00:00
s_rintl.c Use libm_alias_ldouble in sysdeps/i386/fpu. 2017-11-17 22:54:39 +00:00
s_scalbln.c
s_scalblnf.c
s_scalblnl.c
s_scalbn.S
s_scalbnf.S
s_scalbnl.S
s_significand.S
s_significandf.S
s_significandl.c
s_trunc.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_truncf.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_truncl.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
Versions
w_sqrt_compat.c Add support for sqrt asm redirects 2018-03-15 19:21:35 +00:00
w_sqrt.c Add support for sqrt asm redirects 2018-03-15 19:21:35 +00:00