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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 // Ensure that a 64-bit Variable has been split into 2 32-bit | 391 // Ensure that a 64-bit Variable has been split into 2 32-bit |
392 // Variables, creating them if necessary. This is needed for all | 392 // Variables, creating them if necessary. This is needed for all |
393 // I64 operations. | 393 // I64 operations. |
394 void split64(Variable *Var); | 394 void split64(Variable *Var); |
395 Operand *loOperand(Operand *Operand); | 395 Operand *loOperand(Operand *Operand); |
396 Operand *hiOperand(Operand *Operand); | 396 Operand *hiOperand(Operand *Operand); |
397 | 397 |
398 Operand *legalizeUndef(Operand *From, RegNumT RegNum = RegNumT()); | 398 Operand *legalizeUndef(Operand *From, RegNumT RegNum = RegNumT()); |
399 | 399 |
| 400 /// Helper class that understands the Calling Convention and register |
| 401 /// assignments. |
| 402 class CallingConv { |
| 403 CallingConv(const CallingConv &) = delete; |
| 404 CallingConv &operator=(const CallingConv &) = delete; |
| 405 |
| 406 public: |
| 407 CallingConv(); |
| 408 ~CallingConv() = default; |
| 409 |
| 410 /// argInGPR returns true if there is a GPR available for the requested |
| 411 /// type, and false otherwise. If it returns true, Reg is set to the |
| 412 /// appropriate register number. Note that, when Ty == IceType_i64, Reg will |
| 413 /// be an I64 register pair. |
| 414 bool argInGPR(Type Ty, RegNumT *Reg); |
| 415 |
| 416 private: |
| 417 void discardUnavailableGPRsAndTheirAliases(CfgVector<RegNumT> *Regs); |
| 418 SmallBitVector GPRegsUsed; |
| 419 CfgVector<RegNumT> GPRArgs; |
| 420 CfgVector<RegNumT> I64Args; |
| 421 }; |
| 422 |
400 protected: | 423 protected: |
401 explicit TargetMIPS32(Cfg *Func); | 424 explicit TargetMIPS32(Cfg *Func); |
402 | 425 |
403 void postLower() override; | 426 void postLower() override; |
404 | 427 |
405 void lowerAlloca(const InstAlloca *Instr) override; | 428 void lowerAlloca(const InstAlloca *Instr) override; |
406 void lowerArithmetic(const InstArithmetic *Instr) override; | 429 void lowerArithmetic(const InstArithmetic *Instr) override; |
407 void lowerInt64Arithmetic(const InstArithmetic *Instr, Variable *Dest, | 430 void lowerInt64Arithmetic(const InstArithmetic *Instr, Variable *Dest, |
408 Operand *Src0, Operand *Src1); | 431 Operand *Src0, Operand *Src1); |
409 void lowerAssign(const InstAssign *Instr) override; | 432 void lowerAssign(const InstAssign *Instr) override; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 explicit TargetHeaderMIPS32(GlobalContext *Ctx); | 576 explicit TargetHeaderMIPS32(GlobalContext *Ctx); |
554 | 577 |
555 private: | 578 private: |
556 ~TargetHeaderMIPS32() = default; | 579 ~TargetHeaderMIPS32() = default; |
557 }; | 580 }; |
558 | 581 |
559 } // end of namespace MIPS32 | 582 } // end of namespace MIPS32 |
560 } // end of namespace Ice | 583 } // end of namespace Ice |
561 | 584 |
562 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H | 585 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H |
OLD | NEW |