From e208f556cad11f729533385e46e4191fcc49aa0a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 18 Feb 2001 19:52:52 +0000 Subject: Update. 2001-02-18 Ulrich Drepper * math/libm-test.inc (scalb_test): Require invalid exception being raised for invalid parameters. * sysdeps/i386/fpu/e_scalb.S: Raise invalid exception if necessary. * sysdeps/i386/fpu/e_scalbf.S: Likewise. * sysdeps/i386/fpu/e_scalbl.S: Likewise. --- ChangeLog | 8 ++++++++ sysdeps/i386/fpu/e_scalb.S | 10 +++++++++- sysdeps/i386/fpu/e_scalbf.S | 10 +++++++++- sysdeps/i386/fpu/e_scalbl.S | 10 +++++++++- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9101dc6ab3..6753e5c514 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-02-18 Ulrich Drepper + + * math/libm-test.inc (scalb_test): Require invalid exception being + raised for invalid parameters. + * sysdeps/i386/fpu/e_scalb.S: Raise invalid exception if necessary. + * sysdeps/i386/fpu/e_scalbf.S: Likewise. + * sysdeps/i386/fpu/e_scalbl.S: Likewise. + 2001-02-18 Mark Kettenis * sysdeps/mach/getsysstats.c (__get_phys_pages): Change return diff --git a/sysdeps/i386/fpu/e_scalb.S b/sysdeps/i386/fpu/e_scalb.S index f463002617..1596f6a700 100644 --- a/sysdeps/i386/fpu/e_scalb.S +++ b/sysdeps/i386/fpu/e_scalb.S @@ -56,7 +56,7 @@ ENTRY(__ieee754_scalb) fcomp %st(2) fnstsw sahf - jne 2f + jne 4f fscale fstp %st(1) ret @@ -75,6 +75,7 @@ ENTRY(__ieee754_scalb) fstp %st andl $0x80000000, %edx andl $8, %eax + jnz 4f shrl $27, %edx addl %edx, %eax fldl MOX(zero_nan, %eax, 1) @@ -95,4 +96,11 @@ ENTRY(__ieee754_scalb) /* The first parameter is a NaN. Return it. */ 3: fstp %st(1) ret + + /* Return NaN and raise the invalid exception. */ +4: fstp %st + fstp %st + fldz + fdiv %st + ret END(__ieee754_scalb) diff --git a/sysdeps/i386/fpu/e_scalbf.S b/sysdeps/i386/fpu/e_scalbf.S index 4b5b0d07b3..d41c29327d 100644 --- a/sysdeps/i386/fpu/e_scalbf.S +++ b/sysdeps/i386/fpu/e_scalbf.S @@ -58,7 +58,7 @@ ENTRY(__ieee754_scalbf) fcomp %st(2) fnstsw sahf - jne 2f + jne 4f fscale fstp %st(1) ret @@ -77,6 +77,7 @@ ENTRY(__ieee754_scalbf) fstp %st andl $0x80000000, %edx andl $8, %eax + jnz 4f shrl $27, %edx addl %edx, %eax fldl MOX(zero_nan, %eax, 1) @@ -97,4 +98,11 @@ ENTRY(__ieee754_scalbf) /* The first parameter is a NaN. Return it. */ 3: fstp %st(1) ret + + /* Return NaN and raise the invalid exception. */ +4: fstp %st + fstp %st + fldz + fdiv %st + ret END(__ieee754_scalbf) diff --git a/sysdeps/i386/fpu/e_scalbl.S b/sysdeps/i386/fpu/e_scalbl.S index e8166fa9d5..65644f8f0e 100644 --- a/sysdeps/i386/fpu/e_scalbl.S +++ b/sysdeps/i386/fpu/e_scalbl.S @@ -58,7 +58,7 @@ ENTRY(__ieee754_scalbl) fcomp %st(2) fnstsw sahf - jne 2f + jne 4f fscale fstp %st(1) ret @@ -77,6 +77,7 @@ ENTRY(__ieee754_scalbl) fstp %st andl $0x8000, %edx andl $8, %eax + jnz 4f shrl $11, %edx addl %edx, %eax fldl MOX(zero_nan, %eax, 1) @@ -97,4 +98,11 @@ ENTRY(__ieee754_scalbl) /* The first parameter is a NaN. Return it. */ 3: fstp %st(1) ret + + /* Return NaN and raise the invalid exception. */ +4: fstp %st + fstp %st + fldz + fdiv %st + ret END(__ieee754_scalbl) -- cgit v1.2.3