]>
Commit | Line | Data |
---|---|---|
6bc31da0 | 1 | /* ix87 specific implementation of pow function. |
04277e02 | 2 | Copyright (C) 1996-2019 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 | |
41bdb6e2 AJ |
7 | modify it under the terms of the GNU Lesser General Public |
8 | License as published by the Free Software Foundation; either | |
9 | version 2.1 of the License, or (at your option) any later version. | |
6bc31da0 UD |
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 | |
41bdb6e2 | 14 | Lesser General Public License for more details. |
6bc31da0 | 15 | |
41bdb6e2 | 16 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
17 | License along with the GNU C Library; if not, see |
18 | <http://www.gnu.org/licenses/>. */ | |
6bc31da0 UD |
19 | |
20 | #include <machine/asm.h> | |
6f0f237b | 21 | #include <i386-math-asm.h> |
6bc31da0 | 22 | |
0ac5ae23 | 23 | .section .rodata.cst8,"aM",@progbits,8 |
622c86f4 | 24 | |
0ac5ae23 | 25 | .p2align 3 |
b67e9372 | 26 | .type one,@object |
0ac5ae23 UD |
27 | one: .double 1.0 |
28 | ASM_SIZE_DIRECTIVE(one) | |
b67e9372 | 29 | .type limit,@object |
0ac5ae23 UD |
30 | limit: .double 0.29 |
31 | ASM_SIZE_DIRECTIVE(limit) | |
b67e9372 | 32 | .type p63,@object |
0ac5ae23 UD |
33 | p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 |
34 | ASM_SIZE_DIRECTIVE(p63) | |
b67e9372 | 35 | .type p10,@object |
c483f6b4 JM |
36 | p10: .byte 0, 0, 0, 0, 0, 0, 0x90, 0x40 |
37 | ASM_SIZE_DIRECTIVE(p10) | |
6bc31da0 | 38 | |
0ac5ae23 | 39 | .section .rodata.cst16,"aM",@progbits,16 |
622c86f4 | 40 | |
0ac5ae23 | 41 | .p2align 3 |
b67e9372 | 42 | .type infinity,@object |
0d8733c4 UD |
43 | inf_zero: |
44 | infinity: | |
45 | .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f | |
46 | ASM_SIZE_DIRECTIVE(infinity) | |
b67e9372 | 47 | .type zero,@object |
0d8733c4 UD |
48 | zero: .double 0.0 |
49 | ASM_SIZE_DIRECTIVE(zero) | |
b67e9372 | 50 | .type minf_mzero,@object |
0d8733c4 UD |
51 | minf_mzero: |
52 | minfinity: | |
53 | .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff | |
54 | mzero: | |
55 | .byte 0, 0, 0, 0, 0, 0, 0, 0x80 | |
56 | ASM_SIZE_DIRECTIVE(minf_mzero) | |
6ace3938 | 57 | DEFINE_DBL_MIN |
6bc31da0 UD |
58 | |
59 | #ifdef PIC | |
0ac5ae23 UD |
60 | # define MO(op) op##@GOTOFF(%ecx) |
61 | # define MOX(op,x,f) op##@GOTOFF(%ecx,x,f) | |
6bc31da0 | 62 | #else |
0ac5ae23 UD |
63 | # define MO(op) op |
64 | # define MOX(op,x,f) op(,x,f) | |
6bc31da0 UD |
65 | #endif |
66 | ||
67 | .text | |
68 | ENTRY(__ieee754_pow) | |
0d8733c4 UD |
69 | fldl 12(%esp) // y |
70 | fxam | |
e61abf83 UD |
71 | |
72 | #ifdef PIC | |
fee732e5 | 73 | LOAD_PIC_REG (cx) |
e61abf83 UD |
74 | #endif |
75 | ||
0d8733c4 UD |
76 | fnstsw |
77 | movb %ah, %dl | |
78 | andb $0x45, %ah | |
79 | cmpb $0x40, %ah // is y == 0 ? | |
80 | je 11f | |
81 | ||
82 |