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