Further x86 alien fixes; callbacks now work

slava 2006-02-18 23:39:23 +00:00
parent 096513609a
commit 58143c8226
2 changed files with 12 additions and 13 deletions

View File

@ -10,20 +10,21 @@ GENERIC: load-return-reg ( stack@ reg-class -- )
M: int-regs push-return-reg drop EAX PUSH ;
M: int-regs pop-return-reg drop EAX POP ;
M: int-regs load-return-reg drop EAX ESP rot 2array MOV ;
M: int-regs load-return-reg
drop ECX ESP MOV EAX ECX rot 2array MOV ;
: FSTP 4 = [ FSTPS ] [ FSTPL ] if ;
M: float-regs push-return-reg
ESP swap reg-size [ SUB { ESP } ] keep FSTP ;
ESP swap reg-size [ SUB { ECX } ] keep ECX ESP MOV FSTP ;
: FLD 4 = [ FLDS ] [ FLDL ] if ;
M: float-regs load-return-reg
reg-size { ESP } swap FLD ;
M: float-regs pop-return-reg
2dup load-return-reg reg-size ESP swap ADD ;
ECX ESP MOV reg-size { ECX } over FLD ESP swap ADD ;
M: float-regs load-return-reg
reg-size >r ECX ESP MOV ECX swap 2array r> FLD ;
M: %unbox generate-node
drop 2 input f compile-c-call 1 input push-return-reg ;
@ -46,7 +47,7 @@ M: %unbox-struct generate-node ( vop -- )
M: %box generate-node
drop
0 input [ 1 input load-return-reg ] when*
0 input [ 4 + 1 input load-return-reg ] when*
1 input push-return-reg
2 input f compile-c-call
1 input pop-return-reg ;

View File

@ -274,13 +274,11 @@ M: operand CMP OCT: 071 2-operand ;
( x87 Floating Point Unit )
: (FSTP) BIN: 100 f HEX: 1c 1-operand ;
: FSTPS ( operand -- ) HEX: d9 assemble-1 (FSTP) ;
: FSTPL ( operand -- ) HEX: dd assemble-1 (FSTP) ;
: FSTPS ( operand -- ) BIN: 011 f HEX: d9 1-operand ;
: FSTPL ( operand -- ) BIN: 011 f HEX: dd 1-operand ;
: (FLD) BIN: 100 f HEX: 04 1-operand ;
: FLDS ( operand -- ) HEX: d9 assemble-1 (FLD) ;
: FLDL ( operand -- ) HEX: dd assemble-1 (FLD) ;
: FLDS ( operand -- ) BIN: 000 f HEX: d9 1-operand ;
: FLDL ( operand -- ) BIN: 000 f HEX: dd 1-operand ;
( SSE multimedia instructions )