]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - math/e_scalbl.c
Improve __ieee754_exp() performance by greater than 5x on sparc/x86.
[thirdparty/glibc.git] / math / e_scalbl.c
index 739db7a188b617e884725da9fd88b98dcbdd2b08..64c7765adb83ca1bb317fd69ca3888f581b1f288 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -16,7 +16,6 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <fenv.h>
 #include <math.h>
 #include <math_private.h>
 
@@ -26,10 +25,7 @@ __attribute__ ((noinline))
 invalid_fn (long double x, long double fn)
 {
   if (__rintl (fn) != fn)
-    {
-      feraiseexcept (FE_INVALID);
-      return __nan ("");
-    }
+    return (fn - fn) / (fn - fn);
   else if (fn > 65000.0L)
     return __scalbnl (x, 65000);
   else
@@ -40,11 +36,11 @@ invalid_fn (long double x, long double fn)
 long double
 __ieee754_scalbl (long double x, long double fn)
 {
-  if (__glibc_unlikely (__isnanl (x)))
+  if (__glibc_unlikely (isnan (x)))
     return x * fn;
-  if (__glibc_unlikely (!__finitel (fn)))
+  if (__glibc_unlikely (!isfinite (fn)))
     {
-      if (__isnanl (fn) || fn > 0.0L)
+      if (isnan (fn) || fn > 0.0L)
        return x * fn;
       if (x == 0.0L)
        return x;