| Index: src/x64/assembler-x64.cc
|
| diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc
|
| index 925b6c212cb28db786f9f24f7ac668e5d1398902..efdd472e8c5af642f74ed0669db873b088f0f657 100644
|
| --- a/src/x64/assembler-x64.cc
|
| +++ b/src/x64/assembler-x64.cc
|
| @@ -1224,17 +1224,9 @@ void Assembler::jmp(const Operand& src) {
|
| }
|
|
|
|
|
| -void Assembler::lea(Register dst, const Operand& src) {
|
| +void Assembler::emit_lea(Register dst, const Operand& src, int size) {
|
| EnsureSpace ensure_space(this);
|
| - emit_rex_64(dst, src);
|
| - emit(0x8D);
|
| - emit_operand(dst, src);
|
| -}
|
| -
|
| -
|
| -void Assembler::leal(Register dst, const Operand& src) {
|
| - EnsureSpace ensure_space(this);
|
| - emit_optional_rex_32(dst, src);
|
| + emit_rex(dst, src, size);
|
| emit(0x8D);
|
| emit_operand(dst, src);
|
| }
|
| @@ -1473,7 +1465,7 @@ void Assembler::movsxlq(Register dst, const Operand& src) {
|
| }
|
|
|
|
|
| -void Assembler::movzxbq(Register dst, const Operand& src) {
|
| +void Assembler::emit_movzxb(Register dst, const Operand& src, int size) {
|
| EnsureSpace ensure_space(this);
|
| // 32 bit operations zero the top 32 bits of 64 bit registers. Therefore
|
| // there is no need to make this a 64 bit operation.
|
| @@ -1484,26 +1476,10 @@ void Assembler::movzxbq(Register dst, const Operand& src) {
|
| }
|
|
|
|
|
| -void Assembler::movzxbl(Register dst, const Operand& src) {
|
| - EnsureSpace ensure_space(this);
|
| - emit_optional_rex_32(dst, src);
|
| - emit(0x0F);
|
| - emit(0xB6);
|
| - emit_operand(dst, src);
|
| -}
|
| -
|
| -
|
| -void Assembler::movzxwq(Register dst, const Operand& src) {
|
| - EnsureSpace ensure_space(this);
|
| - emit_optional_rex_32(dst, src);
|
| - emit(0x0F);
|
| - emit(0xB7);
|
| - emit_operand(dst, src);
|
| -}
|
| -
|
| -
|
| -void Assembler::movzxwl(Register dst, const Operand& src) {
|
| +void Assembler::emit_movzxw(Register dst, const Operand& src, int size) {
|
| EnsureSpace ensure_space(this);
|
| + // 32 bit operations zero the top 32 bits of 64 bit registers. Therefore
|
| + // there is no need to make this a 64 bit operation.
|
| emit_optional_rex_32(dst, src);
|
| emit(0x0F);
|
| emit(0xB7);
|
| @@ -1511,8 +1487,10 @@ void Assembler::movzxwl(Register dst, const Operand& src) {
|
| }
|
|
|
|
|
| -void Assembler::movzxwl(Register dst, Register src) {
|
| +void Assembler::emit_movzxw(Register dst, Register src, int size) {
|
| EnsureSpace ensure_space(this);
|
| + // 32 bit operations zero the top 32 bits of 64 bit registers. Therefore
|
| + // there is no need to make this a 64 bit operation.
|
| emit_optional_rex_32(dst, src);
|
| emit(0x0F);
|
| emit(0xB7);
|
| @@ -1535,17 +1513,10 @@ void Assembler::repmovsw() {
|
| }
|
|
|
|
|
| -void Assembler::repmovsl() {
|
| - EnsureSpace ensure_space(this);
|
| - emit(0xF3);
|
| - emit(0xA5);
|
| -}
|
| -
|
| -
|
| -void Assembler::repmovsq() {
|
| +void Assembler::emit_repmovs(int size) {
|
| EnsureSpace ensure_space(this);
|
| emit(0xF3);
|
| - emit_rex_64();
|
| + emit_rex(size);
|
| emit(0xA5);
|
| }
|
|
|
| @@ -1789,36 +1760,18 @@ void Assembler::shrd(Register dst, Register src) {
|
| }
|
|
|
|
|
| -void Assembler::xchgq(Register dst, Register src) {
|
| +void Assembler::emit_xchg(Register dst, Register src, int size) {
|
| EnsureSpace ensure_space(this);
|
| if (src.is(rax) || dst.is(rax)) { // Single-byte encoding
|
| Register other = src.is(rax) ? dst : src;
|
| - emit_rex_64(other);
|
| + emit_rex(other, size);
|
| emit(0x90 | other.low_bits());
|
| } else if (dst.low_bits() == 4) {
|
| - emit_rex_64(dst, src);
|
| - emit(0x87);
|
| - emit_modrm(dst, src);
|
| - } else {
|
| - emit_rex_64(src, dst);
|
| - emit(0x87);
|
| - emit_modrm(src, dst);
|
| - }
|
| -}
|
| -
|
| -
|
| -void Assembler::xchgl(Register dst, Register src) {
|
| - EnsureSpace ensure_space(this);
|
| - if (src.is(rax) || dst.is(rax)) { // Single-byte encoding
|
| - Register other = src.is(rax) ? dst : src;
|
| - emit_optional_rex_32(other);
|
| - emit(0x90 | other.low_bits());
|
| - } else if (dst.low_bits() == 4) {
|
| - emit_optional_rex_32(dst, src);
|
| + emit_rex(dst, src, size);
|
| emit(0x87);
|
| emit_modrm(dst, src);
|
| } else {
|
| - emit_optional_rex_32(src, dst);
|
| + emit_rex(src, dst, size);
|
| emit(0x87);
|
| emit_modrm(src, dst);
|
| }
|
|
|