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

Unified Diff: src/IceTargetLoweringARM32.cpp

Issue 1683243003: ARM32 Vector lowering - scalarize select (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Enable test_select crosstest Created 4 years, 10 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
Index: src/IceTargetLoweringARM32.cpp
diff --git a/src/IceTargetLoweringARM32.cpp b/src/IceTargetLoweringARM32.cpp
index f302e35c7efc71f8338177674e9015015732fffc..066c2bfbfde5a7ab202f21d79ecf6b29b481f8cf 100644
--- a/src/IceTargetLoweringARM32.cpp
+++ b/src/IceTargetLoweringARM32.cpp
@@ -583,10 +583,10 @@ void TargetARM32::genTargetHelperCallFor(Inst *Instr) {
const InstCast::OpKind CastKind = CastInstr->getCastKind();
if (isVectorType(DestTy)) {
- scalarizeUnaryInstruction(
- Dest, Src0, [this, CastKind](Variable *Dest, Variable *Src) {
+ scalarizeInstruction(
+ Dest, [this, CastKind](Variable *Dest, Variable *Src) {
return Context.insert<InstCast>(CastKind, Dest, Src);
- });
+ }, Src0);
CastInstr->setDeleted();
return;
}
@@ -742,10 +742,11 @@ void TargetARM32::genTargetHelperCallFor(Inst *Instr) {
auto *CmpInstr = llvm::cast<InstIcmp>(Instr);
const auto Condition = CmpInstr->getCondition();
scalarizeInstruction(
- Dest, CmpInstr->getSrc(0), CmpInstr->getSrc(1),
+ Dest,
[this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) {
return Context.insert<InstIcmp>(Condition, Dest, Src0, Src1);
- });
+ },
+ CmpInstr->getSrc(0), CmpInstr->getSrc(1));
CmpInstr->setDeleted();
}
return;
@@ -757,14 +758,32 @@ void TargetARM32::genTargetHelperCallFor(Inst *Instr) {
auto *CmpInstr = llvm::cast<InstFcmp>(Instr);
const auto Condition = CmpInstr->getCondition();
scalarizeInstruction(
- Dest, CmpInstr->getSrc(0), CmpInstr->getSrc(1),
+ Dest,
[this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) {
return Context.insert<InstFcmp>(Condition, Dest, Src0, Src1);
- });
+ },
+ CmpInstr->getSrc(0), CmpInstr->getSrc(1));
CmpInstr->setDeleted();
}
return;
}
+ case Inst::Select: {
+ Variable *Dest = Instr->getDest();
+ const auto DestTy = Dest->getType();
+ if (isVectorType(DestTy)) {
+ auto *SelectInstr = llvm::cast<InstSelect>(Instr);
+ scalarizeInstruction(Dest,
+ [this](Variable *Dest, Variable *Src0,
+ Variable *Src1, Variable *Src2) {
+ return Context.insert<InstSelect>(Dest, Src0, Src1,
+ Src2);
+ },
+ SelectInstr->getSrc(0), SelectInstr->getSrc(1),
+ SelectInstr->getSrc(2));
+ SelectInstr->setDeleted();
+ }
+ return;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698