aboutsummaryrefslogtreecommitdiff
path: root/src/math/i386/scalbnl.s
diff options
context:
space:
mode:
authornsz <nsz@port70.net>2012-03-20 10:25:02 +0100
committernsz <nsz@port70.net>2012-03-20 10:25:02 +0100
commit03c52e137a28f65519bf6e7c303e5bd25df6e929 (patch)
treef5fe7ae916d9039adfe82217716e2aafd08702fb /src/math/i386/scalbnl.s
parentMerge branch 'master' of git://git.etalabs.net/musl (diff)
parentoptimize scalbn family (diff)
downloadgrovel-03c52e137a28f65519bf6e7c303e5bd25df6e929.tar.gz
grovel-03c52e137a28f65519bf6e7c303e5bd25df6e929.tar.xz
Merge branch 'master' of git://git.etalabs.net/musl
Diffstat (limited to 'src/math/i386/scalbnl.s')
-rw-r--r--src/math/i386/scalbnl.s16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/math/i386/scalbnl.s b/src/math/i386/scalbnl.s
index 224b1bef..54414c2e 100644
--- a/src/math/i386/scalbnl.s
+++ b/src/math/i386/scalbnl.s
@@ -11,7 +11,21 @@ scalblnl:
.global scalbnl
.type scalbnl,@function
scalbnl:
- fildl 16(%esp)
+ mov 16(%esp),%eax
+ add $0x3ffe,%eax
+ cmp $0x7ffd,%eax
+ jae 1f
+ inc %eax
+ fldt 4(%esp)
+ mov %eax,12(%esp)
+ mov $0x80000000,%eax
+ mov %eax,8(%esp)
+ xor %eax,%eax
+ mov %eax,4(%esp)
+ fldt 4(%esp)
+ fmulp
+ ret
+1: fildl 16(%esp)
fldt 4(%esp)
fscale
fstp %st(1)