Index: src/x64/assembler-x64.cc |
diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc |
index 60383da01554a2ad2280f982ff5df20a9665b141..08b3ad0d38846816c3ee8ea47e806fb1e627c36d 100644 |
--- a/src/x64/assembler-x64.cc |
+++ b/src/x64/assembler-x64.cc |
@@ -685,15 +685,19 @@ void Assembler::immediate_arithmetic_op_8(byte subcode, |
} |
-void Assembler::shift(Register dst, Immediate shift_amount, int subcode) { |
+void Assembler::shift(Register dst, |
+ Immediate shift_amount, |
+ int subcode, |
+ int size) { |
EnsureSpace ensure_space(this); |
- ASSERT(is_uint6(shift_amount.value_)); // illegal shift count |
+ ASSERT(size == kInt64Size ? is_uint6(shift_amount.value_) |
+ : is_uint5(shift_amount.value_)); |
if (shift_amount.value_ == 1) { |
- emit_rex_64(dst); |
+ emit_rex(dst, size); |
emit(0xD1); |
emit_modrm(subcode, dst); |
} else { |
- emit_rex_64(dst); |
+ emit_rex(dst, size); |
emit(0xC1); |
emit_modrm(subcode, dst); |
emit(shift_amount.value_); |
@@ -701,38 +705,14 @@ void Assembler::shift(Register dst, Immediate shift_amount, int subcode) { |
} |
-void Assembler::shift(Register dst, int subcode) { |
- EnsureSpace ensure_space(this); |
- emit_rex_64(dst); |
- emit(0xD3); |
- emit_modrm(subcode, dst); |
-} |
- |
- |
-void Assembler::shift_32(Register dst, int subcode) { |
+void Assembler::shift(Register dst, int subcode, int size) { |
EnsureSpace ensure_space(this); |
- emit_optional_rex_32(dst); |
+ emit_rex(dst, size); |
emit(0xD3); |
emit_modrm(subcode, dst); |
} |
-void Assembler::shift_32(Register dst, Immediate shift_amount, int subcode) { |
- EnsureSpace ensure_space(this); |
- ASSERT(is_uint5(shift_amount.value_)); // illegal shift count |
- if (shift_amount.value_ == 1) { |
- emit_optional_rex_32(dst); |
- emit(0xD1); |
- emit_modrm(subcode, dst); |
- } else { |
- emit_optional_rex_32(dst); |
- emit(0xC1); |
- emit_modrm(subcode, dst); |
- emit(shift_amount.value_); |
- } |
-} |
- |
- |
void Assembler::bt(const Operand& dst, Register src) { |
EnsureSpace ensure_space(this); |
emit_rex_64(src, dst); |