Commit b0d09b49 authored by Pierre Langlois's avatar Pierre Langlois Committed by Commit Bot

[arm64] Fix Simd128 register moves and swaps.

FPRegister <-> FPRegister moves and swaps were implemented using the FMOV
instruction, whatever the size of the register. However, FMOV only supports
Float and Double moves, it cannot move a whole 128bit register.

Instead, use the vector MOV instruction:

- Simd128 move:      mov vd.16b, vn.16b
- Float/Double move: mov vd.8b, vn.8b

Bug: 
Change-Id: Ie793078baf3fb816e4047062285bbdaf35483949
Reviewed-on: https://chromium-review.googlesource.com/591308Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarMartyn Capewell <martyn.capewell@arm.com>
Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/master@{#47371}
parent 24a19a43
......@@ -2676,7 +2676,11 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
VRegister src = g.ToDoubleRegister(source);
if (destination->IsFPRegister()) {
VRegister dst = g.ToDoubleRegister(destination);
__ Fmov(dst, src);
if (destination->IsSimd128Register()) {
__ Mov(dst.Q(), src.Q());
} else {
__ Mov(dst, src);
}
} else {
DCHECK(destination->IsFPStackSlot());
MemOperand dst = g.ToMemOperand(destination, tasm());
......@@ -2759,18 +2763,24 @@ void CodeGenerator::AssembleSwap(InstructionOperand* source,
VRegister src = g.ToDoubleRegister(source);
if (destination->IsFPRegister()) {
VRegister dst = g.ToDoubleRegister(destination);
__ Fmov(temp, src);
__ Fmov(src, dst);
__ Fmov(dst, temp);
if (source->IsSimd128Register()) {
__ Mov(temp.Q(), src.Q());
__ Mov(src.Q(), dst.Q());
__ Mov(dst.Q(), temp.Q());
} else {
__ Mov(temp, src);
__ Mov(src, dst);
__ Mov(dst, temp);
}
} else {
DCHECK(destination->IsFPStackSlot());
MemOperand dst = g.ToMemOperand(destination, tasm());
if (source->IsSimd128Register()) {
__ Fmov(temp.Q(), src.Q());
__ Mov(temp.Q(), src.Q());
__ Ldr(src.Q(), dst);
__ Str(temp.Q(), dst);
} else {
__ Fmov(temp, src);
__ Mov(temp, src);
__ Ldr(src, dst);
__ Str(temp, dst);
}
......
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