[obj2yaml] - Fix a comment. NFC.
[llvm-complete.git] / test / MC / AMDGPU / sop1.s
blob97920ac70517fe5d0b36c209741722ebefd4ab81
1 // RUN: not llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
2 // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=VI --check-prefix=GFX89 %s
3 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=GFX89 --check-prefix=GFX9 %s
4 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=GFX10 %s
6 // RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICI --check-prefix=NOSICIVI %s
7 // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=NOVI --check-prefix=NOSICIVI --check-prefix=NOGFX89 %s
8 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck --check-prefix=NOGFX89 %s
10 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding 2>&1 %s | FileCheck --check-prefix=GFX10-ERR %s
12 s_mov_b32 s1, s2
13 // SICI: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe]
14 // GFX89: s_mov_b32 s1, s2 ; encoding: [0x02,0x00,0x81,0xbe]
16 s_mov_b32 s1, 1
17 // SICI: s_mov_b32 s1, 1 ; encoding: [0x81,0x03,0x81,0xbe]
18 // GFX89: s_mov_b32 s1, 1 ; encoding: [0x81,0x00,0x81,0xbe]
20 s_mov_b32 s1, 100
21 // SICI: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x03,0x81,0xbe,0x64,0x00,0x00,0x00]
22 // GFX89: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x00,0x81,0xbe,0x64,0x00,0x00,0x00]
24 // Literal constant sign bit
25 s_mov_b32 s1, 0x80000000
26 // SICI: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x03,0x81,0xbe,0x00,0x00,0x00,0x80]
27 // GFX89: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x00,0x81,0xbe,0x00,0x00,0x00,0x80]
29 // Negative 32-bit constant
30 s_mov_b32 s0, 0xfe5163ab
31 // SICI: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x03,0x80,0xbe,0xab,0x63,0x51,0xfe]
32 // GFX89: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x00,0x80,0xbe,0xab,0x63,0x51,0xfe]
34 s_mov_b64 s[2:3], s[4:5]
35 // SICI: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe]
36 // GFX89: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x01,0x82,0xbe]
38 s_mov_b64 null, s[4:5]
39 // GFX10: s_mov_b64 null, s[4:5] ; encoding: [0x04,0x04,0xfd,0xbe]
40 // NOSICIVI: error: not a valid operand.
42 s_mov_b64 s[2:3], 0xffffffffffffffff
43 // SICI: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x04,0x82,0xbe]
44 // GFX89: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x01,0x82,0xbe]
46 s_mov_b64 s[2:3], 0xffffffff
47 // SICI: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x04,0x82,0xbe,0xff,0xff,0xff,0xff]
48 // GFX89: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x01,0x82,0xbe,0xff,0xff,0xff,0xff]
50 s_mov_b64 s[0:1], 0x80000000
51 // SICI: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x04,0x80,0xbe,0x00,0x00,0x00,0x80]
52 // GFX89: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x01,0x80,0xbe,0x00,0x00,0x00,0x80]
54 s_mov_b64 s[102:103], -1
55 // SICI: s_mov_b64 s[102:103], -1 ; encoding: [0xc1,0x04,0xe6,0xbe]
56 // NOGFX89: error: not a valid operand
58 s_cmov_b32 s1, 200
59 // SICI: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x05,0x81,0xbe,0xc8,0x00,0x00,0x00]
60 // GFX89: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x02,0x81,0xbe,0xc8,0x00,0x00,0x00]
62 s_cmov_b32 s1, 1.0
63 // SICI: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x05,0x81,0xbe]
64 // GFX89: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x02,0x81,0xbe]
66 s_cmov_b32 s1, s2
67 // SICI: s_cmov_b32 s1, s2 ; encoding: [0x02,0x05,0x81,0xbe]
68 // GFX89: s_cmov_b32 s1, s2 ; encoding: [0x02,0x02,0x81,0xbe]
70 //s_cmov_b64 s[2:3], 1.0
71 //GCN-FIXME: s_cmov_b64 s[2:3], 1.0 ; encoding: [0xf2,0x05,0x82,0xb3]
73 s_cmov_b64 s[2:3], s[4:5]
74 // SICI: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x06,0x82,0xbe]
75 // GFX89: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x03,0x82,0xbe]
77 s_not_b32 s1, s2
78 // SICI: s_not_b32 s1, s2 ; encoding: [0x02,0x07,0x81,0xbe]
79 // GFX89: s_not_b32 s1, s2 ; encoding: [0x02,0x04,0x81,0xbe]
81 s_not_b64 s[2:3], s[4:5]
82 // SICI: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x08,0x82,0xbe]
83 // GFX89: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x05,0x82,0xbe]
85 s_wqm_b32 s1, s2
86 // SICI: s_wqm_b32 s1, s2 ; encoding: [0x02,0x09,0x81,0xbe]
87 // GFX89: s_wqm_b32 s1, s2 ; encoding: [0x02,0x06,0x81,0xbe]
89 s_wqm_b64 s[2:3], s[4:5]
90 // SICI: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0a,0x82,0xbe]
91 // GFX89: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x07,0x82,0xbe]
93 s_brev_b32 s1, s2
94 // SICI: s_brev_b32 s1, s2 ; encoding: [0x02,0x0b,0x81,0xbe]
95 // GFX89: s_brev_b32 s1, s2 ; encoding: [0x02,0x08,0x81,0xbe]
97 s_brev_b64 s[2:3], s[4:5]
98 // SICI: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0c,0x82,0xbe]
99 // GFX89: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x09,0x82,0xbe]
101 s_bcnt0_i32_b32 s1, s2
102 // SICI: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0d,0x81,0xbe]
103 // GFX89: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0a,0x81,0xbe]
105 s_bcnt0_i32_b64 s1, s[2:3]
106 // SICI: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0e,0x81,0xbe]
107 // GFX89: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0b,0x81,0xbe]
109 s_bcnt1_i32_b32 s1, s2
110 // SICI: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0f,0x81,0xbe]
111 // GFX89: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0c,0x81,0xbe]
113 s_bcnt1_i32_b64 s1, s[2:3]
114 // SICI: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x10,0x81,0xbe]
115 // GFX89: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0d,0x81,0xbe]
117 s_ff0_i32_b32 s1, s2
118 // SICI: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x11,0x81,0xbe]
119 // GFX89: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x0e,0x81,0xbe]
121 s_ff0_i32_b64 s1, s[2:3]
122 // SICI: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x12,0x81,0xbe]
123 // GFX89: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0f,0x81,0xbe]
125 s_ff1_i32_b32 s1, s2
126 // SICI: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x13,0x81,0xbe]
127 // GFX89: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x10,0x81,0xbe]
129 s_ff1_i32_b64 s1, s[2:3]
130 // SICI: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x14,0x81,0xbe]
131 // GFX89: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x11,0x81,0xbe]
133 s_flbit_i32_b32 s1, s2
134 // SICI: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x15,0x81,0xbe]
135 // GFX89: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x12,0x81,0xbe]
137 s_flbit_i32_b64 s1, s[2:3]
138 // SICI: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x16,0x81,0xbe]
139 // GFX89: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x13,0x81,0xbe]
141 s_flbit_i32 s1, s2
142 // SICI: s_flbit_i32 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe]
143 // GFX89: s_flbit_i32 s1, s2 ; encoding: [0x02,0x14,0x81,0xbe]
145 s_flbit_i32_i64 s1, s[2:3]
146 // SICI: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x18,0x81,0xbe]
147 // GFX89: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x15,0x81,0xbe]
149 s_sext_i32_i8 s1, s2
150 // SICI: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x19,0x81,0xbe]
151 // GFX89: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x16,0x81,0xbe]
153 s_sext_i32_i16 s1, s2
154 // SICI: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe]
155 // GFX89: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe]
157 s_bitset0_b32 s1, s2
158 // SICI: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x1b,0x81,0xbe]
159 // GFX89: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x18,0x81,0xbe]
161 s_bitset0_b64 s[2:3], s4
162 // SICI: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x1c,0x82,0xbe]
163 // GFX89: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x19,0x82,0xbe]
165 s_bitset1_b32 s1, s2
166 // SICI: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1d,0x81,0xbe]
167 // GFX89: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe]
169 s_bitset1_b64 s[2:3], s4
170 // SICI: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1e,0x82,0xbe]
171 // GFX89: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1b,0x82,0xbe]
173 s_getpc_b64 s[2:3]
174 // SICI: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1f,0x82,0xbe]
175 // GFX89: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1c,0x82,0xbe]
177 s_setpc_b64 s[4:5]
178 // SICI: s_setpc_b64 s[4:5] ; encoding: [0x04,0x20,0x80,0xbe]
179 // GFX89: s_setpc_b64 s[4:5] ; encoding: [0x04,0x1d,0x80,0xbe]
181 s_swappc_b64 s[2:3], s[4:5]
182 // SICI: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe]
183 // GFX89: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x1e,0x82,0xbe]
185 s_rfe_b64 s[4:5]
186 // SICI: s_rfe_b64 s[4:5] ; encoding: [0x04,0x22,0x80,0xbe]
187 // GFX89: s_rfe_b64 s[4:5] ; encoding: [0x04,0x1f,0x80,0xbe]
189 s_and_saveexec_b64 s[2:3], s[4:5]
190 // SICI: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe]
191 // GFX89: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x20,0x82,0xbe]
193 s_or_saveexec_b64 s[2:3], s[4:5]
194 // SICI: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe]
195 // GFX89: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe]
197 s_xor_saveexec_b64 s[2:3], s[4:5]
198 // SICI: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe]
199 // GFX89: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x22,0x82,0xbe]
201 s_andn2_saveexec_b64 s[2:3], s[4:5]
202 // SICI: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe]
203 // GFX89: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x23,0x82,0xbe]
205 s_orn2_saveexec_b64 s[2:3], s[4:5]
206 // SICI: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x28,0x82,0xbe]
207 // GFX89: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe]
209 s_nand_saveexec_b64 s[2:3], s[4:5]
210 // SICI: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe]
211 // GFX89: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe]
213 s_nor_saveexec_b64 s[2:3], s[4:5]
214 // SICI: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2a,0x82,0xbe]
215 // GFX89: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe]
217 s_xnor_saveexec_b64 s[2:3], s[4:5]
218 // SICI: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe]
219 // GFX89: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe]
221 s_quadmask_b32 s1, s2
222 // SICI: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe]
223 // GFX89: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x28,0x81,0xbe]
225 s_quadmask_b64 s[2:3], s[4:5]
226 // SICI: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe]
227 // GFX89: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe]
229 s_movrels_b32 s1, s2
230 // SICI: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2e,0x81,0xbe]
231 // GFX89: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2a,0x81,0xbe]
233 s_movrels_b64 s[2:3], s[4:5]
234 // SICI: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2f,0x82,0xbe]
235 // GFX89: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe]
237 s_movreld_b32 s1, s2
238 // SICI: s_movreld_b32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe]
239 // GFX89: s_movreld_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe]
241 s_movreld_b64 s[2:3], s[4:5]
242 // SICI: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x31,0x82,0xbe]
243 // GFX89: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe]
245 s_cbranch_join s4
246 // SICI: s_cbranch_join s4 ; encoding: [0x04,0x32,0x80,0xbe]
247 // GFX89: s_cbranch_join s4 ; encoding: [0x04,0x2e,0x80,0xbe]
248 // GFX10-ERR: error: instruction not supported on this GPU
250 s_cbranch_join 1
251 // NOSICI: error: invalid operand for instruction
252 // NOGFX89: error: invalid operand for instruction
254 s_cbranch_join 100
255 // NOSICI: error: invalid operand for instruction
256 // NOGFX89: error: invalid operand for instruction
258 s_abs_i32 s1, s2
259 // SICI: s_abs_i32 s1, s2 ; encoding: [0x02,0x34,0x81,0xbe]
260 // GFX89: s_abs_i32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe]
262 s_mov_fed_b32 s1, s2
263 // SICI: s_mov_fed_b32 s1, s2 ; encoding: [0x02,0x35,0x81,0xbe]
265 s_set_gpr_idx_idx s0
266 // GFX89: s_set_gpr_idx_idx s0 ; encoding: [0x00,0x32,0x80,0xbe]
267 // NOSICI: error: instruction not supported on this GPU
269 s_andn1_saveexec_b64 s[100:101], s[2:3]
270 // GFX9: s_andn1_saveexec_b64 s[100:101], s[2:3] ; encoding: [0x02,0x33,0xe4,0xbe]
271 // NOSICIVI: error: instruction not supported on this GPU
273 s_andn1_saveexec_b64 s[10:11], s[4:5]
274 // GFX9: s_andn1_saveexec_b64 s[10:11], s[4:5] ; encoding: [0x04,0x33,0x8a,0xbe]
275 // NOSICIVI: error: instruction not supported on this GPU
277 s_andn1_saveexec_b64 s[10:11], -1
278 // GFX9: s_andn1_saveexec_b64 s[10:11], -1 ; encoding: [0xc1,0x33,0x8a,0xbe]
279 // NOSICIVI: error: instruction not supported on this GPU
281 s_andn1_saveexec_b64 s[10:11], 0xaf123456
282 // GFX9: s_andn1_saveexec_b64 s[10:11], 0xaf123456 ; encoding: [0xff,0x33,0x8a,0xbe,0x56,0x34,0x12,0xaf]
283 // NOSICIVI: error: instruction not supported on this GPU
285 s_andn1_wrexec_b64 s[10:11], s[2:3]
286 // GFX9: s_andn1_wrexec_b64 s[10:11], s[2:3] ; encoding: [0x02,0x35,0x8a,0xbe]
287 // NOSICIVI: error: instruction not supported on this GPU
289 s_andn2_wrexec_b64 s[12:13], s[2:3]
290 // GFX9: s_andn2_wrexec_b64 s[12:13], s[2:3] ; encoding: [0x02,0x36,0x8c,0xbe]
291 // NOSICIVI: error: instruction not supported on this GPU
293 s_orn1_saveexec_b64 s[10:11], 0
294 // GFX9: s_orn1_saveexec_b64 s[10:11], 0 ; encoding: [0x80,0x34,0x8a,0xbe]
295 // NOSICIVI: error: instruction not supported on this GPU
297 s_bitreplicate_b64_b32 s[10:11], s101
298 // GFX9: s_bitreplicate_b64_b32 s[10:11], s101 ; encoding: [0x65,0x37,0x8a,0xbe]
299 // NOSICIVI: error: instruction not supported on this GPU
301 s_bitreplicate_b64_b32 s[10:11], -1
302 // GFX9: s_bitreplicate_b64_b32 s[10:11], -1 ; encoding: [0xc1,0x37,0x8a,0xbe]
303 // NOSICIVI: error: instruction not supported on this GPU
305 s_bitreplicate_b64_b32 s[10:11], 0x3f717273
306 // GFX9: s_bitreplicate_b64_b32 s[10:11], 0x3f717273 ; encoding: [0xff,0x37,0x8a,0xbe,0x73,0x72,0x71,0x3f]
307 // NOSICIVI: error: instruction not supported on this GPU