]> sourceware.org Git - newlib-cygwin.git/commitdiff
* mingwex/math/ldexpl.c (ldexpl): Call __asm__("fscale")
authorDanny Smith <dannysmith@users.sourceforge.net>
Sun, 1 Feb 2004 02:52:21 +0000 (02:52 +0000)
committerDanny Smith <dannysmith@users.sourceforge.net>
Sun, 1 Feb 2004 02:52:21 +0000 (02:52 +0000)
directly, rather than via scabnl.

winsup/mingw/ChangeLog
winsup/mingw/mingwex/math/ldexpl.c

index f32087fac12e298a5243462e72a91896a550302f..bd57ce6b4df01647716214d6cb1a3429191ae41e 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-01  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * mingwex/math/ldexpl.c (ldexpl): Call __asm__("fscale")
+       directly, rather than via scabnl.
+
 2004-02-01  Danny Smith  <dannysmith@users.sourceforge.net>
 
        * mingwex/math/powl.c (powl): Return infinity if
index e4477bf6c1be5bd38ea4215f92d55076919c90c9..19a3d56e374d075272f847c3b8641b1569615468 100644 (file)
@@ -1,14 +1,19 @@
 #include <math.h>
 #include <errno.h>
-
-
+  
 long double ldexpl(long double x, int expn)
 {
-  if (isfinite (x) && x != 0.0L)
-    {
-      x = scalbnl (x , expn);
-      if (!isfinite (x) || x == 0.0) errno = ERANGE;
-    }
-  return x;
+  long double res;
+  if (!isfinite (x) || x == 0.0L)
+    return x;
+
+  __asm__ ("fscale"
+           : "=t" (res)
+           : "0" (x), "u" ((long double) expn));
+
+  if (!isfinite (res) || res == 0.0L)
+    errno = ERANGE;
+
+  return res;
 }
 
This page took 0.033511 seconds and 5 git commands to generate.