[PATCH 5/6] Add new pow implementation
Szabolcs Nagy
szabolcs.nagy@arm.com
Wed Jun 27 14:55:00 GMT 2018
The algorithm is exp(y * log(x)), where log(x) is computed with about
1.3*2^-68 relative error (1.5*2^-68 without fma), returning the result
in two doubles, and the exp part uses the same algorithm (and lookup
tables) as exp, but takes the input as two doubles and a sign (to handle
negative bases with odd integer exponent). The __exp1 internal symbol
is no longer necessary.
There is separate code path when fma is not available but the worst case
error is about 0.54 ULP in both cases. The lookup table and consts for
log are 4168 bytes. The .rodata+.text is decreased by 37908 bytes on
aarch64. The non-nearest rounding error is less than 1 ULP.
Improvements on Cortex-A72 compared to current glibc master:
latency: 1.8x
thruput: 2.5x
2018-06-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
* math/Makefile (type-double-routines): Add e_pow_log_data.
* sysdeps/generic/math_private.h (__exp1): Remove.
* sysdeps/ieee754/dbl-64/Makefile (CFLAGS-e_pow.c): Allow fma
contraction.
* sysdeps/ieee754/dbl-64/e_exp.c (__exp1): Remove.
(exp_inline): Remove.
(__ieee754_exp): Only single double input is handled.
* sysdeps/ieee754/dbl-64/e_pow.c: Rewrite.
* sysdeps/ieee754/dbl-64/e_pow_log_data.c: New file.
* sysdeps/ieee754/dbl-64/math_config.h (issignaling_inline): Define.
(__pow_log_data): Define.
* sysdeps/ieee754/dbl-64/upow.h: Remove.
* sysdeps/ieee754/dbl-64/upow.tbl: Remove.
---
math/Makefile | 2 +-
sysdeps/generic/math_private.h | 1 -
sysdeps/ieee754/dbl-64/Makefile | 1 -
sysdeps/ieee754/dbl-64/e_exp.c | 32 +-
sysdeps/ieee754/dbl-64/e_pow.c | 651 +-
sysdeps/ieee754/dbl-64/e_pow_log_data.c | 173 +
sysdeps/ieee754/dbl-64/math_config.h | 20 +
sysdeps/ieee754/dbl-64/upow.h | 76 -
sysdeps/ieee754/dbl-64/upow.tbl | 10188 ------------------------------
9 files changed, 535 insertions(+), 10609 deletions(-)
create mode 100644 sysdeps/ieee754/dbl-64/e_pow_log_data.c
delete mode 100644 sysdeps/ieee754/dbl-64/upow.h
delete mode 100644 sysdeps/ieee754/dbl-64/upow.tbl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Add-new-pow-implementation.patch.diff
Type: text/x-patch
Size: 529262 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20180627/6d12eccc/attachment.bin>
More information about the Libc-alpha
mailing list