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

Unified Diff: src/IceTargetLoweringARM32.h

Issue 1655313002: Subzero: ARM32: lowering of vector insert and extract. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review feedback. 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.h
diff --git a/src/IceTargetLoweringARM32.h b/src/IceTargetLoweringARM32.h
index c5654be401c6d34817c1377f78798cc4f57d348b..68748f0f62ac19928054069e4f2b2f861953ce9a 100644
--- a/src/IceTargetLoweringARM32.h
+++ b/src/IceTargetLoweringARM32.h
@@ -85,13 +85,18 @@ public:
const llvm::SmallBitVector &
getRegistersForVariable(const Variable *Var) const override {
RegClass RC = Var->getRegClass();
- assert(RC < RC_Target);
- return TypeToRegisterSet[RC];
+ switch (RC) {
+ default:
+ assert(RC < RC_Target);
+ return TypeToRegisterSet[RC];
+ case RegARM32::RCARM32_QtoS:
+ return TypeToRegisterSet[RC];
+ }
}
const llvm::SmallBitVector &
getAllRegistersForVariable(const Variable *Var) const override {
RegClass RC = Var->getRegClass();
- assert(RC < RC_Target);
+ assert((RegARM32::RegClassARM32)RC < RegARM32::RCARM32_NUM);
return TypeToRegisterSetUnfiltered[RC];
}
const llvm::SmallBitVector &getAliasesForRegister(SizeT Reg) const override {
@@ -413,6 +418,20 @@ protected:
}
}
+ // Generates a vmov instruction to extract the given index from a vector
+ // register.
+ void _extractelement(Variable *Dest, Variable *Src0, uint32_t Index,
+ CondARM32::Cond Pred = CondARM32::AL) {
+ Context.insert<InstARM32Extract>(Dest, Src0, Index, Pred);
+ }
+
+ // Generates a vmov instruction to insert a value into the given index of a
+ // vector register.
+ void _insertelement(Variable *Dest, Variable *Src0, uint32_t Index,
+ CondARM32::Cond Pred = CondARM32::AL) {
+ Context.insert<InstARM32Insert>(Dest, Src0, Index, Pred);
+ }
+
// --------------------------------------------------------------------------
// Begin bool folding machinery.
//

Powered by Google App Engine
This is Rietveld 408576698