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

Unified Diff: src/IceTargetLoweringMIPS32.cpp

Issue 2364143002: Subzero, MIPS32: lowerSelect for i64 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
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 | tests_lit/llvm2ice_tests/64bit.pnacl.ll » ('j') | tests_lit/llvm2ice_tests/select-opt.ll » ('J')
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 2c90a7c415f7ee4749d1b24031a75daa918ae703..90f87db6a7206b408d44b973b249120021e1198f 100644
--- a/src/IceTargetLoweringMIPS32.cpp
+++ b/src/IceTargetLoweringMIPS32.cpp
@@ -3267,14 +3267,30 @@ void TargetMIPS32::lowerSelect(const InstSelect *Instr) {
Variable *Dest = Instr->getDest();
const Type DestTy = Dest->getType();
- if (DestTy == IceType_i64 || isVectorType(DestTy)) {
+ if (isVectorType(DestTy)) {
UnimplementedLoweringError(this, Instr);
return;
}
- Variable *DestR = legalizeToReg(Dest);
- Variable *SrcTR = legalizeToReg(Instr->getTrueOperand());
- Variable *SrcFR = legalizeToReg(Instr->getFalseOperand());
+ Variable *DestR = nullptr;
+ Variable *DestHiR = nullptr;
+ Variable *SrcTR = nullptr;
+ Variable *SrcTHiR = nullptr;
+ Variable *SrcFR = nullptr;
+ Variable *SrcFHiR = nullptr;
+
+ if (DestTy == IceType_i64) {
+ DestR = llvm::cast<Variable>(loOperand(Dest));
+ DestHiR = llvm::cast<Variable>(hiOperand(Dest));
+ SrcTR = legalizeToReg(loOperand(Instr->getTrueOperand()));
+ SrcTHiR = legalizeToReg(hiOperand(Instr->getTrueOperand()));
+ SrcFR = legalizeToReg(loOperand(Instr->getFalseOperand()));
+ SrcFHiR = legalizeToReg(hiOperand(Instr->getFalseOperand()));
+ } else {
+ DestR = legalizeToReg(Dest);
+ SrcTR = legalizeToReg(Instr->getTrueOperand());
+ SrcFR = legalizeToReg(Instr->getFalseOperand());
+ }
Variable *ConditionR = legalizeToReg(Instr->getCondition());
@@ -3289,6 +3305,12 @@ void TargetMIPS32::lowerSelect(const InstSelect *Instr) {
_mov(DestR, SrcFR);
_mov(Dest, DestR);
break;
+ case IceType_i64:
+ _movn(SrcFR, SrcTR, ConditionR);
+ _movn(SrcFHiR, SrcTHiR, ConditionR);
+ _mov(DestR, SrcFR);
+ _mov(DestHiR, SrcFHiR);
+ break;
case IceType_f32:
_movn_s(SrcFR, SrcTR, ConditionR);
_mov(DestR, SrcFR);
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/64bit.pnacl.ll » ('j') | tests_lit/llvm2ice_tests/select-opt.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698