From 0aa6ae0feb1c12bede58a5ef0b338aca80a97523 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 18 May 2010 17:10:58 -0400 Subject: [PATCH] cpu.x86.x87: use FISTPD to convert floats to integers, instead of the SSE3 instruction FISTTPD --- basis/cpu/x86/x87/x87.factor | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/basis/cpu/x86/x87/x87.factor b/basis/cpu/x86/x87/x87.factor index 8c920ea87b..2890181688 100644 --- a/basis/cpu/x86/x87/x87.factor +++ b/basis/cpu/x86/x87/x87.factor @@ -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 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 -- )