e_powl-amd64.S revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
/* ix87 specific implementation of pow function.
Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 Free Software Founda
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. */
#define ASM_GLOBAL_DIRECTIVE .global
#ifdef __ELF__
#else
.text
#endif
zero: .double 0.0
.byte 0, 0, 0, 0, 0, 0, 0, 0x80
one: .double 1.0
limit: .double 0.29
p63:
//#ifdef PIC
//#define MO(op) op##(%rip)
//#else
//#endif
.text
/*ENTRY(__ieee754_powl)*/
je 11f
je 12f
je 30f
fxch // y : x
/* fistpll raises invalid exception for |y| >= 1L<<63. */
fabs // |y| : 1L<<63 : y : x
jnc 2f
/* First see whether `y' is a natural number. In this case we
can use a more precise algorithm. */
jne 2f
/* OK, we have an integer value for y. */
jnc 5f
jnz 6b
/* y is �NAN */
je 31f
fxch // y : x
2: /* y is a real number. */
fxch // x : y
fabs // |x-1| : 1.0 : x : y
fxch // x : 1.0 : y
jz 7f
fyl2xp1 // log2(x) : y
jmp 8f
je 28f
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
#ifdef PIC
#else
#endif
// x is �inf
// We must find out whether y is an odd integer.
jne 17f
// OK, the value is an integer, but is it odd?
// It's an odd integer.
#ifdef PIC
#else
#endif
#ifdef PIC
#else
#endif
#ifdef PIC
#else
#endif
// x is �0
// x is �0 and y is < 0. We must find out whether y is an odd integer.
jz 25f
jne 26f
// 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.
26:
27: // 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.
jz 22f
jne 23f
// OK, the value is an integer, but is it odd?
// It's an odd integer.
23:
/*END(__ieee754_powl)*/