asm for modf functions

This commit is contained in:
Rich Felker
2012-03-19 05:56:41 -04:00
parent 0b70a1e9a9
commit 1bf4dad327
3 changed files with 45 additions and 0 deletions
+15
View File
@@ -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
+15
View File
@@ -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
+15
View File
@@ -0,0 +1,15 @@
.global modfl
.type modfl,@function
modfl:
mov 16(%esp),%eax
fldt 4(%esp)
fld1
fld %st(1)
1: fprem
fstsw %ax
sahf
jp 1b
fstp %st(1)
fsubr %st(1)
fstpt (%eax)
ret