about summary refs log tree commit diff
path: root/src/math/i386/modf.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/i386/modf.s')
-rw-r--r--src/math/i386/modf.s15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/math/i386/modf.s b/src/math/i386/modf.s
new file mode 100644
index 00000000..b88e7841
--- /dev/null
+++ b/src/math/i386/modf.s
@@ -0,0 +1,15 @@
+.global modf
+.type modf,@function
+modf:
+	mov 12(%esp),%eax
+	fldl 4(%esp)
+	fld1
+	fld %st(1)
+1:	fprem
+	fstsw %ax
+	sahf
+	jp 1b
+	fstp %st(1)
+	fsubr %st(1)
+	fstpl (%eax)
+	ret