/* ix87 specific implementation of pow function.
Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifdef __MINGW32__
# define ASM_SIZE_DIRECTIVE(name)
# define cfi_adjust_cfa_offset(a)
# define ASM_GLOBAL_DIRECTIVE .global
# define ASM_SIZE_DIRECTIVE(name)
# define cfi_adjust_cfa_offset(a)
# define ASM_GLOBAL_DIRECTIVE .globl
#else
# /* figure this one out. */
# define cfi_adjust_cfa_offset(a)
# define ASM_GLOBAL_DIRECTIVE .global
#endif
#ifdef __ELF__
#else
.text
#endif
.byte 0, 0, 0, 0, 0, 0, 0, 0x80
#ifdef PIC
#else
#endif
.text
//ENTRY(__ieee754_powl)
#ifdef RT_OS_DARWIN /* 16-byte long double with 8 byte alignment requirements */
#else
#endif
#ifdef PIC
#endif
fxch // y : x
/* fistpll raises invalid exception for |y| >= 1L<<63. */
fabs // |y| : y : x
/* First see whether `y' is a natural number. In this case we
can use a more precise algorithm. */
/* OK, we have an integer value for y. */
/* y is �NAN */
fxch // y : x
.L2: /* y is a real number. */
fxch // x : y
fabs // |x-1| : 1.0 : x : y
fxch // x : 1.0 : y
fyl2xp1 // log2(x) : y
frndint // int(y*log2(x)) : y*log2(x)
fxch // fract(y*log2(x)) : int(y*log2(x))
f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x))
fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x))
fscale // 2^(y*log2(x)) : y*log2(x)
// pow(x,�0) = 1
// y == �inf
// x is �inf
// We must find out whether y is an odd integer.
fucompp // <empty>
// OK, the value is an integer, but is it odd?
// It's an odd integer.
// x is �0
// x is �0 and y is < 0. We must find out whether y is an odd integer.
fucompp // <empty>
// OK, the value is an integer, but is it odd?
// It's an odd integer.
// Raise divide-by-zero exception and get minus infinity value.
.L27: // Raise divide-by-zero exception and get infinity value.
// x is �0 and y is > 0. We must find out whether y is an odd integer.
fucompp // <empty>
// OK, the value is an integer, but is it odd?
// It's an odd integer.
//END(__ieee754_powl)