[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / MC / AArch64 / SVE / add.s
blob2064181d18d24087aac9708c278ccd71318a7e71
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 add z31.s, z31.s, z31.s
11 // CHECK-INST: add z31.s, z31.s, z31.s
12 // CHECK-ENCODING: [0xff,0x03,0xbf,0x04]
13 // CHECK-ERROR: instruction requires: sve
14 // CHECK-UNKNOWN: ff 03 bf 04 <unknown>
16 add z23.d, z13.d, z8.d
17 // CHECK-INST: add z23.d, z13.d, z8.d
18 // CHECK-ENCODING: [0xb7,0x01,0xe8,0x04]
19 // CHECK-ERROR: instruction requires: sve
20 // CHECK-UNKNOWN: b7 01 e8 04 <unknown>
22 add z23.b, p3/m, z23.b, z13.b
23 // CHECK-INST: add z23.b, p3/m, z23.b, z13.b
24 // CHECK-ENCODING: [0xb7,0x0d,0x00,0x04]
25 // CHECK-ERROR: instruction requires: sve
26 // CHECK-UNKNOWN: b7 0d 00 04 <unknown>
28 add z0.s, z0.s, z0.s
29 // CHECK-INST: add z0.s, z0.s, z0.s
30 // CHECK-ENCODING: [0x00,0x00,0xa0,0x04]
31 // CHECK-ERROR: instruction requires: sve
32 // CHECK-UNKNOWN: 00 00 a0 04 <unknown>
34 add z31.d, z31.d, z31.d
35 // CHECK-INST: add z31.d, z31.d, z31.d
36 // CHECK-ENCODING: [0xff,0x03,0xff,0x04]
37 // CHECK-ERROR: instruction requires: sve
38 // CHECK-UNKNOWN: ff 03 ff 04 <unknown>
40 add z21.b, z10.b, z21.b
41 // CHECK-INST: add z21.b, z10.b, z21.b
42 // CHECK-ENCODING: [0x55,0x01,0x35,0x04]
43 // CHECK-ERROR: instruction requires: sve
44 // CHECK-UNKNOWN: 55 01 35 04 <unknown>
46 add z31.b, z31.b, z31.b
47 // CHECK-INST: add z31.b, z31.b, z31.b
48 // CHECK-ENCODING: [0xff,0x03,0x3f,0x04]
49 // CHECK-ERROR: instruction requires: sve
50 // CHECK-UNKNOWN: ff 03 3f 04 <unknown>
52 add z0.h, p0/m, z0.h, z0.h
53 // CHECK-INST: add z0.h, p0/m, z0.h, z0.h
54 // CHECK-ENCODING: [0x00,0x00,0x40,0x04]
55 // CHECK-ERROR: instruction requires: sve
56 // CHECK-UNKNOWN: 00 00 40 04 <unknown>
58 add z0.h, z0.h, z0.h
59 // CHECK-INST: add z0.h, z0.h, z0.h
60 // CHECK-ENCODING: [0x00,0x00,0x60,0x04]
61 // CHECK-ERROR: instruction requires: sve
62 // CHECK-UNKNOWN: 00 00 60 04 <unknown>
64 add z0.b, p0/m, z0.b, z0.b
65 // CHECK-INST: add z0.b, p0/m, z0.b, z0.b
66 // CHECK-ENCODING: [0x00,0x00,0x00,0x04]
67 // CHECK-ERROR: instruction requires: sve
68 // CHECK-UNKNOWN: 00 00 00 04 <unknown>
70 add z0.s, p0/m, z0.s, z0.s
71 // CHECK-INST: add z0.s, p0/m, z0.s, z0.s
72 // CHECK-ENCODING: [0x00,0x00,0x80,0x04]
73 // CHECK-ERROR: instruction requires: sve
74 // CHECK-UNKNOWN: 00 00 80 04 <unknown>
76 add z23.b, z13.b, z8.b
77 // CHECK-INST: add z23.b, z13.b, z8.b
78 // CHECK-ENCODING: [0xb7,0x01,0x28,0x04]
79 // CHECK-ERROR: instruction requires: sve
80 // CHECK-UNKNOWN: b7 01 28 04 <unknown>
82 add z0.d, z0.d, z0.d
83 // CHECK-INST: add z0.d, z0.d, z0.d
84 // CHECK-ENCODING: [0x00,0x00,0xe0,0x04]
85 // CHECK-ERROR: instruction requires: sve
86 // CHECK-UNKNOWN: 00 00 e0 04 <unknown>
88 add z0.d, p0/m, z0.d, z0.d
89 // CHECK-INST: add z0.d, p0/m, z0.d, z0.d
90 // CHECK-ENCODING: [0x00,0x00,0xc0,0x04]
91 // CHECK-ERROR: instruction requires: sve
92 // CHECK-UNKNOWN: 00 00 c0 04 <unknown>
94 add z31.h, z31.h, z31.h
95 // CHECK-INST: add z31.h, z31.h, z31.h
96 // CHECK-ENCODING: [0xff,0x03,0x7f,0x04]
97 // CHECK-ERROR: instruction requires: sve
98 // CHECK-UNKNOWN: ff 03 7f 04 <unknown>
100 add z0.b, z0.b, z0.b
101 // CHECK-INST: add z0.b, z0.b, z0.b
102 // CHECK-ENCODING: [0x00,0x00,0x20,0x04]
103 // CHECK-ERROR: instruction requires: sve
104 // CHECK-UNKNOWN: 00 00 20 04 <unknown>
106 add z21.d, z10.d, z21.d
107 // CHECK-INST: add z21.d, z10.d, z21.d
108 // CHECK-ENCODING: [0x55,0x01,0xf5,0x04]
109 // CHECK-ERROR: instruction requires: sve
110 // CHECK-UNKNOWN: 55 01 f5 04 <unknown>
112 add z23.h, p3/m, z23.h, z13.h
113 // CHECK-INST: add z23.h, p3/m, z23.h, z13.h
114 // CHECK-ENCODING: [0xb7,0x0d,0x40,0x04]
115 // CHECK-ERROR: instruction requires: sve
116 // CHECK-UNKNOWN: b7 0d 40 04 <unknown>
118 add z23.s, p3/m, z23.s, z13.s
119 // CHECK-INST: add z23.s, p3/m, z23.s, z13.s
120 // CHECK-ENCODING: [0xb7,0x0d,0x80,0x04]
121 // CHECK-ERROR: instruction requires: sve
122 // CHECK-UNKNOWN: b7 0d 80 04 <unknown>
124 add z31.s, p7/m, z31.s, z31.s
125 // CHECK-INST: add z31.s, p7/m, z31.s, z31.s
126 // CHECK-ENCODING: [0xff,0x1f,0x80,0x04]
127 // CHECK-ERROR: instruction requires: sve
128 // CHECK-UNKNOWN: ff 1f 80 04 <unknown>
130 add z21.h, z10.h, z21.h
131 // CHECK-INST: add z21.h, z10.h, z21.h
132 // CHECK-ENCODING: [0x55,0x01,0x75,0x04]
133 // CHECK-ERROR: instruction requires: sve
134 // CHECK-UNKNOWN: 55 01 75 04 <unknown>
136 add z23.d, p3/m, z23.d, z13.d
137 // CHECK-INST: add z23.d, p3/m, z23.d, z13.d
138 // CHECK-ENCODING: [0xb7,0x0d,0xc0,0x04]
139 // CHECK-ERROR: instruction requires: sve
140 // CHECK-UNKNOWN: b7 0d c0 04 <unknown>
142 add z21.d, p5/m, z21.d, z10.d
143 // CHECK-INST: add z21.d, p5/m, z21.d, z10.d
144 // CHECK-ENCODING: [0x55,0x15,0xc0,0x04]
145 // CHECK-ERROR: instruction requires: sve
146 // CHECK-UNKNOWN: 55 15 c0 04 <unknown>
148 add z21.b, p5/m, z21.b, z10.b
149 // CHECK-INST: add z21.b, p5/m, z21.b, z10.b
150 // CHECK-ENCODING: [0x55,0x15,0x00,0x04]
151 // CHECK-ERROR: instruction requires: sve
152 // CHECK-UNKNOWN: 55 15 00 04 <unknown>
154 add z21.s, z10.s, z21.s
155 // CHECK-INST: add z21.s, z10.s, z21.s
156 // CHECK-ENCODING: [0x55,0x01,0xb5,0x04]
157 // CHECK-ERROR: instruction requires: sve
158 // CHECK-UNKNOWN: 55 01 b5 04 <unknown>
160 add z21.h, p5/m, z21.h, z10.h
161 // CHECK-INST: add z21.h, p5/m, z21.h, z10.h
162 // CHECK-ENCODING: [0x55,0x15,0x40,0x04]
163 // CHECK-ERROR: instruction requires: sve
164 // CHECK-UNKNOWN: 55 15 40 04 <unknown>
166 add z31.h, p7/m, z31.h, z31.h
167 // CHECK-INST: add z31.h, p7/m, z31.h, z31.h
168 // CHECK-ENCODING: [0xff,0x1f,0x40,0x04]
169 // CHECK-ERROR: instruction requires: sve
170 // CHECK-UNKNOWN: ff 1f 40 04 <unknown>
172 add z23.h, z13.h, z8.h
173 // CHECK-INST: add z23.h, z13.h, z8.h
174 // CHECK-ENCODING: [0xb7,0x01,0x68,0x04]
175 // CHECK-ERROR: instruction requires: sve
176 // CHECK-UNKNOWN: b7 01 68 04 <unknown>
178 add z31.d, p7/m, z31.d, z31.d
179 // CHECK-INST: add z31.d, p7/m, z31.d, z31.d
180 // CHECK-ENCODING: [0xff,0x1f,0xc0,0x04]
181 // CHECK-ERROR: instruction requires: sve
182 // CHECK-UNKNOWN: ff 1f c0 04 <unknown>
184 add z21.s, p5/m, z21.s, z10.s
185 // CHECK-INST: add z21.s, p5/m, z21.s, z10.s
186 // CHECK-ENCODING: [0x55,0x15,0x80,0x04]
187 // CHECK-ERROR: instruction requires: sve
188 // CHECK-UNKNOWN: 55 15 80 04 <unknown>
190 add z31.b, p7/m, z31.b, z31.b
191 // CHECK-INST: add z31.b, p7/m, z31.b, z31.b
192 // CHECK-ENCODING: [0xff,0x1f,0x00,0x04]
193 // CHECK-ERROR: instruction requires: sve
194 // CHECK-UNKNOWN: ff 1f 00 04 <unknown>
196 add z23.s, z13.s, z8.s
197 // CHECK-INST: add z23.s, z13.s, z8.s
198 // CHECK-ENCODING: [0xb7,0x01,0xa8,0x04]
199 // CHECK-ERROR: instruction requires: sve
200 // CHECK-UNKNOWN: b7 01 a8 04 <unknown>
202 add z0.b, z0.b, #0
203 // CHECK-INST: add z0.b, z0.b, #0
204 // CHECK-ENCODING: [0x00,0xc0,0x20,0x25]
205 // CHECK-ERROR: instruction requires: sve
206 // CHECK-UNKNOWN: 00 c0 20 25 <unknown>
208 add z31.b, z31.b, #255
209 // CHECK-INST: add z31.b, z31.b, #255
210 // CHECK-ENCODING: [0xff,0xdf,0x20,0x25]
211 // CHECK-ERROR: instruction requires: sve
212 // CHECK-UNKNOWN: ff df 20 25 <unknown>
214 add z0.h, z0.h, #0
215 // CHECK-INST: add z0.h, z0.h, #0
216 // CHECK-ENCODING: [0x00,0xc0,0x60,0x25]
217 // CHECK-ERROR: instruction requires: sve
218 // CHECK-UNKNOWN: 00 c0 60 25 <unknown>
220 add z0.h, z0.h, #0, lsl #8
221 // CHECK-INST: add z0.h, z0.h, #0, lsl #8
222 // CHECK-ENCODING: [0x00,0xe0,0x60,0x25]
223 // CHECK-ERROR: instruction requires: sve
224 // CHECK-UNKNOWN: 00 e0 60 25 <unknown>
226 add z31.h, z31.h, #255, lsl #8
227 // CHECK-INST: add z31.h, z31.h, #65280
228 // CHECK-ENCODING: [0xff,0xff,0x60,0x25]
229 // CHECK-ERROR: instruction requires: sve
230 // CHECK-UNKNOWN: ff ff 60 25 <unknown>
232 add z31.h, z31.h, #65280
233 // CHECK-INST: add z31.h, z31.h, #65280
234 // CHECK-ENCODING: [0xff,0xff,0x60,0x25]
235 // CHECK-ERROR: instruction requires: sve
236 // CHECK-UNKNOWN: ff ff 60 25 <unknown>
238 add z0.s, z0.s, #0
239 // CHECK-INST: add z0.s, z0.s, #0
240 // CHECK-ENCODING: [0x00,0xc0,0xa0,0x25]
241 // CHECK-ERROR: instruction requires: sve
242 // CHECK-UNKNOWN: 00 c0 a0 25 <unknown>
244 add z0.s, z0.s, #0, lsl #8
245 // CHECK-INST: add z0.s, z0.s, #0, lsl #8
246 // CHECK-ENCODING: [0x00,0xe0,0xa0,0x25]
247 // CHECK-ERROR: instruction requires: sve
248 // CHECK-UNKNOWN: 00 e0 a0 25 <unknown>
250 add z31.s, z31.s, #255, lsl #8
251 // CHECK-INST: add z31.s, z31.s, #65280
252 // CHECK-ENCODING: [0xff,0xff,0xa0,0x25]
253 // CHECK-ERROR: instruction requires: sve
254 // CHECK-UNKNOWN: ff ff a0 25 <unknown>
256 add z31.s, z31.s, #65280
257 // CHECK-INST: add z31.s, z31.s, #65280
258 // CHECK-ENCODING: [0xff,0xff,0xa0,0x25]
259 // CHECK-ERROR: instruction requires: sve
260 // CHECK-UNKNOWN: ff ff a0 25 <unknown>
262 add z0.d, z0.d, #0
263 // CHECK-INST: add z0.d, z0.d, #0
264 // CHECK-ENCODING: [0x00,0xc0,0xe0,0x25]
265 // CHECK-ERROR: instruction requires: sve
266 // CHECK-UNKNOWN: 00 c0 e0 25 <unknown>
268 add z0.d, z0.d, #0, lsl #8
269 // CHECK-INST: add z0.d, z0.d, #0, lsl #8
270 // CHECK-ENCODING: [0x00,0xe0,0xe0,0x25]
271 // CHECK-ERROR: instruction requires: sve
272 // CHECK-UNKNOWN: 00 e0 e0 25 <unknown>
274 add z31.d, z31.d, #255, lsl #8
275 // CHECK-INST: add z31.d, z31.d, #65280
276 // CHECK-ENCODING: [0xff,0xff,0xe0,0x25]
277 // CHECK-ERROR: instruction requires: sve
278 // CHECK-UNKNOWN: ff ff e0 25 <unknown>
280 add z31.d, z31.d, #65280
281 // CHECK-INST: add z31.d, z31.d, #65280
282 // CHECK-ENCODING: [0xff,0xff,0xe0,0x25]
283 // CHECK-ERROR: instruction requires: sve
284 // CHECK-UNKNOWN: ff ff e0 25 <unknown>
288 // --------------------------------------------------------------------------//
289 // Test compatibility with MOVPRFX instruction.
291 movprfx z4.b, p7/z, z6.b
292 // CHECK-INST: movprfx z4.b, p7/z, z6.b
293 // CHECK-ENCODING: [0xc4,0x3c,0x10,0x04]
294 // CHECK-ERROR: instruction requires: sve
295 // CHECK-UNKNOWN: c4 3c 10 04 <unknown>
297 add z4.b, p7/m, z4.b, z31.b
298 // CHECK-INST: add z4.b, p7/m, z4.b, z31.b
299 // CHECK-ENCODING: [0xe4,0x1f,0x00,0x04]
300 // CHECK-ERROR: instruction requires: sve
301 // CHECK-UNKNOWN: e4 1f 00 04 <unknown>
303 movprfx z4, z6
304 // CHECK-INST: movprfx z4, z6
305 // CHECK-ENCODING: [0xc4,0xbc,0x20,0x04]
306 // CHECK-ERROR: instruction requires: sve
307 // CHECK-UNKNOWN: c4 bc 20 04 <unknown>
309 add z4.b, p7/m, z4.b, z31.b
310 // CHECK-INST: add z4.b, p7/m, z4.b, z31.b
311 // CHECK-ENCODING: [0xe4,0x1f,0x00,0x04]
312 // CHECK-ERROR: instruction requires: sve
313 // CHECK-UNKNOWN: e4 1f 00 04 <unknown>
315 movprfx z31, z6
316 // CHECK-INST: movprfx z31, z6
317 // CHECK-ENCODING: [0xdf,0xbc,0x20,0x04]
318 // CHECK-ERROR: instruction requires: sve
319 // CHECK-UNKNOWN: df bc 20 04 <unknown>
321 add z31.d, z31.d, #65280
322 // CHECK-INST: add z31.d, z31.d, #65280
323 // CHECK-ENCODING: [0xff,0xff,0xe0,0x25]
324 // CHECK-ERROR: instruction requires: sve
325 // CHECK-UNKNOWN: ff ff e0 25 <unknown>