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>
12 /* e^x = 2^(x * log2l(e)) */
15 /* I added the following ugly construct because expl(+-Inf) resulted
16 in NaN. The ugliness results from the bright minds at Intel.
17 For the i686 the code can be written better.
18 -- drepper@cygnus.com. */
19 fxam /* Is NaN or +-Inf? */
22 jnc .LnoInfNaN /* No, jump. */
23 jp .LisInf /* Is +-Inf, jump. */
26 fmulp /* x * log2(e) */
28 frndint /* int(x * log2(e)) */
30 fsubrp /* fract(x * log2(e)) */
31 f2xm1 /* 2^(fract(x * log2(e))) - 1 */
33 faddp /* 2^(fract(x * log2(e))) */
38 andb $2, %ah /* Test sign. */
39 jz .LpInf /* If positive, jump. */
40 fldz /* Set result to 0. */
42 PSEUDO_END (__ieee754_expl)