summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/math/i386/scalbn.s
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/math/i386/scalbn.s')
-rw-r--r--libc-top-half/musl/src/math/i386/scalbn.s33
1 files changed, 33 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/math/i386/scalbn.s b/libc-top-half/musl/src/math/i386/scalbn.s
new file mode 100644
index 0000000..8bf302f
--- /dev/null
+++ b/libc-top-half/musl/src/math/i386/scalbn.s
@@ -0,0 +1,33 @@
+.global ldexp
+.type ldexp,@function
+ldexp:
+ nop
+
+.global scalbln
+.type scalbln,@function
+scalbln:
+ nop
+
+.global scalbn
+.type scalbn,@function
+scalbn:
+ mov 12(%esp),%eax
+ add $0x3ffe,%eax
+ cmp $0x7ffd,%eax
+ jb 1f
+ sub $0x3ffe,%eax
+ sar $31,%eax
+ xor $0xfff,%eax
+ add $0x3ffe,%eax
+1: inc %eax
+ fldl 4(%esp)
+ mov %eax,12(%esp)
+ mov $0x80000000,%eax
+ mov %eax,8(%esp)
+ xor %eax,%eax
+ mov %eax,4(%esp)
+ fldt 4(%esp)
+ fmulp
+ fstpl 4(%esp)
+ fldl 4(%esp)
+ ret