From 26753f62d645c8c858b54678a1dab684529e7807 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 21 May 1997 00:03:54 +0000 Subject: [PATCH] Generate invalid exception correctly. --- sysdeps/libm-i387/e_pow.S | 7 ++----- sysdeps/libm-i387/e_powf.S | 7 ++----- sysdeps/libm-i387/e_powl.S | 20 +++++++++----------- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/sysdeps/libm-i387/e_pow.S b/sysdeps/libm-i387/e_pow.S index e665326438f..45c41b48ab3 100644 --- a/sysdeps/libm-i387/e_pow.S +++ b/sysdeps/libm-i387/e_pow.S @@ -48,9 +48,6 @@ one: .double 1.0 ASM_TYPE_DIRECTIVE(limit,@object) limit: .double 0.29 ASM_SIZE_DIRECTIVE(limit) - ASM_TYPE_DIRECTIVE(nan,@object) -nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f - ASM_SIZE_DIRECTIVE(nan) #ifdef PIC #define MO(op) op##@GOTOFF(%ecx) @@ -191,8 +188,8 @@ ENTRY(__ieee754_pow) ret .align ALIGNARG(4) -14: fldl MO(nan) - faddl MO(zero) // raise invalid exception +14: fldl MO(infinity) + fmull MO(zero) // raise invalid exception ret .align ALIGNARG(4) diff --git a/sysdeps/libm-i387/e_powf.S b/sysdeps/libm-i387/e_powf.S index 102cd4e3af9..d7342bf56f6 100644 --- a/sysdeps/libm-i387/e_powf.S +++ b/sysdeps/libm-i387/e_powf.S @@ -48,9 +48,6 @@ one: .double 1.0 ASM_TYPE_DIRECTIVE(limit,@object) limit: .double 0.29 ASM_SIZE_DIRECTIVE(limit) - ASM_TYPE_DIRECTIVE(nan,@object) -nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f - ASM_SIZE_DIRECTIVE(nan) #ifdef PIC #define MO(op) op##@GOTOFF(%ecx) @@ -187,8 +184,8 @@ ENTRY(__ieee754_powf) ret .align ALIGNARG(4) -14: fldl MO(nan) - faddl MO(zero) // raise invalid exception +14: fldl MO(infinity) + fmull MO(zero) // raise invalid exception ret .align ALIGNARG(4) diff --git a/sysdeps/libm-i387/e_powl.S b/sysdeps/libm-i387/e_powl.S index 3cfb96b213a..0ea48298228 100644 --- a/sysdeps/libm-i387/e_powl.S +++ b/sysdeps/libm-i387/e_powl.S @@ -48,9 +48,6 @@ one: .double 1.0 ASM_TYPE_DIRECTIVE(limit,@object) limit: .double 0.29 ASM_SIZE_DIRECTIVE(limit) - ASM_TYPE_DIRECTIVE(nan,@object) -nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f - ASM_SIZE_DIRECTIVE(nan) #ifdef PIC #define MO(op) op##@GOTOFF(%ecx) @@ -64,6 +61,13 @@ nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f ENTRY(__ieee754_powl) fldt 16(%esp) // y fxam + +#ifdef PIC + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx +#endif + fnstsw movb %ah, %dl andb $0x45, %ah @@ -76,12 +80,6 @@ ENTRY(__ieee754_powl) cmpb $0x01, %ah // is y == NaN ? je 30f -#ifdef PIC - call 1f -1: popl %ecx - addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx -#endif - fldt 4(%esp) // x : y subl $8,%esp @@ -190,8 +188,8 @@ ENTRY(__ieee754_powl) ret .align ALIGNARG(4) -14: fldl MO(nan) - faddl MO(zero) // raise invalid exception +14: fldl MO(infinity) + fmull MO(zero) // raise invalid exception ret .align ALIGNARG(4) -- 2.47.2