Index: runtime/vm/assembler_x64.cc |
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc |
index 804dcf21a18652018d240d6ac95f420bedfe4f42..6984fc3ab35c7a1507f1543830bc8be8cb632b77 100644 |
--- a/runtime/vm/assembler_x64.cc |
+++ b/runtime/vm/assembler_x64.cc |
@@ -350,6 +350,16 @@ void Assembler::movw(const Address& dst, Register src) { |
} |
+void Assembler::movw(const Address& dst, const Immediate& imm) { |
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
+ EmitOperandSizeOverride(); |
+ EmitUint8(0xC7); |
+ EmitOperand(0, dst); |
+ EmitUint8(imm.value() & 0xFF); |
+ EmitUint8((imm.value() >> 8) & 0xFF); |
+} |
+ |
+ |
void Assembler::movq(Register dst, const Immediate& imm) { |
AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
if (imm.is_int32()) { |
@@ -1419,6 +1429,24 @@ void Assembler::cmpb(const Address& address, const Immediate& imm) { |
} |
+void Assembler::cmpw(Register reg, const Address& address) { |
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
+ EmitOperandSizeOverride(); |
+ EmitUint8(0x3B); |
+ EmitOperand(reg, address); |
+} |
+ |
+ |
+void Assembler::cmpw(const Address& address, const Immediate& imm) { |
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
+ EmitOperandSizeOverride(); |
+ EmitUint8(0x81); |
+ EmitOperand(7, address); |
+ EmitUint8(imm.value() & 0xFF); |
+ EmitUint8((imm.value() >> 8) & 0xFF); |
+} |
+ |
+ |
void Assembler::cmpl(Register reg, const Immediate& imm) { |
AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
EmitRegisterREX(reg, REX_NONE); |