diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index f32087fac..bd57ce6b4 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,8 @@ +2004-02-01 Danny Smith + + * mingwex/math/ldexpl.c (ldexpl): Call __asm__("fscale") + directly, rather than via scabnl. + 2004-02-01 Danny Smith * mingwex/math/powl.c (powl): Return infinity if diff --git a/winsup/mingw/mingwex/math/ldexpl.c b/winsup/mingw/mingwex/math/ldexpl.c index e4477bf6c..19a3d56e3 100644 --- a/winsup/mingw/mingwex/math/ldexpl.c +++ b/winsup/mingw/mingwex/math/ldexpl.c @@ -1,14 +1,19 @@ #include #include - - + 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; }