]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Correct errno handling in expm1.
authorAndreas Schwab <schwab@redhat.com>
Tue, 20 Oct 2009 04:23:15 +0000 (21:23 -0700)
committerUlrich Drepper <drepper@redhat.com>
Tue, 20 Oct 2009 04:23:15 +0000 (21:23 -0700)
ChangeLog
include/math.h
sysdeps/i386/fpu/s_expm1.S
sysdeps/i386/fpu/s_expm1f.S
sysdeps/i386/fpu/s_expm1l.S
sysdeps/ieee754/dbl-64/w_exp.c
sysdeps/ieee754/flt-32/w_expf.c
sysdeps/ieee754/ldbl-96/w_expl.c

index 700e346981774ef3bad21f0d063b20a1b550570c..2857d881779996612c594a281030018c34d010d9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-19  Andreas Schwab  <schwab@redhat.com>
+
+       * include/math.h: Add hidden protos for __exp/__expf/__expl.
+       * sysdeps/ieee754/dbl-64/w_exp.c: Add hidden alias.
+       * sysdeps/ieee754/flt-32/w_expf.c: Likewise.
+       * sysdeps/ieee754/ldbl-96/w_expl.c: Likewise.
+       * sysdeps/i386/fpu/s_expm1.S: Call __exp to handle overflow.
+       * sysdeps/i386/fpu/s_expm1f.S: Call __expf to handle overflow.
+       * sysdeps/i386/fpu/s_expm1l.S: Call __expl instead of
+       __ieee751_expl to handle overflow.
+
 2009-10-14  David S. Miller  <davem@davemloft.net>
 
        * sysdeps/unix/sysv/linux/sparc/sparc32/____longjmp_chk.S: New file.
index 100580427387661eff8319fbe5249295c0acc369..eb29ef1a56808fc9b38600503289d1eb059f7fe3 100644 (file)
@@ -22,9 +22,12 @@ hidden_proto (__isnanl)
 
 libm_hidden_proto (__fpclassify)
 libm_hidden_proto (__fpclassifyf)
+libm_hidden_proto (__exp)
+libm_hidden_proto (__expf)
 
 # ifndef __NO_LONG_DOUBLE_MATH
 libm_hidden_proto (__fpclassifyl)
+libm_hidden_proto (__expl)
 libm_hidden_proto (__expm1l)
 # endif
 
index e7611836394ae8729520b3f66ab6cd447295c402..c690a458f847e9a8add2be2f0bcbd8f25ea5ae41 100644 (file)
@@ -22,6 +22,7 @@
 
        /* Using: e^x - 1 = 2^(x * log2(e)) - 1 */
 
+#include <sysdep.h>
 #include <machine/asm.h>
 
 #ifdef __ELF__
@@ -48,6 +49,11 @@ l2e: .tfloat 1.442695040888963407359924681002
 
        .text
 ENTRY(__expm1)
+       movzwl  4+6(%esp), %eax
+       xorb    $0x80, %ah      // invert sign bit (now 1 is "positive")
+       cmpl    $0xc086, %eax   // is num >= 704?
+       jae     HIDDEN_JUMPTARGET (__exp)
+
        fldl    4(%esp)         // x
        fxam                    // Is NaN or +-Inf?
        fstsw   %ax
index 88adb75b867894581463d36f644a1bdaed350ad3..8645107274d90bc52282bcc20b1cba8d0f087c8e 100644 (file)
@@ -22,6 +22,7 @@
 
        /* Using: e^x - 1 = 2^(x * log2(e)) - 1 */
 
+#include <sysdep.h>
 #include <machine/asm.h>
 
 #ifdef __ELF__
@@ -48,6 +49,11 @@ l2e: .tfloat 1.442695040888963407359924681002
 
        .text
 ENTRY(__expm1f)
+       movzwl  4+2(%esp), %eax
+       xorb    $0x80, %ah      // invert sign bit (now 1 is "positive")
+       cmpl    $0xc2b1, %eax   // is num >= 88.5?
+       jae     HIDDEN_JUMPTARGET (__expf)
+
        flds    4(%esp)         // x
        fxam                    // Is NaN or +-Inf?
        fstsw   %ax
index b69b22bc62406984ee10629664fb42671f23e45d..60b5b82e20704661b7692de9290c7a303d291c97 100644 (file)
@@ -22,6 +22,7 @@
 
        /* Using: e^x - 1 = 2^(x * log2(e)) - 1 */
 
+#include <sysdep.h>
 #include <machine/asm.h>
 
 #ifdef __ELF__
@@ -51,7 +52,7 @@ ENTRY(__expm1l)
        movzwl  4+8(%esp), %eax // load sign bit and 15-bit exponent
        xorb    $0x80, %ah      // invert sign bit (now 1 is "positive")
        cmpl    $0xc006, %eax   // is num positive and exp >= 6 (number is >= 128.0)?
-       jae     __ieee754_expl  // (if num is denormal, it is at least >= 64.0)
+       jae     HIDDEN_JUMPTARGET (__expl) // (if num is denormal, it is at least >= 64.0)
 
        fldt    4(%esp)         // x
        fxam                    // Is NaN or +-Inf?
index 445c5788d29ea330ab61bf01b49bf7182108df01..1216492090b1299c145fe11f826771f95a09f947 100644 (file)
@@ -51,6 +51,7 @@ u_threshold= -7.45133219101941108420e+02;  /* 0xc0874910, 0xD52D3051 */
        return z;
 #endif
 }
+hidden_def (__exp)
 weak_alias (__exp, exp)
 #ifdef NO_LONG_DOUBLE
 strong_alias (__exp, __expl)
index 4ba21c7c42b52aa839d0e5b16a4bb623b1008d6a..83b268f570bd910d2e82e59226673a9db921e542 100644 (file)
@@ -56,4 +56,5 @@ u_threshold= -1.0397208405e+02;  /* 0xc2cff1b5 */
        return z;
 #endif
 }
+hidden_def (__expf)
 weak_alias (__expf, expf)
index b8152cea6536fd60d9bb272617bb5f5a1b7603f5..53bb143734d3a7a18a68b0b24549b6d63ae1043f 100644 (file)
@@ -57,4 +57,5 @@ u_threshold= -1.140019167866942050398521670162263001513e4;
        return z;
 #endif
 }
+hidden_def (__expl)
 weak_alias (__expl, expl)