diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2015-09-18 16:30:43 +0100 |
---|---|---|
committer | Wilco Dijkstra <wdijkstr@arm.com> | 2015-09-18 16:34:45 +0100 |
commit | 8df4e219e43a4a257d0759b54fef8c488e2f282e (patch) | |
tree | fd17e1976bc8fb5443476300f9bcf9645de920a9 /math/Makefile | |
parent | cb2f668d4692df8d31b2ccf9b18b86bebe2d9174 (diff) | |
download | glibc-8df4e219e43a4a257d0759b54fef8c488e2f282e.tar.gz glibc-8df4e219e43a4a257d0759b54fef8c488e2f282e.tar.xz glibc-8df4e219e43a4a257d0759b54fef8c488e2f282e.zip |
Add inlining of the C99 math functions isinf/isnan/signbit/isfinite/isnormal/fpclassify using GCC
built-ins when available. Since going through the PLT is expensive for these small functions, inlining results in major speedups (about 7x on Cortex-A57 for isinf). The GCC built-ins are not correct if signalling NaN support is required, and thus are turned off in that case (see GCC bug 66462). The test-snan.c tests sNaNs and so must be explicitly built with -fsignaling-nans. 2015-09-18 Wilco Dijkstra <wdijkstr@arm.com> [BZ #15367] [BZ #17441] * math/Makefile: Build test-snan.c with -fsignaling-nans. * math/math.h (fpclassify): Use __builtin_fpclassify when available. (signbit): Use __builtin_signbit(f/l). (isfinite): Use__builtin_isfinite. (isnormal): Use __builtin_isnormal. (isnan): Use __builtin_isnan. (isinf): Use __builtin_isinf_sign.
Diffstat (limited to 'math/Makefile')
-rw-r--r-- | math/Makefile | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/math/Makefile b/math/Makefile index 48e7e4ce52..2e5291a378 100644 --- a/math/Makefile +++ b/math/Makefile @@ -176,6 +176,8 @@ CFLAGS-test-tgmath.c = -fno-builtin CFLAGS-test-tgmath2.c = -fno-builtin CFLAGS-test-tgmath-ret.c = -fno-builtin CFLAGS-test-powl.c = -fno-builtin + +CFLAGS-test-snan.c = -fsignaling-nans CPPFLAGS-test-ifloat.c = -U__LIBC_INTERNAL_MATH_INLINES \ $(libm-test-fast-math-cflags) CPPFLAGS-test-idouble.c = -U__LIBC_INTERNAL_MATH_INLINES \ @@ -183,7 +185,6 @@ CPPFLAGS-test-idouble.c = -U__LIBC_INTERNAL_MATH_INLINES \ CPPFLAGS-test-ildoubl.c = -U__LIBC_INTERNAL_MATH_INLINES \ $(libm-test-fast-math-cflags) - # The -lieee module sets the _LIB_VERSION_ switch to IEEE mode # for error handling in the -lm functions. install-lib += libieee.a |