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

Unified Diff: src/IceConverter.cpp

Issue 401523003: Lower insertelement and extractelement. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 6 years, 5 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 | « crosstest/test_vector_ops_main.cpp ('k') | src/IceInst.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceConverter.cpp
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp
index 9ba1feace934e981195aac70b58e6a095eda2162..9f4c1d88e93f56042ed7838c0552514716d9cf8b 100644
--- a/src/IceConverter.cpp
+++ b/src/IceConverter.cpp
@@ -337,6 +337,10 @@ private:
return convertArithInstruction(Inst, Ice::InstArithmetic::Or);
case Instruction::Xor:
return convertArithInstruction(Inst, Ice::InstArithmetic::Xor);
+ case Instruction::ExtractElement:
+ return convertExtractElementInstruction(cast<ExtractElementInst>(Inst));
+ case Instruction::InsertElement:
+ return convertInsertElementInstruction(cast<InsertElementInst>(Inst));
case Instruction::Call:
return convertCallInstruction(cast<CallInst>(Inst));
case Instruction::Alloca:
@@ -534,6 +538,22 @@ private:
return Ice::InstFcmp::create(Func, Cond, Dest, Src0, Src1);
}
+ Ice::Inst *convertExtractElementInstruction(const ExtractElementInst *Inst) {
+ Ice::Variable *Dest = mapValueToIceVar(Inst);
+ Ice::Operand *Source1 = convertValue(Inst->getOperand(0));
+ Ice::Operand *Source2 = convertValue(Inst->getOperand(1));
+ return Ice::InstExtractElement::create(Func, Dest, Source1, Source2);
+ }
+
+ Ice::Inst *convertInsertElementInstruction(const InsertElementInst *Inst) {
+ Ice::Variable *Dest = mapValueToIceVar(Inst);
+ Ice::Operand *Source1 = convertValue(Inst->getOperand(0));
+ Ice::Operand *Source2 = convertValue(Inst->getOperand(1));
+ Ice::Operand *Source3 = convertValue(Inst->getOperand(2));
+ return Ice::InstInsertElement::create(Func, Dest, Source1, Source2,
+ Source3);
+ }
+
Ice::Inst *convertSelectInstruction(const SelectInst *Inst) {
Ice::Variable *Dest = mapValueToIceVar(Inst);
Ice::Operand *Cond = convertValue(Inst->getCondition());
« no previous file with comments | « crosstest/test_vector_ops_main.cpp ('k') | src/IceInst.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698