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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 452 |
453 // Ensure that a 64-bit Variable has been split into 2 32-bit | 453 // Ensure that a 64-bit Variable has been split into 2 32-bit |
454 // Variables, creating them if necessary. This is needed for all | 454 // Variables, creating them if necessary. This is needed for all |
455 // I64 operations. | 455 // I64 operations. |
456 void split64(Variable *Var); | 456 void split64(Variable *Var); |
457 Operand *loOperand(Operand *Operand); | 457 Operand *loOperand(Operand *Operand); |
458 Operand *hiOperand(Operand *Operand); | 458 Operand *hiOperand(Operand *Operand); |
459 | 459 |
460 Operand *legalizeUndef(Operand *From, RegNumT RegNum = RegNumT()); | 460 Operand *legalizeUndef(Operand *From, RegNumT RegNum = RegNumT()); |
461 | 461 |
| 462 /// Helper class that understands the Calling Convention and register |
| 463 /// assignments as per MIPS O32 abi. |
| 464 class CallingConv { |
| 465 CallingConv(const CallingConv &) = delete; |
| 466 CallingConv &operator=(const CallingConv &) = delete; |
| 467 |
| 468 public: |
| 469 CallingConv(); |
| 470 ~CallingConv() = default; |
| 471 |
| 472 /// argInReg returns true if there is a Register available for the requested |
| 473 /// type, and false otherwise. If it returns true, Reg is set to the |
| 474 /// appropriate register number. Note that, when Ty == IceType_i64, Reg will |
| 475 /// be an I64 register pair. |
| 476 bool argInReg(Type Ty, uint32_t ArgNo, RegNumT *Reg); |
| 477 |
| 478 private: |
| 479 // argInGPR is used to find if any GPR register is available for argument of |
| 480 // type Ty |
| 481 bool argInGPR(Type Ty, RegNumT *Reg); |
| 482 /// argInVFP is to floating-point/vector types what argInGPR is for integer |
| 483 /// types. |
| 484 bool argInVFP(Type Ty, RegNumT *Reg); |
| 485 inline void discardNextGPRAndItsAliases(CfgVector<RegNumT> *Regs); |
| 486 void discardUnavailableGPRsAndTheirAliases(CfgVector<RegNumT> *Regs); |
| 487 SmallBitVector GPRegsUsed; |
| 488 CfgVector<RegNumT> GPRArgs; |
| 489 CfgVector<RegNumT> I64Args; |
| 490 |
| 491 void discardUnavailableVFPRegsAndTheirAliases(CfgVector<RegNumT> *Regs); |
| 492 SmallBitVector VFPRegsUsed; |
| 493 CfgVector<RegNumT> FP32Args; |
| 494 CfgVector<RegNumT> FP64Args; |
| 495 // UseFPRegs is a flag indicating if FP registers can be used |
| 496 bool UseFPRegs = false; |
| 497 }; |
| 498 |
462 protected: | 499 protected: |
463 explicit TargetMIPS32(Cfg *Func); | 500 explicit TargetMIPS32(Cfg *Func); |
464 | 501 |
465 void postLower() override; | 502 void postLower() override; |
466 | 503 |
467 void lowerAlloca(const InstAlloca *Instr) override; | 504 void lowerAlloca(const InstAlloca *Instr) override; |
468 void lowerArithmetic(const InstArithmetic *Instr) override; | 505 void lowerArithmetic(const InstArithmetic *Instr) override; |
469 void lowerInt64Arithmetic(const InstArithmetic *Instr, Variable *Dest, | 506 void lowerInt64Arithmetic(const InstArithmetic *Instr, Variable *Dest, |
470 Operand *Src0, Operand *Src1); | 507 Operand *Src0, Operand *Src1); |
471 void lowerAssign(const InstAssign *Instr) override; | 508 void lowerAssign(const InstAssign *Instr) override; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 explicit TargetHeaderMIPS32(GlobalContext *Ctx); | 654 explicit TargetHeaderMIPS32(GlobalContext *Ctx); |
618 | 655 |
619 private: | 656 private: |
620 ~TargetHeaderMIPS32() = default; | 657 ~TargetHeaderMIPS32() = default; |
621 }; | 658 }; |
622 | 659 |
623 } // end of namespace MIPS32 | 660 } // end of namespace MIPS32 |
624 } // end of namespace Ice | 661 } // end of namespace Ice |
625 | 662 |
626 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H | 663 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H |
OLD | NEW |