Skip to content

Commit 66392a8

Browse files
rampitecPierre-vh
andauthored
[AMDGPU] Add XNACK_STATE_PRIV and _MASK gfx1250 registers (#152374)
Co-authored-by: Pierre Vanhoutryve <[email protected]> Co-authored-by: Pierre Vanhoutryve <[email protected]>
1 parent 83e5a99 commit 66392a8

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

llvm/lib/Target/AMDGPU/SIDefines.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,10 @@ enum Id { // HwRegCode, (6) [5:0]
536536
ID_SQ_PERF_SNAPSHOT_DATA1 = 22,
537537
ID_SQ_PERF_SNAPSHOT_PC_LO = 23,
538538
ID_SQ_PERF_SNAPSHOT_PC_HI = 24,
539+
540+
// GFX1250
541+
ID_XNACK_STATE_PRIV = 33,
542+
ID_XNACK_MASK_gfx1250 = 34,
539543
};
540544

541545
enum Offset : unsigned { // Offset, (5) [10:6]

llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ static constexpr CustomOperand Operands[] = {
223223
{{"HW_REG_SQ_PERF_SNAPSHOT_PC_LO"}, ID_SQ_PERF_SNAPSHOT_PC_LO, isGFX940},
224224
{{"HW_REG_SQ_PERF_SNAPSHOT_PC_HI"}, ID_SQ_PERF_SNAPSHOT_PC_HI, isGFX940},
225225

226+
// GFX1250
227+
{{"HW_REG_XNACK_STATE_PRIV"}, ID_XNACK_STATE_PRIV, isGFX1250},
228+
{{"HW_REG_XNACK_MASK"}, ID_XNACK_MASK_gfx1250, isGFX1250},
229+
226230
// Aliases
227231
{{"HW_REG_HW_ID"}, ID_HW_ID1, isGFX10},
228232
};

llvm/test/MC/AMDGPU/gfx1250_asm_operands.s

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,28 @@ s_mov_b64 s[0:1], src_shared_limit
2727

2828
s_getreg_b32 s1, hwreg(33)
2929
// GFX1250: encoding: [0x21,0xf8,0x81,0xb8]
30+
31+
s_getreg_b32 s1, hwreg(HW_REG_XNACK_STATE_PRIV)
32+
// GFX1200-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid hardware register: not supported on this GPU
33+
// GFX1250: encoding: [0x21,0xf8,0x81,0xb8]
34+
35+
s_getreg_b32 s1, hwreg(34)
36+
// GFX1250: encoding: [0x22,0xf8,0x81,0xb8]
37+
38+
s_getreg_b32 s1, hwreg(HW_REG_XNACK_MASK)
39+
// GFX1200-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid hardware register: not supported on this GPU
40+
// GFX1250: encoding: [0x22,0xf8,0x81,0xb8]
41+
42+
s_setreg_b32 hwreg(33), s1
43+
// GFX1250: encoding: [0x21,0xf8,0x01,0xb9]
44+
45+
s_setreg_b32 hwreg(HW_REG_XNACK_STATE_PRIV), s1
46+
// GFX1200-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid hardware register: not supported on this GPU
47+
// GFX1250: encoding: [0x21,0xf8,0x01,0xb9]
48+
49+
s_setreg_b32 hwreg(34), s1
50+
// GFX1250: encoding: [0x22,0xf8,0x01,0xb9]
51+
52+
s_setreg_b32 hwreg(HW_REG_XNACK_MASK), s1
53+
// GFX1200-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid hardware register: not supported on this GPU
54+
// GFX1250: encoding: [0x22,0xf8,0x01,0xb9]

llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_operands.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,15 @@
2020

2121
# GFX1250: s_mov_b64 s[0:1], src_shared_limit ; encoding: [0xec,0x01,0x80,0xbe]
2222
0xec,0x01,0x80,0xbe
23+
24+
# GFX1250: s_getreg_b32 s1, hwreg(HW_REG_XNACK_STATE_PRIV) ; encoding: [0x21,0xf8,0x81,0xb8]
25+
0x21,0xf8,0x81,0xb8
26+
27+
# GFX1250: s_getreg_b32 s1, hwreg(HW_REG_XNACK_MASK) ; encoding: [0x22,0xf8,0x81,0xb8]
28+
0x22,0xf8,0x81,0xb8
29+
30+
# GFX1250: s_setreg_b32 hwreg(HW_REG_XNACK_STATE_PRIV), s1 ; encoding: [0x21,0xf8,0x01,0xb9]
31+
0x21,0xf8,0x01,0xb9
32+
33+
# GFX1250: s_setreg_b32 hwreg(HW_REG_XNACK_MASK), s1 ; encoding: [0x22,0xf8,0x01,0xb9]
34+
0x22,0xf8,0x01,0xb9

0 commit comments

Comments
 (0)