Index: src/x64/assembler-x64.cc |
diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc |
index 3cf3398e876e3a51e291a2e2f60ca88355e8d87b..2e4baeb8598e421ec57b44bebdfaee1c0a9c268a 100644 |
--- a/src/x64/assembler-x64.cc |
+++ b/src/x64/assembler-x64.cc |
@@ -2014,6 +2014,50 @@ void Assembler::testb(const Operand& op, Register reg) { |
emit_operand(reg, op); |
} |
+void Assembler::testw(Register dst, Register src) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ if (src.low_bits() == 4) { |
+ emit_rex_32(src, dst); |
+ } |
+ emit(0x85); |
+ emit_modrm(src, dst); |
+} |
+ |
+void Assembler::testw(Register reg, Immediate mask) { |
+ DCHECK(is_int16(mask.value_) || is_uint16(mask.value_)); |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ if (reg.is(rax)) { |
+ emit(0xA9); |
+ emit(mask.value_); |
+ } else { |
+ if (reg.low_bits() == 4) { |
+ emit_rex_32(reg); |
+ } |
+ emit(0xF7); |
+ emit_modrm(0x0, reg); |
+ emit(mask.value_); |
+ } |
+} |
+ |
+void Assembler::testw(const Operand& op, Immediate mask) { |
+ DCHECK(is_int16(mask.value_) || is_uint16(mask.value_)); |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(rax, op); |
+ emit(0xF7); |
+ emit_operand(rax, op); |
+ emit(mask.value_); |
+} |
+ |
+void Assembler::testw(const Operand& op, Register reg) { |
+ EnsureSpace ensure_space(this); |
+ emit(0x66); |
+ emit_optional_rex_32(reg, op); |
+ emit(0x85); |
+ emit_operand(rax, op); |
+} |
void Assembler::emit_test(Register dst, Register src, int size) { |
EnsureSpace ensure_space(this); |