[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / MC / AArch64 / SVE / sub.s
blob8e74cf8cf3f2a83a309242893403bdd1e4b13cee
1 // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
2 // RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3 // RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
4 // RUN: | FileCheck %s --check-prefix=CHECK-ERROR
5 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
6 // RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
7 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
8 // RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
10 sub z0.h, z0.h, z0.h
11 // CHECK-INST: sub z0.h, z0.h, z0.h
12 // CHECK-ENCODING: [0x00,0x04,0x60,0x04]
13 // CHECK-ERROR: instruction requires: sve
14 // CHECK-UNKNOWN: 00 04 60 04 <unknown>
16 sub z21.b, z10.b, z21.b
17 // CHECK-INST: sub z21.b, z10.b, z21.b
18 // CHECK-ENCODING: [0x55,0x05,0x35,0x04]
19 // CHECK-ERROR: instruction requires: sve
20 // CHECK-UNKNOWN: 55 05 35 04 <unknown>
22 sub z31.d, p7/m, z31.d, z31.d
23 // CHECK-INST: sub z31.d, p7/m, z31.d, z31.d
24 // CHECK-ENCODING: [0xff,0x1f,0xc1,0x04]
25 // CHECK-ERROR: instruction requires: sve
26 // CHECK-UNKNOWN: ff 1f c1 04 <unknown>
28 sub z23.h, p3/m, z23.h, z13.h
29 // CHECK-INST: sub z23.h, p3/m, z23.h, z13.h
30 // CHECK-ENCODING: [0xb7,0x0d,0x41,0x04]
31 // CHECK-ERROR: instruction requires: sve
32 // CHECK-UNKNOWN: b7 0d 41 04 <unknown>
34 sub z31.h, z31.h, z31.h
35 // CHECK-INST: sub z31.h, z31.h, z31.h
36 // CHECK-ENCODING: [0xff,0x07,0x7f,0x04]
37 // CHECK-ERROR: instruction requires: sve
38 // CHECK-UNKNOWN: ff 07 7f 04 <unknown>
40 sub z21.h, z10.h, z21.h
41 // CHECK-INST: sub z21.h, z10.h, z21.h
42 // CHECK-ENCODING: [0x55,0x05,0x75,0x04]
43 // CHECK-ERROR: instruction requires: sve
44 // CHECK-UNKNOWN: 55 05 75 04 <unknown>
46 sub z31.b, z31.b, z31.b
47 // CHECK-INST: sub z31.b, z31.b, z31.b
48 // CHECK-ENCODING: [0xff,0x07,0x3f,0x04]
49 // CHECK-ERROR: instruction requires: sve
50 // CHECK-UNKNOWN: ff 07 3f 04 <unknown>
52 sub z0.s, z0.s, z0.s
53 // CHECK-INST: sub z0.s, z0.s, z0.s
54 // CHECK-ENCODING: [0x00,0x04,0xa0,0x04]
55 // CHECK-ERROR: instruction requires: sve
56 // CHECK-UNKNOWN: 00 04 a0 04 <unknown>
58 sub z23.s, p3/m, z23.s, z13.s
59 // CHECK-INST: sub z23.s, p3/m, z23.s, z13.s
60 // CHECK-ENCODING: [0xb7,0x0d,0x81,0x04]
61 // CHECK-ERROR: instruction requires: sve
62 // CHECK-UNKNOWN: b7 0d 81 04 <unknown>
64 sub z23.b, z13.b, z8.b
65 // CHECK-INST: sub z23.b, z13.b, z8.b
66 // CHECK-ENCODING: [0xb7,0x05,0x28,0x04]
67 // CHECK-ERROR: instruction requires: sve
68 // CHECK-UNKNOWN: b7 05 28 04 <unknown>
70 sub z21.d, z10.d, z21.d
71 // CHECK-INST: sub z21.d, z10.d, z21.d
72 // CHECK-ENCODING: [0x55,0x05,0xf5,0x04]
73 // CHECK-ERROR: instruction requires: sve
74 // CHECK-UNKNOWN: 55 05 f5 04 <unknown>
76 sub z21.s, z10.s, z21.s
77 // CHECK-INST: sub z21.s, z10.s, z21.s
78 // CHECK-ENCODING: [0x55,0x05,0xb5,0x04]
79 // CHECK-ERROR: instruction requires: sve
80 // CHECK-UNKNOWN: 55 05 b5 04 <unknown>
82 sub z21.s, p5/m, z21.s, z10.s
83 // CHECK-INST: sub z21.s, p5/m, z21.s, z10.s
84 // CHECK-ENCODING: [0x55,0x15,0x81,0x04]
85 // CHECK-ERROR: instruction requires: sve
86 // CHECK-UNKNOWN: 55 15 81 04 <unknown>
88 sub z31.s, p7/m, z31.s, z31.s
89 // CHECK-INST: sub z31.s, p7/m, z31.s, z31.s
90 // CHECK-ENCODING: [0xff,0x1f,0x81,0x04]
91 // CHECK-ERROR: instruction requires: sve
92 // CHECK-UNKNOWN: ff 1f 81 04 <unknown>
94 sub z0.d, p0/m, z0.d, z0.d
95 // CHECK-INST: sub z0.d, p0/m, z0.d, z0.d
96 // CHECK-ENCODING: [0x00,0x00,0xc1,0x04]
97 // CHECK-ERROR: instruction requires: sve
98 // CHECK-UNKNOWN: 00 00 c1 04 <unknown>
100 sub z0.b, z0.b, z0.b
101 // CHECK-INST: sub z0.b, z0.b, z0.b
102 // CHECK-ENCODING: [0x00,0x04,0x20,0x04]
103 // CHECK-ERROR: instruction requires: sve
104 // CHECK-UNKNOWN: 00 04 20 04 <unknown>
106 sub z23.d, z13.d, z8.d
107 // CHECK-INST: sub z23.d, z13.d, z8.d
108 // CHECK-ENCODING: [0xb7,0x05,0xe8,0x04]
109 // CHECK-ERROR: instruction requires: sve
110 // CHECK-UNKNOWN: b7 05 e8 04 <unknown>
112 sub z23.d, p3/m, z23.d, z13.d
113 // CHECK-INST: sub z23.d, p3/m, z23.d, z13.d
114 // CHECK-ENCODING: [0xb7,0x0d,0xc1,0x04]
115 // CHECK-ERROR: instruction requires: sve
116 // CHECK-UNKNOWN: b7 0d c1 04 <unknown>
118 sub z23.s, z13.s, z8.s
119 // CHECK-INST: sub z23.s, z13.s, z8.s
120 // CHECK-ENCODING: [0xb7,0x05,0xa8,0x04]
121 // CHECK-ERROR: instruction requires: sve
122 // CHECK-UNKNOWN: b7 05 a8 04 <unknown>
124 sub z31.b, p7/m, z31.b, z31.b
125 // CHECK-INST: sub z31.b, p7/m, z31.b, z31.b
126 // CHECK-ENCODING: [0xff,0x1f,0x01,0x04]
127 // CHECK-ERROR: instruction requires: sve
128 // CHECK-UNKNOWN: ff 1f 01 04 <unknown>
130 sub z0.h, p0/m, z0.h, z0.h
131 // CHECK-INST: sub z0.h, p0/m, z0.h, z0.h
132 // CHECK-ENCODING: [0x00,0x00,0x41,0x04]
133 // CHECK-ERROR: instruction requires: sve
134 // CHECK-UNKNOWN: 00 00 41 04 <unknown>
136 sub z31.d, z31.d, z31.d
137 // CHECK-INST: sub z31.d, z31.d, z31.d
138 // CHECK-ENCODING: [0xff,0x07,0xff,0x04]
139 // CHECK-ERROR: instruction requires: sve
140 // CHECK-UNKNOWN: ff 07 ff 04 <unknown>
142 sub z31.h, p7/m, z31.h, z31.h
143 // CHECK-INST: sub z31.h, p7/m, z31.h, z31.h
144 // CHECK-ENCODING: [0xff,0x1f,0x41,0x04]
145 // CHECK-ERROR: instruction requires: sve
146 // CHECK-UNKNOWN: ff 1f 41 04 <unknown>
148 sub z23.h, z13.h, z8.h
149 // CHECK-INST: sub z23.h, z13.h, z8.h
150 // CHECK-ENCODING: [0xb7,0x05,0x68,0x04]
151 // CHECK-ERROR: instruction requires: sve
152 // CHECK-UNKNOWN: b7 05 68 04 <unknown>
154 sub z21.b, p5/m, z21.b, z10.b
155 // CHECK-INST: sub z21.b, p5/m, z21.b, z10.b
156 // CHECK-ENCODING: [0x55,0x15,0x01,0x04]
157 // CHECK-ERROR: instruction requires: sve
158 // CHECK-UNKNOWN: 55 15 01 04 <unknown>
160 sub z21.d, p5/m, z21.d, z10.d
161 // CHECK-INST: sub z21.d, p5/m, z21.d, z10.d
162 // CHECK-ENCODING: [0x55,0x15,0xc1,0x04]
163 // CHECK-ERROR: instruction requires: sve
164 // CHECK-UNKNOWN: 55 15 c1 04 <unknown>
166 sub z0.d, z0.d, z0.d
167 // CHECK-INST: sub z0.d, z0.d, z0.d
168 // CHECK-ENCODING: [0x00,0x04,0xe0,0x04]
169 // CHECK-ERROR: instruction requires: sve
170 // CHECK-UNKNOWN: 00 04 e0 04 <unknown>
172 sub z31.s, z31.s, z31.s
173 // CHECK-INST: sub z31.s, z31.s, z31.s
174 // CHECK-ENCODING: [0xff,0x07,0xbf,0x04]
175 // CHECK-ERROR: instruction requires: sve
176 // CHECK-UNKNOWN: ff 07 bf 04 <unknown>
178 sub z0.b, p0/m, z0.b, z0.b
179 // CHECK-INST: sub z0.b, p0/m, z0.b, z0.b
180 // CHECK-ENCODING: [0x00,0x00,0x01,0x04]
181 // CHECK-ERROR: instruction requires: sve
182 // CHECK-UNKNOWN: 00 00 01 04 <unknown>
184 sub z0.s, p0/m, z0.s, z0.s
185 // CHECK-INST: sub z0.s, p0/m, z0.s, z0.s
186 // CHECK-ENCODING: [0x00,0x00,0x81,0x04]
187 // CHECK-ERROR: instruction requires: sve
188 // CHECK-UNKNOWN: 00 00 81 04 <unknown>
190 sub z21.h, p5/m, z21.h, z10.h
191 // CHECK-INST: sub z21.h, p5/m, z21.h, z10.h
192 // CHECK-ENCODING: [0x55,0x15,0x41,0x04]
193 // CHECK-ERROR: instruction requires: sve
194 // CHECK-UNKNOWN: 55 15 41 04 <unknown>
196 sub z23.b, p3/m, z23.b, z13.b
197 // CHECK-INST: sub z23.b, p3/m, z23.b, z13.b
198 // CHECK-ENCODING: [0xb7,0x0d,0x01,0x04]
199 // CHECK-ERROR: instruction requires: sve
200 // CHECK-UNKNOWN: b7 0d 01 04 <unknown>
202 // -----------------------
205 sub z0.b, z0.b, #0
206 // CHECK-INST: sub z0.b, z0.b, #0
207 // CHECK-ENCODING: [0x00,0xc0,0x21,0x25]
208 // CHECK-ERROR: instruction requires: sve
209 // CHECK-UNKNOWN: 00 c0 21 25 <unknown>
211 sub z31.b, z31.b, #255
212 // CHECK-INST: sub z31.b, z31.b, #255
213 // CHECK-ENCODING: [0xff,0xdf,0x21,0x25]
214 // CHECK-ERROR: instruction requires: sve
215 // CHECK-UNKNOWN: ff df 21 25 <unknown>
217 sub z0.h, z0.h, #0
218 // CHECK-INST: sub z0.h, z0.h, #0
219 // CHECK-ENCODING: [0x00,0xc0,0x61,0x25]
220 // CHECK-ERROR: instruction requires: sve
221 // CHECK-UNKNOWN: 00 c0 61 25 <unknown>
223 sub z0.h, z0.h, #0, lsl #8
224 // CHECK-INST: sub z0.h, z0.h, #0, lsl #8
225 // CHECK-ENCODING: [0x00,0xe0,0x61,0x25]
226 // CHECK-ERROR: instruction requires: sve
227 // CHECK-UNKNOWN: 00 e0 61 25 <unknown>
229 sub z31.h, z31.h, #255, lsl #8
230 // CHECK-INST: sub z31.h, z31.h, #65280
231 // CHECK-ENCODING: [0xff,0xff,0x61,0x25]
232 // CHECK-ERROR: instruction requires: sve
233 // CHECK-UNKNOWN: ff ff 61 25 <unknown>
235 sub z31.h, z31.h, #65280
236 // CHECK-INST: sub z31.h, z31.h, #65280
237 // CHECK-ENCODING: [0xff,0xff,0x61,0x25]
238 // CHECK-ERROR: instruction requires: sve
239 // CHECK-UNKNOWN: ff ff 61 25 <unknown>
241 sub z0.s, z0.s, #0
242 // CHECK-INST: sub z0.s, z0.s, #0
243 // CHECK-ENCODING: [0x00,0xc0,0xa1,0x25]
244 // CHECK-ERROR: instruction requires: sve
245 // CHECK-UNKNOWN: 00 c0 a1 25 <unknown>
247 sub z0.s, z0.s, #0, lsl #8
248 // CHECK-INST: sub z0.s, z0.s, #0, lsl #8
249 // CHECK-ENCODING: [0x00,0xe0,0xa1,0x25]
250 // CHECK-ERROR: instruction requires: sve
251 // CHECK-UNKNOWN: 00 e0 a1 25 <unknown>
253 sub z31.s, z31.s, #255, lsl #8
254 // CHECK-INST: sub z31.s, z31.s, #65280
255 // CHECK-ENCODING: [0xff,0xff,0xa1,0x25]
256 // CHECK-ERROR: instruction requires: sve
257 // CHECK-UNKNOWN: ff ff a1 25 <unknown>
259 sub z31.s, z31.s, #65280
260 // CHECK-INST: sub z31.s, z31.s, #65280
261 // CHECK-ENCODING: [0xff,0xff,0xa1,0x25]
262 // CHECK-ERROR: instruction requires: sve
263 // CHECK-UNKNOWN: ff ff a1 25 <unknown>
265 sub z0.d, z0.d, #0
266 // CHECK-INST: sub z0.d, z0.d, #0
267 // CHECK-ENCODING: [0x00,0xc0,0xe1,0x25]
268 // CHECK-ERROR: instruction requires: sve
269 // CHECK-UNKNOWN: 00 c0 e1 25 <unknown>
271 sub z0.d, z0.d, #0, lsl #8
272 // CHECK-INST: sub z0.d, z0.d, #0, lsl #8
273 // CHECK-ENCODING: [0x00,0xe0,0xe1,0x25]
274 // CHECK-ERROR: instruction requires: sve
275 // CHECK-UNKNOWN: 00 e0 e1 25 <unknown>
277 sub z31.d, z31.d, #255, lsl #8
278 // CHECK-INST: sub z31.d, z31.d, #65280
279 // CHECK-ENCODING: [0xff,0xff,0xe1,0x25]
280 // CHECK-ERROR: instruction requires: sve
281 // CHECK-UNKNOWN: ff ff e1 25 <unknown>
283 sub z31.d, z31.d, #65280
284 // CHECK-INST: sub z31.d, z31.d, #65280
285 // CHECK-ENCODING: [0xff,0xff,0xe1,0x25]
286 // CHECK-ERROR: instruction requires: sve
287 // CHECK-UNKNOWN: ff ff e1 25 <unknown>
291 // --------------------------------------------------------------------------//
292 // Test compatibility with MOVPRFX instruction.
294 movprfx z23.b, p3/z, z30.b
295 // CHECK-INST: movprfx z23.b, p3/z, z30.b
296 // CHECK-ENCODING: [0xd7,0x2f,0x10,0x04]
297 // CHECK-ERROR: instruction requires: sve
298 // CHECK-UNKNOWN: d7 2f 10 04 <unknown>
300 sub z23.b, p3/m, z23.b, z13.b
301 // CHECK-INST: sub z23.b, p3/m, z23.b, z13.b
302 // CHECK-ENCODING: [0xb7,0x0d,0x01,0x04]
303 // CHECK-ERROR: instruction requires: sve
304 // CHECK-UNKNOWN: b7 0d 01 04 <unknown>
306 movprfx z23, z30
307 // CHECK-INST: movprfx z23, z30
308 // CHECK-ENCODING: [0xd7,0xbf,0x20,0x04]
309 // CHECK-ERROR: instruction requires: sve
310 // CHECK-UNKNOWN: d7 bf 20 04 <unknown>
312 sub z23.b, p3/m, z23.b, z13.b
313 // CHECK-INST: sub z23.b, p3/m, z23.b, z13.b
314 // CHECK-ENCODING: [0xb7,0x0d,0x01,0x04]
315 // CHECK-ERROR: instruction requires: sve
316 // CHECK-UNKNOWN: b7 0d 01 04 <unknown>
318 movprfx z31, z6
319 // CHECK-INST: movprfx z31, z6
320 // CHECK-ENCODING: [0xdf,0xbc,0x20,0x04]
321 // CHECK-ERROR: instruction requires: sve
322 // CHECK-UNKNOWN: df bc 20 04 <unknown>
324 sub z31.d, z31.d, #65280
325 // CHECK-INST: sub z31.d, z31.d, #65280
326 // CHECK-ENCODING: [0xff,0xff,0xe1,0x25]
327 // CHECK-ERROR: instruction requires: sve
328 // CHECK-UNKNOWN: ff ff e1 25 <unknown>