mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
VM: [x64] Fix movw and cmpw instructions
They were missing appropriate REX prefixes. Fixes https://github.com/dart-lang/sdk/issues/29827 R=erikcorry@google.com BUG=https://github.com/dart-lang/sdk/issues/29827 Review-Url: https://codereview.chromium.org/2927313002 .
This commit is contained in:
parent
2042128817
commit
da25a49215
1 changed files with 4 additions and 1 deletions
|
@ -350,6 +350,7 @@ void Assembler::movw(const Address& dst, Register src) {
|
|||
void Assembler::movw(const Address& dst, const Immediate& imm) {
|
||||
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
|
||||
EmitOperandSizeOverride();
|
||||
EmitOperandREX(0, dst, REX_NONE);
|
||||
EmitUint8(0xC7);
|
||||
EmitOperand(0, dst);
|
||||
EmitUint8(imm.value() & 0xFF);
|
||||
|
@ -1383,14 +1384,16 @@ void Assembler::cmpb(const Address& address, const Immediate& imm) {
|
|||
void Assembler::cmpw(Register reg, const Address& address) {
|
||||
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
|
||||
EmitOperandSizeOverride();
|
||||
EmitOperandREX(reg, address, REX_NONE);
|
||||
EmitUint8(0x3B);
|
||||
EmitOperand(reg, address);
|
||||
EmitOperand(reg & 7, address);
|
||||
}
|
||||
|
||||
|
||||
void Assembler::cmpw(const Address& address, const Immediate& imm) {
|
||||
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
|
||||
EmitOperandSizeOverride();
|
||||
EmitOperandREX(7, address, REX_NONE);
|
||||
EmitUint8(0x81);
|
||||
EmitOperand(7, address);
|
||||
EmitUint8(imm.value() & 0xFF);
|
||||
|
|
Loading…
Reference in a new issue