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

Unified Diff: src/IceTargetLoweringMIPS32.cpp

Issue 2519863002: Subzero, MIPS32: Changes for improving sandbox crosstest results (Closed)
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
« pydir/crosstest.py ('K') | « src/IceAssemblerMIPS32.cpp ('k') | no next file » | 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 2522a1789f4087588d987b013971fef8af96d385..d1caf887676ee696a8e4f86f0a719116e75a1a10 100644
--- a/src/IceTargetLoweringMIPS32.cpp
+++ b/src/IceTargetLoweringMIPS32.cpp
@@ -5852,6 +5852,8 @@ void TargetHeaderMIPS32::lower() {
<< "nomips16\n";
Str << "\t.set\t"
<< "noat\n";
+ if(getFlags().getUseSandboxing())
+ Str << "\t.bundle_align_mode 4\n";
}
SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM];
@@ -5888,6 +5890,8 @@ void TargetMIPS32::Sandboxer::lw(Variable *Dest, OperandMIPS32Mem *Mem) {
Target->_and(Base, Base, T7);
}
Target->_lw(Dest, Mem);
+ if (Target->NeedSandboxing && (Dest->getRegNum() == Target->getStackReg()))
+ Target->_and(Dest, Dest, T7);
}
void TargetMIPS32::Sandboxer::sw(Variable *Dest, OperandMIPS32Mem *Mem) {
@@ -5946,12 +5950,18 @@ void TargetMIPS32::Sandboxer::reset_sp(Variable *Src) {
createAutoBundle();
Target->_mov(SP, Src);
Target->_and(SP, SP, T7);
+ Target->getContext().insert<InstFakeUse>(SP);
}
InstMIPS32Call *TargetMIPS32::Sandboxer::jal(Variable *ReturnReg,
Operand *CallTarget) {
- if (Target->NeedSandboxing)
+ if (Target->NeedSandboxing) {
createAutoBundle();
+ if (auto *CallTargetR = llvm::dyn_cast<Variable>(CallTarget)) {
+ Variable *T6 = Target->getPhysicalRegister(RegMIPS32::Reg_T6);
+ Target->_and(CallTargetR, CallTargetR, T6);
+ }
+ }
return Target->Context.insert<InstMIPS32Call>(ReturnReg, CallTarget);
}
« pydir/crosstest.py ('K') | « src/IceAssemblerMIPS32.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698