Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(977)

Unified Diff: src/compiler/arm64/code-generator-arm64.cc

Issue 2928853002: [ARM64] Support 128 bit moves and swaps in code generator. (Closed)
Patch Set: Rebase. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/arm64/code-generator-arm64.cc
diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc
index 9b6db06d859002ed523d2cb80023abf43fe0fc67..91efff57e3184038347afb608c408481c1c5c4c3 100644
--- a/src/compiler/arm64/code-generator-arm64.cc
+++ b/src/compiler/arm64/code-generator-arm64.cc
@@ -2229,18 +2229,34 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
__ Fmov(dst, src);
} else {
DCHECK(destination->IsFPStackSlot());
- __ Str(src, g.ToMemOperand(destination, masm()));
+ MemOperand dst = g.ToMemOperand(destination, masm());
+ if (destination->IsSimd128StackSlot()) {
+ __ Str(src.Q(), dst);
+ } else {
+ __ Str(src, dst);
+ }
}
} else if (source->IsFPStackSlot()) {
DCHECK(destination->IsFPRegister() || destination->IsFPStackSlot());
MemOperand src = g.ToMemOperand(source, masm());
if (destination->IsFPRegister()) {
- __ Ldr(g.ToDoubleRegister(destination), src);
+ VRegister dst = g.ToDoubleRegister(destination);
+ if (destination->IsSimd128Register()) {
+ __ Ldr(dst.Q(), src);
+ } else {
+ __ Ldr(dst, src);
+ }
} else {
UseScratchRegisterScope scope(masm());
VRegister temp = scope.AcquireD();
- __ Ldr(temp, src);
- __ Str(temp, g.ToMemOperand(destination, masm()));
+ MemOperand dst = g.ToMemOperand(destination, masm());
+ if (destination->IsSimd128StackSlot()) {
+ __ Ldr(temp.Q(), src);
+ __ Str(temp.Q(), dst);
+ } else {
+ __ Ldr(temp, src);
+ __ Str(temp, dst);
+ }
}
} else {
UNREACHABLE();
@@ -2272,14 +2288,21 @@ void CodeGenerator::AssembleSwap(InstructionOperand* source,
}
} else if (source->IsStackSlot() || source->IsFPStackSlot()) {
UseScratchRegisterScope scope(masm());
- DoubleRegister temp_0 = scope.AcquireD();
- DoubleRegister temp_1 = scope.AcquireD();
+ VRegister temp_0 = scope.AcquireD();
+ VRegister temp_1 = scope.AcquireD();
MemOperand src = g.ToMemOperand(source, masm());
MemOperand dst = g.ToMemOperand(destination, masm());
- __ Ldr(temp_0, src);
- __ Ldr(temp_1, dst);
- __ Str(temp_0, dst);
- __ Str(temp_1, src);
+ if (source->IsSimd128StackSlot()) {
+ __ Ldr(temp_0.Q(), src);
+ __ Ldr(temp_1.Q(), dst);
+ __ Str(temp_0.Q(), dst);
+ __ Str(temp_1.Q(), src);
+ } else {
+ __ Ldr(temp_0, src);
+ __ Ldr(temp_1, dst);
+ __ Str(temp_0, dst);
+ __ Str(temp_1, src);
+ }
} else if (source->IsFPRegister()) {
UseScratchRegisterScope scope(masm());
VRegister temp = scope.AcquireD();
@@ -2292,9 +2315,15 @@ void CodeGenerator::AssembleSwap(InstructionOperand* source,
} else {
DCHECK(destination->IsFPStackSlot());
MemOperand dst = g.ToMemOperand(destination, masm());
- __ Fmov(temp, src);
- __ Ldr(src, dst);
- __ Str(temp, dst);
+ if (source->IsSimd128Register()) {
+ __ Fmov(temp.Q(), src.Q());
+ __ Ldr(src.Q(), dst);
+ __ Str(temp.Q(), dst);
+ } else {
+ __ Fmov(temp, src);
+ __ Ldr(src, dst);
+ __ Str(temp, dst);
+ }
}
} else {
// No other combinations are possible.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698