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##@GOTOFF(%edx)
32 fldt 4(%esp) // x : log(2)
38 fld %st // x : x : log(2)
40 jc 3f // in case x is NaN or +-Inf
41 movzwl 4+8(%esp), %eax
43 jae 6f // x <= -2, avoid overflow from -LDBL_MAX - 1.
44 4: fsubl MO(one) // x-1 : x : log(2)
45 6: fld %st // x-1 : x-1 : x : log(2)
46 fabs // |x-1| : x-1 : x : log(2)
47 fcompl MO(limit) // x-1 : x : log(2)
48 fnstsw // x-1 : x : log(2)
56 fabs // log(1) is +0 in all rounding modes.
57 5: fstp %st(1) // x-1 : log(2)
61 2: fstp %st(0) // x : log(2)
65 3: jp 4b // in case x is +-Inf
74 fldt 4(%esp) // x : log(2)
78 fld %st // x : x : log(2)
79 fsubl MO(one) // x-1 : x : log(2)
80 fld %st // x-1 : x-1 : x : log(2)
81 fabs // |x-1| : x-1 : x : log(2)
82 fcompl MO(limit) // x-1 : x : log(2)
83 fnstsw // x-1 : x : log(2)
91 fabs // log(1) is +0 in all rounding modes.
92 7: fstp %st(1) // x-1 : log(2)
96 libm_alias_finite (__logl_finite, __logl)