2 * Written by Ulrich Drepper.
5 #include <machine/asm.h>
7 /* e^x = 2^(x * log2(10)) */
8 ENTRY(__ieee754_exp10f)
10 /* I added the following ugly construct because exp(+-Inf) resulted
11 in NaN. The ugliness results from the bright minds at Intel.
12 For the i686 the code can be written better.
13 -- drepper@cygnus.com. */
14 fxam /* Is NaN or +-Inf? */
19 je 1f /* Is +-Inf, jump. */
21 fmulp /* x * log2(10) */
23 frndint /* int(x * log2(10)) */
24 fsubr %st,%st(1) /* fract(x * log2(10)) */
26 f2xm1 /* 2^(fract(x * log2(10))) - 1 */
28 faddp /* 2^(fract(x * log2(10))) */
33 1: testl $0x200, %eax /* Test sign. */
34 jz 2f /* If positive, jump. */
36 fldz /* Set result to 0. */
38 END (__ieee754_exp10f)