diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-03-19 09:00:30 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-03-19 09:00:30 -0400 |
commit | 02db27d9deaee71b244c91e720ec819c74dab150 (patch) | |
tree | ef2543fd54a6fdbca8839cb14c71bb10ffdaa8f1 /src/math/i386/expm1.s | |
parent | da7458a602a6f0bdea25d6b9b613372048a974e6 (diff) | |
download | musl-02db27d9deaee71b244c91e720ec819c74dab150.tar.gz musl-02db27d9deaee71b244c91e720ec819c74dab150.tar.xz musl-02db27d9deaee71b244c91e720ec819c74dab150.zip |
optimize exponential asm for i386
up to 30% faster exp2 by avoiding slow frndint and fscale functions. expm1 also takes a much more direct path for small arguments (the expected usage case).
Diffstat (limited to 'src/math/i386/expm1.s')
-rw-r--r-- | src/math/i386/expm1.s | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/src/math/i386/expm1.s b/src/math/i386/expm1.s index bbb5d12e..f335a3e5 100644 --- a/src/math/i386/expm1.s +++ b/src/math/i386/expm1.s @@ -1,47 +1 @@ -.global expm1f -.type expm1f,@function -expm1f: - flds 4(%esp) - jmp 1f - -.global expm1l -.type expm1l,@function -expm1l: - fldt 4(%esp) - jmp 1f - -.global expm1 -.type expm1,@function -expm1: - fldl 4(%esp) -1: fxam - fnstsw %ax - sahf - jnp 1f - jnc 1f - fstps 4(%esp) - mov $0xfe,%al - and %al,7(%esp) - flds 4(%esp) -1: fldl2e - fmulp - fld %st(0) - frndint - fldz - fcomp - fnstsw %ax - sahf - jnz 1f - fstp %st(0) - f2xm1 - ret -1: fxch %st(1) - fsub %st(1) - f2xm1 - fld1 - faddp - fscale - fld1 - fsubrp - fstp %st(1) - ret +# see exp.s |