LLVM 24.0.0git
llvm::MipsABIInfo Class Reference

#include "Target/Mips/MCTargetDesc/MipsABIInfo.h"

Public Types

enum class  ABI {
  Unknown , O32 , N32 , N64 ,
  P32
}

Public Member Functions

 MipsABIInfo (ABI ThisABI)
bool IsKnown () const
bool IsO32 () const
bool IsN32 () const
bool IsN64 () const
bool IsP32 () const
ABI GetEnumValue () const
unsigned getRegAltNameIndex () const
 Register naming convention for this ABI.
ArrayRef< MCPhysReg > getArgRegs (bool Is64Bit) const
 Integer argument registers in calling-convention order.
MCRegister getArgReg (unsigned I, bool Is64Bit) const
 ABI register accessors default to the ABI's GPR width.
MCRegister getArgReg (unsigned I) const
MCRegister getArgRegPtr (unsigned I) const
MCRegister getTempReg (unsigned I, bool Is64Bit) const
 I is the suffix in tI (NABI has t0-t3 and t8-t9).
MCRegister getTempReg (unsigned I) const
MCRegister getTempRegPtr (unsigned I) const
MCRegister getSavedReg (unsigned I, bool Is64Bit) const
MCRegister getSavedReg (unsigned I) const
MCRegister getSavedRegPtr (unsigned I) const
MCRegister getReturnReg (unsigned I, bool Is64Bit) const
 Integer return-value registers.
MCRegister getReturnReg (unsigned I) const
MCRegister getReturnRegPtr (unsigned I) const
ArrayRef< MCPhysReg > GetByValArgRegs () const
 The registers to use for byval arguments.
ArrayRef< MCPhysReg > getVarArgRegs (bool isGP64bit) const
 The registers to use for the variable argument list.
unsigned GetCalleeAllocdArgSizeInBytes (CallingConv::ID CC) const
 Obtain the size of the area allocated by the callee for arguments.
bool operator< (const MipsABIInfo Other) const
 Ordering of ABI's MipsGenSubtargetInfo.inc will use this to resolve conflicts when given multiple ABI options.
unsigned GetStackPtr () const
unsigned GetFramePtr () const
unsigned GetBasePtr () const
unsigned GetGlobalPtr () const
unsigned GetNullPtr () const
unsigned GetZeroReg () const
unsigned GetPtrAdduOp () const
unsigned GetPtrAddiuOp () const
unsigned GetPtrSubuOp () const
unsigned GetPtrAndOp () const
unsigned GetGPRMoveOp () const
bool ArePtrs64bit () const
bool AreGprs64bit () const
unsigned GetEhDataReg (unsigned I) const

Static Public Member Functions

static MipsABIInfo Unknown ()
static MipsABIInfo O32 ()
static MipsABIInfo N32 ()
static MipsABIInfo N64 ()
static MipsABIInfo P32 ()
static MipsABIInfo computeTargetABI (const Triple &TT, StringRef ABIName)

Protected Attributes

ABI ThisABI

Detailed Description

Definition at line 22 of file MipsABIInfo.h.

Member Enumeration Documentation

◆ ABI

enum class llvm::MipsABIInfo::ABI
strong
Enumerator
Unknown 
O32 
N32 
N64 
P32 

Definition at line 24 of file MipsABIInfo.h.

Constructor & Destructor Documentation

◆ MipsABIInfo()

llvm::MipsABIInfo::MipsABIInfo ( ABI ThisABI)
inline

Definition at line 30 of file MipsABIInfo.h.

References ThisABI.

Referenced by computeTargetABI(), N32(), N64(), O32(), operator<(), P32(), and Unknown().

Member Function Documentation

◆ AreGprs64bit()

bool llvm::MipsABIInfo::AreGprs64bit ( ) const
inline

Definition at line 115 of file MipsABIInfo.h.

References IsN32(), and IsN64().

Referenced by getArgReg(), GetByValArgRegs(), getReturnReg(), getSavedReg(), getTempReg(), and GetZeroReg().

◆ ArePtrs64bit()

◆ computeTargetABI()

MipsABIInfo MipsABIInfo::computeTargetABI ( const Triple & TT,
StringRef ABIName )
static

◆ getArgReg() [1/2]

MCRegister llvm::MipsABIInfo::getArgReg ( unsigned I) const
inline

Definition at line 56 of file MipsABIInfo.h.

References AreGprs64bit(), getArgReg(), and I.

◆ getArgReg() [2/2]

MCRegister MipsABIInfo::getArgReg ( unsigned I,
bool Is64Bit ) const

ABI register accessors default to the ABI's GPR width.

Use the *RegPtr variants for pointer-sized values; N32 has 32-bit pointers and 64-bit GPRs.

Definition at line 121 of file MipsABIInfo.cpp.

References assert(), getArgRegs(), I, and llvm::ArrayRef< T >::size().

Referenced by getArgReg(), and getArgRegPtr().

◆ getArgRegPtr()

MCRegister llvm::MipsABIInfo::getArgRegPtr ( unsigned I) const
inline

Definition at line 59 of file MipsABIInfo.h.

References ArePtrs64bit(), getArgReg(), and I.

Referenced by GetEhDataReg().

◆ getArgRegs()

ArrayRef< MCPhysReg > MipsABIInfo::getArgRegs ( bool Is64Bit) const

Integer argument registers in calling-convention order.

Definition at line 93 of file MipsABIInfo.cpp.

References llvm::ArrayRef(), assert(), IsKnown(), IsO32(), and IsP32().

Referenced by getArgReg(), and GetByValArgRegs().

◆ GetBasePtr()

unsigned MipsABIInfo::GetBasePtr ( ) const

Definition at line 209 of file MipsABIInfo.cpp.

References getSavedRegPtr().

◆ GetByValArgRegs()

ArrayRef< MCPhysReg > MipsABIInfo::GetByValArgRegs ( ) const

The registers to use for byval arguments.

Definition at line 102 of file MipsABIInfo.cpp.

References AreGprs64bit(), and getArgRegs().

◆ GetCalleeAllocdArgSizeInBytes()

unsigned MipsABIInfo::GetCalleeAllocdArgSizeInBytes ( CallingConv::ID CC) const

Obtain the size of the area allocated by the callee for arguments.

CallingConv::FastCall affects the value for O32.

Definition at line 173 of file MipsABIInfo.cpp.

References CC, llvm::CallingConv::Fast, IsN32(), IsN64(), IsO32(), IsP32(), and llvm_unreachable.

◆ GetEhDataReg()

unsigned MipsABIInfo::GetEhDataReg ( unsigned I) const

Definition at line 243 of file MipsABIInfo.cpp.

References assert(), getArgRegPtr(), and I.

◆ GetEnumValue()

ABI llvm::MipsABIInfo::GetEnumValue ( ) const
inline

Definition at line 44 of file MipsABIInfo.h.

References ThisABI.

◆ GetFramePtr()

unsigned MipsABIInfo::GetFramePtr ( ) const

Definition at line 205 of file MipsABIInfo.cpp.

References ArePtrs64bit(), llvm::Mips::FP, and llvm::Mips::FP_64.

◆ GetGlobalPtr()

unsigned MipsABIInfo::GetGlobalPtr ( ) const

Definition at line 211 of file MipsABIInfo.cpp.

References ArePtrs64bit(), llvm::Mips::GP, and llvm::Mips::GP_64.

◆ GetGPRMoveOp()

unsigned MipsABIInfo::GetGPRMoveOp ( ) const

Definition at line 239 of file MipsABIInfo.cpp.

References ArePtrs64bit(), and IsP32().

◆ GetNullPtr()

unsigned MipsABIInfo::GetNullPtr ( ) const

Definition at line 215 of file MipsABIInfo.cpp.

References ArePtrs64bit().

◆ GetPtrAddiuOp()

unsigned MipsABIInfo::GetPtrAddiuOp ( ) const

Definition at line 227 of file MipsABIInfo.cpp.

References ArePtrs64bit(), and IsP32().

◆ GetPtrAdduOp()

unsigned MipsABIInfo::GetPtrAdduOp ( ) const

Definition at line 223 of file MipsABIInfo.cpp.

References ArePtrs64bit(), and IsP32().

◆ GetPtrAndOp()

unsigned MipsABIInfo::GetPtrAndOp ( ) const

Definition at line 235 of file MipsABIInfo.cpp.

References ArePtrs64bit(), and IsP32().

◆ GetPtrSubuOp()

unsigned MipsABIInfo::GetPtrSubuOp ( ) const

Definition at line 231 of file MipsABIInfo.cpp.

References ArePtrs64bit(), and IsP32().

◆ getRegAltNameIndex()

unsigned MipsABIInfo::getRegAltNameIndex ( ) const

Register naming convention for this ABI.

Definition at line 106 of file MipsABIInfo.cpp.

References llvm_unreachable, N32, N64, O32, P32, ThisABI, and Unknown.

Referenced by getTempReg().

◆ getReturnReg() [1/2]

MCRegister llvm::MipsABIInfo::getReturnReg ( unsigned I) const
inline

Definition at line 79 of file MipsABIInfo.h.

References AreGprs64bit(), getReturnReg(), and I.

◆ getReturnReg() [2/2]

MCRegister MipsABIInfo::getReturnReg ( unsigned I,
bool Is64Bit ) const

Integer return-value registers.

Definition at line 145 of file MipsABIInfo.cpp.

References getReg(), I, llvm_unreachable, N32, N64, O32, P32, ThisABI, and Unknown.

Referenced by getReturnReg(), and getReturnRegPtr().

◆ getReturnRegPtr()

MCRegister llvm::MipsABIInfo::getReturnRegPtr ( unsigned I) const
inline

Definition at line 82 of file MipsABIInfo.h.

References ArePtrs64bit(), getReturnReg(), and I.

◆ getSavedReg() [1/2]

MCRegister llvm::MipsABIInfo::getSavedReg ( unsigned I) const
inline

Definition at line 71 of file MipsABIInfo.h.

References AreGprs64bit(), getSavedReg(), and I.

◆ getSavedReg() [2/2]

MCRegister MipsABIInfo::getSavedReg ( unsigned I,
bool Is64Bit ) const

Definition at line 140 of file MipsABIInfo.cpp.

References assert(), getReg(), I, and IsKnown().

Referenced by getSavedReg(), and getSavedRegPtr().

◆ getSavedRegPtr()

MCRegister llvm::MipsABIInfo::getSavedRegPtr ( unsigned I) const
inline

Definition at line 74 of file MipsABIInfo.h.

References ArePtrs64bit(), getSavedReg(), and I.

Referenced by GetBasePtr().

◆ GetStackPtr()

unsigned MipsABIInfo::GetStackPtr ( ) const

Definition at line 201 of file MipsABIInfo.cpp.

References ArePtrs64bit(), llvm::Mips::SP, and llvm::Mips::SP_64.

◆ getTempReg() [1/2]

MCRegister llvm::MipsABIInfo::getTempReg ( unsigned I) const
inline

Definition at line 64 of file MipsABIInfo.h.

References AreGprs64bit(), getTempReg(), and I.

◆ getTempReg() [2/2]

MCRegister MipsABIInfo::getTempReg ( unsigned I,
bool Is64Bit ) const

I is the suffix in tI (NABI has t0-t3 and t8-t9).

Definition at line 127 of file MipsABIInfo.cpp.

References getReg(), getRegAltNameIndex(), I, and llvm_unreachable.

Referenced by getTempReg(), and getTempRegPtr().

◆ getTempRegPtr()

MCRegister llvm::MipsABIInfo::getTempRegPtr ( unsigned I) const
inline

Definition at line 67 of file MipsABIInfo.h.

References ArePtrs64bit(), getTempReg(), and I.

◆ getVarArgRegs()

ArrayRef< MCPhysReg > MipsABIInfo::getVarArgRegs ( bool isGP64bit) const

The registers to use for the variable argument list.

Definition at line 159 of file MipsABIInfo.cpp.

References llvm::ArrayRef(), IsN32(), IsN64(), IsO32(), IsP32(), and llvm_unreachable.

◆ GetZeroReg()

unsigned MipsABIInfo::GetZeroReg ( ) const

Definition at line 219 of file MipsABIInfo.cpp.

References AreGprs64bit().

◆ IsKnown()

bool llvm::MipsABIInfo::IsKnown ( ) const
inline

Definition at line 39 of file MipsABIInfo.h.

References ThisABI, and Unknown.

Referenced by getArgRegs(), and getSavedReg().

◆ IsN32()

bool llvm::MipsABIInfo::IsN32 ( ) const
inline

◆ IsN64()

bool llvm::MipsABIInfo::IsN64 ( ) const
inline

◆ IsO32()

bool llvm::MipsABIInfo::IsO32 ( ) const
inline

◆ IsP32()

bool llvm::MipsABIInfo::IsP32 ( ) const
inline

◆ N32()

MipsABIInfo llvm::MipsABIInfo::N32 ( )
inlinestatic

Definition at line 34 of file MipsABIInfo.h.

References MipsABIInfo(), and N32.

Referenced by computeTargetABI().

◆ N64()

MipsABIInfo llvm::MipsABIInfo::N64 ( )
inlinestatic

Definition at line 35 of file MipsABIInfo.h.

References MipsABIInfo(), and N64.

Referenced by computeTargetABI(), and llvm::MipsTargetELFStreamer::MipsTargetELFStreamer().

◆ O32()

MipsABIInfo llvm::MipsABIInfo::O32 ( )
inlinestatic

Definition at line 33 of file MipsABIInfo.h.

References MipsABIInfo(), and O32.

Referenced by computeTargetABI(), and llvm::MipsTargetELFStreamer::MipsTargetELFStreamer().

◆ operator<()

bool llvm::MipsABIInfo::operator< ( const MipsABIInfo Other) const
inline

Ordering of ABI's MipsGenSubtargetInfo.inc will use this to resolve conflicts when given multiple ABI options.

Definition at line 99 of file MipsABIInfo.h.

References MipsABIInfo(), llvm::Other, and ThisABI.

◆ P32()

MipsABIInfo llvm::MipsABIInfo::P32 ( )
inlinestatic

Definition at line 36 of file MipsABIInfo.h.

References MipsABIInfo(), and P32.

Referenced by computeTargetABI(), and llvm::MipsTargetELFStreamer::MipsTargetELFStreamer().

◆ Unknown()

MipsABIInfo llvm::MipsABIInfo::Unknown ( )
inlinestatic

Definition at line 32 of file MipsABIInfo.h.

References MipsABIInfo(), and Unknown.

Member Data Documentation

◆ ThisABI

ABI llvm::MipsABIInfo::ThisABI
protected

The documentation for this class was generated from the following files: