bootstrap.x86: using 32 bit regs as operands when it's safe to do so
It shaves off a few bytes as e.g and eax, 0xf is one byte shorter than and rax, 0xflocals-and-roots
parent
4509371f7c
commit
8f2738cd82
|
@ -7,6 +7,11 @@ locals.backend math math.private memory namespaces sequences
|
||||||
slots.private strings.private vocabs ;
|
slots.private strings.private vocabs ;
|
||||||
IN: bootstrap.x86
|
IN: bootstrap.x86
|
||||||
|
|
||||||
|
: temp0/32 ( -- reg )
|
||||||
|
temp0 32-bit-version-of ;
|
||||||
|
: temp1/32 ( -- reg )
|
||||||
|
temp1 32-bit-version-of ;
|
||||||
|
|
||||||
big-endian off
|
big-endian off
|
||||||
|
|
||||||
! C to Factor entry point
|
! C to Factor entry point
|
||||||
|
@ -231,19 +236,19 @@ big-endian off
|
||||||
temp1 ds-reg 0x7f [+] MOV f rc-absolute-1 rel-untagged
|
temp1 ds-reg 0x7f [+] MOV f rc-absolute-1 rel-untagged
|
||||||
] PIC-LOAD jit-define
|
] PIC-LOAD jit-define
|
||||||
|
|
||||||
[ temp1 tag-mask get AND ] PIC-TAG jit-define
|
[ temp1/32 tag-mask get AND ] PIC-TAG jit-define
|
||||||
|
|
||||||
[
|
[
|
||||||
temp0 temp1 MOV
|
temp0 temp1 MOV
|
||||||
temp1 tag-mask get AND
|
temp1/32 tag-mask get AND
|
||||||
temp1 tuple type-number CMP
|
temp1/32 tuple type-number CMP
|
||||||
[ JNE ]
|
[ JNE ]
|
||||||
[ temp1 temp0 tuple-class-offset [+] MOV ]
|
[ temp1 temp0 tuple-class-offset [+] MOV ]
|
||||||
jit-conditional
|
jit-conditional
|
||||||
] PIC-TUPLE jit-define
|
] PIC-TUPLE jit-define
|
||||||
|
|
||||||
[
|
[
|
||||||
temp1 0x7f CMP f rc-absolute-1 rel-untagged
|
temp1/32 0x7f CMP f rc-absolute-1 rel-untagged
|
||||||
] PIC-CHECK-TAG jit-define
|
] PIC-CHECK-TAG jit-define
|
||||||
|
|
||||||
[ 0 JE f rc-relative rel-word ] PIC-HIT jit-define
|
[ 0 JE f rc-relative rel-word ] PIC-HIT jit-define
|
||||||
|
@ -253,9 +258,9 @@ big-endian off
|
||||||
[
|
[
|
||||||
! class = ...
|
! class = ...
|
||||||
temp0 temp1 MOV
|
temp0 temp1 MOV
|
||||||
temp1 tag-mask get AND
|
temp1/32 tag-mask get AND
|
||||||
temp1 tag-bits get SHL
|
temp1/32 tag-bits get SHL
|
||||||
temp1 tuple type-number tag-fixnum CMP
|
temp1/32 tuple type-number tag-fixnum CMP
|
||||||
[ JNE ]
|
[ JNE ]
|
||||||
[ temp1 temp0 tuple-class-offset [+] MOV ]
|
[ temp1 temp0 tuple-class-offset [+] MOV ]
|
||||||
jit-conditional
|
jit-conditional
|
||||||
|
@ -484,9 +489,9 @@ big-endian off
|
||||||
! load from stack
|
! load from stack
|
||||||
temp0 ds-reg [] MOV
|
temp0 ds-reg [] MOV
|
||||||
! compute tag
|
! compute tag
|
||||||
temp0 tag-mask get AND
|
temp0/32 tag-mask get AND
|
||||||
! tag the tag
|
! tag the tag
|
||||||
temp0 tag-bits get SHL
|
temp0/32 tag-bits get SHL
|
||||||
! push to stack
|
! push to stack
|
||||||
ds-reg [] temp0 MOV
|
ds-reg [] temp0 MOV
|
||||||
] }
|
] }
|
||||||
|
|
Loading…
Reference in New Issue