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_log2l)
37 jnz 3f // in case x is NaN or ±Inf
38 4: fsub %st(2), %st // x-1 : x : 1
39 fld %st // x-1 : x-1 : x : 1
40 fabs // |x-1| : x-1 : x : 1
41 fcompl MO(limit) // x-1 : x : 1
50 fabs // log2(1) is +0 in all rounding modes.
51 5: fstp %st(1) // x-1 : 1
55 2: fstp %st(0) // x : 1
60 jnz 4b // in case x is ±Inf
72 fsub %st(2), %st // x-1 : x : 1
73 fld %st // x-1 : x-1 : x : 1
74 fabs // |x-1| : x-1 : x : 1
75 fcompl MO(limit) // x-1 : x : 1
84 fabs // log2(1) is +0 in all rounding modes.
85 6: fstp %st(1) // x-1 : 1
89 libm_alias_finite (__log2l_finite, __log2l)