]>
Commit | Line | Data |
---|---|---|
c9cf6dde | 1 | /* ix87 specific implementation of pow function. |
8db73634 | 2 | Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2007, 2011 |
8f3edfee | 3 | Free Software Foundation, Inc. |
c9cf6dde AJ |
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 | |
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. | |
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 | |
15 | Lesser General Public License for more details. | |
16 | ||
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. */ | |
21 | ||
22 | #include <machine/asm.h> | |
23 | ||
24 | #ifdef __ELF__ | |
25 | .section .rodata | |
26 | #else | |
27 | .text | |
28 | #endif | |
29 | ||
30 | .align ALIGNARG(4) | |
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) | |
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) | |
164f863e UD |
52 | ASM_TYPE_DIRECTIVE(p63,@object) |
53 | p63: | |
54 | .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 | |
55 | ASM_SIZE_DIRECTIVE(p63) | |
c9cf6dde AJ |
56 | |
57 | #ifdef PIC | |
58 | #define MO(op) op##(%rip) | |
59 | #else | |
60 | #define MO(op) op | |
61 | #endif | |
62 | ||
63 | .text | |
64 | ENTRY(__ieee754_powl) | |
65 | fldt 24(%rsp) // y | |
66 | fxam | |
67 | ||
68 | ||
69 | fnstsw | |
70 | movb %ah, %dl | |
71 | andb $0x45, %ah | |
72 | cmpb $0x40, %ah // is y == 0 ? | |
73 | je 11f | |
74 | ||
75 |