2 * Written by J.T. Conklin <jtc@netbsd.org>.
4 * Adapted for float type by Ulrich Drepper <drepper@cygnus.com>.
6 * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
13 /* It is not important that this constant is precise. It is only
14 a value which is known to be on the safe side for using the
15 fyl2xp1 instruction. */
21 .def _log10f; .scl 2; .type 32; .endef
24 flds 4(%esp) /* x : log10(2) */
27 fld %st /* x : x : log10(2) */
29 jc 3f /* in case x is NaN or ±Inf */
30 4: fsubl one /* x-1 : x : log10(2) */
31 fld %st /* x-1 : x-1 : x : log10(2) */
32 fabs /* |x-1| : x-1 : x : log10(2) */
33 fcompl limit /* x-1 : x : log10(2) */
34 fnstsw /* x-1 : x : log10(2) */
37 fstp %st(1) /* x-1 : log10(2) */
38 fyl2xp1 /* log10(x) */
41 2: fstp %st(0) /* x : log10(2) */
45 3: jp 4b /* in case x is ±Inf */