cpu.x86: combine 32-bit and 64-bit %dispatch template
parent
e4d6611070
commit
8ed4760b51
|
@ -56,20 +56,6 @@ M: x86.32 %mark-deck
|
||||||
rc-absolute-cell rel-decks-offset
|
rc-absolute-cell rel-decks-offset
|
||||||
building get push ;
|
building get push ;
|
||||||
|
|
||||||
M:: x86.32 %dispatch ( src temp -- )
|
|
||||||
! Load jump table base.
|
|
||||||
temp src HEX: ffffffff [+] LEA
|
|
||||||
building get length :> start
|
|
||||||
0 rc-absolute-cell rel-here
|
|
||||||
! Go
|
|
||||||
temp HEX: 7f [+] JMP
|
|
||||||
building get length :> end
|
|
||||||
! Fix up the displacement above
|
|
||||||
cell alignment
|
|
||||||
[ end start - + building get dup pop* push ]
|
|
||||||
[ (align-code) ]
|
|
||||||
bi ;
|
|
||||||
|
|
||||||
M: x86.32 pic-tail-reg EDX ;
|
M: x86.32 pic-tail-reg EDX ;
|
||||||
|
|
||||||
M: x86.32 reserved-stack-space 0 ;
|
M: x86.32 reserved-stack-space 0 ;
|
||||||
|
|
|
@ -81,21 +81,6 @@ M: x86.64 %mark-deck
|
||||||
dup load-decks-offset
|
dup load-decks-offset
|
||||||
[+] card-mark <byte> MOV ;
|
[+] card-mark <byte> MOV ;
|
||||||
|
|
||||||
M:: x86.64 %dispatch ( src temp -- )
|
|
||||||
! Load jump table base.
|
|
||||||
temp HEX: ffffffff MOV
|
|
||||||
building get length :> start
|
|
||||||
0 rc-absolute-cell rel-here
|
|
||||||
! Add jump table base
|
|
||||||
temp src ADD
|
|
||||||
temp HEX: 7f [+] JMP
|
|
||||||
building get length :> end
|
|
||||||
! Fix up the displacement above
|
|
||||||
cell alignment
|
|
||||||
[ end start - + building get dup pop* push ]
|
|
||||||
[ (align-code) ]
|
|
||||||
bi ;
|
|
||||||
|
|
||||||
M:: x86.64 %load-reg-param ( dst reg rep -- )
|
M:: x86.64 %load-reg-param ( dst reg rep -- )
|
||||||
dst reg rep %copy ;
|
dst reg rep %copy ;
|
||||||
|
|
||||||
|
|
|
@ -570,6 +570,20 @@ M:: x86 %compare-imm-branch ( label src1 src2 cc -- )
|
||||||
src1 src2 (%compare-imm)
|
src1 src2 (%compare-imm)
|
||||||
label cc %branch ;
|
label cc %branch ;
|
||||||
|
|
||||||
|
M:: x86 %dispatch ( src temp -- )
|
||||||
|
! Load jump table base.
|
||||||
|
temp HEX: ffffffff MOV
|
||||||
|
building get length :> start
|
||||||
|
0 rc-absolute-cell rel-here
|
||||||
|
! Add jump table base
|
||||||
|
temp src HEX: 7f [++] JMP
|
||||||
|
building get length :> end
|
||||||
|
! Fix up the displacement above
|
||||||
|
cell alignment
|
||||||
|
[ end start - + building get dup pop* push ]
|
||||||
|
[ (align-code) ]
|
||||||
|
bi ;
|
||||||
|
|
||||||
M:: x86 %spill ( src rep dst -- )
|
M:: x86 %spill ( src rep dst -- )
|
||||||
dst src rep %copy ;
|
dst src rep %copy ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue