2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Adapted for exp2 by Ulrich Drepper <drepper@cygnus.com>.
7 #include <machine/asm.h>
8 #include <i386-math-asm.h>
13 # define MO(op) op##@GOTOFF(%ecx)
19 ENTRY(__ieee754_exp2f)
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. */
36 fsubr %st,%st(1) /* fract(x) */
38 f2xm1 /* 2^(fract(x)) - 1 */
40 faddp /* 2^(fract(x)) */
43 FLT_NARROW_EVAL_UFLOW_NONNEG_NAN
46 1: testl $0x200, %eax /* Test sign. */
47 jz 2f /* If positive, jump. */
49 fldz /* Set result to 0. */
52 strong_alias (__ieee754_exp2f, __exp2f_finite)