asm for modf functions
[musl] / src / math / i386 / modff.s
diff --git a/src/math/i386/modff.s b/src/math/i386/modff.s
new file mode 100644 (file)
index 0000000..d29b4b6
--- /dev/null
@@ -0,0 +1,15 @@
+.global modff
+.type modff,@function
+modff:
+       mov 8(%esp),%eax
+       flds 4(%esp)
+       fld1
+       fld %st(1)
+1:     fprem
+       fstsw %ax
+       sahf
+       jp 1b
+       fstp %st(1)
+       fsubr %st(1)
+       fstps (%eax)
+       ret