Ver código fonte

asm for modf functions

Rich Felker 13 anos atrás
pai
commit
1bf4dad327
3 arquivos alterados com 45 adições e 0 exclusões
  1. 15 0
      src/math/i386/modf.s
  2. 15 0
      src/math/i386/modff.s
  3. 15 0
      src/math/i386/modfl.s

+ 15 - 0
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

+ 15 - 0
src/math/i386/modff.s

@@ -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 - 0
src/math/i386/modfl.s

@@ -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