cpu.x86: xor rax, rax -> xor eax, eax

The latter should be equivalent in all ways, but its encoding is one
byte shorter.
locals-and-roots
Björn Lindqvist 2016-05-20 13:38:42 +02:00
parent e60d45a169
commit 5b3933e2e4
2 changed files with 6 additions and 1 deletions

View File

@ -74,6 +74,11 @@ cpu x86.64? [
] unit-test ] unit-test
] when ] when
! %load-immediate
{ B{ 49 201 } } [
[ RCX 0 %load-immediate ] B{ } make
] unit-test
! %prologue ! %prologue
{ t } [ { t } [
[ 2 cells %prologue ] B{ } make [ 2 cells %prologue ] B{ } make

View File

@ -61,7 +61,7 @@ M: x86 test-instruction? t ;
M: x86 immediate-store? immediate-comparand? ; M: x86 immediate-store? immediate-comparand? ;
M: x86 %load-immediate [ dup XOR ] [ MOV ] if-zero ; M: x86 %load-immediate [ 32-bit-version-of dup XOR ] [ MOV ] if-zero ;
M: x86 %load-reference M: x86 %load-reference
[ swap 0 MOV rc-absolute-cell rel-literal ] [ swap 0 MOV rc-absolute-cell rel-literal ]