5 #include <machine/asm.h>
6 #include <libm-alias-finite.h>
8 .section .rodata.cst8,"aM",@progbits,8
13 ASM_SIZE_DIRECTIVE(one)
14 /* It is not important that this constant is precise. It is only
15 a value which is known to be on the safe side for using the
16 fyl2xp1 instruction. */
19 ASM_SIZE_DIRECTIVE(limit)
23 # define MO(op) op##@GOTOFF(%edx)
39 jc 3f // in case x is NaN or ±Inf
40 4: fsub %st(2), %st // x-1 : x : 1
41 fld %st // x-1 : x-1 : x : 1
42 fabs // |x-1| : x-1 : x : 1
43 fcompl MO(limit) // x-1 : x : 1
52 fabs // log2(1) is +0 in all rounding modes.
53 5: fstp %st(1) // x-1 : 1
57 2: fstp %st(0) // x : 1
61 3: jp 4b // in case x is ±Inf
66 libm_alias_finite (__ieee754_log2, __log2)