[SubZero] Vector types support for MIPS This patch implements vector operations on MIPS32 using VariableVecOn32 method (on the lines of Variable64On32). Vector operations are scalarized prior to lowering. Each vector variable is split into 4 containers to hold a variable of vector type. For MIPS32, four GP/FP registers are used to hold a vector variable. Arguments are passed in GP registers irrespective of the type of the vector variable. Lit test vector-mips.ll has been added to test this implementation. R=stichnot@chromium.org Review URL: https://codereview.chromium.org/2380023002 . Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp index ef775fe..0af025b 100644 --- a/src/IceCfg.cpp +++ b/src/IceCfg.cpp
@@ -119,9 +119,14 @@ template <> Variable *Cfg::makeVariable<Variable>(Type Ty) { SizeT Index = Variables.size(); - Variable *Var = Target->shouldSplitToVariable64On32(Ty) - ? Variable64On32::create(this, Ty, Index) - : Variable::create(this, Ty, Index); + Variable *Var; + if (Target->shouldSplitToVariableVecOn32(Ty)) { + Var = VariableVecOn32::create(this, Ty, Index); + } else if (Target->shouldSplitToVariable64On32(Ty)) { + Var = Variable64On32::create(this, Ty, Index); + } else { + Var = Variable::create(this, Ty, Index); + } Variables.push_back(Var); return Var; } @@ -244,9 +249,13 @@ } // Create the Hi and Lo variables where a split was needed - for (Variable *Var : Variables) - if (auto *Var64On32 = llvm::dyn_cast<Variable64On32>(Var)) + for (Variable *Var : Variables) { + if (auto *Var64On32 = llvm::dyn_cast<Variable64On32>(Var)) { Var64On32->initHiLo(this); + } else if (auto *VarVecOn32 = llvm::dyn_cast<VariableVecOn32>(Var)) { + VarVecOn32->initVecElement(this); + } + } // Instrument the Cfg, e.g. with AddressSanitizer if (!BuildDefs::minimal() && getFlags().getSanitizeAddresses()) {