Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // | 1 // |
| 2 // The Subzero Code Generator | 2 // The Subzero Code Generator |
| 3 // | 3 // |
| 4 // This file is distributed under the University of Illinois Open Source | 4 // This file is distributed under the University of Illinois Open Source |
| 5 // License. See LICENSE.TXT for details. | 5 // License. See LICENSE.TXT for details. |
| 6 // | 6 // |
| 7 //===----------------------------------------------------------------------===// | 7 //===----------------------------------------------------------------------===// |
| 8 /// | 8 /// |
| 9 /// \file | 9 /// \file |
| 10 /// \brief Implements the TargetLoweringMIPS32 class, which consists almost | 10 /// \brief Implements the TargetLoweringMIPS32 class, which consists almost |
| (...skipping 2300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2311 _sw(ValueLo, llvm::cast<OperandMIPS32Mem>(loOperand(NewAddr))); | 2311 _sw(ValueLo, llvm::cast<OperandMIPS32Mem>(loOperand(NewAddr))); |
| 2312 } else { | 2312 } else { |
| 2313 Variable *ValueR = legalizeToReg(Value); | 2313 Variable *ValueR = legalizeToReg(Value); |
| 2314 _sw(ValueR, NewAddr); | 2314 _sw(ValueR, NewAddr); |
| 2315 } | 2315 } |
| 2316 } | 2316 } |
| 2317 | 2317 |
| 2318 void TargetMIPS32::doAddressOptStore() { UnimplementedError(getFlags()); } | 2318 void TargetMIPS32::doAddressOptStore() { UnimplementedError(getFlags()); } |
| 2319 | 2319 |
| 2320 void TargetMIPS32::lowerSwitch(const InstSwitch *Instr) { | 2320 void TargetMIPS32::lowerSwitch(const InstSwitch *Instr) { |
| 2321 UnimplementedLoweringError(this, Instr); | 2321 Operand *Src = Instr->getComparison(); |
| 2322 SizeT NumCases = Instr->getNumCases(); | |
| 2323 if (Src->getType() == IceType_i64) { | |
| 2324 Src = legalizeUndef(Src); | |
| 2325 Variable *Src0Lo = legalizeToReg(loOperand(Src)); | |
| 2326 Variable *Src0Hi = legalizeToReg(hiOperand(Src)); | |
| 2327 for (SizeT I = 0; I < NumCases; ++I) { | |
| 2328 Operand *ValueLo = Ctx->getConstantInt32(Instr->getValue(I)); | |
| 2329 Operand *ValueHi = Ctx->getConstantInt32(Instr->getValue(I) >> 32); | |
| 2330 CfgNode *TargetTrue = Instr->getLabel(I); | |
| 2331 CfgNode *NoTarget = nullptr; | |
| 2332 ValueHi = legalize(ValueHi, Legal_Reg); | |
|
Jim Stichnoth
2016/08/30 13:20:36
Just use legalizeToReg() here for for ValueLo?
jaydeep.patil
2016/08/31 04:10:23
Done.
| |
| 2333 InstMIPS32Label *IntraLabel = InstMIPS32Label::create(Func, this); | |
| 2334 _br(NoTarget, NoTarget, Src0Hi, ValueHi, IntraLabel, | |
| 2335 CondMIPS32::Cond::NE); | |
| 2336 ValueLo = legalize(ValueLo, Legal_Reg); | |
| 2337 _br(NoTarget, TargetTrue, Src0Lo, ValueLo, CondMIPS32::Cond::EQ); | |
| 2338 Context.insert(IntraLabel); | |
| 2339 } | |
| 2340 _br(Instr->getLabelDefault()); | |
| 2341 return; | |
| 2342 } | |
| 2343 Variable *SrcVar = legalizeToReg(Src); | |
| 2344 assert(SrcVar->mustHaveReg()); | |
| 2345 for (SizeT I = 0; I < NumCases; ++I) { | |
| 2346 Operand *Value = Ctx->getConstantInt32(Instr->getValue(I)); | |
| 2347 CfgNode *TargetTrue = Instr->getLabel(I); | |
| 2348 CfgNode *NoTargetFlase = nullptr; | |
|
Jim Stichnoth
2016/08/30 13:20:36
s/Flase/False/
also, use "static constexpr" or "c
jaydeep.patil
2016/08/31 04:10:23
Done.
| |
| 2349 Value = legalize(Value, Legal_Reg); | |
| 2350 _br(NoTargetFlase, TargetTrue, SrcVar, Value, CondMIPS32::Cond::EQ); | |
| 2351 } | |
| 2352 _br(Instr->getLabelDefault()); | |
| 2322 } | 2353 } |
| 2323 | 2354 |
| 2324 void TargetMIPS32::lowerBreakpoint(const InstBreakpoint *Instr) { | 2355 void TargetMIPS32::lowerBreakpoint(const InstBreakpoint *Instr) { |
| 2325 UnimplementedLoweringError(this, Instr); | 2356 UnimplementedLoweringError(this, Instr); |
| 2326 } | 2357 } |
| 2327 | 2358 |
| 2328 void TargetMIPS32::lowerUnreachable(const InstUnreachable *Instr) { | 2359 void TargetMIPS32::lowerUnreachable(const InstUnreachable *Instr) { |
| 2329 UnimplementedLoweringError(this, Instr); | 2360 UnimplementedLoweringError(this, Instr); |
| 2330 } | 2361 } |
| 2331 | 2362 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2574 Str << "\t.set\t" | 2605 Str << "\t.set\t" |
| 2575 << "nomips16\n"; | 2606 << "nomips16\n"; |
| 2576 } | 2607 } |
| 2577 | 2608 |
| 2578 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM]; | 2609 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM]; |
| 2579 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; | 2610 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; |
| 2580 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM]; | 2611 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM]; |
| 2581 | 2612 |
| 2582 } // end of namespace MIPS32 | 2613 } // end of namespace MIPS32 |
| 2583 } // end of namespace Ice | 2614 } // end of namespace Ice |
| OLD | NEW |