aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/fpu/e_expl.S16
1 files changed, 15 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_expl.S b/sysdeps/i386/fpu/e_expl.S
index c7e43732dc..74968bbc2b 100644
--- a/sysdeps/i386/fpu/e_expl.S
+++ b/sysdeps/i386/fpu/e_expl.S
@@ -65,6 +65,10 @@ c1: .byte 0x20, 0xfa, 0xee, 0xc2, 0x5f, 0x70, 0xa5, 0xec, 0xed, 0x3f
csat: .byte 0, 0, 0, 0, 0, 0, 0, 0x80, 0x0e, 0x40
.byte 0, 0, 0, 0, 0, 0
ASM_SIZE_DIRECTIVE(csat)
+ .type cmin,@object
+cmin: .byte 0, 0, 0, 0, 0, 0, 0, 0x80, 0x1, 0
+ .byte 0, 0, 0, 0, 0, 0
+ ASM_SIZE_DIRECTIVE(cmin)
#endif
#ifdef PIC
@@ -189,8 +193,18 @@ ENTRY(IEEE754_EXPL)
fstp %st(1) /* 2 */
fscale /* 2 scale factor is st(1); base^x */
fstp %st(1) /* 1 */
+ /* Ensure underflow for tiny result. */
+ fldt MO(cmin) /* 2 cmin */
+ fld %st(1) /* 3 */
+ fcompp /* 1 */
+ fnstsw
+ sahf
+ jnc 6f
+ fld %st
+ fmul %st
+ fstp %st
#endif
- fstp %st(1) /* 0 */
+6: fstp %st(1) /* 0 */
jmp 2f
1:
#ifdef USE_AS_EXPM1L