| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 llvm::report_fatal_error("Not yet implemented"); | 130 llvm::report_fatal_error("Not yet implemented"); |
| 131 } | 131 } |
| 132 | 132 |
| 133 // The following are helpers that insert lowered MIPS32 instructions with | 133 // The following are helpers that insert lowered MIPS32 instructions with |
| 134 // minimal syntactic overhead, so that the lowering code can look as close to | 134 // minimal syntactic overhead, so that the lowering code can look as close to |
| 135 // assembly as practical. | 135 // assembly as practical. |
| 136 void _add(Variable *Dest, Variable *Src0, Variable *Src1) { | 136 void _add(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 137 Context.insert<InstMIPS32Add>(Dest, Src0, Src1); | 137 Context.insert<InstMIPS32Add>(Dest, Src0, Src1); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void _addu(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 141 Context.insert<InstMIPS32Addu>(Dest, Src0, Src1); |
| 142 } |
| 143 |
| 140 void _and(Variable *Dest, Variable *Src0, Variable *Src1) { | 144 void _and(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 141 Context.insert<InstMIPS32And>(Dest, Src0, Src1); | 145 Context.insert<InstMIPS32And>(Dest, Src0, Src1); |
| 142 } | 146 } |
| 143 | 147 |
| 144 void _ret(Variable *RA, Variable *Src0 = nullptr) { | 148 void _ret(Variable *RA, Variable *Src0 = nullptr) { |
| 145 Context.insert<InstMIPS32Ret>(RA, Src0); | 149 Context.insert<InstMIPS32Ret>(RA, Src0); |
| 146 } | 150 } |
| 147 | 151 |
| 148 void _addiu(Variable *Dest, Variable *Src, uint32_t Imm) { | 152 void _addiu(Variable *Dest, Variable *Src, uint32_t Imm) { |
| 149 Context.insert<InstMIPS32Addiu>(Dest, Src, Imm); | 153 Context.insert<InstMIPS32Addiu>(Dest, Src, Imm); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 178 } | 182 } |
| 179 | 183 |
| 180 void _ori(Variable *Dest, Variable *Src, uint32_t Imm) { | 184 void _ori(Variable *Dest, Variable *Src, uint32_t Imm) { |
| 181 Context.insert<InstMIPS32Ori>(Dest, Src, Imm); | 185 Context.insert<InstMIPS32Ori>(Dest, Src, Imm); |
| 182 } | 186 } |
| 183 | 187 |
| 184 void _sub(Variable *Dest, Variable *Src0, Variable *Src1) { | 188 void _sub(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 185 Context.insert<InstMIPS32Sub>(Dest, Src0, Src1); | 189 Context.insert<InstMIPS32Sub>(Dest, Src0, Src1); |
| 186 } | 190 } |
| 187 | 191 |
| 192 void _sltu(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 193 Context.insert<InstMIPS32Sltu>(Dest, Src0, Src1); |
| 194 } |
| 195 |
| 196 void _subu(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 197 Context.insert<InstMIPS32Subu>(Dest, Src0, Src1); |
| 198 } |
| 199 |
| 188 void _xor(Variable *Dest, Variable *Src0, Variable *Src1) { | 200 void _xor(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 189 Context.insert<InstMIPS32Xor>(Dest, Src0, Src1); | 201 Context.insert<InstMIPS32Xor>(Dest, Src0, Src1); |
| 190 } | 202 } |
| 191 | 203 |
| 192 void lowerArguments() override; | 204 void lowerArguments() override; |
| 193 | 205 |
| 194 /// Operand legalization helpers. To deal with address mode constraints, | 206 /// Operand legalization helpers. To deal with address mode constraints, |
| 195 /// the helpers will create a new Operand and emit instructions that | 207 /// the helpers will create a new Operand and emit instructions that |
| 196 /// guarantee that the Operand kind is one of those indicated by the | 208 /// guarantee that the Operand kind is one of those indicated by the |
| 197 /// LegalMask (a bitmask of allowed kinds). If the input Operand is known | 209 /// LegalMask (a bitmask of allowed kinds). If the input Operand is known |
| (...skipping 30 matching lines...) Expand all Loading... |
| 228 | 240 |
| 229 Operand *legalizeUndef(Operand *From, int32_t RegNum = Variable::NoRegister); | 241 Operand *legalizeUndef(Operand *From, int32_t RegNum = Variable::NoRegister); |
| 230 | 242 |
| 231 protected: | 243 protected: |
| 232 explicit TargetMIPS32(Cfg *Func); | 244 explicit TargetMIPS32(Cfg *Func); |
| 233 | 245 |
| 234 void postLower() override; | 246 void postLower() override; |
| 235 | 247 |
| 236 void lowerAlloca(const InstAlloca *Inst) override; | 248 void lowerAlloca(const InstAlloca *Inst) override; |
| 237 void lowerArithmetic(const InstArithmetic *Inst) override; | 249 void lowerArithmetic(const InstArithmetic *Inst) override; |
| 250 void lowerInt64Arithmetic(const InstArithmetic *Inst, Variable *Dest, |
| 251 Operand *Src0, Operand *Src1); |
| 238 void lowerAssign(const InstAssign *Inst) override; | 252 void lowerAssign(const InstAssign *Inst) override; |
| 239 void lowerBr(const InstBr *Inst) override; | 253 void lowerBr(const InstBr *Inst) override; |
| 240 void lowerCall(const InstCall *Inst) override; | 254 void lowerCall(const InstCall *Inst) override; |
| 241 void lowerCast(const InstCast *Inst) override; | 255 void lowerCast(const InstCast *Inst) override; |
| 242 void lowerExtractElement(const InstExtractElement *Inst) override; | 256 void lowerExtractElement(const InstExtractElement *Inst) override; |
| 243 void lowerFcmp(const InstFcmp *Inst) override; | 257 void lowerFcmp(const InstFcmp *Inst) override; |
| 244 void lowerIcmp(const InstIcmp *Inst) override; | 258 void lowerIcmp(const InstIcmp *Inst) override; |
| 245 void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override; | 259 void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override; |
| 246 void lowerInsertElement(const InstInsertElement *Inst) override; | 260 void lowerInsertElement(const InstInsertElement *Inst) override; |
| 247 void lowerLoad(const InstLoad *Inst) override; | 261 void lowerLoad(const InstLoad *Inst) override; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 explicit TargetHeaderMIPS32(GlobalContext *Ctx); | 331 explicit TargetHeaderMIPS32(GlobalContext *Ctx); |
| 318 | 332 |
| 319 private: | 333 private: |
| 320 ~TargetHeaderMIPS32() = default; | 334 ~TargetHeaderMIPS32() = default; |
| 321 }; | 335 }; |
| 322 | 336 |
| 323 } // end of namespace MIPS32 | 337 } // end of namespace MIPS32 |
| 324 } // end of namespace Ice | 338 } // end of namespace Ice |
| 325 | 339 |
| 326 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H | 340 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H |
| OLD | NEW |