From d69e5f014e9e05e03d5ee41fb79ad98dea21f195 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 20 Mar 1997 03:21:13 +0000 Subject: [PATCH] Handle x == +-0 as a special case since expm1(-0) == -0. --- sysdeps/libm-i387/s_expm1.S | 8 +++++--- sysdeps/libm-i387/s_expm1f.S | 8 +++++--- sysdeps/libm-i387/s_expm1l.S | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sysdeps/libm-i387/s_expm1.S b/sysdeps/libm-i387/s_expm1.S index e1b198d604e..92beaf0776e 100644 --- a/sysdeps/libm-i387/s_expm1.S +++ b/sysdeps/libm-i387/s_expm1.S @@ -51,15 +51,17 @@ ENTRY(__expm1) fldl 4(%esp) // x fxam // Is NaN or +-Inf? fstsw %ax + movb $0x45, %ch + andb %ah, %ch + cmpb $0x40, %ch + je 3f // If +-0, jump. #ifdef PIC call 1f 1: popl %edx addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif - movb $0x45, %ch - andb %ah, %ch cmpb $0x05, %ch - je 2f // Is +-Inf, jump. + je 2f // If +-Inf, jump. fldt MO(l2e) // log2(e) : x fmulp // log2(e)*x diff --git a/sysdeps/libm-i387/s_expm1f.S b/sysdeps/libm-i387/s_expm1f.S index 8626fee45db..45a60fe010e 100644 --- a/sysdeps/libm-i387/s_expm1f.S +++ b/sysdeps/libm-i387/s_expm1f.S @@ -51,15 +51,17 @@ ENTRY(__expm1f) flds 4(%esp) // x fxam // Is NaN or +-Inf? fstsw %ax + movb $0x45, %ch + andb %ah, %ch + cmpb $0x40, %ch + je 3f // If +-0, jump. #ifdef PIC call 1f 1: popl %edx addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif - movb $0x45, %ch - andb %ah, %ch cmpb $0x05, %ch - je 2f // Is +-Inf, jump. + je 2f // If +-Inf, jump. fldt MO(l2e) // log2(e) : x fmulp // log2(e)*x diff --git a/sysdeps/libm-i387/s_expm1l.S b/sysdeps/libm-i387/s_expm1l.S index 46290ca4a9e..13fa698cc79 100644 --- a/sysdeps/libm-i387/s_expm1l.S +++ b/sysdeps/libm-i387/s_expm1l.S @@ -51,15 +51,17 @@ ENTRY(__expm1l) fldt 4(%esp) // x fxam // Is NaN or +-Inf? fstsw %ax + movb $0x45, %ch + andb %ah, %ch + cmpb $0x40, %ch + je 3f // If +-0, jump. #ifdef PIC call 1f 1: popl %edx addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif - movb $0x45, %ch - andb %ah, %ch cmpb $0x05, %ch - je 2f // Is +-Inf, jump. + je 2f // If +-Inf, jump. fldt MO(l2e) // log2(e) : x fmulp // log2(e)*x -- 2.47.2