cpu.x86,bootstrap.assembler.*: making sure 0 is the relocation dummy value everywhere

In some places it was 0xffffffff, but it should always be 0 MOV for
consistency.
locals-and-roots
Björn Lindqvist 2016-05-19 22:43:52 +02:00
parent 9f0cd740c8
commit 0fc8fb22ca
3 changed files with 41 additions and 12 deletions

View File

@ -107,7 +107,7 @@ IN: bootstrap.x86
\ lazy-jit-compile define-combinator-primitive
[
temp2 0xffffffff MOV f rc-absolute-cell rel-literal
temp2 0 MOV f rc-absolute-cell rel-literal
temp1 temp2 CMP
] PIC-CHECK-TUPLE jit-define

View File

@ -12,6 +12,15 @@ IN: cpu.x86.tests
assert=
] unit-test
! (%compare-tagged)
cpu x86.64? [
{
B{ 72 129 248 255 255 255 255 }
} [
init-relocation [ RAX RAX (%compare-tagged) ] B{ } make
] unit-test
] when
! %add-imm
{
B{ 72 255 192 }
@ -21,6 +30,14 @@ IN: cpu.x86.tests
[ RAX RAX 29 %add-imm ] B{ } make
] unit-test
! %alien-invoke
{ 1 } [
init-relocation init-gc-maps [
{ } { } { } { } 0 0 { } "dll" T{ gc-map { scrub-d V{ 0 } } } %alien-invoke
] B{ } make drop
gc-maps get length
] unit-test
! %call-gc
{ V{ } } [
init-relocation init-gc-maps
@ -34,20 +51,22 @@ IN: cpu.x86.tests
gc-maps get length
] unit-test
! %alien-invoke
{ 1 } [
init-relocation init-gc-maps [
{ } { } { } { } 0 0 { } "dll" T{ gc-map { scrub-d V{ 0 } } } %alien-invoke
] B{ } make drop
gc-maps get length
] unit-test
! %clear
{ t } [
[ D: 0 %clear ] B{ } make
cpu x86.32? B{ 199 6 144 18 0 0 } B{ 73 199 6 144 18 0 0 } ? =
] unit-test
! %dispatch
cpu x86.64? [
{
B{ 72 187 0 0 0 0 0 0 0 0 72 255 100 3 6 0 }
}
[
init-relocation [ RAX RBX %dispatch ] B{ } make
] unit-test
] when
! %prologue
{ t } [
[ 2 cells %prologue ] B{ } make
@ -58,3 +77,13 @@ IN: cpu.x86.tests
[ 8 cells %prologue ] B{ } make
[ stack-reg 7 cells SUB ] B{ } make =
] unit-test
! %replace-imm
cpu x86.64? [
{
B{ 73 199 6 0 0 0 0 }
}
[
init-relocation [ 34.0 D: 0 %replace-imm ] B{ } make
] unit-test
] when

View File

@ -87,7 +87,7 @@ M: x86 %replace-imm
{
{ [ dup not ] [ drop \ f type-number MOV ] }
{ [ dup fixnum? ] [ tag-fixnum MOV ] }
[ [ 0xffffffff MOV ] dip rc-absolute rel-literal ]
[ [ 0 MOV ] dip rc-absolute rel-literal ]
} cond ;
M: x86 %clear ( loc -- )
@ -598,9 +598,9 @@ M:: x86 %compare-imm-branch ( label src1 src2 cc -- )
M:: x86 %dispatch ( src temp -- )
! Load jump table base.
temp 0xffffffff MOV
building get length :> start
temp 0 MOV
0 rc-absolute-cell rel-here
building get length :> start
! Add jump table base
temp src 0x7f [++] JMP
building get length :> end