aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/flt-32/math_config.h
diff options
context:
space:
mode:
authorPaul Zimmermann <Paul.Zimmermann@inria.fr>2020-04-08 17:32:28 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-06-19 10:48:15 -0300
commit6e98983c0991433fec8cef8702e2028fa6bef12d (patch)
tree3b19a725eef799a2f2fed827e4914d7b15764665 /sysdeps/ieee754/flt-32/math_config.h
parent2004063fb4658095b3b0311606462430e9d0ab2d (diff)
downloadglibc-6e98983c0991433fec8cef8702e2028fa6bef12d.zip
glibc-6e98983c0991433fec8cef8702e2028fa6bef12d.tar.gz
glibc-6e98983c0991433fec8cef8702e2028fa6bef12d.tar.bz2
math: Optimized generic exp10f with wrappers
It is inspired by expf and reuses its tables and internal functions. The error checks are inlined and errno setting is in separate tail called functions, but the wrappers are kept in this patch to handle the _LIB_VERSION==_SVID_ case. Double precision arithmetics is used which is expected to be faster on most targets (including soft-float) than using single precision and it is easier to get good precision result with it. Result for x86_64 (i7-4790K CPU @ 4.00GHz) are: Before new code: "exp10f": { "workload-spec2017.wrf (adapted)": { "duration": 4.0414e+09, "iterations": 1.00128e+08, "reciprocal-throughput": 26.6818, "latency": 54.043, "max-throughput": 3.74787e+07, "min-throughput": 1.85038e+07 } With new code: "exp10f": { "workload-spec2017.wrf (adapted)": { "duration": 4.11951e+09, "iterations": 1.23968e+08, "reciprocal-throughput": 21.0581, "latency": 45.4028, "max-throughput": 4.74876e+07, "min-throughput": 2.20251e+07 } Result for aarch64 (A72 @ 2GHz) are: Before new code: "exp10f": { "workload-spec2017.wrf (adapted)": { "duration": 4.62362e+09, "iterations": 3.3376e+07, "reciprocal-throughput": 127.698, "latency": 149.365, "max-throughput": 7.831e+06, "min-throughput": 6.69501e+06 } With new code: "exp10f": { "workload-spec2017.wrf (adapted)": { "duration": 4.29108e+09, "iterations": 6.6752e+07, "reciprocal-throughput": 51.2111, "latency": 77.3568, "max-throughput": 1.9527e+07, "min-throughput": 1.29271e+07 } Checked on x86_64-linux-gnu, powerpc64le-linux-gnu, aarch64-linux-gnu, and sparc64-linux-gnu.
Diffstat (limited to 'sysdeps/ieee754/flt-32/math_config.h')
-rw-r--r--sysdeps/ieee754/flt-32/math_config.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/ieee754/flt-32/math_config.h b/sysdeps/ieee754/flt-32/math_config.h
index bf79274..4817e50 100644
--- a/sysdeps/ieee754/flt-32/math_config.h
+++ b/sysdeps/ieee754/flt-32/math_config.h
@@ -109,7 +109,7 @@ attribute_hidden float __math_may_uflowf (uint32_t);
attribute_hidden float __math_divzerof (uint32_t);
attribute_hidden float __math_invalidf (float);
-/* Shared between expf, exp2f and powf. */
+/* Shared between expf, exp2f, exp10f, and powf. */
#define EXP2F_TABLE_BITS 5
#define EXP2F_POLY_ORDER 3
extern const struct exp2f_data