4 * Adapted for i686 instructions.
7 #include <machine/asm.h>
8 #include <libm-alias-finite.h>
10 .section .rodata.cst8,"aM",@progbits,8
15 ASM_SIZE_DIRECTIVE(one)
16 /* It is not important that this constant is precise. It is only
17 a value which is known to be on the safe side for using the
18 fyl2xp1 instruction. */
21 ASM_SIZE_DIRECTIVE(limit)
25 # define MO(op) op##@GOTOFF(%edx)
33 fldt 4(%esp) // x : log(2)
39 fld %st // x : x : log(2)
40 movzwl 4+8(%esp), %eax
42 jae 5f // x <= -2, avoid overflow from -LDBL_MAX - 1.
43 fsubl MO(one) // x-1 : x : log(2)
44 5: fld %st // x-1 : x-1 : x : log(2)
45 fabs // |x-1| : x-1 : x : log(2)
46 fld MO(limit) // 0.29 : |x-1| : x-1 : x : log(2)
47 fcomip %st(1) // |x-1| : x-1 : x : log(2)
48 fstp %st(0) // x-1 : x : log(2)
55 fabs // log(1) is +0 in all rounding modes.
56 4: fstp %st(1) // x-1 : log(2)
60 2: fstp %st(0) // x : log(2)
71 fldt 4(%esp) // x : log(2)
75 fld %st // x : x : log(2)
76 fsubl MO(one) // x-1 : x : log(2)
77 fld %st // x-1 : x-1 : x : log(2)
78 fabs // |x-1| : x-1 : x : log(2)
79 fld MO(limit) // 0.29 : |x-1| : x-1 : x : log(2)
80 fcomip %st(1) // |x-1| : x-1 : x : log(2)
81 fstp %st(0) // x-1 : x : log(2)
88 fabs // log(1) is +0 in all rounding modes.
89 6: fstp %st(1) // x-1 : log(2)
93 libm_alias_finite (__logl_finite, __logl)