]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/i386/fpu/e_powf.S
[BZ #2510, BZ #2830, BZ #3137, BZ #3313, BZ #3426, BZ #3465, BZ #3480, BZ #3483,...
[thirdparty/glibc.git] / sysdeps / i386 / fpu / e_powf.S
CommitLineData
6bc31da0 1/* ix87 specific implementation of pow function.
11bf311e 2 Copyright (C) 1996, 1997, 1999, 2001, 2004, 2005
fee732e5 3 Free Software Foundation, Inc.
6bc31da0
UD
4 This file is part of the GNU C Library.
5 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
6
7 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
6bc31da0
UD
11
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 15 Lesser General Public License for more details.
6bc31da0 16
41bdb6e2
AJ
17 You should have received a copy of the GNU Lesser General Public
18 License along with the GNU C Library; if not, write to the Free
19 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 02111-1307 USA. */
6bc31da0
UD
21
22#include <machine/asm.h>
23
24#ifdef __ELF__
25 .section .rodata
26#else
27 .text
28#endif
29
30 .align ALIGNARG(4)
0d8733c4
UD
31 ASM_TYPE_DIRECTIVE(infinity,@object)
32inf_zero:
33infinity:
34 .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
35 ASM_SIZE_DIRECTIVE(infinity)
36 ASM_TYPE_DIRECTIVE(zero,@object)
37zero: .double 0.0
38 ASM_SIZE_DIRECTIVE(zero)
39 ASM_TYPE_DIRECTIVE(minf_mzero,@object)
40minf_mzero:
41minfinity:
42 .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff
43mzero:
44 .byte 0, 0, 0, 0, 0, 0, 0, 0x80
45 ASM_SIZE_DIRECTIVE(minf_mzero)
6bc31da0
UD
46 ASM_TYPE_DIRECTIVE(one,@object)
47one: .double 1.0
48 ASM_SIZE_DIRECTIVE(one)
49 ASM_TYPE_DIRECTIVE(limit,@object)
50limit: .double 0.29
51 ASM_SIZE_DIRECTIVE(limit)
c747e725
UD
52 ASM_TYPE_DIRECTIVE(p31,@object)
53p31: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x41
54 ASM_SIZE_DIRECTIVE(p31)
6bc31da0
UD
55
56#ifdef PIC
57#define MO(op) op##@GOTOFF(%ecx)
0d8733c4 58#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
6bc31da0
UD
59#else
60#define MO(op) op
0d8733c4 61#define MOX(op,x,f) op(,x,f)
6bc31da0
UD
62#endif
63
64 .text
65ENTRY(__ieee754_powf)
0d8733c4
UD
66 flds 8(%esp) // y
67 fxam
e61abf83
UD
68
69#ifdef PIC
fee732e5 70 LOAD_PIC_REG (cx)
e61abf83
UD
71#endif
72
0d8733c4
UD
73 fnstsw
74 movb %ah, %dl
75 andb $0x45, %ah
76 cmpb $0x40, %ah // is y == 0 ?
77 je 11f
78
79