factor/library/compiler/x86/architecture.factor

28 lines
589 B
Factor
Raw Normal View History

2005-09-05 17:36:20 -04:00
IN: compiler-backend
USING: assembler compiler-backend kernel sequences ;
2005-09-05 17:14:15 -04:00
! x86 register assignments
2005-09-07 17:21:11 -04:00
! EAX, ECX, EDX, EBP vregs
2005-09-05 17:14:15 -04:00
! ESI datastack
! EBX callstack
2005-12-04 02:30:19 -05:00
: ds-reg ESI ; inline
: cs-reg EBX ; inline
: fixnum-imm? ( -- ? )
#! Can fixnum operations take immediate operands?
t ; inline
: vregs ( -- n )
#! Number of vregs
2005-09-05 17:14:15 -04:00
3 ; inline
M: vreg v>operand vreg-n { EAX ECX EDX } nth ;
! On x86, parameters are never passed in registers.
M: int-regs fastcall-regs drop 0 ;
M: int-regs reg-class-size drop 4 ;
M: float-regs fastcall-regs drop 0 ;
: dual-fp/int-regs? f ;