]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/i386/fpu/e_powl.S
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / i386 / fpu / e_powl.S
CommitLineData
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 17 License along with the GNU C Library; if not, see
5a82c748 18 <https://www.gnu.org/licenses/>. */
6bc31da0
UD
19
20#include <machine/asm.h>
6ace3938 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
27one: .double 1.0
28 ASM_SIZE_DIRECTIVE(one)
c898991d
JM
29 .type p2,@object
30p2: .byte 0, 0, 0, 0, 0, 0, 0x10, 0x40
31 ASM_SIZE_DIRECTIVE(p2)
b67e9372 32 .type p63,@object
0ac5ae23
UD
33p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
34 ASM_SIZE_DIRECTIVE(p63)
b67e9372 35 .type p64,@object
2460d3aa
JM
36p64: .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x43
37 ASM_SIZE_DIRECTIVE(p64)
b67e9372 38 .type p78,@object
8f9a2fae
JM
39p78: .byte 0, 0, 0, 0, 0, 0, 0xd0, 0x44
40 ASM_SIZE_DIRECTIVE(p78)
60e235ee
JM
41 .type pm79,@object
42pm79: .byte 0, 0, 0, 0, 0, 0, 0, 0x3b
43 ASM_SIZE_DIRECTIVE(pm79)
6bc31da0 44
0ac5ae23 45 .section .rodata.cst16,"aM",@progbits,16
622c86f4 46
0ac5ae23 47 .p2align 3
b67e9372 48 .type infinity,@object
0d8733c4
UD
49inf_zero:
50infinity:
51 .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
52 ASM_SIZE_DIRECTIVE(infinity)
b67e9372 53 .type zero,@object
0d8733c4
UD
54zero: .double 0.0
55 ASM_SIZE_DIRECTIVE(zero)
b67e9372 56 .type minf_mzero,@object
0d8733c4
UD
57minf_mzero:
58minfinity:
59 .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff
60mzero:
61 .byte 0, 0, 0, 0, 0, 0, 0, 0x80
62 ASM_SIZE_DIRECTIVE(minf_mzero)
6ace3938 63DEFINE_LDBL_MIN
6bc31da0
UD
64
65#ifdef PIC
0ac5ae23
UD
66# define MO(op) op##@GOTOFF(%ecx)
67# define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
6bc31da0 68#else
0ac5ae23
UD
69# define MO(op) op
70# define MOX(op,x,f) op(,x,f)
6bc31da0
UD
71#endif
72
73 .text
74ENTRY(__ieee754_powl)
0d8733c4
UD
75 fldt 16(%esp) // y
76 fxam
e61abf83
UD
77
78#ifdef PIC
fee732e5 79 LOAD_PIC_REG (cx)
e61abf83
UD
80#endif
81
0d8733c4
UD
82 fnstsw
83 movb %ah, %dl
84 andb $0x45, %ah
85 cmpb $0x40, %ah // is y == 0 ?
86 je 11f
87
88