]>
Commit | Line | Data |
---|---|---|
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 | ||
10 | RCSID("$NetBSD: e_log10.S,v 1.4 1995/05/08 23:49:24 jtc Exp $") | |
11 | ||
d38cd08c UD |
12 | #ifdef __ELF__ |
13 | .section .rodata | |
14 | #else | |
15 | .text | |
16 | #endif | |
17 | .align ALIGNARG(4) | |
18 | ASM_TYPE_DIRECTIVE(one,@object) | |
19 | one: .double 1.0 | |
20 | ASM_SIZE_DIRECTIVE(one) | |
21 | /* It is not important that this constant is precise. It is only | |
22 | a value which is known to be on the safe side for using the | |
23 | fyl2xp1 instruction. */ | |
24 | ASM_TYPE_DIRECTIVE(limit,@object) | |
25 | limit: .double 0.29 | |
26 | ASM_SIZE_DIRECTIVE(limit) | |
27 | ||
28 | ||
29 | #ifdef PIC | |
30 | #define MO(op) op##@GOTOFF(%edx) | |
31 | #else | |
32 | #define MO(op) op | |
33 | #endif | |
34 | ||
35 | .text | |
f7eac6eb | 36 | ENTRY(__ieee754_log10) |
d38cd08c UD |
37 | fldlg2 // log10(2) |
38 | fldl 4(%esp) // x : log10(2) | |
39 | #ifdef PIC | |
a334319f UD |
40 | call 1f |
41 | 1: popl %edx | |
42 | addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx | |
d38cd08c | 43 | #endif |
15daa639 UD |
44 | fxam |
45 | fnstsw | |
d38cd08c | 46 | fld %st // x : x : log10(2) |
15daa639 UD |
47 | sahf |
48 |