Commit 3c6cd92d authored by JialuZhang-intel's avatar JialuZhang-intel Committed by V8 LUCI CQ

[x64] use movl for move instruction with word32 operand.

Before:
  488bd6 REX.W movq rdx, rsi

After:
  8bd6 movl rdx, rsi

This CL can save a 1-byte encoding length for move instruction.

Change-Id: Ief482b4093f22ab810dbc693e8d9ed55a8c14c84
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3875397
Commit-Queue: Jialu Zhang <jialu.zhang@intel.com>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83070}
parent 2c0a49f3
......@@ -5211,7 +5211,17 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
switch (MoveType::InferMove(source, destination)) {
case MoveType::kRegisterToRegister:
if (source->IsRegister()) {
__ movq(g.ToRegister(destination), g.ToRegister(source));
MachineRepresentation src_rep =
LocationOperand::cast(source)->representation();
MachineRepresentation dest_rep =
LocationOperand::cast(destination)->representation();
if (dest_rep == MachineRepresentation::kWord32 &&
src_rep == MachineRepresentation::kWord32) {
DCHECK(destination->IsRegister());
__ movl(g.ToRegister(destination), g.ToRegister(source));
} else {
__ movq(g.ToRegister(destination), g.ToRegister(source));
}
} else {
DCHECK(source->IsFPRegister());
__ Movapd(g.ToDoubleRegister(destination), g.ToDoubleRegister(source));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment