Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / AArch64 / SVE / sub.s
blob86c84760d5ca04639e252f13b5bd7215ac3061a5
1 // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
2 // RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3 // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s \
4 // RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
5 // RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
6 // RUN: | FileCheck %s --check-prefix=CHECK-ERROR
7 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
8 // RUN: | llvm-objdump --no-print-imm-hex -d --mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
9 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
10 // RUN: | llvm-objdump --no-print-imm-hex -d --mattr=-sve - | FileCheck %s --check-prefix=CHECK-UNKNOWN
12 sub z0.h, z0.h, z0.h
13 // CHECK-INST: sub z0.h, z0.h, z0.h
14 // CHECK-ENCODING: [0x00,0x04,0x60,0x04]
15 // CHECK-ERROR: instruction requires: sve or sme
16 // CHECK-UNKNOWN: 04600400 <unknown>
18 sub z21.b, z10.b, z21.b
19 // CHECK-INST: sub z21.b, z10.b, z21.b
20 // CHECK-ENCODING: [0x55,0x05,0x35,0x04]
21 // CHECK-ERROR: instruction requires: sve or sme
22 // CHECK-UNKNOWN: 04350555 <unknown>
24 sub z31.d, p7/m, z31.d, z31.d
25 // CHECK-INST: sub z31.d, p7/m, z31.d, z31.d
26 // CHECK-ENCODING: [0xff,0x1f,0xc1,0x04]
27 // CHECK-ERROR: instruction requires: sve or sme
28 // CHECK-UNKNOWN: 04c11fff <unknown>
30 sub z23.h, p3/m, z23.h, z13.h
31 // CHECK-INST: sub z23.h, p3/m, z23.h, z13.h
32 // CHECK-ENCODING: [0xb7,0x0d,0x41,0x04]
33 // CHECK-ERROR: instruction requires: sve or sme
34 // CHECK-UNKNOWN: 04410db7 <unknown>
36 sub z31.h, z31.h, z31.h
37 // CHECK-INST: sub z31.h, z31.h, z31.h
38 // CHECK-ENCODING: [0xff,0x07,0x7f,0x04]
39 // CHECK-ERROR: instruction requires: sve or sme
40 // CHECK-UNKNOWN: 047f07ff <unknown>
42 sub z21.h, z10.h, z21.h
43 // CHECK-INST: sub z21.h, z10.h, z21.h
44 // CHECK-ENCODING: [0x55,0x05,0x75,0x04]
45 // CHECK-ERROR: instruction requires: sve or sme
46 // CHECK-UNKNOWN: 04750555 <unknown>
48 sub z31.b, z31.b, z31.b
49 // CHECK-INST: sub z31.b, z31.b, z31.b
50 // CHECK-ENCODING: [0xff,0x07,0x3f,0x04]
51 // CHECK-ERROR: instruction requires: sve or sme
52 // CHECK-UNKNOWN: 043f07ff <unknown>
54 sub z0.s, z0.s, z0.s
55 // CHECK-INST: sub z0.s, z0.s, z0.s
56 // CHECK-ENCODING: [0x00,0x04,0xa0,0x04]
57 // CHECK-ERROR: instruction requires: sve or sme
58 // CHECK-UNKNOWN: 04a00400 <unknown>
60 sub z23.s, p3/m, z23.s, z13.s
61 // CHECK-INST: sub z23.s, p3/m, z23.s, z13.s
62 // CHECK-ENCODING: [0xb7,0x0d,0x81,0x04]
63 // CHECK-ERROR: instruction requires: sve or sme
64 // CHECK-UNKNOWN: 04810db7 <unknown>
66 sub z23.b, z13.b, z8.b
67 // CHECK-INST: sub z23.b, z13.b, z8.b
68 // CHECK-ENCODING: [0xb7,0x05,0x28,0x04]
69 // CHECK-ERROR: instruction requires: sve or sme
70 // CHECK-UNKNOWN: 042805b7 <unknown>
72 sub z21.d, z10.d, z21.d
73 // CHECK-INST: sub z21.d, z10.d, z21.d
74 // CHECK-ENCODING: [0x55,0x05,0xf5,0x04]
75 // CHECK-ERROR: instruction requires: sve or sme
76 // CHECK-UNKNOWN: 04f50555 <unknown>
78 sub z21.s, z10.s, z21.s
79 // CHECK-INST: sub z21.s, z10.s, z21.s
80 // CHECK-ENCODING: [0x55,0x05,0xb5,0x04]
81 // CHECK-ERROR: instruction requires: sve or sme
82 // CHECK-UNKNOWN: 04b50555 <unknown>
84 sub z21.s, p5/m, z21.s, z10.s
85 // CHECK-INST: sub z21.s, p5/m, z21.s, z10.s
86 // CHECK-ENCODING: [0x55,0x15,0x81,0x04]
87 // CHECK-ERROR: instruction requires: sve or sme
88 // CHECK-UNKNOWN: 04811555 <unknown>
90 sub z31.s, p7/m, z31.s, z31.s
91 // CHECK-INST: sub z31.s, p7/m, z31.s, z31.s
92 // CHECK-ENCODING: [0xff,0x1f,0x81,0x04]
93 // CHECK-ERROR: instruction requires: sve or sme
94 // CHECK-UNKNOWN: 04811fff <unknown>
96 sub z0.d, p0/m, z0.d, z0.d
97 // CHECK-INST: sub z0.d, p0/m, z0.d, z0.d
98 // CHECK-ENCODING: [0x00,0x00,0xc1,0x04]
99 // CHECK-ERROR: instruction requires: sve or sme
100 // CHECK-UNKNOWN: 04c10000 <unknown>
102 sub z0.b, z0.b, z0.b
103 // CHECK-INST: sub z0.b, z0.b, z0.b
104 // CHECK-ENCODING: [0x00,0x04,0x20,0x04]
105 // CHECK-ERROR: instruction requires: sve or sme
106 // CHECK-UNKNOWN: 04200400 <unknown>
108 sub z23.d, z13.d, z8.d
109 // CHECK-INST: sub z23.d, z13.d, z8.d
110 // CHECK-ENCODING: [0xb7,0x05,0xe8,0x04]
111 // CHECK-ERROR: instruction requires: sve or sme
112 // CHECK-UNKNOWN: 04e805b7 <unknown>
114 sub z23.d, p3/m, z23.d, z13.d
115 // CHECK-INST: sub z23.d, p3/m, z23.d, z13.d
116 // CHECK-ENCODING: [0xb7,0x0d,0xc1,0x04]
117 // CHECK-ERROR: instruction requires: sve or sme
118 // CHECK-UNKNOWN: 04c10db7 <unknown>
120 sub z23.s, z13.s, z8.s
121 // CHECK-INST: sub z23.s, z13.s, z8.s
122 // CHECK-ENCODING: [0xb7,0x05,0xa8,0x04]
123 // CHECK-ERROR: instruction requires: sve or sme
124 // CHECK-UNKNOWN: 04a805b7 <unknown>
126 sub z31.b, p7/m, z31.b, z31.b
127 // CHECK-INST: sub z31.b, p7/m, z31.b, z31.b
128 // CHECK-ENCODING: [0xff,0x1f,0x01,0x04]
129 // CHECK-ERROR: instruction requires: sve or sme
130 // CHECK-UNKNOWN: 04011fff <unknown>
132 sub z0.h, p0/m, z0.h, z0.h
133 // CHECK-INST: sub z0.h, p0/m, z0.h, z0.h
134 // CHECK-ENCODING: [0x00,0x00,0x41,0x04]
135 // CHECK-ERROR: instruction requires: sve or sme
136 // CHECK-UNKNOWN: 04410000 <unknown>
138 sub z31.d, z31.d, z31.d
139 // CHECK-INST: sub z31.d, z31.d, z31.d
140 // CHECK-ENCODING: [0xff,0x07,0xff,0x04]
141 // CHECK-ERROR: instruction requires: sve or sme
142 // CHECK-UNKNOWN: 04ff07ff <unknown>
144 sub z31.h, p7/m, z31.h, z31.h
145 // CHECK-INST: sub z31.h, p7/m, z31.h, z31.h
146 // CHECK-ENCODING: [0xff,0x1f,0x41,0x04]
147 // CHECK-ERROR: instruction requires: sve or sme
148 // CHECK-UNKNOWN: 04411fff <unknown>
150 sub z23.h, z13.h, z8.h
151 // CHECK-INST: sub z23.h, z13.h, z8.h
152 // CHECK-ENCODING: [0xb7,0x05,0x68,0x04]
153 // CHECK-ERROR: instruction requires: sve or sme
154 // CHECK-UNKNOWN: 046805b7 <unknown>
156 sub z21.b, p5/m, z21.b, z10.b
157 // CHECK-INST: sub z21.b, p5/m, z21.b, z10.b
158 // CHECK-ENCODING: [0x55,0x15,0x01,0x04]
159 // CHECK-ERROR: instruction requires: sve or sme
160 // CHECK-UNKNOWN: 04011555 <unknown>
162 sub z21.d, p5/m, z21.d, z10.d
163 // CHECK-INST: sub z21.d, p5/m, z21.d, z10.d
164 // CHECK-ENCODING: [0x55,0x15,0xc1,0x04]
165 // CHECK-ERROR: instruction requires: sve or sme
166 // CHECK-UNKNOWN: 04c11555 <unknown>
168 sub z0.d, z0.d, z0.d
169 // CHECK-INST: sub z0.d, z0.d, z0.d
170 // CHECK-ENCODING: [0x00,0x04,0xe0,0x04]
171 // CHECK-ERROR: instruction requires: sve or sme
172 // CHECK-UNKNOWN: 04e00400 <unknown>
174 sub z31.s, z31.s, z31.s
175 // CHECK-INST: sub z31.s, z31.s, z31.s
176 // CHECK-ENCODING: [0xff,0x07,0xbf,0x04]
177 // CHECK-ERROR: instruction requires: sve or sme
178 // CHECK-UNKNOWN: 04bf07ff <unknown>
180 sub z0.b, p0/m, z0.b, z0.b
181 // CHECK-INST: sub z0.b, p0/m, z0.b, z0.b
182 // CHECK-ENCODING: [0x00,0x00,0x01,0x04]
183 // CHECK-ERROR: instruction requires: sve or sme
184 // CHECK-UNKNOWN: 04010000 <unknown>
186 sub z0.s, p0/m, z0.s, z0.s
187 // CHECK-INST: sub z0.s, p0/m, z0.s, z0.s
188 // CHECK-ENCODING: [0x00,0x00,0x81,0x04]
189 // CHECK-ERROR: instruction requires: sve or sme
190 // CHECK-UNKNOWN: 04810000 <unknown>
192 sub z21.h, p5/m, z21.h, z10.h
193 // CHECK-INST: sub z21.h, p5/m, z21.h, z10.h
194 // CHECK-ENCODING: [0x55,0x15,0x41,0x04]
195 // CHECK-ERROR: instruction requires: sve or sme
196 // CHECK-UNKNOWN: 04411555 <unknown>
198 sub z23.b, p3/m, z23.b, z13.b
199 // CHECK-INST: sub z23.b, p3/m, z23.b, z13.b
200 // CHECK-ENCODING: [0xb7,0x0d,0x01,0x04]
201 // CHECK-ERROR: instruction requires: sve or sme
202 // CHECK-UNKNOWN: 04010db7 <unknown>
204 // -----------------------
207 sub z0.b, z0.b, #0
208 // CHECK-INST: sub z0.b, z0.b, #0
209 // CHECK-ENCODING: [0x00,0xc0,0x21,0x25]
210 // CHECK-ERROR: instruction requires: sve or sme
211 // CHECK-UNKNOWN: 2521c000 <unknown>
213 sub z31.b, z31.b, #255
214 // CHECK-INST: sub z31.b, z31.b, #255
215 // CHECK-ENCODING: [0xff,0xdf,0x21,0x25]
216 // CHECK-ERROR: instruction requires: sve or sme
217 // CHECK-UNKNOWN: 2521dfff <unknown>
219 sub z0.h, z0.h, #0
220 // CHECK-INST: sub z0.h, z0.h, #0
221 // CHECK-ENCODING: [0x00,0xc0,0x61,0x25]
222 // CHECK-ERROR: instruction requires: sve or sme
223 // CHECK-UNKNOWN: 2561c000 <unknown>
225 sub z0.h, z0.h, #0, lsl #8
226 // CHECK-INST: sub z0.h, z0.h, #0, lsl #8
227 // CHECK-ENCODING: [0x00,0xe0,0x61,0x25]
228 // CHECK-ERROR: instruction requires: sve or sme
229 // CHECK-UNKNOWN: 2561e000 <unknown>
231 sub z31.h, z31.h, #255, lsl #8
232 // CHECK-INST: sub z31.h, z31.h, #65280
233 // CHECK-ENCODING: [0xff,0xff,0x61,0x25]
234 // CHECK-ERROR: instruction requires: sve or sme
235 // CHECK-UNKNOWN: 2561ffff <unknown>
237 sub z31.h, z31.h, #65280
238 // CHECK-INST: sub z31.h, z31.h, #65280
239 // CHECK-ENCODING: [0xff,0xff,0x61,0x25]
240 // CHECK-ERROR: instruction requires: sve or sme
241 // CHECK-UNKNOWN: 2561ffff <unknown>
243 sub z0.s, z0.s, #0
244 // CHECK-INST: sub z0.s, z0.s, #0
245 // CHECK-ENCODING: [0x00,0xc0,0xa1,0x25]
246 // CHECK-ERROR: instruction requires: sve or sme
247 // CHECK-UNKNOWN: 25a1c000 <unknown>
249 sub z0.s, z0.s, #0, lsl #8
250 // CHECK-INST: sub z0.s, z0.s, #0, lsl #8
251 // CHECK-ENCODING: [0x00,0xe0,0xa1,0x25]
252 // CHECK-ERROR: instruction requires: sve or sme
253 // CHECK-UNKNOWN: 25a1e000 <unknown>
255 sub z31.s, z31.s, #255, lsl #8
256 // CHECK-INST: sub z31.s, z31.s, #65280
257 // CHECK-ENCODING: [0xff,0xff,0xa1,0x25]
258 // CHECK-ERROR: instruction requires: sve or sme
259 // CHECK-UNKNOWN: 25a1ffff <unknown>
261 sub z31.s, z31.s, #65280
262 // CHECK-INST: sub z31.s, z31.s, #65280
263 // CHECK-ENCODING: [0xff,0xff,0xa1,0x25]
264 // CHECK-ERROR: instruction requires: sve or sme
265 // CHECK-UNKNOWN: 25a1ffff <unknown>
267 sub z0.d, z0.d, #0
268 // CHECK-INST: sub z0.d, z0.d, #0
269 // CHECK-ENCODING: [0x00,0xc0,0xe1,0x25]
270 // CHECK-ERROR: instruction requires: sve or sme
271 // CHECK-UNKNOWN: 25e1c000 <unknown>
273 sub z0.d, z0.d, #0, lsl #8
274 // CHECK-INST: sub z0.d, z0.d, #0, lsl #8
275 // CHECK-ENCODING: [0x00,0xe0,0xe1,0x25]
276 // CHECK-ERROR: instruction requires: sve or sme
277 // CHECK-UNKNOWN: 25e1e000 <unknown>
279 sub z31.d, z31.d, #255, lsl #8
280 // CHECK-INST: sub z31.d, z31.d, #65280
281 // CHECK-ENCODING: [0xff,0xff,0xe1,0x25]
282 // CHECK-ERROR: instruction requires: sve or sme
283 // CHECK-UNKNOWN: 25e1ffff <unknown>
285 sub z31.d, z31.d, #65280
286 // CHECK-INST: sub z31.d, z31.d, #65280
287 // CHECK-ENCODING: [0xff,0xff,0xe1,0x25]
288 // CHECK-ERROR: instruction requires: sve or sme
289 // CHECK-UNKNOWN: 25e1ffff <unknown>
293 // --------------------------------------------------------------------------//
294 // Test compatibility with MOVPRFX instruction.
296 movprfx z23.b, p3/z, z30.b
297 // CHECK-INST: movprfx z23.b, p3/z, z30.b
298 // CHECK-ENCODING: [0xd7,0x2f,0x10,0x04]
299 // CHECK-ERROR: instruction requires: sve or sme
300 // CHECK-UNKNOWN: 04102fd7 <unknown>
302 sub z23.b, p3/m, z23.b, z13.b
303 // CHECK-INST: sub z23.b, p3/m, z23.b, z13.b
304 // CHECK-ENCODING: [0xb7,0x0d,0x01,0x04]
305 // CHECK-ERROR: instruction requires: sve or sme
306 // CHECK-UNKNOWN: 04010db7 <unknown>
308 movprfx z23, z30
309 // CHECK-INST: movprfx z23, z30
310 // CHECK-ENCODING: [0xd7,0xbf,0x20,0x04]
311 // CHECK-ERROR: instruction requires: sve or sme
312 // CHECK-UNKNOWN: 0420bfd7 <unknown>
314 sub z23.b, p3/m, z23.b, z13.b
315 // CHECK-INST: sub z23.b, p3/m, z23.b, z13.b
316 // CHECK-ENCODING: [0xb7,0x0d,0x01,0x04]
317 // CHECK-ERROR: instruction requires: sve or sme
318 // CHECK-UNKNOWN: 04010db7 <unknown>
320 movprfx z31, z6
321 // CHECK-INST: movprfx z31, z6
322 // CHECK-ENCODING: [0xdf,0xbc,0x20,0x04]
323 // CHECK-ERROR: instruction requires: sve or sme
324 // CHECK-UNKNOWN: 0420bcdf <unknown>
326 sub z31.d, z31.d, #65280
327 // CHECK-INST: sub z31.d, z31.d, #65280
328 // CHECK-ENCODING: [0xff,0xff,0xe1,0x25]
329 // CHECK-ERROR: instruction requires: sve or sme
330 // CHECK-UNKNOWN: 25e1ffff <unknown>