diff options
author | Vladimir Azarov <avm@intermediate-node.net> | 2024-10-01 15:47:05 +0200 |
---|---|---|
committer | Vladimir Azarov <avm@intermediate-node.net> | 2024-10-01 15:47:05 +0200 |
commit | 4abab5ad6c8465a7528ccdd5f49367da05f78bbd (patch) | |
tree | ebf009bf1376a5a223a915bc27cbbd791a1316bc /src/math/i386/scalbn.s |
Initial version
Diffstat (limited to 'src/math/i386/scalbn.s')
-rw-r--r-- | src/math/i386/scalbn.s | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/math/i386/scalbn.s b/src/math/i386/scalbn.s new file mode 100644 index 0000000..8bf302f --- /dev/null +++ b/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 |