factor/library/compiler/amd64/architecture.factor

35 lines
777 B
Factor
Raw Normal View History

2005-12-02 01:23:09 -05:00
IN: compiler-backend
USING: assembler compiler-backend kernel sequences ;
! AMD64 register assignments
! RAX RCX RDX RSI RDI R8 R9 R10 R11 vregs
2005-12-04 02:30:19 -05:00
! R14 datastack
! R15 callstack
: ds-reg R14 ; inline
: cs-reg R15 ; inline
2005-12-02 01:23:09 -05:00
: fixnum-imm? ( -- ? )
#! Can fixnum operations take immediate operands?
2005-12-04 14:30:28 -05:00
f ; inline
2005-12-02 01:23:09 -05:00
2005-12-04 22:06:12 -05:00
: vregs { RAX RCX RDX RSI RDI R8 R9 R10 R11 } ; inline
2005-12-02 01:23:09 -05:00
! FIXME
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 ;
2005-12-04 22:55:02 -05:00
: address-operand ( address -- operand )
#! On AMD64, we have to load 64-bit addresses into a
#! scratch register first.
0 scratch [ swap MOV ] keep ; inline
: fixnum>slot@ drop ; inline
2005-12-06 21:34:18 -05:00
: return-register RAX ; inline
: remainder-reg RDX ; inline