diff options
author | Paul Zimmermann <Paul.Zimmermann@inria.fr> | 2020-04-08 17:32:28 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-06-19 10:48:15 -0300 |
commit | 6e98983c0991433fec8cef8702e2028fa6bef12d (patch) | |
tree | 3b19a725eef799a2f2fed827e4914d7b15764665 /math | |
parent | 2004063fb4658095b3b0311606462430e9d0ab2d (diff) | |
download | glibc-6e98983c0991433fec8cef8702e2028fa6bef12d.tar.gz glibc-6e98983c0991433fec8cef8702e2028fa6bef12d.tar.xz glibc-6e98983c0991433fec8cef8702e2028fa6bef12d.zip |
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 'math')
-rw-r--r-- | math/e_exp10f.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/math/e_exp10f.c b/math/e_exp10f.c deleted file mode 100644 index 93c41d00a6..0000000000 --- a/math/e_exp10f.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1998-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <math.h> -#include <math_private.h> -#include <libm-alias-finite.h> - -float -__ieee754_exp10f (float arg) -{ - /* The argument to exp needs to be calculated in enough precision - that the fractional part has as much precision as float, in - addition to the bits in the integer part; using double ensures - this. */ - return __ieee754_exp (M_LN10 * arg); -} -libm_alias_finite (__ieee754_exp10f, __exp10f) |