mirror of
https://sourceware.org/git/glibc.git
synced 2025-09-05 14:24:06 +03:00
(__ieee754_powf): Don't generate invalid exception if |y| >= 1U<<31.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/* ix87 specific implementation of pow function.
|
/* ix87 specific implementation of pow function.
|
||||||
Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
|
Copyright (C) 1996, 1997, 1999, 2001, 2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||||
|
|
||||||
@@ -48,6 +48,9 @@ one: .double 1.0
|
|||||||
ASM_TYPE_DIRECTIVE(limit,@object)
|
ASM_TYPE_DIRECTIVE(limit,@object)
|
||||||
limit: .double 0.29
|
limit: .double 0.29
|
||||||
ASM_SIZE_DIRECTIVE(limit)
|
ASM_SIZE_DIRECTIVE(limit)
|
||||||
|
ASM_TYPE_DIRECTIVE(p31,@object)
|
||||||
|
p31: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x41
|
||||||
|
ASM_SIZE_DIRECTIVE(p31)
|
||||||
|
|
||||||
#ifdef PIC
|
#ifdef PIC
|
||||||
#define MO(op) op##@GOTOFF(%ecx)
|
#define MO(op) op##@GOTOFF(%ecx)
|
||||||
@@ -96,6 +99,14 @@ ENTRY(__ieee754_powf)
|
|||||||
|
|
||||||
fxch // y : x
|
fxch // y : x
|
||||||
|
|
||||||
|
/* fistpl raises invalid exception for |y| >= 1L<<31. */
|
||||||
|
fld %st // y : y : x
|
||||||
|
fabs // |y| : y : x
|
||||||
|
fcompl MO(p31) // y : x
|
||||||
|
fnstsw
|
||||||
|
sahf
|
||||||
|
jnc 2f
|
||||||
|
|
||||||
/* First see whether `y' is a natural number. In this case we
|
/* First see whether `y' is a natural number. In this case we
|
||||||
can use a more precise algorithm. */
|
can use a more precise algorithm. */
|
||||||
fld %st // y : y : x
|
fld %st // y : y : x
|
||||||
|
Reference in New Issue
Block a user