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

Unified Diff: src/IceTargetLoweringMIPS32.cpp

Issue 2533563002: [SubZero] Fix size of arguments on stack (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 1 month 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 | tests_lit/llvm2ice_tests/fused-alloca-arg.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringMIPS32.cpp
diff --git a/src/IceTargetLoweringMIPS32.cpp b/src/IceTargetLoweringMIPS32.cpp
index e97fc5a576a69ce2a05569d0e69c2245c9243eff..ae03f3e12a1694d75ea934a0087b90f9ad82a25b 100644
--- a/src/IceTargetLoweringMIPS32.cpp
+++ b/src/IceTargetLoweringMIPS32.cpp
@@ -225,18 +225,31 @@ uint32_t TargetMIPS32::getCallStackArgumentsSizeBytes(const InstCall *Call) {
TargetMIPS32::CallingConv CC;
RegNumT DummyReg;
size_t OutArgsSizeBytes = 0;
+ Variable *Dest = Call->getDest();
+ bool PartialOnStack = false;
+ if (Dest && isVectorFloatingType(Dest->getType())) {
Jim Stichnoth 2016/11/25 14:58:02 if (Dest != nullptr && ...)
jaydeep.patil 2016/11/28 03:08:36 Done.
+ CC.discardReg(RegMIPS32::Reg_A0);
+ // Next vector is partially on stack
+ PartialOnStack = true;
+ }
for (SizeT i = 0, NumArgs = Call->getNumArgs(); i < NumArgs; ++i) {
Operand *Arg = legalizeUndef(Call->getArg(i));
const Type Ty = Arg->getType();
RegNumT RegNum;
if (CC.argInReg(Ty, i, &RegNum)) {
+ // If PartialOnStack is true and if this is a vector type
Jim Stichnoth 2016/11/25 14:58:02 Reflow comment to 80-col
jaydeep.patil 2016/11/28 03:08:36 Done.
+ // then last two elements are on stack
+ if (PartialOnStack == true && isVectorType(Ty)) {
Jim Stichnoth 2016/11/25 14:58:02 if (PartialOnStack && ...)
jaydeep.patil 2016/11/28 03:08:36 Done.
+ OutArgsSizeBytes = applyStackAlignmentTy(OutArgsSizeBytes, IceType_i32);
+ OutArgsSizeBytes += typeWidthInBytesOnStack(IceType_i32) * 2;
+ }
continue;
}
-
OutArgsSizeBytes = applyStackAlignmentTy(OutArgsSizeBytes, Ty);
OutArgsSizeBytes += typeWidthInBytesOnStack(Ty);
}
-
+ // Add size of argument save area
+ OutArgsSizeBytes += MIPS32_MAX_GPR_ARG * 4;
Jim Stichnoth 2016/11/25 14:58:02 Instead of "4", can you use something more symboli
jaydeep.patil 2016/11/28 03:08:36 Done.
return applyStackAlignment(OutArgsSizeBytes);
}
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/fused-alloca-arg.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698