2 * Written by Ulrich Drepper.
5 #include <machine/asm.h>
6 #include <i386-math-asm.h>
7 #include <libm-alias-finite.h>
12 # define MO(op) op##@GOTOFF(%ecx)
18 /* 10^x = 2^(x * log2(10)) */
19 ENTRY(__ieee754_exp10f)
24 /* I added the following ugly construct because exp(+-Inf) resulted
25 in NaN. The ugliness results from the bright minds at Intel.
26 For the i686 the code can be written better.
27 -- drepper@cygnus.com. */
28 fxam /* Is NaN or +-Inf? */
33 je 1f /* Is +-Inf, jump. */
35 fmulp /* x * log2(10) */
37 frndint /* int(x * log2(10)) */
38 fsubr %st,%st(1) /* fract(x * log2(10)) */
40 f2xm1 /* 2^(fract(x * log2(10))) - 1 */
42 faddp /* 2^(fract(x * log2(10))) */
45 FLT_NARROW_EVAL_UFLOW_NONNEG_NAN
48 1: testl $0x200, %eax /* Test sign. */
49 jz 2f /* If positive, jump. */
51 fldz /* Set result to 0. */
53 END (__ieee754_exp10f)
54 libm_alias_finite (__ieee754_exp10f, __exp10f)