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)
31 fldl 4(%esp) // x : log(2)
37 fld %st // x : x : log(2)
39 jc 3f // in case x is NaN or +-Inf
40 4: fsubl MO(one) // x-1 : x : log(2)
41 fld %st // x-1 : x-1 : x : log(2)
42 fabs // |x-1| : x-1 : x : log(2)
43 fcompl MO(limit) // x-1 : x : log(2)
44 fnstsw // x-1 : x : log(2)
52 fabs // log(1) is +0 in all rounding modes.
53 5: fstp %st(1) // x-1 : log(2)
57 2: fstp %st(0) // x : log(2)
61 3: jp 4b // in case x is +-Inf
69 fldl 4(%esp) // x : log(2)
73 fld %st // x : x : log(2)
74 fsubl MO(one) // x-1 : x : log(2)
75 fld %st // x-1 : x-1 : x : log(2)
76 fabs // |x-1| : x-1 : x : log(2)
77 fcompl MO(limit) // x-1 : x : log(2)
78 fnstsw // x-1 : x : log(2)
86 fabs // log(1) is +0 in all rounding modes.
87 6: fstp %st(1) // x-1 : log(2)
91 libm_alias_finite (__log_finite, __log)