diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-10-15 20:22:59 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-10-15 20:22:59 -0400 |
commit | bcf01e6d800e837622ddbc851b42b55fa99e5636 (patch) | |
tree | 5df0ae9971331105fe53de872895abb68d8276a5 /sysdeps/i386/fpu/e_expf.S | |
parent | ba1a0d5938b53454a249d679ab90baf541cd91ad (diff) | |
download | glibc-bcf01e6d800e837622ddbc851b42b55fa99e5636.tar.gz glibc-bcf01e6d800e837622ddbc851b42b55fa99e5636.tar.xz glibc-bcf01e6d800e837622ddbc851b42b55fa99e5636.zip |
Optimize exp
Add __exp*_finite optimizations and rewrite some wrappers.
Diffstat (limited to 'sysdeps/i386/fpu/e_expf.S')
-rw-r--r-- | sysdeps/i386/fpu/e_expf.S | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_expf.S b/sysdeps/i386/fpu/e_expf.S index 5fd49b89fd..4e4f6a0df7 100644 --- a/sysdeps/i386/fpu/e_expf.S +++ b/sysdeps/i386/fpu/e_expf.S @@ -6,7 +6,6 @@ #include <machine/asm.h> -RCSID("$NetBSD: $") /* e^x = 2^(x * log2(e)) */ ENTRY(__ieee754_expf) @@ -40,3 +39,19 @@ ENTRY(__ieee754_expf) fldz /* Set result to 0. */ 2: ret END (__ieee754_expf) + + +ENTRY(__expf_finite) + fldl2e + fmuls 4(%esp) /* x * log2(e) */ + fld %st + frndint /* int(x * log2(e)) */ + fsubr %st,%st(1) /* fract(x * log2(e)) */ + fxch + f2xm1 /* 2^(fract(x * log2(e))) - 1 */ + fld1 + faddp /* 2^(fract(x * log2(e))) */ + fscale /* e^x */ + fstp %st(1) + ret +END(__expf_finite) |