]>
Commit | Line | Data |
---|---|---|
c9cf6dde AJ |
1 | /* |
2 | * Written by J.T. Conklin <jtc@netbsd.org>. | |
3 | * Public domain. | |
4 | * | |
5 | * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. | |
6 | * | |
7 | * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. | |
8 | * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. | |
9 | */ | |
10 | ||
11 | #include <machine/asm.h> | |
12 | ||
13 | RCSID("$NetBSD: $") | |
14 | ||
15 | #ifdef __ELF__ | |
16 | .section .rodata | |
17 | #else | |
18 | .text | |
19 | #endif | |
20 | .align ALIGNARG(4) | |
21 | ASM_TYPE_DIRECTIVE(one,@object) | |
22 | one: .double 1.0 | |
23 | ASM_SIZE_DIRECTIVE(one) | |
24 | /* It is not important that this constant is precise. It is only | |
25 | a value which is known to be on the safe side for using the | |
26 | fyl2xp1 instruction. */ | |
27 | ASM_TYPE_DIRECTIVE(limit,@object) | |
28 | limit: .double 0.29 | |
29 | ASM_SIZE_DIRECTIVE(limit) | |
30 | ||
31 | ||
32 | #ifdef PIC | |
33 | #define MO(op) op##(%rip) | |
34 | #else | |
35 | #define MO(op) op | |
36 | #endif | |
37 | ||
38 | .text | |
39 | ENTRY(__ieee754_log10l) | |
40 | fldlg2 // log10(2) | |
41 | fldt 8(%rsp) // x : log10(2) | |
42 | fxam | |
43 | fnstsw | |
44 | fld %st // x : x : log10(2) | |
32c075e1 | 45 | testb $1, %ah |
c9cf6dde AJ |
46 |