2 * Written by J.T. Conklin <jtc@NetBSD.org>.
6 #include <machine/asm.h>
11 RCSID("$NetBSD: e_expf.S,v 1.5 2003/07/26 19:24:58 salo Exp $")
13 /* e^x = 2^(x * log2(e)) */
15 XMM_ONE_ARG_FLOAT_PROLOGUE
18 * catch +/-Inf and NaN arguments
20 movl ARG_FLOAT_ONE,%eax
27 fmulp /* x * log2(e) */
29 frndint /* int(x * log2(e)) */
30 fsubr %st(0),%st(1) /* fract(x * log2(e)) */
32 f2xm1 /* 2^(fract(x * log2(e))) - 1 */
34 faddp /* 2^(fract(x * log2(e))) */
42 * Return 0 if x is -Inf. Otherwise just return x, although the
43 * C version would return (x + x) (Real Indefinite) if x is a NaN.
45 movl ARG_FLOAT_ONE,%eax