mirror of git://sourceware.org/git/glibc.git
[BZ #3919]
* math/libm-test.inc (log_test): Test -Inf and NaN. (log10_test, log1p_test, log2_test): Test -Inf. * sysdeps/i386/fpu/e_log.S (__ieee754_log): Don't raise FE_INVALID when argument is qNaN. * sysdeps/i386/fpu/e_logl.S (__ieee754_logl): Likewise. * sysdeps/i386/fpu/e_logf.S (__ieee754_logf): Likewise. * sysdeps/x86_64/fpu/e_logl.S (__ieee754_logl): Likewise. * sysdeps/x86_64/fpu/e_log10l.S (__ieee754_log10l): Replace andb $1, %ah with testb $1, %ah, don't test for parity, instead testb $4, %ah and jump if non-zero. * sysdeps/x86_64/fpu/e_log2l.S (__ieee754_log2l): Likewise. * sysdeps/x86_64/fpu/s_log1pl.S (__log1pl): Likewise. 2007-03-15 Jakub Jelinek <jakub@redhat.com>
This commit is contained in:
parent
44969f17bb
commit
6b2665f534
16
ChangeLog
16
ChangeLog
|
|
@ -1,3 +1,19 @@
|
||||||
|
2007-03-15 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
[BZ #3919]
|
||||||
|
* math/libm-test.inc (log_test): Test -Inf and NaN.
|
||||||
|
(log10_test, log1p_test, log2_test): Test -Inf.
|
||||||
|
* sysdeps/i386/fpu/e_log.S (__ieee754_log): Don't raise
|
||||||
|
FE_INVALID when argument is qNaN.
|
||||||
|
* sysdeps/i386/fpu/e_logl.S (__ieee754_logl): Likewise.
|
||||||
|
* sysdeps/i386/fpu/e_logf.S (__ieee754_logf): Likewise.
|
||||||
|
* sysdeps/x86_64/fpu/e_logl.S (__ieee754_logl): Likewise.
|
||||||
|
* sysdeps/x86_64/fpu/e_log10l.S (__ieee754_log10l): Replace
|
||||||
|
andb $1, %ah with testb $1, %ah, don't test for parity, instead
|
||||||
|
testb $4, %ah and jump if non-zero.
|
||||||
|
* sysdeps/x86_64/fpu/e_log2l.S (__ieee754_log2l): Likewise.
|
||||||
|
* sysdeps/x86_64/fpu/s_log1pl.S (__log1pl): Likewise.
|
||||||
|
|
||||||
2007-03-15 Jakub Jelinek <jakub@redhat.com>
|
2007-03-15 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
[BZ #4101]
|
[BZ #4101]
|
||||||
|
|
|
||||||
|
|
@ -4127,7 +4127,9 @@ log_test (void)
|
||||||
TEST_f_f (log, 1, 0);
|
TEST_f_f (log, 1, 0);
|
||||||
|
|
||||||
TEST_f_f (log, -1, nan_value, INVALID_EXCEPTION);
|
TEST_f_f (log, -1, nan_value, INVALID_EXCEPTION);
|
||||||
|
TEST_f_f (log, minus_infty, nan_value, INVALID_EXCEPTION);
|
||||||
TEST_f_f (log, plus_infty, plus_infty);
|
TEST_f_f (log, plus_infty, plus_infty);
|
||||||
|
TEST_f_f (log, nan_value, nan_value);
|
||||||
|
|
||||||
TEST_f_f (log, M_El, 1);
|
TEST_f_f (log, M_El, 1);
|
||||||
TEST_f_f (log, 1.0 / M_El, -1);
|
TEST_f_f (log, 1.0 / M_El, -1);
|
||||||
|
|
@ -4157,6 +4159,7 @@ log10_test (void)
|
||||||
|
|
||||||
/* log10 (x) == NaN plus invalid exception if x < 0. */
|
/* log10 (x) == NaN plus invalid exception if x < 0. */
|
||||||
TEST_f_f (log10, -1, nan_value, INVALID_EXCEPTION);
|
TEST_f_f (log10, -1, nan_value, INVALID_EXCEPTION);
|
||||||
|
TEST_f_f (log10, minus_infty, nan_value, INVALID_EXCEPTION);
|
||||||
|
|
||||||
TEST_f_f (log10, plus_infty, plus_infty);
|
TEST_f_f (log10, plus_infty, plus_infty);
|
||||||
TEST_f_f (log10, nan_value, nan_value);
|
TEST_f_f (log10, nan_value, nan_value);
|
||||||
|
|
@ -4188,6 +4191,7 @@ log1p_test (void)
|
||||||
|
|
||||||
TEST_f_f (log1p, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
|
TEST_f_f (log1p, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
|
||||||
TEST_f_f (log1p, -2, nan_value, INVALID_EXCEPTION);
|
TEST_f_f (log1p, -2, nan_value, INVALID_EXCEPTION);
|
||||||
|
TEST_f_f (log1p, minus_infty, nan_value, INVALID_EXCEPTION);
|
||||||
|
|
||||||
TEST_f_f (log1p, plus_infty, plus_infty);
|
TEST_f_f (log1p, plus_infty, plus_infty);
|
||||||
TEST_f_f (log1p, nan_value, nan_value);
|
TEST_f_f (log1p, nan_value, nan_value);
|
||||||
|
|
@ -4218,6 +4222,7 @@ log2_test (void)
|
||||||
TEST_f_f (log2, 1, 0);
|
TEST_f_f (log2, 1, 0);
|
||||||
|
|
||||||
TEST_f_f (log2, -1, nan_value, INVALID_EXCEPTION);
|
TEST_f_f (log2, -1, nan_value, INVALID_EXCEPTION);
|
||||||
|
TEST_f_f (log2, minus_infty, nan_value, INVALID_EXCEPTION);
|
||||||
|
|
||||||
TEST_f_f (log2, plus_infty, plus_infty);
|
TEST_f_f (log2, plus_infty, plus_infty);
|
||||||
TEST_f_f (log2, nan_value, nan_value);
|
TEST_f_f (log2, nan_value, nan_value);
|
||||||
|
|
|
||||||
|
|
@ -36,11 +36,15 @@ limit: .double 0.29
|
||||||
ENTRY(__ieee754_log)
|
ENTRY(__ieee754_log)
|
||||||
fldln2 // log(2)
|
fldln2 // log(2)
|
||||||
fldl 4(%esp) // x : log(2)
|
fldl 4(%esp) // x : log(2)
|
||||||
|
fxam
|
||||||
|
fnstsw
|
||||||
#ifdef PIC
|
#ifdef PIC
|
||||||
LOAD_PIC_REG (dx)
|
LOAD_PIC_REG (dx)
|
||||||
#endif
|
#endif
|
||||||
fld %st // x : x : log(2)
|
fld %st // x : x : log(2)
|
||||||
fsubl MO(one) // x-1 : x : log(2)
|
sahf
|
||||||
|
jc 3f // in case x is NaN or +-Inf
|
||||||
|
4: fsubl MO(one) // x-1 : x : log(2)
|
||||||
fld %st // x-1 : x-1 : x : log(2)
|
fld %st // x-1 : x-1 : x : log(2)
|
||||||
fabs // |x-1| : x-1 : x : log(2)
|
fabs // |x-1| : x-1 : x : log(2)
|
||||||
fcompl MO(limit) // x-1 : x : log(2)
|
fcompl MO(limit) // x-1 : x : log(2)
|
||||||
|
|
@ -54,4 +58,9 @@ ENTRY(__ieee754_log)
|
||||||
2: fstp %st(0) // x : log(2)
|
2: fstp %st(0) // x : log(2)
|
||||||
fyl2x // log(x)
|
fyl2x // log(x)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
3: jp 4b // in case x is +-Inf
|
||||||
|
fstp %st(1)
|
||||||
|
fstp %st(1)
|
||||||
|
ret
|
||||||
END (__ieee754_log)
|
END (__ieee754_log)
|
||||||
|
|
|
||||||
|
|
@ -37,11 +37,15 @@ limit: .double 0.29
|
||||||
ENTRY(__ieee754_logf)
|
ENTRY(__ieee754_logf)
|
||||||
fldln2 // log(2)
|
fldln2 // log(2)
|
||||||
flds 4(%esp) // x : log(2)
|
flds 4(%esp) // x : log(2)
|
||||||
|
fxam
|
||||||
|
fnstsw
|
||||||
#ifdef PIC
|
#ifdef PIC
|
||||||
LOAD_PIC_REG (dx)
|
LOAD_PIC_REG (dx)
|
||||||
#endif
|
#endif
|
||||||
fld %st // x : x : log(2)
|
fld %st // x : x : log(2)
|
||||||
fsubl MO(one) // x-1 : x : log(2)
|
sahf
|
||||||
|
jc 3f // in case x is NaN or +-Inf
|
||||||
|
4: fsubl MO(one) // x-1 : x : log(2)
|
||||||
fld %st // x-1 : x-1 : x : log(2)
|
fld %st // x-1 : x-1 : x : log(2)
|
||||||
fabs // |x-1| : x-1 : x : log(2)
|
fabs // |x-1| : x-1 : x : log(2)
|
||||||
fcompl MO(limit) // x-1 : x : log(2)
|
fcompl MO(limit) // x-1 : x : log(2)
|
||||||
|
|
@ -55,4 +59,9 @@ ENTRY(__ieee754_logf)
|
||||||
2: fstp %st(0) // x : log(2)
|
2: fstp %st(0) // x : log(2)
|
||||||
fyl2x // log(x)
|
fyl2x // log(x)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
3: jp 4b // in case x is +-Inf
|
||||||
|
fstp %st(1)
|
||||||
|
fstp %st(1)
|
||||||
|
ret
|
||||||
END (__ieee754_logf)
|
END (__ieee754_logf)
|
||||||
|
|
|
||||||
|
|
@ -37,11 +37,15 @@ limit: .double 0.29
|
||||||
ENTRY(__ieee754_logl)
|
ENTRY(__ieee754_logl)
|
||||||
fldln2 // log(2)
|
fldln2 // log(2)
|
||||||
fldt 4(%esp) // x : log(2)
|
fldt 4(%esp) // x : log(2)
|
||||||
|
fxam
|
||||||
|
fnstsw
|
||||||
#ifdef PIC
|
#ifdef PIC
|
||||||
LOAD_PIC_REG (dx)
|
LOAD_PIC_REG (dx)
|
||||||
#endif
|
#endif
|
||||||
fld %st // x : x : log(2)
|
fld %st // x : x : log(2)
|
||||||
fsubl MO(one) // x-1 : x : log(2)
|
sahf
|
||||||
|
jc 3f // in case x is NaN or +-Inf
|
||||||
|
4: fsubl MO(one) // x-1 : x : log(2)
|
||||||
fld %st // x-1 : x-1 : x : log(2)
|
fld %st // x-1 : x-1 : x : log(2)
|
||||||
fabs // |x-1| : x-1 : x : log(2)
|
fabs // |x-1| : x-1 : x : log(2)
|
||||||
fcompl MO(limit) // x-1 : x : log(2)
|
fcompl MO(limit) // x-1 : x : log(2)
|
||||||
|
|
@ -55,4 +59,9 @@ ENTRY(__ieee754_logl)
|
||||||
2: fstp %st(0) // x : log(2)
|
2: fstp %st(0) // x : log(2)
|
||||||
fyl2x // log(x)
|
fyl2x // log(x)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
3: jp 4b // in case x is +-Inf
|
||||||
|
fstp %st(1)
|
||||||
|
fstp %st(1)
|
||||||
|
ret
|
||||||
END (__ieee754_logl)
|
END (__ieee754_logl)
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ ENTRY(__ieee754_log10l)
|
||||||
fxam
|
fxam
|
||||||
fnstsw
|
fnstsw
|
||||||
fld %st // x : x : log10(2)
|
fld %st // x : x : log10(2)
|
||||||
andb $1,%ah
|
testb $1, %ah
|
||||||
jnz 3f // in case x is NaN or ±Inf
|
jnz 3f // in case x is NaN or ±Inf
|
||||||
4: fsubl MO(one) // x-1 : x : log10(2)
|
4: fsubl MO(one) // x-1 : x : log10(2)
|
||||||
fld %st // x-1 : x-1 : x : log10(2)
|
fld %st // x-1 : x-1 : x : log10(2)
|
||||||
|
|
@ -59,7 +59,8 @@ ENTRY(__ieee754_log10l)
|
||||||
fyl2x // log10(x)
|
fyl2x // log10(x)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
3: jp 4b // in case x is ±Inf
|
3: testb $4, %ah
|
||||||
|
jnz 4b // in case x is ±Inf
|
||||||
fstp %st(1)
|
fstp %st(1)
|
||||||
fstp %st(1)
|
fstp %st(1)
|
||||||
ret
|
ret
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ ENTRY(__ieee754_log2l)
|
||||||
fxam
|
fxam
|
||||||
fnstsw
|
fnstsw
|
||||||
fld %st // x : x : 1
|
fld %st // x : x : 1
|
||||||
andb $1,%ah
|
testb $1, %ah
|
||||||
jnz 3f // in case x is NaN or ±Inf
|
jnz 3f // in case x is NaN or ±Inf
|
||||||
4: fsub %st(2), %st // x-1 : x : 1
|
4: fsub %st(2), %st // x-1 : x : 1
|
||||||
fld %st // x-1 : x-1 : x : 1
|
fld %st // x-1 : x-1 : x : 1
|
||||||
|
|
@ -56,7 +56,8 @@ ENTRY(__ieee754_log2l)
|
||||||
fyl2x // log(x)
|
fyl2x // log(x)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
3: jp 4b // in case x is ±Inf
|
3: testb $4, %ah
|
||||||
|
jnz 4b // in case x is ±Inf
|
||||||
fstp %st(1)
|
fstp %st(1)
|
||||||
fstp %st(1)
|
fstp %st(1)
|
||||||
ret
|
ret
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,12 @@ limit: .double 0.29
|
||||||
ENTRY(__ieee754_logl)
|
ENTRY(__ieee754_logl)
|
||||||
fldln2 // log(2)
|
fldln2 // log(2)
|
||||||
fldt 8(%rsp) // x : log(2)
|
fldt 8(%rsp) // x : log(2)
|
||||||
|
fxam
|
||||||
|
fnstsw
|
||||||
fld %st // x : x : log(2)
|
fld %st // x : x : log(2)
|
||||||
fsubl MO(one) // x-1 : x : log(2)
|
testb $1, %ah
|
||||||
|
jnz 3f // in case x is NaN or +-Inf
|
||||||
|
4: fsubl MO(one) // x-1 : x : log(2)
|
||||||
fld %st // x-1 : x-1 : x : log(2)
|
fld %st // x-1 : x-1 : x : log(2)
|
||||||
fabs // |x-1| : x-1 : x : log(2)
|
fabs // |x-1| : x-1 : x : log(2)
|
||||||
fcompl MO(limit) // x-1 : x : log(2)
|
fcompl MO(limit) // x-1 : x : log(2)
|
||||||
|
|
@ -53,4 +57,10 @@ ENTRY(__ieee754_logl)
|
||||||
2: fstp %st(0) // x : log(2)
|
2: fstp %st(0) // x : log(2)
|
||||||
fyl2x // log(x)
|
fyl2x // log(x)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
3: testb $4, %ah
|
||||||
|
jnz 4b // in case x is +-Inf
|
||||||
|
fstp %st(1)
|
||||||
|
fstp %st(1)
|
||||||
|
ret
|
||||||
END (__ieee754_logl)
|
END (__ieee754_logl)
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ ENTRY(__log1pl)
|
||||||
fxam
|
fxam
|
||||||
fnstsw
|
fnstsw
|
||||||
fld %st
|
fld %st
|
||||||
andb $1,%ah
|
testb $1, %ah
|
||||||
jnz 3f // in case x is NaN or ±Inf
|
jnz 3f // in case x is NaN or ±Inf
|
||||||
4:
|
4:
|
||||||
fabs
|
fabs
|
||||||
|
|
@ -62,7 +62,8 @@ ENTRY(__log1pl)
|
||||||
2: fyl2xp1
|
2: fyl2xp1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
3: jp 4b // in case x is ±Inf
|
3: testb $4, %ah
|
||||||
|
jnz 4b // in case x is ±Inf
|
||||||
fstp %st(1)
|
fstp %st(1)
|
||||||
fstp %st(1)
|
fstp %st(1)
|
||||||
ret
|
ret
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue