diff options
Diffstat (limited to 'sysdeps/i386/fpu/s_log2.S')
-rw-r--r-- | sysdeps/i386/fpu/s_log2.S | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/s_log2.S b/sysdeps/i386/fpu/s_log2.S index 4632c96f67..5ba40761e9 100644 --- a/sysdeps/i386/fpu/s_log2.S +++ b/sysdeps/i386/fpu/s_log2.S @@ -40,8 +40,12 @@ ENTRY(__log2) #endif fldl MO(one) fldl 4(%esp) // x : 1 + fxam + fnstsw fld %st // x : x : 1 - fsub %st(2), %st // x-1 : x : 1 + sahf + jc 3f // in case x is NaN or ħInf +4: fsub %st(2), %st // x-1 : x : 1 fld %st // x-1 : x-1 : x : 1 fabs // |x-1| : x-1 : x : 1 fcompl MO(limit) // x-1 : x : 1 @@ -55,5 +59,10 @@ ENTRY(__log2) 2: fstp %st(0) // x : 1 fyl2x // log(x) ret + +3: jp 4b // in case x is ħInf + fstp %st(1) + fstp %st(1) + ret END (__log2) weak_alias (__log2, log2) |