6 #include <machine/asm.h>
7 #include <libm-alias-finite.h>
9 .section .rodata.cst8,"aM",@progbits,8
14 ASM_SIZE_DIRECTIVE(one)
15 /* It is not important that this constant is precise. It is only
16 a value which is known to be on the safe side for using the
17 fyl2xp1 instruction. */
20 ASM_SIZE_DIRECTIVE(limit)
24 # define MO(op) op##(%rip)
30 ENTRY(__ieee754_log10l)
32 fldt 8(%rsp) // x : log10(2)
35 fld %st // x : x : log10(2)
37 jnz 3f // in case x is NaN or ±Inf
38 4: fsubl MO(one) // x-1 : x : log10(2)
39 fld %st // x-1 : x-1 : x : log10(2)
40 fabs // |x-1| : x-1 : x : log10(2)
41 fcompl MO(limit) // x-1 : x : log10(2)
42 fnstsw // x-1 : x : log10(2)
50 fabs // log10(1) is +0 in all rounding modes.
51 5: fstp %st(1) // x-1 : log10(2)
55 2: fstp %st(0) // x : log10(2)
60 jnz 4b // in case x is ±Inf
68 ENTRY(__log10l_finite)
70 fldt 8(%rsp) // x : log10(2)
71 fld %st // x : x : log10(2)
72 4: fsubl MO(one) // x-1 : x : log10(2)
73 fld %st // x-1 : x-1 : x : log10(2)
74 fabs // |x-1| : x-1 : x : log10(2)
75 fcompl MO(limit) // x-1 : x : log10(2)
76 fnstsw // x-1 : x : log10(2)
84 fabs // log10(1) is +0 in all rounding modes.
85 6: fstp %st(1) // x-1 : log10(2)
89 libm_alias_finite (__log10l_finite, __log10l)