]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/i386/fpu/e_log10.S
Optimize libm
[thirdparty/glibc.git] / sysdeps / i386 / fpu / e_log10.S
CommitLineData
f7eac6eb
RM
1/*
2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Public domain.
d38cd08c
UD
4 *
5 * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
f7eac6eb
RM
6 */
7
8#include <machine/asm.h>
9
d38cd08c 10#ifdef __ELF__
0ac5ae23 11 .section .rodata.cst8,"aM",@progbits,8
d38cd08c
UD
12#else
13 .text
14#endif
0ac5ae23 15 .p2align 3
d38cd08c
UD
16 ASM_TYPE_DIRECTIVE(one,@object)
17one: .double 1.0
18 ASM_SIZE_DIRECTIVE(one)
19 /* It is not important that this constant is precise. It is only
20 a value which is known to be on the safe side for using the
21 fyl2xp1 instruction. */
22 ASM_TYPE_DIRECTIVE(limit,@object)
23limit: .double 0.29
24 ASM_SIZE_DIRECTIVE(limit)
25
26
27#ifdef PIC
0ac5ae23 28# define MO(op) op##@GOTOFF(%edx)
d38cd08c 29#else
0ac5ae23 30# define MO(op) op
d38cd08c
UD
31#endif
32
33 .text
f7eac6eb 34ENTRY(__ieee754_log10)
d38cd08c
UD
35 fldlg2 // log10(2)
36 fldl 4(%esp) // x : log10(2)
37#ifdef PIC
fee732e5 38 LOAD_PIC_REG (dx)
d38cd08c 39#endif
15daa639
UD
40 fxam
41 fnstsw
d38cd08c 42 fld %st // x : x : log10(2)
15daa639
UD
43 sahf
44