]>
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 | * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. | |
7 | */ | |
8 | ||
9 | #include <machine/asm.h> | |
10 | ||
11 | RCSID("$NetBSD: s_log1p.S,v 1.7 1995/05/09 00:10:58 jtc Exp $") | |
12 | ||
13 | #ifdef __ELF__ | |
14 | .section .rodata | |
15 | #else | |
16 | .text | |
17 | #endif | |
18 | .align ALIGNARG(4) | |
19 | /* The fyl2xp1 can only be used for values in | |
20 | -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2 | |
21 | 0.29 is a safe value. | |
22 | */ | |
23 | limit: .tfloat 0.29 | |
24 | /* Please note: we use a double value here. Since 1.0 has | |
25 | an exact representation this does not effect the accuracy | |
26 | but it helps to optimize the code. */ | |
27 | one: .double 1.0 | |
28 | ||
29 | /* | |
30 | * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29, | |
31 | * otherwise fyl2x with the needed extra computation. | |
32 | */ | |
33 | #ifdef PIC | |
34 | #define MO(op) op##(%rip) | |
35 | #else | |
36 | #define MO(op) op | |
37 | #endif | |
38 | ||
39 | .text | |
40 | ENTRY(__log1pl) | |
41 | fldln2 | |
42 | ||
43 | fldt 8(%rsp) | |
44 | ||
45 | fxam | |
46 | fnstsw | |
47 | fld %st | |
32c075e1 | 48 | testb $1, %ah |
c9cf6dde AJ |
49 |