1 // RUN
: not llvm-mc
-triple
=amdgcn
-show-encoding
%s | FileCheck
--check-prefix
=GCN
%s
2 // RUN
: not llvm-mc
-triple
=amdgcn
-mcpu
=tahiti
-show-encoding
%s | FileCheck
--check-prefix
=GCN
%s
3 // RUN
: llvm-mc
-triple
=amdgcn
-mcpu
=bonaire
-show-encoding
%s | FileCheck
--check-prefixes
=GCN
,CI
%s
4 // RUN
: not llvm-mc
-triple
=amdgcn
-mcpu
=fiji
-show-encoding
%s | FileCheck
--check-prefix
=VI
%s
6 // RUN
: not llvm-mc
-triple
=amdgcn
%s
2>&1 | FileCheck
%s
--check-prefix
=NOSI
--implicit-check-
not=error
:
7 // RUN
: not llvm-mc
-triple
=amdgcn
-mcpu
=tahiti
%s
2>&1 | FileCheck
%s
--check-prefix
=NOSI
--implicit-check-
not=error
:
8 // RUN
: not llvm-mc
-triple
=amdgcn
-mcpu
=fiji
%s
2>&1 | FileCheck
%s
--check-prefix
=NOVI
--implicit-check-
not=error
:
10 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
14 // SP3 requires the immediate offset
, but we allow to drop it for
15 // compatibility reasons.
16 s_load_dword s1
, s
[2:3]
17 // GCN
: s_load_dword s1
, s
[2:3], 0x0 ; encoding
: [0x00,0x83,0x00,0xc0]
18 // VI
: s_load_dword s1
, s
[2:3], 0x0 ; encoding
: [0x41,0x00,0x02,0xc0,0x00,0x00,0x00,0x00]
20 s_load_dword s1
, s
[2:3], 0xfc
21 // GCN
: s_load_dword s1
, s
[2:3], 0xfc ; encoding
: [0xfc,0x83,0x00,0xc0]
22 // VI
: s_load_dword s1
, s
[2:3], 0xfc ; encoding
: [0x41,0x00,0x02,0xc0,0xfc,0x00,0x00,0x00]
24 s_load_dword s1
, s
[2:3], 0xff
25 // GCN
: s_load_dword s1
, s
[2:3], 0xff ; encoding
: [0xff,0x83,0x00,0xc0]
26 // VI
: s_load_dword s1
, s
[2:3], 0xff ; encoding
: [0x41,0x00,0x02,0xc0,0xff,0x00,0x00,0x00]
28 s_load_dword s1
, s
[2:3], 0x100
29 // NOSI
: :[[@LINE-
1]]:{{[0-9]+}}: error
: operands are
not valid for this GPU
or mode
30 // CI
: s_load_dword s1
, s
[2:3], 0x100 ; encoding
: [0xff,0x82,0x00,0xc0,0x00,0x01,0x00,0x00]
31 // VI
: s_load_dword s1
, s
[2:3], 0x100 ; encoding
: [0x41,0x00,0x02,0xc0,0x00,0x01,0x00,0x00]
33 s_load_dword s1
, s
[2:3], 0xfffff
34 // NOSI
: :[[@LINE-
1]]:{{[0-9]+}}: error
: operands are
not valid for this GPU
or mode
35 // CI
: s_load_dword s1
, s
[2:3], 0xfffff ; encoding
: [0xff,0x82,0x00,0xc0,0xff,0xff,0x0f,0x00]
36 // VI
: s_load_dword s1
, s
[2:3], 0xfffff ; encoding
: [0x41,0x00,0x02,0xc0,0xff,0xff,0x0f,0x00]
38 s_load_dword s1
, s
[2:3], 0x100000
39 // NOSI
: :[[@LINE-
1]]:{{[0-9]+}}: error
: operands are
not valid for this GPU
or mode
40 // CI
: s_load_dword s1
, s
[2:3], 0x100000 ; encoding
: [0xff,0x82,0x00,0xc0,0x00,0x00,0x10,0x00]
41 // NOVI
: :[[@LINE-
3]]:{{[0-9]+}}: error
: expected
a 20-bit unsigned offset
43 s_load_dword s1
, s
[2:3], 0xffffffff
44 // NOSI
: :[[@LINE-
1]]:{{[0-9]+}}: error
: operands are
not valid for this GPU
or mode
45 // CI
: s_load_dword s1
, s
[2:3], 0xffffffff ; encoding
: [0xff,0x82,0x00,0xc0,0xff,0xff,0xff,0xff]
46 // NOVI
: :[[@LINE-
3]]:{{[0-9]+}}: error
: expected
a 20-bit unsigned offset
48 //===----------------------------------------------------------------------===//
50 //===----------------------------------------------------------------------===//
52 s_load_dword s1
, s
[2:3], 1
53 // GCN
: s_load_dword s1
, s
[2:3], 0x1 ; encoding
: [0x01,0x83,0x00,0xc0]
54 // VI
: s_load_dword s1
, s
[2:3], 0x1 ; encoding
: [0x41,0x00,0x02,0xc0,0x01,0x00,0x00,0x00]
56 s_load_dword s1
, s
[2:3], s4
57 // GCN
: s_load_dword s1
, s
[2:3], s4 ; encoding
: [0x04,0x82,0x00,0xc0]
58 // VI
: s_load_dword s1
, s
[2:3], s4 ; encoding
: [0x41,0x00,0x00,0xc0,0x04,0x00,0x00,0x00]
60 s_load_dword tba_lo
, s
[2:3], s4
61 // GCN
: s_load_dword tba_lo
, s
[2:3], s4 ; encoding
: [0x04,0x02,0x36,0xc0]
62 // VI
: s_load_dword tba_lo
, s
[2:3], s4 ; encoding
: [0x01,0x1b,0x00,0xc0,0x04,0x00,0x00,0x00]
64 s_load_dword tba_hi
, s
[2:3], s4
65 // GCN
: s_load_dword tba_hi
, s
[2:3], s4 ; encoding
: [0x04,0x82,0x36,0xc0]
66 // VI
: s_load_dword tba_hi
, s
[2:3], s4 ; encoding
: [0x41,0x1b,0x00,0xc0,0x04,0x00,0x00,0x00]
68 s_load_dword tma_lo
, s
[2:3], s4
69 // GCN
: s_load_dword tma_lo
, s
[2:3], s4 ; encoding
: [0x04,0x02,0x37,0xc0]
70 // VI
: s_load_dword tma_lo
, s
[2:3], s4 ; encoding
: [0x81,0x1b,0x00,0xc0,0x04,0x00,0x00,0x00]
72 s_load_dword tma_hi
, s
[2:3], s4
73 // GCN
: s_load_dword tma_hi
, s
[2:3], s4 ; encoding
: [0x04,0x82,0x37,0xc0]
74 // VI
: s_load_dword tma_hi
, s
[2:3], s4 ; encoding
: [0xc1,0x1b,0x00,0xc0,0x04,0x00,0x00,0x00]
76 s_load_dword ttmp0
, s
[2:3], s4
77 // GCN
: s_load_dword ttmp0
, s
[2:3], s4 ; encoding
: [0x04,0x02,0x38,0xc0]
78 // VI
: s_load_dword ttmp0
, s
[2:3], s4 ; encoding
: [0x01,0x1c,0x00,0xc0,0x04,0x00,0x00,0x00]
80 s_load_dwordx2 s
[2:3], s
[2:3], 1
81 // GCN
: s_load_dwordx2 s
[2:3], s
[2:3], 0x1 ; encoding
: [0x01,0x03,0x41,0xc0]
82 // VI
: s_load_dwordx2 s
[2:3], s
[2:3], 0x1 ; encoding
: [0x81,0x00,0x06,0xc0,0x01,0x00,0x00,0x00]
84 s_load_dwordx2 s
[2:3], s
[2:3], s4
85 // GCN
: s_load_dwordx2 s
[2:3], s
[2:3], s4 ; encoding
: [0x04,0x02,0x41,0xc0]
86 // VI
: s_load_dwordx2 s
[2:3], s
[2:3], s4 ; encoding
: [0x81,0x00,0x04,0xc0,0x04,0x00,0x00,0x00]
88 s_load_dwordx2 tba
, s
[2:3], s4
89 // GCN
: s_load_dwordx2 tba
, s
[2:3], s4 ; encoding
: [0x04,0x02,0x76,0xc0]
90 // VI
: s_load_dwordx2 tba
, s
[2:3], s4 ; encoding
: [0x01,0x1b,0x04,0xc0,0x04,0x00,0x00,0x00]
92 s_load_dwordx2 tma
, s
[2:3], s4
93 // GCN
: s_load_dwordx2 tma
, s
[2:3], s4 ; encoding
: [0x04,0x02,0x77,0xc0]
94 // VI
: s_load_dwordx2 tma
, s
[2:3], s4 ; encoding
: [0x81,0x1b,0x04,0xc0,0x04,0x00,0x00,0x00]
96 s_load_dwordx2 ttmp
[2:3], s
[2:3], s4
97 // GCN
: s_load_dwordx2 ttmp
[2:3], s
[2:3], s4 ; encoding
: [0x04,0x02,0x79,0xc0]
98 // VI
: s_load_dwordx2 ttmp
[2:3], s
[2:3], s4 ; encoding
: [0x81,0x1c,0x04,0xc0,0x04,0x00,0x00,0x00]
100 s_load_dwordx4 s
[4:7], s
[2:3], 1
101 // GCN
: s_load_dwordx4 s
[4:7], s
[2:3], 0x1 ; encoding
: [0x01,0x03,0x82,0xc0]
102 // VI
: s_load_dwordx4 s
[4:7], s
[2:3], 0x1 ; encoding
: [0x01,0x01,0x0a,0xc0,0x01,0x00,0x00,0x00]
104 s_load_dwordx4 s
[4:7], s
[2:3], s4
105 // GCN
: s_load_dwordx4 s
[4:7], s
[2:3], s4 ; encoding
: [0x04,0x02,0x82,0xc0]
106 // VI
: s_load_dwordx4 s
[4:7], s
[2:3], s4 ; encoding
: [0x01,0x01,0x08,0xc0,0x04,0x00,0x00,0x00]
108 s_load_dwordx4 ttmp
[4:7], ttmp
[2:3], ttmp4
109 // GCN
: s_load_dwordx4 ttmp
[4:7], ttmp
[2:3], ttmp4 ; encoding
: [0x74,0x72,0xba,0xc0]
110 // VI
: s_load_dwordx4 ttmp
[4:7], ttmp
[2:3], ttmp4 ; encoding
: [0x39,0x1d,0x08,0xc0,0x74,0x00,0x00,0x00]
112 s_load_dwordx4 s
[100:103], s
[2:3], s4
113 // GCN
: s_load_dwordx4 s
[100:103], s
[2:3], s4 ; encoding
: [0x04,0x02,0xb2,0xc0]
114 // NOVI
: :[[@LINE-
2]]:{{[0-9]+}}: error
: s
[100:103] register
not available on this GPU
116 s_load_dwordx8 s
[8:15], s
[2:3], 1
117 // GCN
: s_load_dwordx8 s
[8:15], s
[2:3], 0x1 ; encoding
: [0x01,0x03,0xc4,0xc0]
118 // VI
: s_load_dwordx8 s
[8:15], s
[2:3], 0x1 ; encoding
: [0x01,0x02,0x0e,0xc0,0x01,0x00,0x00,0x00]
120 s_load_dwordx8 s
[8:15], s
[2:3], s4
121 // GCN
: s_load_dwordx8 s
[8:15], s
[2:3], s4 ; encoding
: [0x04,0x02,0xc4,0xc0]
122 // VI
: s_load_dwordx8 s
[8:15], s
[2:3], s4 ; encoding
: [0x01,0x02,0x0c,0xc0,0x04,0x00,0x00,0x00]
124 s_load_dwordx8 s
[96:103], s
[2:3], s4
125 // GCN
: s_load_dwordx8 s
[96:103], s
[2:3], s4 ; encoding
: [0x04,0x02,0xf0,0xc0]
126 // NOVI
: :[[@LINE-
2]]:{{[0-9]+}}: error
: s
[96:103] register
not available on this GPU
128 s_load_dwordx16 s
[16:31], s
[2:3], 1
129 // GCN
: s_load_dwordx16 s
[16:31], s
[2:3], 0x1 ; encoding
: [0x01,0x03,0x08,0xc1]
130 // VI
: s_load_dwordx16 s
[16:31], s
[2:3], 0x1 ; encoding
: [0x01,0x04,0x12,0xc0,0x01,0x00,0x00,0x00]
132 s_load_dwordx16 s
[16:31], s
[2:3], s4
133 // GCN
: s_load_dwordx16 s
[16:31], s
[2:3], s4 ; encoding
: [0x04,0x02,0x08,0xc1]
134 // VI
: s_load_dwordx16 s
[16:31], s
[2:3], s4 ; encoding
: [0x01,0x04,0x10,0xc0,0x04,0x00,0x00,0x00]
136 s_load_dwordx16 s
[88:103], s
[2:3], s4
137 // GCN
: s_load_dwordx16 s
[88:103], s
[2:3], s4 ; encoding
: [0x04,0x02,0x2c,0xc1]
138 // NOVI
: :[[@LINE-
2]]:{{[0-9]+}}: error
: s
[88:103] register
not available on this GPU
140 s_buffer_load_dword s1
, s
[4:7], 1
141 // GCN
: s_buffer_load_dword s1
, s
[4:7], 0x1 ; encoding
: [0x01,0x85,0x00,0xc2]
142 // VI
: s_buffer_load_dword s1
, s
[4:7], 0x1 ; encoding
: [0x42,0x00,0x22,0xc0,0x01,0x00,0x00,0x00]
144 s_buffer_load_dword s1
, s
[4:7], s4
145 // GCN
: s_buffer_load_dword s1
, s
[4:7], s4 ; encoding
: [0x04,0x84,0x00,0xc2]
146 // VI
: s_buffer_load_dword s1
, s
[4:7], s4 ; encoding
: [0x42,0x00,0x20,0xc0,0x04,0x00,0x00,0x00]
148 s_buffer_load_dword tba_lo
, s
[4:7], s4
149 // GCN
: s_buffer_load_dword tba_lo
, s
[4:7], s4 ; encoding
: [0x04,0x04,0x36,0xc2]
150 // VI
: s_buffer_load_dword tba_lo
, s
[4:7], s4 ; encoding
: [0x02,0x1b,0x20,0xc0,0x04,0x00,0x00,0x00]
152 s_buffer_load_dword tba_hi
, s
[4:7], s4
153 // GCN
: s_buffer_load_dword tba_hi
, s
[4:7], s4 ; encoding
: [0x04,0x84,0x36,0xc2]
154 // VI
: s_buffer_load_dword tba_hi
, s
[4:7], s4 ; encoding
: [0x42,0x1b,0x20,0xc0,0x04,0x00,0x00,0x00]
156 s_buffer_load_dword tma_lo
, s
[4:7], s4
157 // GCN
: s_buffer_load_dword tma_lo
, s
[4:7], s4 ; encoding
: [0x04,0x04,0x37,0xc2]
158 // VI
: s_buffer_load_dword tma_lo
, s
[4:7], s4 ; encoding
: [0x82,0x1b,0x20,0xc0,0x04,0x00,0x00,0x00]
160 s_buffer_load_dword tma_hi
, s
[4:7], s4
161 // GCN
: s_buffer_load_dword tma_hi
, s
[4:7], s4 ; encoding
: [0x04,0x84,0x37,0xc2]
162 // VI
: s_buffer_load_dword tma_hi
, s
[4:7], s4 ; encoding
: [0xc2,0x1b,0x20,0xc0,0x04,0x00,0x00,0x00]
164 s_buffer_load_dword ttmp1
, ttmp
[4:7], ttmp4
165 // GCN
: s_buffer_load_dword ttmp1
, ttmp
[4:7], ttmp4 ; encoding
: [0x74,0xf4,0x38,0xc2]
166 // VI
: s_buffer_load_dword ttmp1
, ttmp
[4:7], ttmp4 ; encoding
: [0x7a,0x1c,0x20,0xc0,0x74,0x00,0x00,0x00]
168 s_buffer_load_dwordx2 s
[8:9], s
[4:7], 1
169 // GCN
: s_buffer_load_dwordx2 s
[8:9], s
[4:7], 0x1 ; encoding
: [0x01,0x05,0x44,0xc2]
170 // VI
: s_buffer_load_dwordx2 s
[8:9], s
[4:7], 0x1 ; encoding
: [0x02,0x02,0x26,0xc0,0x01,0x00,0x00,0x00]
172 s_buffer_load_dwordx2 s
[8:9], s
[4:7], s4
173 // GCN
: s_buffer_load_dwordx2 s
[8:9], s
[4:7], s4 ; encoding
: [0x04,0x04,0x44,0xc2]
174 // VI
: s_buffer_load_dwordx2 s
[8:9], s
[4:7], s4 ; encoding
: [0x02,0x02,0x24,0xc0,0x04,0x00,0x00,0x00]
176 s_buffer_load_dwordx2 tba
, s
[4:7], s4
177 // GCN
: s_buffer_load_dwordx2 tba
, s
[4:7], s4 ; encoding
: [0x04,0x04,0x76,0xc2]
178 // VI
: s_buffer_load_dwordx2 tba
, s
[4:7], s4 ; encoding
: [0x02,0x1b,0x24,0xc0,0x04,0x00,0x00,0x00]
180 s_buffer_load_dwordx2 tma
, s
[4:7], s4
181 // GCN
: s_buffer_load_dwordx2 tma
, s
[4:7], s4 ; encoding
: [0x04,0x04,0x77,0xc2]
182 // VI
: s_buffer_load_dwordx2 tma
, s
[4:7], s4 ; encoding
: [0x82,0x1b,0x24,0xc0,0x04,0x00,0x00,0x00]
184 s_buffer_load_dwordx4 s
[8:11], s
[4:7], 1
185 // GCN
: s_buffer_load_dwordx4 s
[8:11], s
[4:7], 0x1 ; encoding
: [0x01,0x05,0x84,0xc2]
186 // VI
: s_buffer_load_dwordx4 s
[8:11], s
[4:7], 0x1 ; encoding
: [0x02,0x02,0x2a,0xc0,0x01,0x00,0x00,0x00]
188 s_buffer_load_dwordx4 s
[8:11], s
[4:7], s4
189 // GCN
: s_buffer_load_dwordx4 s
[8:11], s
[4:7], s4 ; encoding
: [0x04,0x04,0x84,0xc2]
190 // VI
: s_buffer_load_dwordx4 s
[8:11], s
[4:7], s4 ; encoding
: [0x02,0x02,0x28,0xc0,0x04,0x00,0x00,0x00]
192 s_buffer_load_dwordx4 ttmp
[8:11], ttmp
[4:7], ttmp4
193 // GCN
: s_buffer_load_dwordx4 ttmp
[8:11], ttmp
[4:7], ttmp4 ; encoding
: [0x74,0x74,0xbc,0xc2]
194 // VI
: s_buffer_load_dwordx4 ttmp
[8:11], ttmp
[4:7], ttmp4 ; encoding
: [0x3a,0x1e,0x28,0xc0,0x74,0x00,0x00,0x00]
196 s_buffer_load_dwordx4 s
[100:103], s
[4:7], s4
197 // GCN
: s_buffer_load_dwordx4 s
[100:103], s
[4:7], s4 ; encoding
: [0x04,0x04,0xb2,0xc2]
198 // NOVI
: :[[@LINE-
2]]:{{[0-9]+}}: error
: s
[100:103] register
not available on this GPU
200 s_buffer_load_dwordx8 s
[8:15], s
[4:7], 1
201 // GCN
: s_buffer_load_dwordx8 s
[8:15], s
[4:7], 0x1 ; encoding
: [0x01,0x05,0xc4,0xc2]
202 // VI
: s_buffer_load_dwordx8 s
[8:15], s
[4:7], 0x1 ; encoding
: [0x02,0x02,0x2e,0xc0,0x01,0x00,0x00,0x00]
204 s_buffer_load_dwordx8 s
[8:15], s
[4:7], s4
205 // GCN
: s_buffer_load_dwordx8 s
[8:15], s
[4:7], s4 ; encoding
: [0x04,0x04,0xc4,0xc2]
206 // VI
: s_buffer_load_dwordx8 s
[8:15], s
[4:7], s4 ; encoding
: [0x02,0x02,0x2c,0xc0,0x04,0x00,0x00,0x00]
208 s_buffer_load_dwordx8 s
[96:103], s
[4:7], s4
209 // GCN
: s_buffer_load_dwordx8 s
[96:103], s
[4:7], s4 ; encoding
: [0x04,0x04,0xf0,0xc2]
210 // NOVI
: :[[@LINE-
2]]:{{[0-9]+}}: error
: s
[96:103] register
not available on this GPU
212 s_buffer_load_dwordx16 s
[16:31], s
[4:7], 1
213 // GCN
: s_buffer_load_dwordx16 s
[16:31], s
[4:7], 0x1 ; encoding
: [0x01,0x05,0x08,0xc3]
214 // VI
: s_buffer_load_dwordx16 s
[16:31], s
[4:7], 0x1 ; encoding
: [0x02,0x04,0x32,0xc0,0x01,0x00,0x00,0x00]
216 s_buffer_load_dwordx16 s
[16:31], s
[4:7], s4
217 // GCN
: s_buffer_load_dwordx16 s
[16:31], s
[4:7], s4 ; encoding
: [0x04,0x04,0x08,0xc3]
218 // VI
: s_buffer_load_dwordx16 s
[16:31], s
[4:7], s4 ; encoding
: [0x02,0x04,0x30,0xc0,0x04,0x00,0x00,0x00]
220 s_buffer_load_dwordx16 s
[88:103], s
[4:7], s4
221 // GCN
: s_buffer_load_dwordx16 s
[88:103], s
[4:7], s4 ; encoding
: [0x04,0x04,0x2c,0xc3]
222 // NOVI
: :[[@LINE-
2]]:{{[0-9]+}}: error
: s
[88:103] register
not available on this GPU
225 // GCN
: s_dcache_inv ; encoding
: [0x00,0x00,0xc0,0xc7]
226 // VI
: s_dcache_inv ; encoding
: [0x00,0x00,0x80,0xc0,0x00,0x00,0x00,0x00]
229 // CI
: s_dcache_inv_vol ; encoding
: [0x00,0x00,0x40,0xc7]
230 // NOSI
: :[[@LINE-
2]]:{{[0-9]+}}: error
: instruction
not supported on this GPU
231 // VI
: s_dcache_inv_vol ; encoding
: [0x00,0x00,0x88,0xc0,0x00,0x00,0x00,0x00]
234 // GCN
: s_memtime s
[4:5] ; encoding
: [0x00,0x00,0x82,0xc7]
235 // VI
: s_memtime s
[4:5] ; encoding
: [0x00,0x01,0x90,0xc0,0x00,0x00,0x00,0x00]
238 // GCN
: s_memtime tba ; encoding
: [0x00,0x00,0xb6,0xc7]
239 // VI
: s_memtime tba ; encoding
: [0x00,0x1b,0x90,0xc0,0x00,0x00,0x00,0x00]
242 // GCN
: s_memtime tma ; encoding
: [0x00,0x00,0xb7,0xc7]
243 // VI
: s_memtime tma ; encoding
: [0x80,0x1b,0x90,0xc0,0x00,0x00,0x00,0x00]