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

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

Issue 2339943002: [turbofan] ARM64: Use zr for zeroing stack slots (Closed)
Patch Set: Created 4 years, 3 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 5c27bbec2bdc9dd245faa7e8f61bbf50bacf73b3..54930c79a61c653f2ae0f2560e263b858b743a50 100644
--- a/src/compiler/arm64/code-generator-arm64.cc
+++ b/src/compiler/arm64/code-generator-arm64.cc
@@ -1956,10 +1956,14 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
__ Fmov(dst, src.ToFloat32());
} else {
DCHECK(destination->IsFPStackSlot());
- UseScratchRegisterScope scope(masm());
- FPRegister temp = scope.AcquireS();
- __ Fmov(temp, src.ToFloat32());
- __ Str(temp, g.ToMemOperand(destination, masm()));
+ if (bit_cast<int32_t>(src.ToFloat32()) == 0) {
+ __ Str(wzr, g.ToMemOperand(destination, masm()));
+ } else {
+ UseScratchRegisterScope scope(masm());
+ FPRegister temp = scope.AcquireS();
+ __ Fmov(temp, src.ToFloat32());
+ __ Str(temp, g.ToMemOperand(destination, masm()));
+ }
}
} else {
DCHECK_EQ(Constant::kFloat64, src.type());
@@ -1968,10 +1972,14 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
__ Fmov(dst, src.ToFloat64());
} else {
DCHECK(destination->IsFPStackSlot());
- UseScratchRegisterScope scope(masm());
- FPRegister temp = scope.AcquireD();
- __ Fmov(temp, src.ToFloat64());
- __ Str(temp, g.ToMemOperand(destination, masm()));
+ if (bit_cast<int64_t>(src.ToFloat64()) == 0) {
+ __ Str(xzr, g.ToMemOperand(destination, masm()));
+ } else {
+ UseScratchRegisterScope scope(masm());
+ FPRegister temp = scope.AcquireD();
+ __ Fmov(temp, src.ToFloat64());
+ __ Str(temp, g.ToMemOperand(destination, masm()));
+ }
}
}
} else if (source->IsFPRegister()) {
« 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