2 * Written by J.T. Conklin <jtc@netbsd.org>.
5 * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
8 #include <machine/asm.h>
19 ASM_TYPE_DIRECTIVE(one,@object)
21 ASM_SIZE_DIRECTIVE(one)
22 /* It is not important that this constant is precise. It is only
23 a value which is known to be on the safe side for using the
24 fyl2xp1 instruction. */
25 ASM_TYPE_DIRECTIVE(limit,@object)
27 ASM_SIZE_DIRECTIVE(limit)
31 #define MO(op) op##@GOTOFF(%edx)
39 fldt 4(%esp) // x : log(2)
43 addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
45 fld %st // x : x : log(2)
46 fsubl MO(one) // x-1 : x : log(2)
47 fld %st // x-1 : x-1 : x : log(2)
48 fabs // |x-1| : x-1 : x : log(2)
49 fcompl MO(limit) // x-1 : x : log(2)
50 fnstsw // x-1 : x : log(2)
53 fstp %st(1) // x-1 : log(2)
57 2: fstp %st(0) // x : log(2)