OLD | NEW |
1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 lowering ----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 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 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 /// available registers can be split between the registers and the stack. | 1039 /// available registers can be split between the registers and the stack. |
1040 /// However, this is typically for passing GPR structs by value, and PNaCl | 1040 /// However, this is typically for passing GPR structs by value, and PNaCl |
1041 /// transforms expand this out. | 1041 /// transforms expand this out. |
1042 /// | 1042 /// |
1043 /// At (public) function entry, the stack must be 8-byte aligned. | 1043 /// At (public) function entry, the stack must be 8-byte aligned. |
1044 class CallingConv { | 1044 class CallingConv { |
1045 CallingConv(const CallingConv &) = delete; | 1045 CallingConv(const CallingConv &) = delete; |
1046 CallingConv &operator=(const CallingConv &) = delete; | 1046 CallingConv &operator=(const CallingConv &) = delete; |
1047 | 1047 |
1048 public: | 1048 public: |
1049 CallingConv() | 1049 CallingConv(); |
1050 : VFPRegsFree(ARM32_MAX_FP_REG_UNITS, true), | |
1051 ValidF64Regs(ARM32_MAX_FP_REG_UNITS), | |
1052 ValidV128Regs(ARM32_MAX_FP_REG_UNITS) { | |
1053 for (uint32_t i = 0; i < ARM32_MAX_FP_REG_UNITS; ++i) { | |
1054 if ((i % 2) == 0) { | |
1055 ValidF64Regs[i] = true; | |
1056 } | |
1057 if ((i % 4) == 0) { | |
1058 ValidV128Regs[i] = true; | |
1059 } | |
1060 } | |
1061 } | |
1062 ~CallingConv() = default; | 1050 ~CallingConv() = default; |
1063 | 1051 |
1064 bool I64InRegs(std::pair<int32_t, int32_t> *Regs); | 1052 /// argInGPR returns true if there is a GPR available for the requested |
1065 bool I32InReg(int32_t *Reg); | 1053 /// type, and false otherwise. If it returns true, Reg is set to the |
1066 bool FPInReg(Type Ty, int32_t *Reg); | 1054 /// appropriate register number. Note that, when Ty == IceType_i64, Reg will |
| 1055 /// be an I64 register pair. |
| 1056 bool argInGPR(Type Ty, int32_t *Reg); |
1067 | 1057 |
1068 static constexpr uint32_t ARM32_MAX_GPR_ARG = 4; | 1058 /// argInVFP is to floating-point/vector types what argInGPR is for integer |
1069 // TODO(jpp): comment. | 1059 /// types. |
1070 static constexpr uint32_t ARM32_MAX_FP_REG_UNITS = 16; | 1060 bool argInVFP(Type Ty, int32_t *Reg); |
1071 | 1061 |
1072 private: | 1062 private: |
1073 uint32_t NumGPRRegsUsed = 0; | 1063 void discardUnavailableGPRsAndTheirAliases(CfgVector<SizeT> *Regs); |
1074 llvm::SmallBitVector VFPRegsFree; | 1064 llvm::SmallBitVector GPRegsUsed; |
1075 llvm::SmallBitVector ValidF64Regs; | 1065 CfgVector<SizeT> GPRArgs; |
1076 llvm::SmallBitVector ValidV128Regs; | 1066 CfgVector<SizeT> I64Args; |
| 1067 |
| 1068 void discardUnavailableVFPRegs(CfgVector<SizeT> *Regs); |
| 1069 llvm::SmallBitVector VFPRegsUsed; |
| 1070 CfgVector<SizeT> FP32Args; |
| 1071 CfgVector<SizeT> FP64Args; |
| 1072 CfgVector<SizeT> Vec128Args; |
1077 }; | 1073 }; |
1078 | 1074 |
1079 private: | 1075 private: |
1080 ~TargetARM32() override = default; | 1076 ~TargetARM32() override = default; |
1081 | 1077 |
1082 OperandARM32Mem *formAddressingMode(Type Ty, Cfg *Func, const Inst *LdSt, | 1078 OperandARM32Mem *formAddressingMode(Type Ty, Cfg *Func, const Inst *LdSt, |
1083 Operand *Base); | 1079 Operand *Base); |
1084 | 1080 |
1085 void postambleCtpop64(const InstCall *Instr); | 1081 void postambleCtpop64(const InstCall *Instr); |
1086 void preambleDivRem(const InstCall *Instr); | 1082 void preambleDivRem(const InstCall *Instr); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 | 1209 |
1214 private: | 1210 private: |
1215 ~TargetHeaderARM32() = default; | 1211 ~TargetHeaderARM32() = default; |
1216 | 1212 |
1217 TargetARM32Features CPUFeatures; | 1213 TargetARM32Features CPUFeatures; |
1218 }; | 1214 }; |
1219 | 1215 |
1220 } // end of namespace Ice | 1216 } // end of namespace Ice |
1221 | 1217 |
1222 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H | 1218 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H |
OLD | NEW |