| 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 20 matching lines...) Expand all Loading... |
| 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 if (auto *ConstDouble = llvm::dyn_cast<ConstantDouble>(C)) { | 38 if (auto *ConstDouble = llvm::dyn_cast<ConstantDouble>(C)) { |
| 39 return !Utils::isPositiveZero(ConstDouble->getValue()); | 39 return !Utils::isPositiveZero(ConstDouble->getValue()); |
| 40 } | 40 } |
| 41 if (llvm::isa<ConstantFloat>(C)) | 41 if (auto *ConstFloat = llvm::dyn_cast<ConstantFloat>(C)) { |
| 42 return true; | 42 return !Utils::isPositiveZero(ConstFloat->getValue()); |
| 43 } |
| 43 return false; | 44 return false; |
| 44 } | 45 } |
| 45 static std::unique_ptr<::Ice::TargetLowering> create(Cfg *Func) { | 46 static std::unique_ptr<::Ice::TargetLowering> create(Cfg *Func) { |
| 46 return makeUnique<TargetMIPS32>(Func); | 47 return makeUnique<TargetMIPS32>(Func); |
| 47 } | 48 } |
| 48 | 49 |
| 49 std::unique_ptr<::Ice::Assembler> createAssembler() const override { | 50 std::unique_ptr<::Ice::Assembler> createAssembler() const override { |
| 50 return makeUnique<MIPS32::AssemblerMIPS32>(); | 51 return makeUnique<MIPS32::AssemblerMIPS32>(); |
| 51 } | 52 } |
| 52 | 53 |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 void lowerGlobals(const VariableDeclarationList &Vars, | 818 void lowerGlobals(const VariableDeclarationList &Vars, |
| 818 const std::string &SectionSuffix) override; | 819 const std::string &SectionSuffix) override; |
| 819 void lowerConstants() override; | 820 void lowerConstants() override; |
| 820 void lowerJumpTables() override; | 821 void lowerJumpTables() override; |
| 821 | 822 |
| 822 protected: | 823 protected: |
| 823 explicit TargetDataMIPS32(GlobalContext *Ctx); | 824 explicit TargetDataMIPS32(GlobalContext *Ctx); |
| 824 | 825 |
| 825 private: | 826 private: |
| 826 ~TargetDataMIPS32() override = default; | 827 ~TargetDataMIPS32() override = default; |
| 827 template <typename T> static void emitConstantPool(GlobalContext *Ctx); | |
| 828 }; | 828 }; |
| 829 | 829 |
| 830 class TargetHeaderMIPS32 final : public TargetHeaderLowering { | 830 class TargetHeaderMIPS32 final : public TargetHeaderLowering { |
| 831 TargetHeaderMIPS32() = delete; | 831 TargetHeaderMIPS32() = delete; |
| 832 TargetHeaderMIPS32(const TargetHeaderMIPS32 &) = delete; | 832 TargetHeaderMIPS32(const TargetHeaderMIPS32 &) = delete; |
| 833 TargetHeaderMIPS32 &operator=(const TargetHeaderMIPS32 &) = delete; | 833 TargetHeaderMIPS32 &operator=(const TargetHeaderMIPS32 &) = delete; |
| 834 | 834 |
| 835 public: | 835 public: |
| 836 static std::unique_ptr<TargetHeaderLowering> create(GlobalContext *Ctx) { | 836 static std::unique_ptr<TargetHeaderLowering> create(GlobalContext *Ctx) { |
| 837 return std::unique_ptr<TargetHeaderLowering>(new TargetHeaderMIPS32(Ctx)); | 837 return std::unique_ptr<TargetHeaderLowering>(new TargetHeaderMIPS32(Ctx)); |
| 838 } | 838 } |
| 839 | 839 |
| 840 void lower() override; | 840 void lower() override; |
| 841 | 841 |
| 842 protected: | 842 protected: |
| 843 explicit TargetHeaderMIPS32(GlobalContext *Ctx); | 843 explicit TargetHeaderMIPS32(GlobalContext *Ctx); |
| 844 | 844 |
| 845 private: | 845 private: |
| 846 ~TargetHeaderMIPS32() = default; | 846 ~TargetHeaderMIPS32() = default; |
| 847 }; | 847 }; |
| 848 | 848 |
| 849 } // end of namespace MIPS32 | 849 } // end of namespace MIPS32 |
| 850 } // end of namespace Ice | 850 } // end of namespace Ice |
| 851 | 851 |
| 852 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H | 852 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H |
| OLD | NEW |