]>
Commit | Line | Data |
---|---|---|
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) |
32 | inf_zero: | |
33 | infinity: | |
34 | .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f | |
35 | ASM_SIZE_DIRECTIVE(infinity) | |
36 | ASM_TYPE_DIRECTIVE(zero,@object) | |
37 | zero: .double 0.0 | |
38 | ASM_SIZE_DIRECTIVE(zero) | |
39 | ASM_TYPE_DIRECTIVE(minf_mzero,@object) | |
40 | minf_mzero: | |
41 | minfinity: | |
42 | .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff | |
43 | mzero: | |
44 | .byte 0, 0, 0, 0, 0, 0, 0, 0x80 | |
45 | ASM_SIZE_DIRECTIVE(minf_mzero) | |
6bc31da0 UD |
46 | ASM_TYPE_DIRECTIVE(one,@object) |
47 | one: .double 1.0 | |
48 | ASM_SIZE_DIRECTIVE(one) | |
49 | ASM_TYPE_DIRECTIVE(limit,@object) | |
50 | limit: .double 0.29 | |
51 | ASM_SIZE_DIRECTIVE(limit) | |
c747e725 UD |
52 | ASM_TYPE_DIRECTIVE(p31,@object) |
53 | p31: .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 | |
65 | ENTRY(__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 |