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>
20 ASM_TYPE_DIRECTIVE(one,@object)
22 ASM_SIZE_DIRECTIVE(one)
23 /* It is not important that this constant is precise. It is only
24 a value which is known to be on the safe side for using the
25 fyl2xp1 instruction. */
26 ASM_TYPE_DIRECTIVE(limit,@object)
28 ASM_SIZE_DIRECTIVE(limit)
32 #define MO(op) op##@GOTOFF(%edx)
38 ENTRY(__ieee754_log10l)
40 fldt 4(%esp) // x : log10(2)
46 fld %st // x : x : log10(2)
48 jc 3f // in case x is NaN or ±Inf
49 4: fsubl MO(one) // x-1 : x : log10(2)
50 fld %st // x-1 : x-1 : x : log10(2)
51 fabs // |x-1| : x-1 : x : log10(2)
52 fcompl MO(limit) // x-1 : x : log10(2)
53 fnstsw // x-1 : x : log10(2)
56 fstp %st(1) // x-1 : log10(2)
60 2: fstp %st(0) // x : log10(2)
64 3: jp 4b // in case x is ±Inf