| 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 // OperandMIPS32Mem, so in that case it wouldn't need another level of | 461 // OperandMIPS32Mem, so in that case it wouldn't need another level of |
| 462 // transformation. | 462 // transformation. |
| 463 if (auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(Operand)) { | 463 if (auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(Operand)) { |
| 464 return Mem; | 464 return Mem; |
| 465 } | 465 } |
| 466 | 466 |
| 467 // If we didn't do address mode optimization, then we only have a base/offset | 467 // If we didn't do address mode optimization, then we only have a base/offset |
| 468 // to work with. MIPS always requires a base register, so just use that to | 468 // to work with. MIPS always requires a base register, so just use that to |
| 469 // hold the operand. | 469 // hold the operand. |
| 470 auto *Base = llvm::cast<Variable>(legalize(Operand, Legal_Reg)); | 470 auto *Base = llvm::cast<Variable>(legalize(Operand, Legal_Reg)); |
| 471 const int32_t Offset = Base->hasStackOffset() ? Base->getStackOffset() : 0; |
| 471 return OperandMIPS32Mem::create( | 472 return OperandMIPS32Mem::create( |
| 472 Func, Ty, Base, llvm::cast<ConstantInteger32>( | 473 Func, Ty, Base, |
| 473 Ctx->getConstantInt32(Base->getStackOffset()))); | 474 llvm::cast<ConstantInteger32>(Ctx->getConstantInt32(Offset))); |
| 474 } | 475 } |
| 475 | 476 |
| 476 void TargetMIPS32::emitVariable(const Variable *Var) const { | 477 void TargetMIPS32::emitVariable(const Variable *Var) const { |
| 477 if (!BuildDefs::dump()) | 478 if (!BuildDefs::dump()) |
| 478 return; | 479 return; |
| 479 Ostream &Str = Ctx->getStrEmit(); | 480 Ostream &Str = Ctx->getStrEmit(); |
| 480 const Type FrameSPTy = IceType_i32; | 481 const Type FrameSPTy = IceType_i32; |
| 481 if (Var->hasReg()) { | 482 if (Var->hasReg()) { |
| 482 Str << '$' << getRegName(Var->getRegNum(), Var->getType()); | 483 Str << '$' << getRegName(Var->getRegNum(), Var->getType()); |
| 483 } else { | 484 } else { |
| (...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2341 Str << "\t.set\t" | 2342 Str << "\t.set\t" |
| 2342 << "nomips16\n"; | 2343 << "nomips16\n"; |
| 2343 } | 2344 } |
| 2344 | 2345 |
| 2345 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM]; | 2346 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM]; |
| 2346 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; | 2347 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; |
| 2347 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM]; | 2348 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM]; |
| 2348 | 2349 |
| 2349 } // end of namespace MIPS32 | 2350 } // end of namespace MIPS32 |
| 2350 } // end of namespace Ice | 2351 } // end of namespace Ice |
| OLD | NEW |