| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 lowering ---*- C++-*-===// | 1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 lowering ---*- C++-*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class TargetMIPS32 : public TargetLowering { | 28 class TargetMIPS32 : public TargetLowering { |
| 29 TargetMIPS32() = delete; | 29 TargetMIPS32() = delete; |
| 30 TargetMIPS32(const TargetMIPS32 &) = delete; | 30 TargetMIPS32(const TargetMIPS32 &) = delete; |
| 31 TargetMIPS32 &operator=(const TargetMIPS32 &) = delete; | 31 TargetMIPS32 &operator=(const TargetMIPS32 &) = delete; |
| 32 | 32 |
| 33 public: | 33 public: |
| 34 ~TargetMIPS32() override = default; | 34 ~TargetMIPS32() override = default; |
| 35 | 35 |
| 36 static void staticInit(GlobalContext *Ctx); | 36 static void staticInit(GlobalContext *Ctx); |
| 37 static bool shouldBePooled(const Constant *C) { | 37 static bool shouldBePooled(const Constant *C) { |
| 38 (void)C; | 38 if (auto *ConstDouble = llvm::dyn_cast<ConstantDouble>(C)) { |
| 39 return !Utils::isPositiveZero(ConstDouble->getValue()); |
| 40 } |
| 41 if (llvm::isa<ConstantFloat>(C)) |
| 42 return true; |
| 39 return false; | 43 return false; |
| 40 } | 44 } |
| 41 static std::unique_ptr<::Ice::TargetLowering> create(Cfg *Func) { | 45 static std::unique_ptr<::Ice::TargetLowering> create(Cfg *Func) { |
| 42 return makeUnique<TargetMIPS32>(Func); | 46 return makeUnique<TargetMIPS32>(Func); |
| 43 } | 47 } |
| 44 | 48 |
| 45 std::unique_ptr<::Ice::Assembler> createAssembler() const override { | 49 std::unique_ptr<::Ice::Assembler> createAssembler() const override { |
| 46 return makeUnique<MIPS32::AssemblerMIPS32>(); | 50 return makeUnique<MIPS32::AssemblerMIPS32>(); |
| 47 } | 51 } |
| 48 | 52 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 } | 227 } |
| 224 | 228 |
| 225 void _div_s(Variable *Dest, Variable *Src0, Variable *Src1) { | 229 void _div_s(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 226 Context.insert<InstMIPS32Div_s>(Dest, Src0, Src1); | 230 Context.insert<InstMIPS32Div_s>(Dest, Src0, Src1); |
| 227 } | 231 } |
| 228 | 232 |
| 229 void _divu(Variable *Dest, Variable *Src0, Variable *Src1) { | 233 void _divu(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 230 Context.insert<InstMIPS32Divu>(Dest, Src0, Src1); | 234 Context.insert<InstMIPS32Divu>(Dest, Src0, Src1); |
| 231 } | 235 } |
| 232 | 236 |
| 233 void _ldc1(Variable *Value, OperandMIPS32Mem *Mem) { | 237 void _ldc1(Variable *Value, OperandMIPS32Mem *Mem, RelocOp Reloc = RO_No) { |
| 234 Context.insert<InstMIPS32Ldc1>(Value, Mem); | 238 Context.insert<InstMIPS32Ldc1>(Value, Mem, Reloc); |
| 235 } | 239 } |
| 236 | 240 |
| 237 void _lw(Variable *Value, OperandMIPS32Mem *Mem) { | 241 void _lw(Variable *Value, OperandMIPS32Mem *Mem) { |
| 238 Context.insert<InstMIPS32Lw>(Value, Mem); | 242 Context.insert<InstMIPS32Lw>(Value, Mem); |
| 239 } | 243 } |
| 240 | 244 |
| 241 void _lwc1(Variable *Value, OperandMIPS32Mem *Mem) { | 245 void _lwc1(Variable *Value, OperandMIPS32Mem *Mem, RelocOp Reloc = RO_No) { |
| 242 Context.insert<InstMIPS32Lwc1>(Value, Mem); | 246 Context.insert<InstMIPS32Lwc1>(Value, Mem, Reloc); |
| 243 } | 247 } |
| 244 | 248 |
| 245 void _lui(Variable *Dest, uint32_t Imm) { | 249 void _lui(Variable *Dest, Operand *Src, RelocOp Reloc = RO_No) { |
| 246 Context.insert<InstMIPS32Lui>(Dest, Imm); | 250 Context.insert<InstMIPS32Lui>(Dest, Src, Reloc); |
| 247 } | 251 } |
| 248 | 252 |
| 249 void _mov(Variable *Dest, Operand *Src0) { | 253 void _mov(Variable *Dest, Operand *Src0) { |
| 250 assert(Dest != nullptr); | 254 assert(Dest != nullptr); |
| 251 // Variable* Src0_ = llvm::dyn_cast<Variable>(Src0); | 255 // Variable* Src0_ = llvm::dyn_cast<Variable>(Src0); |
| 252 if (llvm::isa<ConstantRelocatable>(Src0)) { | 256 if (llvm::isa<ConstantRelocatable>(Src0)) { |
| 253 Context.insert<InstMIPS32La>(Dest, Src0); | 257 Context.insert<InstMIPS32La>(Dest, Src0); |
| 254 } else { | 258 } else { |
| 255 auto *Instr = Context.insert<InstMIPS32Mov>(Dest, Src0); | 259 auto *Instr = Context.insert<InstMIPS32Mov>(Dest, Src0); |
| 256 if (Instr->isMultiDest()) { | 260 if (Instr->isMultiDest()) { |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 explicit TargetHeaderMIPS32(GlobalContext *Ctx); | 681 explicit TargetHeaderMIPS32(GlobalContext *Ctx); |
| 678 | 682 |
| 679 private: | 683 private: |
| 680 ~TargetHeaderMIPS32() = default; | 684 ~TargetHeaderMIPS32() = default; |
| 681 }; | 685 }; |
| 682 | 686 |
| 683 } // end of namespace MIPS32 | 687 } // end of namespace MIPS32 |
| 684 } // end of namespace Ice | 688 } // end of namespace Ice |
| 685 | 689 |
| 686 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H | 690 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H |
| OLD | NEW |