aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/i386/fpu/e_pow.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-07-20 07:06:48 +0000
committerUlrich Drepper <drepper@redhat.com>2004-07-20 07:06:48 +0000
commit164f863efd3c4fa9183ab85f2af82583c88ae90d (patch)
tree967a8dd5467587fc409e9f5f41b203368ebd41ae /sysdeps/i386/fpu/e_pow.S
parentc747e725e310d16c40aa815ed9e3e9f2805351e7 (diff)
downloadglibc-164f863efd3c4fa9183ab85f2af82583c88ae90d.tar
glibc-164f863efd3c4fa9183ab85f2af82583c88ae90d.tar.gz
glibc-164f863efd3c4fa9183ab85f2af82583c88ae90d.tar.bz2
glibc-164f863efd3c4fa9183ab85f2af82583c88ae90d.zip
[BZ #258]
Update. 2004-07-19 Jakub Jelinek <jakub@redhat.com> [BZ #258] * math/libm-test.inc (max_value, min_value): New variables. (initialize): Initialize them. (pow_test): Add a couple of new tests. * sysdeps/i386/fpu/e_powf.S (__ieee754_powf): Don't generate invalid exception if |y| >= 1U<<31. * sysdeps/i386/fpu/e_pow.S (__ieee754_pow): Don't generate invalid exception if |y| >= 1L<<63. * sysdeps/i386/fpu/e_powl.S (__ieee754_powl): Likewise. If y*log2(x) overflows to +-inf, return still +inf/+0 instead of NaN. * sysdeps/x86_64/fpu/e_powl.S (__ieee754_powl): Likewise.
Diffstat (limited to 'sysdeps/i386/fpu/e_pow.S')
-rw-r--r--sysdeps/i386/fpu/e_pow.S14
1 files changed, 13 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_pow.S b/sysdeps/i386/fpu/e_pow.S
index 997dd30e9d..d100c0ac57 100644
--- a/sysdeps/i386/fpu/e_pow.S
+++ b/sysdeps/i386/fpu/e_pow.S
@@ -1,5 +1,6 @@
/* ix87 specific implementation of pow function.
- Copyright (C) 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -48,6 +49,9 @@ one: .double 1.0
ASM_TYPE_DIRECTIVE(limit,@object)
limit: .double 0.29
ASM_SIZE_DIRECTIVE(limit)
+ ASM_TYPE_DIRECTIVE(p63,@object)
+p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
+ ASM_SIZE_DIRECTIVE(p63)
#ifdef PIC
#define MO(op) op##@GOTOFF(%ecx)
@@ -96,6 +100,14 @@ ENTRY(__ieee754_pow)
fxch // y : x
+ /* fistpll raises invalid exception for |y| >= 1L<<63. */
+ fld %st // y : y : x
+ fabs // |y| : y : x
+ fcompl MO(p63) // y : x
+ fnstsw
+ sahf
+ jnc 2f
+
/* First see whether `y' is a natural number. In this case we
can use a more precise algorithm. */
fld %st // y : y : x