Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / test / MC / AMDGPU / sop2.s
blob8102b0d7f331162d9427eda20bac81dae58327f5
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=tahiti -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
3 // RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
4 // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=GFX89 %s
5 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=GFX89 --check-prefix=GFX9 %s
7 // RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICIVI %s
8 // RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICIVI %s
9 // RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICIVI %s
10 // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICIVI --check-prefix=NOVI --check-prefix=NOGFX89 %s
11 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck --check-prefix=NOGFX89 %s
13 s_add_u32 s1, s2, s3
14 // GCN: s_add_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x80]
16 s_sub_u32 s1, s2, s3
17 // GCN: s_sub_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x80]
19 s_add_i32 s1, s2, s3
20 // GCN: s_add_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x81]
22 s_sub_i32 s1, s2, s3
23 // GCN: s_sub_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x81]
25 s_addc_u32 s1, s2, s3
26 // GCN: s_addc_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x82]
28 s_subb_u32 s1, s2, s3
29 // GCN: s_subb_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x82]
31 s_min_i32 s1, s2, s3
32 // GCN: s_min_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x83]
34 s_min_u32 s1, s2, s3
35 // GCN: s_min_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x83]
37 s_max_i32 s1, s2, s3
38 // GCN: s_max_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x84]
40 s_max_u32 s1, s2, s3
41 // GCN: s_max_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x84]
43 s_cselect_b32 s1, s2, s3
44 // GCN: s_cselect_b32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x85]
46 s_cselect_b64 s[2:3], s[4:5], s[6:7]
47 // GCN: s_cselect_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x85]
49 s_and_b32 s2, s4, s6
50 // SICI: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87]
51 // GFX89: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x86]
53 s_and_b32 s2, 1234, 1234
54 // SICI: s_and_b32 s2, 0x4d2, 0x4d2 ; encoding: [0xff,0xff,0x02,0x87,0xd2,0x04,0x00,0x00]
55 // GFX89: s_and_b32 s2, 0x4d2, 0x4d2 ; encoding: [0xff,0xff,0x02,0x86,0xd2,0x04,0x00,0x00]
57 s_and_b32 s2, 0xFFFF0000, -65536
58 // SICI: s_and_b32 s2, 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x02,0x87,0x00,0x00,0xff,0xff]
59 // GFX89: s_and_b32 s2, 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x02,0x86,0x00,0x00,0xff,0xff]
61 s_and_b64 s[2:3], s[4:5], s[6:7]
62 // SICI: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87]
63 // GFX89: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x86]
65 s_or_b32 s2, s4, s6
66 // SICI: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88]
67 // GFX89: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87]
69 s_or_b64 s[2:3], s[4:5], s[6:7]
70 // SICI: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88]
71 // GFX89: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87]
73 s_xor_b32 s2, s4, s6
74 // SICI: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89]
75 // GFX89: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88]
77 s_xor_b64 s[2:3], s[4:5], s[6:7]
78 // SICI: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89]
79 // GFX89: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88]
81 s_andn2_b32 s2, s4, s6
82 // SICI: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a]
83 // GFX89: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89]
85 s_andn2_b64 s[2:3], s[4:5], s[6:7]
86 // SICI: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a]
87 // GFX89: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89]
89 s_orn2_b32 s2, s4, s6
90 // SICI: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b]
91 // GFX89: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a]
93 s_orn2_b64 s[2:3], s[4:5], s[6:7]
94 // SICI: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b]
95 // GFX89: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a]
97 s_nand_b32 s2, s4, s6
98 // SICI: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c]
99 // GFX89: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b]
101 s_nand_b64 s[2:3], s[4:5], s[6:7]
102 // SICI: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c]
103 // GFX89: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b]
105 s_nor_b32 s2, s4, s6
106 // SICI: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d]
107 // GFX89: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c]
109 s_nor_b64 s[2:3], s[4:5], s[6:7]
110 // SICI: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d]
111 // GFX89: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c]
113 s_xnor_b32 s2, s4, s6
114 // SICI: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e]
115 // GFX89: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d]
117 s_xnor_b64 s[2:3], s[4:5], s[6:7]
118 // SICI: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8e]
119 // GFX89: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d]
121 s_lshl_b32 s2, s4, s6
122 // SICI: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f]
123 // GFX89: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e]
125 s_lshl_b64 s[2:3], s[4:5], s6
126 // SICI: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f]
127 // GFX89: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8e]
129 s_lshr_b32 s2, s4, s6
130 // SICI: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90]
131 // GFX89: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f]
133 s_lshr_b64 s[2:3], s[4:5], s6
134 // SICI: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90]
135 // GFX89: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f]
137 s_ashr_i32 s2, s4, s6
138 // SICI: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91]
139 // GFX89: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90]
141 s_ashr_i64 s[2:3], s[4:5], s6
142 // SICI: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x91]
143 // GFX89: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90]
145 s_ashr_i64 s[2:3], -65536, 0xFFFF0000
146 // SICI: s_ashr_i64 s[2:3], 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x82,0x91,0x00,0x00,0xff,0xff]
147 // GFX89: s_ashr_i64 s[2:3], 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x82,0x90,0x00,0x00,0xff,0xff]
149 s_bfm_b32 s2, s4, s6
150 // SICI: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92]
151 // GFX89: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91]
153 s_bfm_b64 s[2:3], s4, s6
154 // SICI: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x92]
155 // GFX89: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x91]
157 s_mul_i32 s2, s4, s6
158 // SICI: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93]
159 // GFX89: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92]
161 s_bfe_u32 s2, s4, s6
162 // SICI: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x93]
163 // GFX89: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x92]
165 s_bfe_i32 s2, s4, s6
166 // SICI: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x94]
167 // GFX89: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93]
169 s_bfe_u64 s[2:3], s[4:5], s6
170 // SICI: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x94]
171 // GFX89: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x93]
173 s_bfe_i64 s[2:3], s[4:5], s6
174 // SICI: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x95]
175 // GFX89: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x94]
177 s_cbranch_g_fork s[4:5], s[6:7]
178 // SICI: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x95]
179 // GFX89: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x94]
181 s_cbranch_g_fork 1, s[6:7]
182 // SICI: s_cbranch_g_fork 1, s[6:7] ; encoding: [0x81,0x06,0x80,0x95]
183 // GFX89: s_cbranch_g_fork 1, s[6:7] ; encoding: [0x81,0x06,0x80,0x94]
185 s_cbranch_g_fork s[6:7], 2
186 // SICI: s_cbranch_g_fork s[6:7], 2 ; encoding: [0x06,0x82,0x80,0x95]
187 // GFX89: s_cbranch_g_fork s[6:7], 2 ; encoding: [0x06,0x82,0x80,0x94]
189 s_absdiff_i32 s2, s4, s6
190 // SICI: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x96]
191 // GFX89: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x95]
193 s_add_u32 s101, s102, s103
194 // SICI: s_add_u32 s101, s102, s103 ; encoding: [0x66,0x67,0x65,0x80]
195 // NOGFX89: error: not a valid operand
197 s_lshl1_add_u32 s5, s1, s2
198 // GFX9: s_lshl1_add_u32 s5, s1, s2 ; encoding: [0x01,0x02,0x05,0x97]
199 // NOSICIVI: error
201 s_lshl1_add_u32 s5, -1, s2
202 // GFX9: s_lshl1_add_u32 s5, -1, s2 ; encoding: [0xc1,0x02,0x05,0x97]
203 // NOSICIVI: error
205 s_lshl1_add_u32 s5, s1, 0
206 // GFX9: s_lshl1_add_u32 s5, s1, 0 ; encoding: [0x01,0x80,0x05,0x97]
207 // NOSICIVI: error
209 s_lshl1_add_u32 s5, s1, 0x3f717273
210 // GFX9: s_lshl1_add_u32 s5, s1, 0x3f717273 ; encoding: [0x01,0xff,0x05,0x97,0x73,0x72,0x71,0x3f]
211 // NOSICIVI: error
213 s_lshl2_add_u32 s101, s1, s2
214 // GFX9: s_lshl2_add_u32 s101, s1, s2 ; encoding: [0x01,0x02,0xe5,0x97]
215 // NOSICIVI: error
217 s_lshl2_add_u32 s5, 0xaf123456, s2
218 // GFX9: s_lshl2_add_u32 s5, 0xaf123456, s2 ; encoding: [0xff,0x02,0x85,0x97,0x56,0x34,0x12,0xaf]
219 // NOSICIVI: error
221 s_lshl3_add_u32 s5, 0x3f717273, s2
222 // GFX9: s_lshl3_add_u32 s5, 0x3f717273, s2 ; encoding: [0xff,0x02,0x05,0x98,0x73,0x72,0x71,0x3f]
223 // NOSICIVI: error
225 s_lshl3_add_u32 s5, s1, s101
226 // GFX9: s_lshl3_add_u32 s5, s1, s101 ; encoding: [0x01,0x65,0x05,0x98]
227 // NOSICIVI: error
229 s_lshl4_add_u32 s5, s1, 0xaf123456
230 // GFX9: s_lshl4_add_u32 s5, s1, 0xaf123456 ; encoding: [0x01,0xff,0x85,0x98,0x56,0x34,0x12,0xaf]
231 // NOSICIVI: error
233 s_lshl4_add_u32 s5, -1, s2
234 // GFX9: s_lshl4_add_u32 s5, -1, s2 ; encoding: [0xc1,0x02,0x85,0x98]
235 // NOSICIVI: error
237 s_mul_hi_i32 s5, s101, s2
238 // GFX9: s_mul_hi_i32 s5, s101, s2 ; encoding: [0x65,0x02,0x85,0x96]
239 // NOSICIVI: error
241 s_mul_hi_i32 s5, 0, s2
242 // GFX9: s_mul_hi_i32 s5, 0, s2 ; encoding: [0x80,0x02,0x85,0x96]
243 // NOSICIVI: error
245 s_mul_hi_i32 s5, 0x3f717273, s2
246 // GFX9: s_mul_hi_i32 s5, 0x3f717273, s2 ; encoding: [0xff,0x02,0x85,0x96,0x73,0x72,0x71,0x3f]
247 // NOSICIVI: error
249 s_mul_hi_i32 s5, s1, s101
250 // GFX9: s_mul_hi_i32 s5, s1, s101 ; encoding: [0x01,0x65,0x85,0x96]
251 // NOSICIVI: error
253 s_mul_hi_i32 s5, s1, 0
254 // GFX9: s_mul_hi_i32 s5, s1, 0 ; encoding: [0x01,0x80,0x85,0x96]
255 // NOSICIVI: error
257 s_mul_hi_u32 s5, s1, 0x3f717273
258 // GFX9: s_mul_hi_u32 s5, s1, 0x3f717273 ; encoding: [0x01,0xff,0x05,0x96,0x73,0x72,0x71,0x3f]
259 // NOSICIVI: error
261 s_mul_hi_u32 s5, s1, s101
262 // GFX9: s_mul_hi_u32 s5, s1, s101 ; encoding: [0x01,0x65,0x05,0x96]
263 // NOSICIVI: error
265 s_mul_hi_u32 s5, s1, 0
266 // GFX9: s_mul_hi_u32 s5, s1, 0 ; encoding: [0x01,0x80,0x05,0x96]
267 // NOSICIVI: error