2 * Written by J.T. Conklin <jtc@NetBSD.org>.
5 * $NetBSD: e_expf.S,v 1.6 2008/06/24 17:27:56 drochner Exp $ $
8 #include <machine/asm.h>
12 /* e^x = 2^(x * log2(e)) */
14 XMM_ONE_ARG_FLOAT_PROLOGUE
17 * catch +/-Inf and NaN arguments
19 movl ARG_FLOAT_ONE,%eax
26 fmulp /* x * log2(e) */
28 frndint /* int(x * log2(e)) */
29 fsubr %st(0),%st(1) /* fract(x * log2(e)) */
31 f2xm1 /* 2^(fract(x * log2(e))) - 1 */
33 faddp /* 2^(fract(x * log2(e))) */
41 * Return 0 if x is -Inf. Otherwise just return x, although the
42 * C version would return (x + x) (Real Indefinite) if x is a NaN.
44 movl ARG_FLOAT_ONE,%eax