2 * Written by Ulrich Drepper <drepper@cygnus.com>.
5 #include <machine/asm.h>
6 #include <i386-math-asm.h>
11 # define MO(op) op##@GOTOFF(%ecx)
17 /* 10^x = 2^(x * log2(10)) */
18 ENTRY(__ieee754_exp10)
23 /* I added the following ugly construct because exp(+-Inf) resulted
24 in NaN. The ugliness results from the bright minds at Intel.
25 For the i686 the code can be written better.
26 -- drepper@cygnus.com. */
27 fxam /* Is NaN or +-Inf? */
32 je 1f /* Is +-Inf, jump. */
34 fmulp /* x * log2(10) */
36 frndint /* int(x * log2(10)) */
37 fsubr %st,%st(1) /* fract(x * log2(10)) */
39 f2xm1 /* 2^(fract(x * log2(10))) - 1 */
41 faddp /* 2^(fract(x * log2(10))) */
44 DBL_NARROW_EVAL_UFLOW_NONNEG_NAN
47 1: testl $0x200, %eax /* Test sign. */
48 jz 2f /* If positive, jump. */
50 fldz /* Set result to 0. */
53 strong_alias (__ieee754_exp10, __exp10_finite)