]> gitweb.factorcode.org Git - factor.git/commitdiff
cpu.x86.x87: use FISTPD to convert floats to integers, instead of the SSE3 instructio...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 18 May 2010 21:10:58 +0000 (17:10 -0400)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 18 May 2010 21:10:58 +0000 (17:10 -0400)
basis/cpu/x86/x87/x87.factor

index 8c920ea87bab726f9e75bfb783108c2b3f9f11af..2890181688df1376672aae0bc117c92263e631d1 100644 (file)
@@ -72,7 +72,15 @@ M:: x86 %integer>float ( dst src -- )
 
 M:: x86 %float>integer ( dst src -- )
     src FLD*
-    4 stack@ FISTTPD
+    8 stack@ EAX MOV
+    0 stack@ FNSTCW
+    AX 0 stack@ MOV
+    AH 12 <byte> MOV
+    2 stack@ AX MOV
+    2 stack@ FLDCW
+    4 stack@ FISTPD
+    0 stack@ FLDCW
+    EAX 8 stack@ MOV
     dst 4 stack@ MOV ;
 
 : compare-op ( src1 src2 quot -- )