Fix x86.32

db4
Slava Pestov 2008-10-31 21:07:41 -05:00
parent 0ae87275f7
commit 804c6f93ea
4 changed files with 10 additions and 8 deletions
basis
compiler/cfg
intrinsics/slots
cpu/x86/32

View File

@ -1,4 +1,4 @@
! Copyright (C) 2004, 2008 Slava Pestov.
! Copyright (C) 2004, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs combinators hashtables kernel
math fry namespaces make sequences words byte-arrays

View File

@ -12,12 +12,12 @@ IN: compiler.cfg.intrinsics.slots
: value-tag ( info -- n ) class>> class-tag ; inline
: (emit-slot) ( infos -- dst )
[ 2inputs ] [ first value-tag ] bi*
[ 2inputs ^^offset>slot ] [ first value-tag ] bi*
^^slot ;
: (emit-slot-imm) ( infos -- dst )
ds-drop
[ ds-pop ^^offset>slot ]
[ ds-pop ]
[ [ second literal>> ] [ first value-tag ] bi ] bi*
^^slot-imm ;

View File

@ -74,7 +74,7 @@ M: float-regs store-return-reg
[ [ align-sub ] [ call ] bi* ]
[ [ align-add ] [ drop ] bi* ] 2bi ; inline
M: x86.64 rel-literal-x86 rc-absolute-cell rel-literal ;
M: x86.32 rel-literal-x86 rc-absolute-cell rel-literal ;
M: x86.32 %prologue ( n -- )
dup PUSH
@ -281,10 +281,12 @@ os windows? [
FUNCTION: bool check_sse2 ( ) ;
: sse2? ( -- ? )
[ optimized-recompile-hook ] recompile-hook
[ [ check_sse2 ] compile-call ] with-variable ;
check_sse2 ;
"-no-sse2" cli-args member? [
[ optimized-recompile-hook ] recompile-hook
[ { check_sse2 } compile ] with-variable
"Checking if your CPU supports SSE2..." print flush
sse2? [
" - yes" print

View File

@ -40,9 +40,9 @@ DEF(void,set_callstack,(F_STACK_FRAME *to, F_STACK_FRAME *from, CELL length, voi
ret /* return _with new stack_ */
/* cpu.x86.32 calls this */
DEF(bool,check_sse2,())
DEF(bool,check_sse2,()):
push %ebx
mov 1,%eax
mov $1,%eax
cpuid
shr $26,%edx
and $1,%edx