Index: src/x64/assembler-x64.cc |
diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc |
index 36928f7fb14fcf5ce756ea176aad6f534c312b0a..925b6c212cb28db786f9f24f7ac668e5d1398902 100644 |
--- a/src/x64/assembler-x64.cc |
+++ b/src/x64/assembler-x64.cc |
@@ -944,33 +944,17 @@ void Assembler::cqo() { |
} |
-void Assembler::decq(Register dst) { |
+void Assembler::emit_dec(Register dst, int size) { |
EnsureSpace ensure_space(this); |
- emit_rex_64(dst); |
- emit(0xFF); |
- emit_modrm(0x1, dst); |
-} |
- |
- |
-void Assembler::decq(const Operand& dst) { |
- EnsureSpace ensure_space(this); |
- emit_rex_64(dst); |
- emit(0xFF); |
- emit_operand(1, dst); |
-} |
- |
- |
-void Assembler::decl(Register dst) { |
- EnsureSpace ensure_space(this); |
- emit_optional_rex_32(dst); |
+ emit_rex(dst, size); |
emit(0xFF); |
emit_modrm(0x1, dst); |
} |
-void Assembler::decl(const Operand& dst) { |
+void Assembler::emit_dec(const Operand& dst, int size) { |
EnsureSpace ensure_space(this); |
- emit_optional_rex_32(dst); |
+ emit_rex(dst, size); |
emit(0xFF); |
emit_operand(1, dst); |
} |
@@ -1058,38 +1042,22 @@ void Assembler::emit_imul(Register dst, Register src, Immediate imm, int size) { |
} |
-void Assembler::incq(Register dst) { |
+void Assembler::emit_inc(Register dst, int size) { |
EnsureSpace ensure_space(this); |
- emit_rex_64(dst); |
+ emit_rex(dst, size); |
emit(0xFF); |
emit_modrm(0x0, dst); |
} |
-void Assembler::incq(const Operand& dst) { |
- EnsureSpace ensure_space(this); |
- emit_rex_64(dst); |
- emit(0xFF); |
- emit_operand(0, dst); |
-} |
- |
- |
-void Assembler::incl(const Operand& dst) { |
+void Assembler::emit_inc(const Operand& dst, int size) { |
EnsureSpace ensure_space(this); |
- emit_optional_rex_32(dst); |
+ emit_rex(dst, size); |
emit(0xFF); |
emit_operand(0, dst); |
} |
-void Assembler::incl(Register dst) { |
- EnsureSpace ensure_space(this); |
- emit_optional_rex_32(dst); |
- emit(0xFF); |
- emit_modrm(0, dst); |
-} |
- |
- |
void Assembler::int3() { |
EnsureSpace ensure_space(this); |
emit(0xCC); |
@@ -1590,23 +1558,15 @@ void Assembler::mul(Register src) { |
} |
-void Assembler::neg(Register dst) { |
- EnsureSpace ensure_space(this); |
- emit_rex_64(dst); |
- emit(0xF7); |
- emit_modrm(0x3, dst); |
-} |
- |
- |
-void Assembler::negl(Register dst) { |
+void Assembler::emit_neg(Register dst, int size) { |
EnsureSpace ensure_space(this); |
- emit_optional_rex_32(dst); |
+ emit_rex(dst, size); |
emit(0xF7); |
emit_modrm(0x3, dst); |
} |
-void Assembler::neg(const Operand& dst) { |
+void Assembler::emit_neg(const Operand& dst, int size) { |
EnsureSpace ensure_space(this); |
emit_rex_64(dst); |
emit(0xF7); |
@@ -1946,21 +1906,21 @@ void Assembler::testb(const Operand& op, Register reg) { |
} |
-void Assembler::testl(Register dst, Register src) { |
+void Assembler::emit_test(Register dst, Register src, int size) { |
EnsureSpace ensure_space(this); |
if (src.low_bits() == 4) { |
- emit_optional_rex_32(src, dst); |
+ emit_rex(src, dst, size); |
emit(0x85); |
emit_modrm(src, dst); |
} else { |
- emit_optional_rex_32(dst, src); |
+ emit_rex(dst, src, size); |
emit(0x85); |
emit_modrm(dst, src); |
} |
} |
-void Assembler::testl(Register reg, Immediate mask) { |
+void Assembler::emit_test(Register reg, Immediate mask, int size) { |
// testl with a mask that fits in the low byte is exactly testb. |
if (is_uint8(mask.value_)) { |
testb(reg, mask); |
@@ -1968,10 +1928,11 @@ void Assembler::testl(Register reg, Immediate mask) { |
} |
EnsureSpace ensure_space(this); |
if (reg.is(rax)) { |
+ emit_rex(rax, size); |
emit(0xA9); |
emit(mask); |
} else { |
- emit_optional_rex_32(rax, reg); |
+ emit_rex(reg, size); |
emit(0xF7); |
emit_modrm(0x0, reg); |
emit(mask); |
@@ -1979,69 +1940,28 @@ void Assembler::testl(Register reg, Immediate mask) { |
} |
-void Assembler::testl(const Operand& op, Immediate mask) { |
+void Assembler::emit_test(const Operand& op, Immediate mask, int size) { |
// testl with a mask that fits in the low byte is exactly testb. |
if (is_uint8(mask.value_)) { |
testb(op, mask); |
return; |
} |
EnsureSpace ensure_space(this); |
- emit_optional_rex_32(rax, op); |
+ emit_rex(rax, op, size); |
emit(0xF7); |
emit_operand(rax, op); // Operation code 0 |
emit(mask); |
} |
-void Assembler::testl(const Operand& op, Register reg) { |
+void Assembler::emit_test(const Operand& op, Register reg, int size) { |
EnsureSpace ensure_space(this); |
- emit_optional_rex_32(reg, op); |
+ emit_rex(reg, op, size); |
emit(0x85); |
emit_operand(reg, op); |
} |
-void Assembler::testq(const Operand& op, Register reg) { |
- EnsureSpace ensure_space(this); |
- emit_rex_64(reg, op); |
- emit(0x85); |
- emit_operand(reg, op); |
-} |
- |
- |
-void Assembler::testq(Register dst, Register src) { |
- EnsureSpace ensure_space(this); |
- if (src.low_bits() == 4) { |
- emit_rex_64(src, dst); |
- emit(0x85); |
- emit_modrm(src, dst); |
- } else { |
- emit_rex_64(dst, src); |
- emit(0x85); |
- emit_modrm(dst, src); |
- } |
-} |
- |
- |
-void Assembler::testq(Register dst, Immediate mask) { |
- if (is_uint8(mask.value_)) { |
- testb(dst, mask); |
- return; |
- } |
- EnsureSpace ensure_space(this); |
- if (dst.is(rax)) { |
- emit_rex_64(); |
- emit(0xA9); |
- emit(mask); |
- } else { |
- emit_rex_64(dst); |
- emit(0xF7); |
- emit_modrm(0, dst); |
- emit(mask); |
- } |
-} |
- |
- |
// FPU instructions. |