[llvm-readobj] - Simplify stack-sizes.test test case.
[llvm-complete.git] / test / MC / AMDGPU / sop2.s
blob84e157cb5b6c3fd8f6225a1fdaa5a8c3af45b99d
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 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding 2>&1 %s | FileCheck --check-prefix=GFX10-ERR %s
15 s_add_u32 s1, s2, s3
16 // GCN: s_add_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x80]
18 s_sub_u32 s1, s2, s3
19 // GCN: s_sub_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x80]
21 s_add_i32 s1, s2, s3
22 // GCN: s_add_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x81]
24 s_sub_i32 s1, s2, s3
25 // GCN: s_sub_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x81]
27 s_addc_u32 s1, s2, s3
28 // GCN: s_addc_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x82]
30 s_subb_u32 s1, s2, s3
31 // GCN: s_subb_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x82]
33 s_min_i32 s1, s2, s3
34 // GCN: s_min_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x83]
36 s_min_u32 s1, s2, s3
37 // GCN: s_min_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x83]
39 s_max_i32 s1, s2, s3
40 // GCN: s_max_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x84]
42 s_max_u32 s1, s2, s3
43 // GCN: s_max_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x84]
45 s_cselect_b32 s1, s2, s3
46 // GCN: s_cselect_b32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x85]
48 s_cselect_b64 s[2:3], s[4:5], s[6:7]
49 // GCN: s_cselect_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x85]
51 s_and_b32 s2, s4, s6
52 // SICI: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87]
53 // GFX89: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x86]
55 s_and_b32 s2, 1234, 1234
56 // SICI: s_and_b32 s2, 0x4d2, 0x4d2 ; encoding: [0xff,0xff,0x02,0x87,0xd2,0x04,0x00,0x00]
57 // GFX89: s_and_b32 s2, 0x4d2, 0x4d2 ; encoding: [0xff,0xff,0x02,0x86,0xd2,0x04,0x00,0x00]
59 s_and_b32 s2, 0xFFFF0000, -65536
60 // SICI: s_and_b32 s2, 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x02,0x87,0x00,0x00,0xff,0xff]
61 // GFX89: s_and_b32 s2, 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x02,0x86,0x00,0x00,0xff,0xff]
63 s_and_b64 s[2:3], s[4:5], s[6:7]
64 // SICI: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87]
65 // GFX89: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x86]
67 s_or_b32 s2, s4, s6
68 // SICI: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88]
69 // GFX89: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87]
71 s_or_b64 s[2:3], s[4:5], s[6:7]
72 // SICI: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88]
73 // GFX89: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87]
75 s_xor_b32 s2, s4, s6
76 // SICI: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89]
77 // GFX89: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88]
79 s_xor_b64 s[2:3], s[4:5], s[6:7]
80 // SICI: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89]
81 // GFX89: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88]
83 s_andn2_b32 s2, s4, s6
84 // SICI: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a]
85 // GFX89: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89]
87 s_andn2_b64 s[2:3], s[4:5], s[6:7]
88 // SICI: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a]
89 // GFX89: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89]
91 s_orn2_b32 s2, s4, s6
92 // SICI: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b]
93 // GFX89: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a]
95 s_orn2_b64 s[2:3], s[4:5], s[6:7]
96 // SICI: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b]
97 // GFX89: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a]
99 s_nand_b32 s2, s4, s6
100 // SICI: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c]
101 // GFX89: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b]
103 s_nand_b64 s[2:3], s[4:5], s[6:7]
104 // SICI: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c]
105 // GFX89: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b]
107 s_nor_b32 s2, s4, s6
108 // SICI: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d]
109 // GFX89: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c]
111 s_nor_b64 s[2:3], s[4:5], s[6:7]
112 // SICI: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d]
113 // GFX89: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c]
115 s_xnor_b32 s2, s4, s6
116 // SICI: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e]
117 // GFX89: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d]
119 s_xnor_b64 s[2:3], s[4:5], s[6:7]
120 // SICI: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8e]
121 // GFX89: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d]
123 s_lshl_b32 s2, s4, s6
124 // SICI: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f]
125 // GFX89: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e]
127 s_lshl_b64 s[2:3], s[4:5], s6
128 // SICI: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f]
129 // GFX89: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8e]
131 s_lshr_b32 s2, s4, s6
132 // SICI: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90]
133 // GFX89: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f]
135 s_lshr_b64 s[2:3], s[4:5], s6
136 // SICI: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90]
137 // GFX89: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f]
139 s_ashr_i32 s2, s4, s6
140 // SICI: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91]
141 // GFX89: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90]
143 s_ashr_i64 s[2:3], s[4:5], s6
144 // SICI: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x91]
145 // GFX89: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90]
147 s_ashr_i64 s[2:3], -65536, 0xFFFF0000
148 // SICI: s_ashr_i64 s[2:3], 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x82,0x91,0x00,0x00,0xff,0xff]
149 // GFX89: s_ashr_i64 s[2:3], 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x82,0x90,0x00,0x00,0xff,0xff]
151 s_bfm_b32 s2, s4, s6
152 // SICI: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92]
153 // GFX89: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91]
155 s_bfm_b64 s[2:3], s4, s6
156 // SICI: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x92]
157 // GFX89: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x91]
159 s_mul_i32 s2, s4, s6
160 // SICI: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93]
161 // GFX89: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92]
163 s_bfe_u32 s2, s4, s6
164 // SICI: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x93]
165 // GFX89: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x92]
167 s_bfe_i32 s2, s4, s6
168 // SICI: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x94]
169 // GFX89: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93]
171 s_bfe_u64 s[2:3], s[4:5], s6
172 // SICI: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x94]
173 // GFX89: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x93]
175 s_bfe_i64 s[2:3], s[4:5], s6
176 // SICI: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x95]
177 // GFX89: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x94]
179 s_cbranch_g_fork s[4:5], s[6:7]
180 // SICI: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x95]
181 // GFX89: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x94]
182 // GFX10-ERR: error: instruction not supported on this GPU
184 s_cbranch_g_fork 1, s[6:7]
185 // SICI: s_cbranch_g_fork 1, s[6:7] ; encoding: [0x81,0x06,0x80,0x95]
186 // GFX89: s_cbranch_g_fork 1, s[6:7] ; encoding: [0x81,0x06,0x80,0x94]
187 // GFX10-ERR: error: instruction not supported on this GPU
189 s_cbranch_g_fork s[6:7], 2
190 // SICI: s_cbranch_g_fork s[6:7], 2 ; encoding: [0x06,0x82,0x80,0x95]
191 // GFX89: s_cbranch_g_fork s[6:7], 2 ; encoding: [0x06,0x82,0x80,0x94]
192 // GFX10-ERR: error: instruction not supported on this GPU
194 s_absdiff_i32 s2, s4, s6
195 // SICI: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x96]
196 // GFX89: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x95]
198 s_add_u32 s101, s102, s103
199 // SICI: s_add_u32 s101, s102, s103 ; encoding: [0x66,0x67,0x65,0x80]
200 // NOGFX89: error: not a valid operand
202 s_lshl1_add_u32 s5, s1, s2
203 // GFX9: s_lshl1_add_u32 s5, s1, s2 ; encoding: [0x01,0x02,0x05,0x97]
204 // NOSICIVI: error
206 s_lshl1_add_u32 s5, -1, s2
207 // GFX9: s_lshl1_add_u32 s5, -1, s2 ; encoding: [0xc1,0x02,0x05,0x97]
208 // NOSICIVI: error
210 s_lshl1_add_u32 s5, s1, 0
211 // GFX9: s_lshl1_add_u32 s5, s1, 0 ; encoding: [0x01,0x80,0x05,0x97]
212 // NOSICIVI: error
214 s_lshl1_add_u32 s5, s1, 0x3f717273
215 // GFX9: s_lshl1_add_u32 s5, s1, 0x3f717273 ; encoding: [0x01,0xff,0x05,0x97,0x73,0x72,0x71,0x3f]
216 // NOSICIVI: error
218 s_lshl2_add_u32 s101, s1, s2
219 // GFX9: s_lshl2_add_u32 s101, s1, s2 ; encoding: [0x01,0x02,0xe5,0x97]
220 // NOSICIVI: error
222 s_lshl2_add_u32 s5, 0xaf123456, s2
223 // GFX9: s_lshl2_add_u32 s5, 0xaf123456, s2 ; encoding: [0xff,0x02,0x85,0x97,0x56,0x34,0x12,0xaf]
224 // NOSICIVI: error
226 s_lshl3_add_u32 s5, 0x3f717273, s2
227 // GFX9: s_lshl3_add_u32 s5, 0x3f717273, s2 ; encoding: [0xff,0x02,0x05,0x98,0x73,0x72,0x71,0x3f]
228 // NOSICIVI: error
230 s_lshl3_add_u32 s5, s1, s101
231 // GFX9: s_lshl3_add_u32 s5, s1, s101 ; encoding: [0x01,0x65,0x05,0x98]
232 // NOSICIVI: error
234 s_lshl4_add_u32 s5, s1, 0xaf123456
235 // GFX9: s_lshl4_add_u32 s5, s1, 0xaf123456 ; encoding: [0x01,0xff,0x85,0x98,0x56,0x34,0x12,0xaf]
236 // NOSICIVI: error
238 s_lshl4_add_u32 s5, -1, s2
239 // GFX9: s_lshl4_add_u32 s5, -1, s2 ; encoding: [0xc1,0x02,0x85,0x98]
240 // NOSICIVI: error
242 s_mul_hi_i32 s5, s101, s2
243 // GFX9: s_mul_hi_i32 s5, s101, s2 ; encoding: [0x65,0x02,0x85,0x96]
244 // NOSICIVI: error
246 s_mul_hi_i32 s5, 0, s2
247 // GFX9: s_mul_hi_i32 s5, 0, s2 ; encoding: [0x80,0x02,0x85,0x96]
248 // NOSICIVI: error
250 s_mul_hi_i32 s5, 0x3f717273, s2
251 // GFX9: s_mul_hi_i32 s5, 0x3f717273, s2 ; encoding: [0xff,0x02,0x85,0x96,0x73,0x72,0x71,0x3f]
252 // NOSICIVI: error
254 s_mul_hi_i32 s5, s1, s101
255 // GFX9: s_mul_hi_i32 s5, s1, s101 ; encoding: [0x01,0x65,0x85,0x96]
256 // NOSICIVI: error
258 s_mul_hi_i32 s5, s1, 0
259 // GFX9: s_mul_hi_i32 s5, s1, 0 ; encoding: [0x01,0x80,0x85,0x96]
260 // NOSICIVI: error
262 s_mul_hi_u32 s5, s1, 0x3f717273
263 // GFX9: s_mul_hi_u32 s5, s1, 0x3f717273 ; encoding: [0x01,0xff,0x05,0x96,0x73,0x72,0x71,0x3f]
264 // NOSICIVI: error
266 s_mul_hi_u32 s5, s1, s101
267 // GFX9: s_mul_hi_u32 s5, s1, s101 ; encoding: [0x01,0x65,0x05,0x96]
268 // NOSICIVI: error
270 s_mul_hi_u32 s5, s1, 0
271 // GFX9: s_mul_hi_u32 s5, s1, 0 ; encoding: [0x01,0x80,0x05,0x96]
272 // NOSICIVI: error