2 * Written by J.T. Conklin <jtc@netbsd.org>.
5 * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
7 * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
10 #include <machine/asm.h>
12 .section .rodata.cst8,"aM",@progbits,8
15 ASM_TYPE_DIRECTIVE(one,@object)
17 ASM_SIZE_DIRECTIVE(one)
18 /* It is not important that this constant is precise. It is only
19 a value which is known to be on the safe side for using the
20 fyl2xp1 instruction. */
21 ASM_TYPE_DIRECTIVE(limit,@object)
23 ASM_SIZE_DIRECTIVE(limit)
27 # define MO(op) op##@GOTOFF(%edx)
33 ENTRY(__ieee754_log10l)
35 fldt 4(%esp) // x : log10(2)
41 fld %st // x : x : log10(2)
43 jc 3f // in case x is NaN or ±Inf
44 4: fsubl MO(one) // x-1 : x : log10(2)
45 fld %st // x-1 : x-1 : x : log10(2)
46 fabs // |x-1| : x-1 : x : log10(2)
47 fcompl MO(limit) // x-1 : x : log10(2)
48 fnstsw // x-1 : x : log10(2)
51 fstp %st(1) // x-1 : log10(2)
55 2: fstp %st(0) // x : log10(2)
59 3: jp 4b // in case x is ±Inf
64 strong_alias (__ieee754_log10l, __log10l_finite)