43 #define GET_INSTRINFO_NAMED_OPS 44 #define GET_INSTRMAP_INFO 45 #include "AMDGPUGenInstrInfo.inc" 46 #undef GET_INSTRMAP_INFO 47 #undef GET_INSTRINFO_NAMED_OPS 52 unsigned getBitMask(
unsigned Shift,
unsigned Width) {
53 return ((1 << Width) - 1) << Shift;
59 unsigned packBits(
unsigned Src,
unsigned Dst,
unsigned Shift,
unsigned Width) {
60 Dst &= ~(1 << Shift) & ~getBitMask(Shift, Width);
61 Dst |= (Src << Shift) & getBitMask(Shift, Width);
68 unsigned unpackBits(
unsigned Src,
unsigned Shift,
unsigned Width) {
69 return (Src & getBitMask(Shift, Width)) >> Shift;
73 unsigned getVmcntBitShiftLo() {
return 0; }
76 unsigned getVmcntBitWidthLo() {
return 4; }
79 unsigned getExpcntBitShift() {
return 4; }
82 unsigned getExpcntBitWidth() {
return 3; }
85 unsigned getLgkmcntBitShift() {
return 8; }
88 unsigned getLgkmcntBitWidth() {
return 4; }
91 unsigned getVmcntBitShiftHi() {
return 14; }
94 unsigned getVmcntBitWidthHi() {
return 2; }
110 #define GET_MIMGBaseOpcodesTable_IMPL 111 #define GET_MIMGDimInfoTable_IMPL 112 #define GET_MIMGInfoTable_IMPL 113 #define GET_MIMGLZMappingTable_IMPL 114 #include "AMDGPUGenSearchableTables.inc" 118 const MIMGInfo *Info = getMIMGOpcodeHelper(BaseOpcode, MIMGEncoding,
119 VDataDwords, VAddrDwords);
120 return Info ? Info->
Opcode : -1;
124 const MIMGInfo *OrigInfo = getMIMGInfo(Opc);
128 return NewInfo ? NewInfo->
Opcode : -1;
135 return getMCOpcodeGen(Opcode, static_cast<Subtarget>(Gen));
142 if (Features.test(FeatureISAVersion6_0_0))
144 if (Features.test(FeatureISAVersion6_0_1))
148 if (Features.test(FeatureISAVersion7_0_0))
150 if (Features.test(FeatureISAVersion7_0_1))
152 if (Features.test(FeatureISAVersion7_0_2))
154 if (Features.test(FeatureISAVersion7_0_3))
156 if (Features.test(FeatureISAVersion7_0_4))
158 if (Features.test(FeatureSeaIslands))
162 if (Features.test(FeatureISAVersion8_0_1))
164 if (Features.test(FeatureISAVersion8_0_2))
166 if (Features.test(FeatureISAVersion8_0_3))
168 if (Features.test(FeatureISAVersion8_1_0))
170 if (Features.test(FeatureVolcanicIslands))
174 if (Features.test(FeatureISAVersion9_0_0))
176 if (Features.test(FeatureISAVersion9_0_2))
178 if (Features.test(FeatureISAVersion9_0_4))
180 if (Features.test(FeatureISAVersion9_0_6))
182 if (Features.test(FeatureGFX9))
185 if (Features.test(FeatureSouthernIslands))
194 Stream << TargetTriple.getArchName() <<
'-' 195 << TargetTriple.getVendorName() <<
'-' 196 << TargetTriple.getOSName() <<
'-' 197 << TargetTriple.getEnvironmentName() <<
'-' 201 << ISAVersion.Stepping;
214 if (Features.test(FeatureWavefrontSize16))
216 if (Features.test(FeatureWavefrontSize32))
223 if (Features.test(FeatureLocalMemorySize32768))
225 if (Features.test(FeatureLocalMemorySize65536))
236 unsigned FlatWorkGroupSize) {
237 if (!Features.test(FeatureGCN))
243 return std::min(N, 16u);
251 unsigned FlatWorkGroupSize) {
265 unsigned FlatWorkGroupSize) {
279 unsigned FlatWorkGroupSize) {
286 if (Version.
Major >= 8)
297 if (Version.
Major >= 8)
303 if (Features.test(FeatureSGPRInitBug))
307 if (Version.
Major >= 8)
319 if (Features.test(FeatureTrapHandler))
331 if (Version.
Major >= 8 && !Addressable)
332 AddressableNumSGPRs = 112;
334 if (Features.test(FeatureTrapHandler))
337 return std::min(MaxNumSGPRs, AddressableNumSGPRs);
341 bool FlatScrUsed,
bool XNACKUsed) {
342 unsigned ExtraSGPRs = 0;
347 if (Version.
Major < 8) {
364 Features[AMDGPU::FeatureXNACK]);
394 unsigned MinNumVGPRs =
406 return std::min(MaxNumVGPRs, AddressableNumVGPRs);
421 memset(&Header, 0,
sizeof(Header));
446 memset(&KD, 0,
sizeof(KD));
448 amdhsa::COMPUTE_PGM_RSRC1_FLOAT_DENORM_MODE_16_64,
451 amdhsa::COMPUTE_PGM_RSRC1_ENABLE_DX10_CLAMP, 1);
453 amdhsa::COMPUTE_PGM_RSRC1_ENABLE_IEEE_MODE, 1);
455 amdhsa::COMPUTE_PGM_RSRC2_ENABLE_SGPR_WORKGROUP_ID_X, 1);
484 Ctx.
emitError(
"can't parse integer attribute " + Name);
493 std::pair<int, int> Default,
494 bool OnlyFirstRequired) {
500 std::pair<int, int> Ints = Default;
502 if (Strs.first.trim().getAsInteger(0, Ints.first)) {
503 Ctx.
emitError(
"can't parse first integer attribute " + Name);
506 if (Strs.second.trim().getAsInteger(0, Ints.second)) {
507 if (!OnlyFirstRequired || !Strs.second.trim().empty()) {
508 Ctx.
emitError(
"can't parse second integer attribute " + Name);
517 unsigned VmcntLo = (1 << getVmcntBitWidthLo()) - 1;
518 if (Version.
Major < 9)
521 unsigned VmcntHi = ((1 << getVmcntBitWidthHi()) - 1) << getVmcntBitWidthLo();
522 return VmcntLo | VmcntHi;
526 return (1 << getExpcntBitWidth()) - 1;
530 return (1 << getLgkmcntBitWidth()) - 1;
534 unsigned VmcntLo = getBitMask(getVmcntBitShiftLo(), getVmcntBitWidthLo());
535 unsigned Expcnt = getBitMask(getExpcntBitShift(), getExpcntBitWidth());
536 unsigned Lgkmcnt = getBitMask(getLgkmcntBitShift(), getLgkmcntBitWidth());
537 unsigned Waitcnt = VmcntLo | Expcnt | Lgkmcnt;
538 if (Version.
Major < 9)
541 unsigned VmcntHi = getBitMask(getVmcntBitShiftHi(), getVmcntBitWidthHi());
542 return Waitcnt | VmcntHi;
547 unpackBits(Waitcnt, getVmcntBitShiftLo(), getVmcntBitWidthLo());
548 if (Version.
Major < 9)
552 unpackBits(Waitcnt, getVmcntBitShiftHi(), getVmcntBitWidthHi());
553 VmcntHi <<= getVmcntBitWidthLo();
554 return VmcntLo | VmcntHi;
558 return unpackBits(Waitcnt, getExpcntBitShift(), getExpcntBitWidth());
562 return unpackBits(Waitcnt, getLgkmcntBitShift(), getLgkmcntBitWidth());
566 unsigned &Vmcnt,
unsigned &Expcnt,
unsigned &Lgkmcnt) {
575 packBits(Vmcnt, Waitcnt, getVmcntBitShiftLo(), getVmcntBitWidthLo());
576 if (Version.
Major < 9)
579 Vmcnt >>= getVmcntBitWidthLo();
580 return packBits(Vmcnt, Waitcnt, getVmcntBitShiftHi(), getVmcntBitWidthHi());
585 return packBits(Expcnt, Waitcnt, getExpcntBitShift(), getExpcntBitWidth());
590 return packBits(Lgkmcnt, Waitcnt, getLgkmcntBitShift(), getLgkmcntBitWidth());
594 unsigned Vmcnt,
unsigned Expcnt,
unsigned Lgkmcnt) {
676 const unsigned FirstSubReg = TRI->
getSubReg(Reg, 1);
677 return SGPRClass.
contains(FirstSubReg != 0 ? FirstSubReg : Reg) ||
683 if (*R == Reg1)
return true;
688 #define MAP_REG2REG \ 689 using namespace AMDGPU; \ 691 default: return Reg; \ 692 CASE_CI_VI(FLAT_SCR) \ 693 CASE_CI_VI(FLAT_SCR_LO) \ 694 CASE_CI_VI(FLAT_SCR_HI) \ 695 CASE_VI_GFX9(TTMP0) \ 696 CASE_VI_GFX9(TTMP1) \ 697 CASE_VI_GFX9(TTMP2) \ 698 CASE_VI_GFX9(TTMP3) \ 699 CASE_VI_GFX9(TTMP4) \ 700 CASE_VI_GFX9(TTMP5) \ 701 CASE_VI_GFX9(TTMP6) \ 702 CASE_VI_GFX9(TTMP7) \ 703 CASE_VI_GFX9(TTMP8) \ 704 CASE_VI_GFX9(TTMP9) \ 705 CASE_VI_GFX9(TTMP10) \ 706 CASE_VI_GFX9(TTMP11) \ 707 CASE_VI_GFX9(TTMP12) \ 708 CASE_VI_GFX9(TTMP13) \ 709 CASE_VI_GFX9(TTMP14) \ 710 CASE_VI_GFX9(TTMP15) \ 711 CASE_VI_GFX9(TTMP0_TTMP1) \ 712 CASE_VI_GFX9(TTMP2_TTMP3) \ 713 CASE_VI_GFX9(TTMP4_TTMP5) \ 714 CASE_VI_GFX9(TTMP6_TTMP7) \ 715 CASE_VI_GFX9(TTMP8_TTMP9) \ 716 CASE_VI_GFX9(TTMP10_TTMP11) \ 717 CASE_VI_GFX9(TTMP12_TTMP13) \ 718 CASE_VI_GFX9(TTMP14_TTMP15) \ 719 CASE_VI_GFX9(TTMP0_TTMP1_TTMP2_TTMP3) \ 720 CASE_VI_GFX9(TTMP4_TTMP5_TTMP6_TTMP7) \ 721 CASE_VI_GFX9(TTMP8_TTMP9_TTMP10_TTMP11) \ 722 CASE_VI_GFX9(TTMP12_TTMP13_TTMP14_TTMP15) \ 723 CASE_VI_GFX9(TTMP0_TTMP1_TTMP2_TTMP3_TTMP4_TTMP5_TTMP6_TTMP7) \ 724 CASE_VI_GFX9(TTMP4_TTMP5_TTMP6_TTMP7_TTMP8_TTMP9_TTMP10_TTMP11) \ 725 CASE_VI_GFX9(TTMP8_TTMP9_TTMP10_TTMP11_TTMP12_TTMP13_TTMP14_TTMP15) \ 726 CASE_VI_GFX9(TTMP0_TTMP1_TTMP2_TTMP3_TTMP4_TTMP5_TTMP6_TTMP7_TTMP8_TTMP9_TTMP10_TTMP11_TTMP12_TTMP13_TTMP14_TTMP15) \ 729 #define CASE_CI_VI(node) \ 730 assert(!isSI(STI)); \ 731 case node: return isCI(STI) ? node##_ci : node##_vi; 733 #define CASE_VI_GFX9(node) \ 734 case node: return isGFX9(STI) ? node##_gfx9 : node##_vi; 745 #define CASE_CI_VI(node) case node##_ci: case node##_vi: return node; 746 #define CASE_VI_GFX9(node) case node##_vi: case node##_gfx9: return node; 791 case AMDGPU::SGPR_32RegClassID:
792 case AMDGPU::VGPR_32RegClassID:
793 case AMDGPU::VS_32RegClassID:
794 case AMDGPU::SReg_32RegClassID:
795 case AMDGPU::SReg_32_XM0RegClassID:
797 case AMDGPU::SGPR_64RegClassID:
798 case AMDGPU::VS_64RegClassID:
799 case AMDGPU::SReg_64RegClassID:
800 case AMDGPU::VReg_64RegClassID:
802 case AMDGPU::VReg_96RegClassID:
804 case AMDGPU::SGPR_128RegClassID:
805 case AMDGPU::SReg_128RegClassID:
806 case AMDGPU::VReg_128RegClassID:
808 case AMDGPU::SReg_256RegClassID:
809 case AMDGPU::VReg_256RegClassID:
811 case AMDGPU::SReg_512RegClassID:
812 case AMDGPU::VReg_512RegClassID:
831 if (Literal >= -16 && Literal <= 64)
834 uint64_t Val =
static_cast<uint64_t
>(Literal);
844 (Val == 0x3fc45f306dc9c882 && HasInv2Pi);
848 if (Literal >= -16 && Literal <= 64)
870 (Val == 0x3e22f983 && HasInv2Pi);
877 if (Literal >= -16 && Literal <= 64)
880 uint16_t Val =
static_cast<uint16_t
>(Literal);
881 return Val == 0x3C00 ||
895 int16_t Lo16 =
static_cast<int16_t
>(Literal);
896 int16_t Hi16 =
static_cast<int16_t
>(Literal >> 16);
929 return ByteOffset >> 2;
935 isUInt<20>(EncodedOffset) :
isUInt<8>(EncodedOffset);
963 struct SourceOfDivergence {
966 const SourceOfDivergence *lookupSourceOfDivergence(
unsigned Intr);
968 #define GET_SourcesOfDivergence_IMPL 969 #include "AMDGPUGenSearchableTables.inc" 974 return lookupSourceOfDivergence(IntrID);
unsigned getMinNumVGPRs(const FeatureBitset &Features, unsigned WavesPerEU)
const std::string & getTargetTriple() const
Get the target triple which is a string describing the target host.
unsigned mc2PseudoReg(unsigned Reg)
Convert hardware register Reg to a pseudo register.
Calling convention used for AMDPAL shader stage before geometry shader if geometry is in use...
bool hasPackedD16(const MCSubtargetInfo &STI)
unsigned getAddressableNumVGPRs(const FeatureBitset &Features)
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
This class represents an incoming formal argument to a Function.
Compute iterated dominance frontiers using a linear time algorithm.
A Module instance is used to store all the information related to an LLVM module. ...
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
Describe properties that are true of each instruction in the target description file.
unsigned getMaxWorkGroupsPerCU(const FeatureBitset &Features, unsigned FlatWorkGroupSize)
AMDGPUAS getAMDGPUAS(const Module &M)
unsigned getMaxWavesPerEU(const FeatureBitset &Features, unsigned FlatWorkGroupSize)
unsigned getRegBitWidth(unsigned RCID)
Get the size in bits of a register from the register class RC.
unsigned const TargetRegisterInfo * TRI
unsigned getTotalNumVGPRs(const FeatureBitset &Features)
unsigned getMinWavesPerEU(const FeatureBitset &Features)
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
bool isInlinableLiteralV216(int32_t Literal, bool HasInv2Pi)
Address space for local memory.
unsigned getWavesPerWorkGroup(const FeatureBitset &Features, unsigned FlatWorkGroupSize)
std::pair< int, int > getIntegerPairAttribute(const Function &F, StringRef Name, std::pair< int, int > Default, bool OnlyFirstRequired)
const Triple & getTargetTriple() const
unsigned getVGPREncodingGranule(const FeatureBitset &Features)
bool isGlobalSegment(const GlobalValue *GV)
bool isInlinableLiteral16(int16_t Literal, bool HasInv2Pi)
Calling convention used for Mesa/AMDPAL pixel shaders.
amdhsa::kernel_descriptor_t getDefaultAmdhsaKernelDescriptor()
unsigned getID() const
getID() - Return the register class ID number.
uint32_t amd_kernel_code_version_major
unsigned getEUsPerCU(const FeatureBitset &Features)
uint64_t alignDown(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the largest uint64_t less than or equal to Value and is Skew mod Align.
Address space for constant memory (VTX2)
unsigned getWavefrontSize(const FeatureBitset &Features)
unsigned getVGPRAllocGranule(const FeatureBitset &Features)
bool isRegIntersect(unsigned Reg0, unsigned Reg1, const MCRegisterInfo *TRI)
Is there any intersection between registers.
bool isStringAttribute() const
Return true if the attribute is a string (target-dependent) attribute.
OpenCL uses address spaces to differentiate between various memory regions on the hardware...
bool contains(unsigned Reg) const
contains - Return true if the specified register is included in this register class.
const FeatureBitset & getFeatureBits() const
AMD Kernel Code Object (amd_kernel_code_t).
unsigned getRegOperandSize(const MCRegisterInfo *MRI, const MCInstrDesc &Desc, unsigned OpNo)
Get size of register operand.
uint16_t amd_machine_version_major
This file contains the simple types necessary to represent the attributes associated with functions a...
unsigned getMinFlatWorkGroupSize(const FeatureBitset &Features)
unsigned encodeLgkmcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt, unsigned Lgkmcnt)
uint32_t compute_pgm_rsrc2
unsigned decodeLgkmcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt)
int getMaskedMIMGOp(unsigned Opc, unsigned NewChannels)
unsigned encodeExpcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt, unsigned Expcnt)
unsigned getNumExtraSGPRs(const FeatureBitset &Features, bool VCCUsed, bool FlatScrUsed)
unsigned getMaxNumSGPRs(const FeatureBitset &Features, unsigned WavesPerEU, bool Addressable)
bool hasCodeObjectV3(const MCSubtargetInfo *STI)
unsigned getWaitcntBitMask(const IsaInfo::IsaVersion &Version)
int getMCOpcode(uint16_t Opcode, unsigned Gen)
void emitError(unsigned LocCookie, const Twine &ErrorStr)
emitError - Emit an error message to the currently installed error handler with optional location inf...
uint8_t OperandType
Information about the type of the operand.
SPIR_KERNEL - Calling convention for SPIR kernel functions.
uint8_t kernarg_segment_alignment
The maximum byte alignment of variables used by the kernel in the specified memory segment...
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
uint8_t group_segment_alignment
bool isGroupSegment(const GlobalValue *GV)
bool isReadOnlySegment(const GlobalValue *GV)
AttributeList getAttributes() const
Return the attribute list for this Function.
uint16_t amd_machine_version_minor
unsigned getMaxFlatWorkGroupSize(const FeatureBitset &Features)
uint32_t amd_kernel_code_version_minor
MCRegisterClass - Base class of TargetRegisterClass.
unsigned short NumOperands
uint32_t FloatToBits(float Float)
This function takes a float and returns the bit equivalent 32-bit integer.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
bool isSISrcFPOperand(const MCInstrDesc &Desc, unsigned OpNo)
Is this floating-point operand?
unsigned getNumSGPRBlocks(const FeatureBitset &Features, unsigned NumSGPRs)
int64_t getSMRDEncodedOffset(const MCSubtargetInfo &ST, int64_t ByteOffset)
bool isCompute(CallingConv::ID cc)
bool isInlinableLiteral64(int64_t Literal, bool HasInv2Pi)
Is this literal inlinable.
bool isSI(const MCSubtargetInfo &STI)
constexpr bool isUInt< 8 >(uint64_t x)
unsigned const MachineRegisterInfo * MRI
Container class for subtarget features.
This is an important class for using LLVM in a threaded context.
void decodeWaitcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt, unsigned &Vmcnt, unsigned &Expcnt, unsigned &Lgkmcnt)
Decodes Vmcnt, Expcnt and Lgkmcnt from given Waitcnt for given isa Version, and writes decoded values...
unsigned getTotalNumSGPRs(const FeatureBitset &Features)
bool hasMIMG_R128(const MCSubtargetInfo &STI)
This file contains the declarations for the subclasses of Constant, which represent the different fla...
bool isEntryFunctionCC(CallingConv::ID CC)
Calling convention used for AMDPAL vertex shader if tessellation is in use.
unsigned getSubReg(unsigned Reg, unsigned Idx) const
Returns the physical register number of sub-register "Index" for physical register RegNo...
unsigned getMinNumSGPRs(const FeatureBitset &Features, unsigned WavesPerEU)
uint8_t private_segment_alignment
bool isIntrinsicSourceOfDivergence(unsigned IntrID)
MCRegAliasIterator enumerates all registers aliasing Reg.
Instruction set architecture version.
const Triple & getTargetTriple() const
unsigned getAddressSpace() const
Return the address space of the Pointer type.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
bool isLegalSMRDImmOffset(const MCSubtargetInfo &ST, int64_t ByteOffset)
unsigned REGION_ADDRESS
Address space for region memory.
bool isSISrcInlinableOperand(const MCInstrDesc &Desc, unsigned OpNo)
Does this opearnd support only inlinable literals?
#define AMDHSA_BITS_SET(DST, MSK, VAL)
void initDefaultAMDKernelCodeT(amd_kernel_code_t &Header, const FeatureBitset &Features)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char NumSGPRs[]
Key for Kernel::CodeProps::Metadata::mNumSGPRs.
Triple - Helper class for working with autoconf configuration names.
int getMIMGOpcode(unsigned BaseOpcode, unsigned MIMGEncoding, unsigned VDataDwords, unsigned VAddrDwords)
std::enable_if< std::numeric_limits< T >::is_signed, bool >::type getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
unsigned decodeVmcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt)
unsigned getLgkmcntBitMask(const IsaInfo::IsaVersion &Version)
bool hasParamAttribute(unsigned ArgNo, Attribute::AttrKind Kind) const
Equivalent to hasAttribute(ArgNo + FirstArgIndex, Kind).
Address space for 32-bit constant memory.
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
Module.h This file contains the declarations for the Module class.
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
uint16_t amd_machine_version_stepping
unsigned getExpcntBitMask(const IsaInfo::IsaVersion &Version)
uint8_t wavefront_size
Wavefront size expressed as a power of two.
bool isArgPassedInSGPR(const Argument *A)
uint64_t DoubleToBits(double Double)
This function takes a double and returns the bit equivalent 64-bit integer.
unsigned encodeVmcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt, unsigned Vmcnt)
unsigned getNumVGPRBlocks(const FeatureBitset &Features, unsigned NumVGPRs)
Calling convention used for Mesa/AMDPAL compute shaders.
bool isShader(CallingConv::ID cc)
unsigned getArgNo() const
Return the index of this formal argument in its containing function.
Calling convention for AMDGPU code object kernels.
constexpr char NumVGPRs[]
Key for Kernel::CodeProps::Metadata::mNumVGPRs.
bool isGCN3Encoding(const MCSubtargetInfo &STI)
Address space for global memory (RAT0, VTX0).
bool isCI(const MCSubtargetInfo &STI)
unsigned getInitialPSInputAddr(const Function &F)
uint32_t compute_pgm_rsrc1
bool isGFX9(const MCSubtargetInfo &STI)
Provides AMDGPU specific target descriptions.
Calling convention used for Mesa/AMDPAL geometry shaders.
const Function * getParent() const
bool isVI(const MCSubtargetInfo &STI)
unsigned getMaxWavesPerCU(const FeatureBitset &Features, unsigned FlatWorkGroupSize)
StringRef getValueAsString() const
Return the attribute's value as a string.
int16_t RegClass
This specifies the register class enumeration of the operand if the operand is a register.
unsigned decodeExpcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt)
bool hasXNACK(const MCSubtargetInfo &STI)
unsigned encodeWaitcnt(const IsaInfo::IsaVersion &Version, unsigned Vmcnt, unsigned Expcnt, unsigned Lgkmcnt)
Encodes Vmcnt, Expcnt and Lgkmcnt into Waitcnt for given isa Version.
unsigned FLAT_ADDRESS
Address space for flat memory.
int getIntegerAttribute(const Function &F, StringRef Name, int Default)
Generic base class for all target subtargets.
bool shouldEmitConstantsToTextSection(const Triple &TT)
unsigned getVmcntBitMask(const IsaInfo::IsaVersion &Version)
unsigned getAddressableNumSGPRs(const FeatureBitset &Features)
unsigned getSGPREncodingGranule(const FeatureBitset &Features)
int64_t kernel_code_entry_byte_offset
Byte offset (possibly negative) from start of amd_kernel_code_t object to kernel's entry point instru...
bool isSISrcOperand(const MCInstrDesc &Desc, unsigned OpNo)
Can this operand also contain immediate values?
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isInlinableLiteral32(int32_t Literal, bool HasInv2Pi)
Calling convention used for Mesa vertex shaders, or AMDPAL last shader stage before rasterization (ve...
const FeatureBitset Features
const MCOperandInfo * OpInfo
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
unsigned getMCReg(unsigned Reg, const MCSubtargetInfo &STI)
If Reg is a pseudo reg, return the correct hardware register given STI otherwise return Reg...
This class implements an extremely fast bulk output stream that can only output to a stream...
uint16_t amd_machine_kind
unsigned getSGPRAllocGranule(const FeatureBitset &Features)
Primary interface to the complete machine description for the target machine.
unsigned getLocalMemorySize(const FeatureBitset &Features)
StringRef - Represent a constant reference to a string, i.e.
bool isSGPR(unsigned Reg, const MCRegisterInfo *TRI)
Is Reg - scalar register.
unsigned getMaxNumVGPRs(const FeatureBitset &Features, unsigned WavesPerEU)
Calling convention used for Mesa/AMDPAL hull shaders (= tessellation control shaders).
IsaVersion getIsaVersion(const FeatureBitset &Features)
PointerType * getType() const
Global values are always pointers.
unsigned PRIVATE_ADDRESS
Address space for private memory.
void streamIsaVersion(const MCSubtargetInfo *STI, raw_ostream &Stream)
Streams isa version string for given subtarget STI into Stream.
const MCRegisterClass & getRegClass(unsigned i) const
Returns the register class associated with the enumeration value.