summaryrefslogtreecommitdiff
path: root/src/math/i386/scalbnl.s
diff options
context:
space:
mode:
authorVladimir Azarov <avm@intermediate-node.net>2024-10-01 15:47:05 +0200
committerVladimir Azarov <avm@intermediate-node.net>2024-10-01 15:47:05 +0200
commit4abab5ad6c8465a7528ccdd5f49367da05f78bbd (patch)
treeebf009bf1376a5a223a915bc27cbbd791a1316bc /src/math/i386/scalbnl.s
Initial version
Diffstat (limited to 'src/math/i386/scalbnl.s')
-rw-r--r--src/math/i386/scalbnl.s32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/math/i386/scalbnl.s b/src/math/i386/scalbnl.s
new file mode 100644
index 0000000..54414c2
--- /dev/null
+++ b/src/math/i386/scalbnl.s
@@ -0,0 +1,32 @@
+.global ldexpl
+.type ldexpl,@function
+ldexpl:
+ nop
+
+.global scalblnl
+.type scalblnl,@function
+scalblnl:
+ nop
+
+.global scalbnl
+.type scalbnl,@function
+scalbnl:
+ 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)
+ ret