LLVM  14.0.0git
Enumerations | Functions | Variables
llvm::AMDGPU::MTBUFFormat Namespace Reference

Enumerations

enum  DataFormat : int64_t {
  DFMT_INVALID = 0, DFMT_8, DFMT_16, DFMT_8_8,
  DFMT_32, DFMT_16_16, DFMT_10_11_11, DFMT_11_11_10,
  DFMT_10_10_10_2, DFMT_2_10_10_10, DFMT_8_8_8_8, DFMT_32_32,
  DFMT_16_16_16_16, DFMT_32_32_32, DFMT_32_32_32_32, DFMT_RESERVED_15,
  DFMT_MIN = DFMT_INVALID, DFMT_MAX = DFMT_RESERVED_15, DFMT_UNDEF = -1, DFMT_DEFAULT = DFMT_8,
  DFMT_SHIFT = 0, DFMT_MASK = 0xF
}
 
enum  NumFormat : int64_t {
  NFMT_UNORM = 0, NFMT_SNORM, NFMT_USCALED, NFMT_SSCALED,
  NFMT_UINT, NFMT_SINT, NFMT_RESERVED_6, NFMT_SNORM_OGL = NFMT_RESERVED_6,
  NFMT_FLOAT, NFMT_MIN = NFMT_UNORM, NFMT_MAX = NFMT_FLOAT, NFMT_UNDEF = -1,
  NFMT_DEFAULT = NFMT_UNORM, NFMT_SHIFT = 4, NFMT_MASK = 7
}
 
enum  MergedFormat : int64_t { DFMT_NFMT_UNDEF = -1, DFMT_NFMT_DEFAULT, DFMT_NFMT_MASK = (DFMT_MASK << DFMT_SHIFT) | (NFMT_MASK << NFMT_SHIFT), DFMT_NFMT_MAX = DFMT_NFMT_MASK }
 
enum  UnifiedFormat : int64_t {
  UFMT_INVALID = 0, UFMT_8_UNORM, UFMT_8_SNORM, UFMT_8_USCALED,
  UFMT_8_SSCALED, UFMT_8_UINT, UFMT_8_SINT, UFMT_16_UNORM,
  UFMT_16_SNORM, UFMT_16_USCALED, UFMT_16_SSCALED, UFMT_16_UINT,
  UFMT_16_SINT, UFMT_16_FLOAT, UFMT_8_8_UNORM, UFMT_8_8_SNORM,
  UFMT_8_8_USCALED, UFMT_8_8_SSCALED, UFMT_8_8_UINT, UFMT_8_8_SINT,
  UFMT_32_UINT, UFMT_32_SINT, UFMT_32_FLOAT, UFMT_16_16_UNORM,
  UFMT_16_16_SNORM, UFMT_16_16_USCALED, UFMT_16_16_SSCALED, UFMT_16_16_UINT,
  UFMT_16_16_SINT, UFMT_16_16_FLOAT, UFMT_10_11_11_UNORM, UFMT_10_11_11_SNORM,
  UFMT_10_11_11_USCALED, UFMT_10_11_11_SSCALED, UFMT_10_11_11_UINT, UFMT_10_11_11_SINT,
  UFMT_10_11_11_FLOAT, UFMT_11_11_10_UNORM, UFMT_11_11_10_SNORM, UFMT_11_11_10_USCALED,
  UFMT_11_11_10_SSCALED, UFMT_11_11_10_UINT, UFMT_11_11_10_SINT, UFMT_11_11_10_FLOAT,
  UFMT_10_10_10_2_UNORM, UFMT_10_10_10_2_SNORM, UFMT_10_10_10_2_USCALED, UFMT_10_10_10_2_SSCALED,
  UFMT_10_10_10_2_UINT, UFMT_10_10_10_2_SINT, UFMT_2_10_10_10_UNORM, UFMT_2_10_10_10_SNORM,
  UFMT_2_10_10_10_USCALED, UFMT_2_10_10_10_SSCALED, UFMT_2_10_10_10_UINT, UFMT_2_10_10_10_SINT,
  UFMT_8_8_8_8_UNORM, UFMT_8_8_8_8_SNORM, UFMT_8_8_8_8_USCALED, UFMT_8_8_8_8_SSCALED,
  UFMT_8_8_8_8_UINT, UFMT_8_8_8_8_SINT, UFMT_32_32_UINT, UFMT_32_32_SINT,
  UFMT_32_32_FLOAT, UFMT_16_16_16_16_UNORM, UFMT_16_16_16_16_SNORM, UFMT_16_16_16_16_USCALED,
  UFMT_16_16_16_16_SSCALED, UFMT_16_16_16_16_UINT, UFMT_16_16_16_16_SINT, UFMT_16_16_16_16_FLOAT,
  UFMT_32_32_32_UINT, UFMT_32_32_32_SINT, UFMT_32_32_32_FLOAT, UFMT_32_32_32_32_UINT,
  UFMT_32_32_32_32_SINT, UFMT_32_32_32_32_FLOAT, UFMT_FIRST = UFMT_INVALID, UFMT_LAST = UFMT_32_32_32_32_FLOAT,
  UFMT_MAX = 127, UFMT_UNDEF = -1, UFMT_DEFAULT = UFMT_8_UNORM
}
 

Functions

int64_t getDfmt (const StringRef Name)
 
StringRef getDfmtName (unsigned Id)
 
static const StringLiteralgetNfmtLookupTable (const MCSubtargetInfo &STI)
 
int64_t getNfmt (const StringRef Name, const MCSubtargetInfo &STI)
 
StringRef getNfmtName (unsigned Id, const MCSubtargetInfo &STI)
 
bool isValidDfmtNfmt (unsigned Id, const MCSubtargetInfo &STI)
 
bool isValidNfmt (unsigned Id, const MCSubtargetInfo &STI)
 
int64_t encodeDfmtNfmt (unsigned Dfmt, unsigned Nfmt)
 
void decodeDfmtNfmt (unsigned Format, unsigned &Dfmt, unsigned &Nfmt)
 
int64_t getUnifiedFormat (const StringRef Name)
 
StringRef getUnifiedFormatName (unsigned Id)
 
bool isValidUnifiedFormat (unsigned Id)
 
int64_t convertDfmtNfmt2Ufmt (unsigned Dfmt, unsigned Nfmt)
 
bool isValidFormatEncoding (unsigned Val, const MCSubtargetInfo &STI)
 
unsigned getDefaultFormatEncoding (const MCSubtargetInfo &STI)
 

Variables

const StringLiteral DfmtSymbolic []
 
const StringLiteral NfmtSymbolicGFX10 []
 
const StringLiteral NfmtSymbolicSICI []
 
const StringLiteral NfmtSymbolicVI []
 
const StringLiteral UfmtSymbolic []
 
const unsigned DfmtNfmt2UFmt []
 

Enumeration Type Documentation

◆ DataFormat

Enumerator
DFMT_INVALID 
DFMT_8 
DFMT_16 
DFMT_8_8 
DFMT_32 
DFMT_16_16 
DFMT_10_11_11 
DFMT_11_11_10 
DFMT_10_10_10_2 
DFMT_2_10_10_10 
DFMT_8_8_8_8 
DFMT_32_32 
DFMT_16_16_16_16 
DFMT_32_32_32 
DFMT_32_32_32_32 
DFMT_RESERVED_15 
DFMT_MIN 
DFMT_MAX 
DFMT_UNDEF 
DFMT_DEFAULT 
DFMT_SHIFT 
DFMT_MASK 

Definition at line 443 of file SIDefines.h.

◆ MergedFormat

Enumerator
DFMT_NFMT_UNDEF 
DFMT_NFMT_DEFAULT 
DFMT_NFMT_MASK 
DFMT_NFMT_MAX 

Definition at line 492 of file SIDefines.h.

◆ NumFormat

Enumerator
NFMT_UNORM 
NFMT_SNORM 
NFMT_USCALED 
NFMT_SSCALED 
NFMT_UINT 
NFMT_SINT 
NFMT_RESERVED_6 
NFMT_SNORM_OGL 
NFMT_FLOAT 
NFMT_MIN 
NFMT_MAX 
NFMT_UNDEF 
NFMT_DEFAULT 
NFMT_SHIFT 
NFMT_MASK 

Definition at line 471 of file SIDefines.h.

◆ UnifiedFormat

Enumerator
UFMT_INVALID 
UFMT_8_UNORM 
UFMT_8_SNORM 
UFMT_8_USCALED 
UFMT_8_SSCALED 
UFMT_8_UINT 
UFMT_8_SINT 
UFMT_16_UNORM 
UFMT_16_SNORM 
UFMT_16_USCALED 
UFMT_16_SSCALED 
UFMT_16_UINT 
UFMT_16_SINT 
UFMT_16_FLOAT 
UFMT_8_8_UNORM 
UFMT_8_8_SNORM 
UFMT_8_8_USCALED 
UFMT_8_8_SSCALED 
UFMT_8_8_UINT 
UFMT_8_8_SINT 
UFMT_32_UINT 
UFMT_32_SINT 
UFMT_32_FLOAT 
UFMT_16_16_UNORM 
UFMT_16_16_SNORM 
UFMT_16_16_USCALED 
UFMT_16_16_SSCALED 
UFMT_16_16_UINT 
UFMT_16_16_SINT 
UFMT_16_16_FLOAT 
UFMT_10_11_11_UNORM 
UFMT_10_11_11_SNORM 
UFMT_10_11_11_USCALED 
UFMT_10_11_11_SSCALED 
UFMT_10_11_11_UINT 
UFMT_10_11_11_SINT 
UFMT_10_11_11_FLOAT 
UFMT_11_11_10_UNORM 
UFMT_11_11_10_SNORM 
UFMT_11_11_10_USCALED 
UFMT_11_11_10_SSCALED 
UFMT_11_11_10_UINT 
UFMT_11_11_10_SINT 
UFMT_11_11_10_FLOAT 
UFMT_10_10_10_2_UNORM 
UFMT_10_10_10_2_SNORM 
UFMT_10_10_10_2_USCALED 
UFMT_10_10_10_2_SSCALED 
UFMT_10_10_10_2_UINT 
UFMT_10_10_10_2_SINT 
UFMT_2_10_10_10_UNORM 
UFMT_2_10_10_10_SNORM 
UFMT_2_10_10_10_USCALED 
UFMT_2_10_10_10_SSCALED 
UFMT_2_10_10_10_UINT 
UFMT_2_10_10_10_SINT 
UFMT_8_8_8_8_UNORM 
UFMT_8_8_8_8_SNORM 
UFMT_8_8_8_8_USCALED 
UFMT_8_8_8_8_SSCALED 
UFMT_8_8_8_8_UINT 
UFMT_8_8_8_8_SINT 
UFMT_32_32_UINT 
UFMT_32_32_SINT 
UFMT_32_32_FLOAT 
UFMT_16_16_16_16_UNORM 
UFMT_16_16_16_16_SNORM 
UFMT_16_16_16_16_USCALED 
UFMT_16_16_16_16_SSCALED 
UFMT_16_16_16_16_UINT 
UFMT_16_16_16_16_SINT 
UFMT_16_16_16_16_FLOAT 
UFMT_32_32_32_UINT 
UFMT_32_32_32_SINT 
UFMT_32_32_32_FLOAT 
UFMT_32_32_32_32_UINT 
UFMT_32_32_32_32_SINT 
UFMT_32_32_32_32_FLOAT 
UFMT_FIRST 
UFMT_LAST 
UFMT_MAX 
UFMT_UNDEF 
UFMT_DEFAULT 

Definition at line 503 of file SIDefines.h.

Function Documentation

◆ convertDfmtNfmt2Ufmt()

int64_t llvm::AMDGPU::MTBUFFormat::convertDfmtNfmt2Ufmt ( unsigned  Dfmt,
unsigned  Nfmt 
)

Definition at line 1194 of file AMDGPUBaseInfo.cpp.

References DfmtNfmt2UFmt, encodeDfmtNfmt(), UFMT_FIRST, UFMT_LAST, and UFMT_UNDEF.

◆ decodeDfmtNfmt()

void llvm::AMDGPU::MTBUFFormat::decodeDfmtNfmt ( unsigned  Format,
unsigned &  Dfmt,
unsigned &  Nfmt 
)

Definition at line 1173 of file AMDGPUBaseInfo.cpp.

References DFMT_MASK, DFMT_SHIFT, NFMT_MASK, and NFMT_SHIFT.

Referenced by isValidDfmtNfmt().

◆ encodeDfmtNfmt()

LLVM_READNONE int64_t llvm::AMDGPU::MTBUFFormat::encodeDfmtNfmt ( unsigned  Dfmt,
unsigned  Nfmt 
)

Definition at line 1169 of file AMDGPUBaseInfo.cpp.

References DFMT_SHIFT, and NFMT_SHIFT.

Referenced by convertDfmtNfmt2Ufmt().

◆ getDefaultFormatEncoding()

unsigned llvm::AMDGPU::MTBUFFormat::getDefaultFormatEncoding ( const MCSubtargetInfo STI)

Definition at line 1207 of file AMDGPUBaseInfo.cpp.

References DFMT_NFMT_DEFAULT, llvm::AMDGPU::isGFX10Plus(), and UFMT_DEFAULT.

◆ getDfmt()

int64_t llvm::AMDGPU::MTBUFFormat::getDfmt ( const StringRef  Name)

Definition at line 1123 of file AMDGPUBaseInfo.cpp.

References DFMT_MAX, DFMT_MIN, DFMT_UNDEF, and DfmtSymbolic.

◆ getDfmtName()

StringRef llvm::AMDGPU::MTBUFFormat::getDfmtName ( unsigned  Id)

Definition at line 1131 of file AMDGPUBaseInfo.cpp.

References assert(), DFMT_MAX, and DfmtSymbolic.

◆ getNfmt()

int64_t llvm::AMDGPU::MTBUFFormat::getNfmt ( const StringRef  Name,
const MCSubtargetInfo STI 
)

Definition at line 1144 of file AMDGPUBaseInfo.cpp.

References getNfmtLookupTable(), NFMT_MAX, NFMT_MIN, and NFMT_UNDEF.

◆ getNfmtLookupTable()

static const StringLiteral* llvm::AMDGPU::MTBUFFormat::getNfmtLookupTable ( const MCSubtargetInfo STI)
static

◆ getNfmtName()

StringRef llvm::AMDGPU::MTBUFFormat::getNfmtName ( unsigned  Id,
const MCSubtargetInfo STI 
)

Definition at line 1153 of file AMDGPUBaseInfo.cpp.

References assert(), getNfmtLookupTable(), and NFMT_MAX.

Referenced by isValidNfmt().

◆ getUnifiedFormat()

int64_t llvm::AMDGPU::MTBUFFormat::getUnifiedFormat ( const StringRef  Name)

Definition at line 1178 of file AMDGPUBaseInfo.cpp.

References UFMT_FIRST, UFMT_LAST, UFMT_UNDEF, and UfmtSymbolic.

◆ getUnifiedFormatName()

StringRef llvm::AMDGPU::MTBUFFormat::getUnifiedFormatName ( unsigned  Id)

Definition at line 1186 of file AMDGPUBaseInfo.cpp.

References isValidUnifiedFormat(), and UfmtSymbolic.

◆ isValidDfmtNfmt()

bool llvm::AMDGPU::MTBUFFormat::isValidDfmtNfmt ( unsigned  Id,
const MCSubtargetInfo STI 
)

Definition at line 1158 of file AMDGPUBaseInfo.cpp.

References decodeDfmtNfmt(), and isValidNfmt().

◆ isValidFormatEncoding()

bool llvm::AMDGPU::MTBUFFormat::isValidFormatEncoding ( unsigned  Val,
const MCSubtargetInfo STI 
)

Definition at line 1203 of file AMDGPUBaseInfo.cpp.

References DFMT_NFMT_MAX, llvm::AMDGPU::isGFX10Plus(), and UFMT_MAX.

◆ isValidNfmt()

bool llvm::AMDGPU::MTBUFFormat::isValidNfmt ( unsigned  Id,
const MCSubtargetInfo STI 
)

Definition at line 1165 of file AMDGPUBaseInfo.cpp.

References llvm::StringRef::empty(), and getNfmtName().

Referenced by isValidDfmtNfmt().

◆ isValidUnifiedFormat()

bool llvm::AMDGPU::MTBUFFormat::isValidUnifiedFormat ( unsigned  Id)

Definition at line 1190 of file AMDGPUBaseInfo.cpp.

References UFMT_LAST.

Referenced by getUnifiedFormatName().

Variable Documentation

◆ DfmtNfmt2UFmt

const unsigned llvm::AMDGPU::MTBUFFormat::DfmtNfmt2UFmt

Definition at line 241 of file AMDGPUAsmUtils.cpp.

Referenced by convertDfmtNfmt2Ufmt().

◆ DfmtSymbolic

const StringLiteral llvm::AMDGPU::MTBUFFormat::DfmtSymbolic
Initial value:
= {
"BUF_DATA_FORMAT_INVALID",
"BUF_DATA_FORMAT_8",
"BUF_DATA_FORMAT_16",
"BUF_DATA_FORMAT_8_8",
"BUF_DATA_FORMAT_32",
"BUF_DATA_FORMAT_16_16",
"BUF_DATA_FORMAT_10_11_11",
"BUF_DATA_FORMAT_11_11_10",
"BUF_DATA_FORMAT_10_10_10_2",
"BUF_DATA_FORMAT_2_10_10_10",
"BUF_DATA_FORMAT_8_8_8_8",
"BUF_DATA_FORMAT_32_32",
"BUF_DATA_FORMAT_16_16_16_16",
"BUF_DATA_FORMAT_32_32_32",
"BUF_DATA_FORMAT_32_32_32_32",
"BUF_DATA_FORMAT_RESERVED_15"
}

Definition at line 95 of file AMDGPUAsmUtils.cpp.

Referenced by getDfmt(), and getDfmtName().

◆ NfmtSymbolicGFX10

const StringLiteral llvm::AMDGPU::MTBUFFormat::NfmtSymbolicGFX10
Initial value:
= {
"BUF_NUM_FORMAT_UNORM",
"BUF_NUM_FORMAT_SNORM",
"BUF_NUM_FORMAT_USCALED",
"BUF_NUM_FORMAT_SSCALED",
"BUF_NUM_FORMAT_UINT",
"BUF_NUM_FORMAT_SINT",
"",
"BUF_NUM_FORMAT_FLOAT"
}

Definition at line 114 of file AMDGPUAsmUtils.cpp.

Referenced by getNfmtLookupTable().

◆ NfmtSymbolicSICI

const StringLiteral llvm::AMDGPU::MTBUFFormat::NfmtSymbolicSICI
Initial value:
= {
"BUF_NUM_FORMAT_UNORM",
"BUF_NUM_FORMAT_SNORM",
"BUF_NUM_FORMAT_USCALED",
"BUF_NUM_FORMAT_SSCALED",
"BUF_NUM_FORMAT_UINT",
"BUF_NUM_FORMAT_SINT",
"BUF_NUM_FORMAT_SNORM_OGL",
"BUF_NUM_FORMAT_FLOAT"
}

Definition at line 125 of file AMDGPUAsmUtils.cpp.

Referenced by getNfmtLookupTable().

◆ NfmtSymbolicVI

const StringLiteral llvm::AMDGPU::MTBUFFormat::NfmtSymbolicVI
Initial value:
= {
"BUF_NUM_FORMAT_UNORM",
"BUF_NUM_FORMAT_SNORM",
"BUF_NUM_FORMAT_USCALED",
"BUF_NUM_FORMAT_SSCALED",
"BUF_NUM_FORMAT_UINT",
"BUF_NUM_FORMAT_SINT",
"BUF_NUM_FORMAT_RESERVED_6",
"BUF_NUM_FORMAT_FLOAT"
}

Definition at line 136 of file AMDGPUAsmUtils.cpp.

Referenced by getNfmtLookupTable().

◆ UfmtSymbolic

const StringLiteral llvm::AMDGPU::MTBUFFormat::UfmtSymbolic

Definition at line 147 of file AMDGPUAsmUtils.cpp.

Referenced by getUnifiedFormat(), and getUnifiedFormatName().