]>
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__ | |
0ac5ae23 | 25 | .section .rodata.cst8,"aM",@progbits,8 |
c9cf6dde AJ |
26 | #else |
27 | .text | |
28 | #endif | |
0ac5ae23 UD |
29 | .p2align 3 |
30 | ASM_TYPE_DIRECTIVE(one,@object) | |
31 | one: .double 1.0 | |
32 | ASM_SIZE_DIRECTIVE(one) | |
33 | ASM_TYPE_DIRECTIVE(limit,@object) | |
34 | limit: .double 0.29 | |
35 | ASM_SIZE_DIRECTIVE(limit) | |
36 | ASM_TYPE_DIRECTIVE(p63,@object) | |
37 | p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 | |
38 | ASM_SIZE_DIRECTIVE(p63) | |
c9cf6dde | 39 | |
0ac5ae23 UD |
40 | #ifdef __ELF__ |
41 | .section .rodata.cst16,"aM",@progbits,16 | |
42 | #else | |
43 | .text | |
44 | #endif | |
45 | .p2align 3 | |
c9cf6dde AJ |
46 | ASM_TYPE_DIRECTIVE(infinity,@object) |
47 | inf_zero: | |
48 | infinity: | |
49 | .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f | |
50 | ASM_SIZE_DIRECTIVE(infinity) | |
51 | ASM_TYPE_DIRECTIVE(zero,@object) | |
52 | zero: .double 0.0 | |
53 | ASM_SIZE_DIRECTIVE(zero) | |
54 | ASM_TYPE_DIRECTIVE(minf_mzero,@object) | |
55 | minf_mzero: | |
56 | minfinity: | |
57 | .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff | |
58 | mzero: | |
59 | .byte 0, 0, 0, 0, 0, 0, 0, 0x80 | |
60 | ASM_SIZE_DIRECTIVE(minf_mzero) | |
c9cf6dde AJ |
61 | |
62 | #ifdef PIC | |
0ac5ae23 | 63 | # define MO(op) op##(%rip) |
c9cf6dde | 64 | #else |
0ac5ae23 | 65 | # define MO(op) op |
c9cf6dde AJ |
66 | #endif |
67 | ||
68 | .text | |
69 | ENTRY(__ieee754_powl) | |
70 | fldt 24(%rsp) // y | |
71 | fxam | |
72 | ||
73 | ||
74 | fnstsw | |
75 | movb %ah, %dl | |
76 | andb $0x45, %ah | |
77 | cmpb $0x40, %ah // is y == 0 ? | |
78 | je 11f | |
79 | ||
80 |