21 cl::desc(
"MIPS: Emit R_{MICRO}MIPS_JALR relocation with jalr"),
25 cl::desc(
"MIPS: Don't trap on integer division by zero."),
29static constexpr MCPhysReg O32IntRegs[] = {Mips::A0, Mips::A1, Mips::A2,
31static constexpr MCPhysReg NABIIntRegs[] = {Mips::A0, Mips::A1, Mips::A2,
32 Mips::A3, Mips::T0, Mips::T1,
34static constexpr MCPhysReg Mips64IntRegs[] = {
35 Mips::A0_64, Mips::A1_64, Mips::A2_64, Mips::A3_64,
36 Mips::T0_64, Mips::T1_64, Mips::T2_64, Mips::T3_64};
43static constexpr GPR OABITempRegs[] = {
44 {Mips::T0, Mips::T0_64}, {Mips::T1, Mips::T1_64}, {Mips::T2, Mips::T2_64},
45 {Mips::T3, Mips::T3_64}, {Mips::T4, Mips::T4_64}, {Mips::T5, Mips::T5_64},
46 {Mips::T6, Mips::T6_64}, {Mips::T7, Mips::T7_64}, {Mips::T8, Mips::T8_64},
47 {Mips::T9, Mips::T9_64},
50static constexpr GPR NABITempRegs[] = {
51 {Mips::T4, Mips::T4_64},
52 {Mips::T5, Mips::T5_64},
53 {Mips::T6, Mips::T6_64},
54 {Mips::T7, Mips::T7_64},
55 {Mips::NoRegister, Mips::NoRegister},
56 {Mips::NoRegister, Mips::NoRegister},
57 {Mips::NoRegister, Mips::NoRegister},
58 {Mips::NoRegister, Mips::NoRegister},
59 {Mips::T8, Mips::T8_64},
60 {Mips::T9, Mips::T9_64},
63static constexpr GPR PABITempRegs[] = {
64 {Mips::T4, Mips::T4_64},
65 {Mips::T5, Mips::T5_64},
66 {Mips::T6, Mips::T6_64},
67 {Mips::T7, Mips::T7_64},
68 {Mips::V0, Mips::V0_64},
69 {Mips::V1, Mips::V1_64},
70 {Mips::NoRegister, Mips::NoRegister},
71 {Mips::NoRegister, Mips::NoRegister},
72 {Mips::T8, Mips::T8_64},
73 {Mips::T9, Mips::T9_64},
76static constexpr GPR SavedRegs[] = {
77 {Mips::S0, Mips::S0_64}, {Mips::S1, Mips::S1_64}, {Mips::S2, Mips::S2_64},
78 {Mips::S3, Mips::S3_64}, {Mips::S4, Mips::S4_64}, {Mips::S5, Mips::S5_64},
79 {Mips::S6, Mips::S6_64}, {Mips::S7, Mips::S7_64},
82static constexpr GPR ReturnRegs[] = {
83 {Mips::V0, Mips::V0_64},
84 {Mips::V1, Mips::V1_64},
88 assert(
I < Regs.
size() &&
"Invalid ABI register index");
90 assert(
Reg &&
"Register name is not defined by this ABI");
109 return Mips::OABIRegAltName;
112 return Mips::NABIRegAltName;
121 assert(
I < Regs.
size() &&
"Invalid argument register");
127 case Mips::OABIRegAltName:
128 return getReg(OABITempRegs,
I, Is64Bit);
129 case Mips::NABIRegAltName:
130 return getReg(NABITempRegs,
I, Is64Bit);
131 case Mips::PABIRegAltName:
132 return getReg(PABITempRegs,
I, Is64Bit);
140 return getReg(SavedRegs,
I, Is64Bit);
148 return getReg(ReturnRegs,
I, Is64Bit);
184 assert(ABIName.
empty() &&
"Unknown ABI option for MIPS");
234 assert(
I < 4 &&
"Invalid EH data register");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
cl::opt< bool > EmitJalrReloc("mips-jalr-reloc", cl::Hidden, cl::desc("MIPS: Emit R_{MICRO}MIPS_JALR relocation with jalr"), cl::init(true))
cl::opt< bool > NoZeroDivCheck("mno-check-zero-division", cl::Hidden, cl::desc("MIPS: Don't trap on integer division by zero."), cl::init(false))
static MCRegister getReg(const MCDisassembler *D, unsigned RC, unsigned RegNo)
Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
Get the array size.
Wrapper class representing physical registers. Should be passed by value.
bool AreGprs64bit() const
unsigned GetGlobalPtr() const
unsigned GetEhDataReg(unsigned I) const
bool ArePtrs64bit() const
unsigned GetGPRMoveOp() const
MCRegister getArgReg(unsigned I, bool Is64Bit) const
ABI register accessors default to the ABI's GPR width.
unsigned GetStackPtr() const
unsigned GetZeroReg() const
unsigned GetCalleeAllocdArgSizeInBytes(CallingConv::ID CC) const
Obtain the size of the area allocated by the callee for arguments.
unsigned GetPtrAddiuOp() const
unsigned GetPtrAndOp() const
unsigned GetFramePtr() const
unsigned getRegAltNameIndex() const
Register naming convention for this ABI.
static MipsABIInfo computeTargetABI(const Triple &TT, StringRef ABIName)
ArrayRef< MCPhysReg > GetByValArgRegs() const
The registers to use for byval arguments.
unsigned GetNullPtr() const
ArrayRef< MCPhysReg > getVarArgRegs(bool isGP64bit) const
The registers to use for the variable argument list.
unsigned GetPtrAdduOp() const
MCRegister getReturnReg(unsigned I, bool Is64Bit) const
Integer return-value registers.
MCRegister getSavedReg(unsigned I, bool Is64Bit) const
unsigned GetBasePtr() const
unsigned GetPtrSubuOp() const
MCRegister getSavedRegPtr(unsigned I) const
MCRegister getTempReg(unsigned I, bool Is64Bit) const
I is the suffix in tI (NABI has t0-t3 and t8-t9).
ArrayRef< MCPhysReg > getArgRegs(bool Is64Bit) const
Integer argument registers in calling-convention order.
MCRegister getArgRegPtr(unsigned I) const
Represent a constant reference to a string, i.e.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
constexpr bool empty() const
Check if the string is empty.
Triple - Helper class for working with autoconf configuration names.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ Fast
Attempts to make calls as fast as possible (e.g.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
ArrayRef(const T &OneElt) -> ArrayRef< T >