diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-03-06 13:42:07 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-03-30 10:52:25 -0300 |
commit | 5f34491510efe37d094c1fca66c7404002cdcdc5 (patch) | |
tree | bee11189dd19f37350b385821d43f020aef6f4bc /sysdeps/powerpc/fpu | |
parent | e095db0bc6c53a0b7ac3d915c5feb7678049dc33 (diff) | |
download | glibc-5f34491510efe37d094c1fca66c7404002cdcdc5.tar.gz glibc-5f34491510efe37d094c1fca66c7404002cdcdc5.tar.xz glibc-5f34491510efe37d094c1fca66c7404002cdcdc5.zip |
math: Remove fenvinline.h
Similar to string2.h (18b10de7ce) and string3.h (09a596cc2c) this patch removes the fenvinline.h on all architectures. Currently only powerpc implements some optimizations. This kind of optimization is better implemented by the compiler (which handles the architecture ISA transparently). Also, for the specific optimized powerpc implementation the code is becoming convoluted and these micro-optimization are hardly wildly used, even more being a possible hotspot in realword cases (non-default rounding are used only on specific cases and exception handling are done most likely only on errors path). Only x86 implements similar optimization (on fenv.h) also indicates that these should no be on libc. The math/test-fenv already covers all math/test-fenvinline tests, so it is safe to remove it. The powerpc fegetround optimization is moved to internal fenv_libc.h. The BZ#94193 [1] the corresponding GCC bug for adding replacements for these on powerpc. Checked on x86_64-linux-gnu and powerpc64le-linux-gnu. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94193
Diffstat (limited to 'sysdeps/powerpc/fpu')
-rw-r--r-- | sysdeps/powerpc/fpu/fegetround.c | 8 | ||||
-rw-r--r-- | sysdeps/powerpc/fpu/fraiseexcpt.c | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sysdeps/powerpc/fpu/fegetround.c b/sysdeps/powerpc/fpu/fegetround.c index 00b4462624..7f50c58177 100644 --- a/sysdeps/powerpc/fpu/fegetround.c +++ b/sysdeps/powerpc/fpu/fegetround.c @@ -21,10 +21,12 @@ int (__fegetround) (void) { - return __fegetround(); + fenv_union_t fe; + + fe.fenv = fegetenv_control (); + + return fe.l & 0x3; } -#undef fegetround -#undef __fegetround libm_hidden_def (__fegetround) weak_alias (__fegetround, fegetround) libm_hidden_weak (fegetround) diff --git a/sysdeps/powerpc/fpu/fraiseexcpt.c b/sysdeps/powerpc/fpu/fraiseexcpt.c index daa13de500..1bcd31ae14 100644 --- a/sysdeps/powerpc/fpu/fraiseexcpt.c +++ b/sysdeps/powerpc/fpu/fraiseexcpt.c @@ -18,7 +18,6 @@ #include <fenv_libc.h> -#undef feraiseexcept int __feraiseexcept (int excepts) { |