Skip to content

Commit 7972b9c

Browse files
committed
[AMDGPU] Move SIEncodingFamily into SIDefines.h. NFC.
I need this for future patch in the MC, while TII is not available in the llvm-mc. Besides this is not a first time I want it there. Differential Revision: https://reviews.llvm.org/D155228
1 parent 0aecddc commit 7972b9c

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

llvm/lib/Target/AMDGPU/SIDefines.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ enum SIRCFlags : uint8_t {
2929
RegKindMask = (HasVGPR | HasAGPR | HasSGPR)
3030
}; // enum SIRCFlagsr
3131

32+
namespace SIEncodingFamily {
33+
// This must be kept in sync with the SIEncodingFamily class in SIInstrInfo.td
34+
// and the columns of the getMCOpcodeGen table.
35+
enum {
36+
SI = 0,
37+
VI = 1,
38+
SDWA = 2,
39+
SDWA9 = 3,
40+
GFX80 = 4,
41+
GFX9 = 5,
42+
GFX10 = 6,
43+
SDWA10 = 7,
44+
GFX90A = 8,
45+
GFX940 = 9,
46+
GFX11 = 10,
47+
};
48+
}
49+
3250
namespace SIInstrFlags {
3351
// This needs to be kept in sync with the field bits in InstSI.
3452
enum : uint64_t {

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8240,23 +8240,7 @@ SIInstrInfo::splitFlatOffset(int64_t COffsetVal, unsigned AddrSpace,
82408240
return {ImmField, RemainderOffset};
82418241
}
82428242

8243-
// This must be kept in sync with the SIEncodingFamily class in SIInstrInfo.td
8244-
// and the columns of the getMCOpcodeGen table.
8245-
enum SIEncodingFamily {
8246-
SI = 0,
8247-
VI = 1,
8248-
SDWA = 2,
8249-
SDWA9 = 3,
8250-
GFX80 = 4,
8251-
GFX9 = 5,
8252-
GFX10 = 6,
8253-
SDWA10 = 7,
8254-
GFX90A = 8,
8255-
GFX940 = 9,
8256-
GFX11 = 10,
8257-
};
8258-
8259-
static SIEncodingFamily subtargetEncodingFamily(const GCNSubtarget &ST) {
8243+
static unsigned subtargetEncodingFamily(const GCNSubtarget &ST) {
82608244
switch (ST.getGeneration()) {
82618245
default:
82628246
break;
@@ -8295,7 +8279,7 @@ bool SIInstrInfo::isAsmOnlyOpcode(int MCOp) const {
82958279
}
82968280

82978281
int SIInstrInfo::pseudoToMCOpcode(int Opcode) const {
8298-
SIEncodingFamily Gen = subtargetEncodingFamily(ST);
8282+
unsigned Gen = subtargetEncodingFamily(ST);
82998283

83008284
if ((get(Opcode).TSFlags & SIInstrFlags::renamedInGFX9) != 0 &&
83018285
ST.getGeneration() == AMDGPUSubtarget::GFX9)

0 commit comments

Comments
 (0)