summaryrefslogtreecommitdiff
path: root/src/math/i386/log1pf.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/log1pf.s
Initial version
Diffstat (limited to 'src/math/i386/log1pf.s')
-rw-r--r--src/math/i386/log1pf.s26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/math/i386/log1pf.s b/src/math/i386/log1pf.s
new file mode 100644
index 0000000..9f13d95
--- /dev/null
+++ b/src/math/i386/log1pf.s
@@ -0,0 +1,26 @@
+.global log1pf
+.type log1pf,@function
+log1pf:
+ mov 4(%esp),%eax
+ fldln2
+ and $0x7fffffff,%eax
+ flds 4(%esp)
+ cmp $0x3e940000,%eax
+ ja 1f
+ cmp $0x00800000,%eax
+ jb 2f
+ fyl2xp1
+ fstps 4(%esp)
+ flds 4(%esp)
+ ret
+1: fld1
+ faddp
+ fyl2x
+ fstps 4(%esp)
+ flds 4(%esp)
+ ret
+ # subnormal x, return x with underflow
+2: fxch
+ fmul %st(1)
+ fstps 4(%esp)
+ ret