1 ; RUN: llvm-mc -triple arm64-apple-darwin -mattr=neon -show-encoding < %s | FileCheck %s
4 ;==---------------------------------------------------------------------------==
5 ; Add/Subtract with carry/borrow
6 ;==---------------------------------------------------------------------------==
13 ; CHECK: adc w1, w2, w3 ; encoding: [0x41,0x00,0x03,0x1a]
14 ; CHECK: adc x1, x2, x3 ; encoding: [0x41,0x00,0x03,0x9a]
15 ; CHECK: adcs w5, w4, w3 ; encoding: [0x85,0x00,0x03,0x3a]
16 ; CHECK: adcs x5, x4, x3 ; encoding: [0x85,0x00,0x03,0xba]
23 ; CHECK: sbc w1, w2, w3 ; encoding: [0x41,0x00,0x03,0x5a]
24 ; CHECK: sbc x1, x2, x3 ; encoding: [0x41,0x00,0x03,0xda]
25 ; CHECK: sbcs w1, w2, w3 ; encoding: [0x41,0x00,0x03,0x7a]
26 ; CHECK: sbcs x1, x2, x3 ; encoding: [0x41,0x00,0x03,0xfa]
28 ;==---------------------------------------------------------------------------==
29 ; Add/Subtract with (optionally shifted) immediate
30 ;==---------------------------------------------------------------------------==
33 add w3, w4, #1024, lsl #0
35 add x3, x4, #1024, lsl #0
37 ; CHECK: add w3, w4, #1024 ; encoding: [0x83,0x00,0x10,0x11]
38 ; CHECK: add w3, w4, #1024 ; encoding: [0x83,0x00,0x10,0x11]
39 ; CHECK: add x3, x4, #1024 ; encoding: [0x83,0x00,0x10,0x91]
40 ; CHECK: add x3, x4, #1024 ; encoding: [0x83,0x00,0x10,0x91]
42 add w3, w4, #1024, lsl #12
44 add w3, w4, #0, lsl #12
45 add x3, x4, #1024, lsl #12
47 add x3, x4, #0, lsl #12
50 ; CHECK: add w3, w4, #1024, lsl #12 ; encoding: [0x83,0x00,0x50,0x11]
51 ; CHECK: add w3, w4, #1024, lsl #12 ; encoding: [0x83,0x00,0x50,0x11]
52 ; CHECK: add w3, w4, #0, lsl #12 ; encoding: [0x83,0x00,0x40,0x11]
53 ; CHECK: add x3, x4, #1024, lsl #12 ; encoding: [0x83,0x00,0x50,0x91]
54 ; CHECK: add x3, x4, #1024, lsl #12 ; encoding: [0x83,0x00,0x50,0x91]
55 ; CHECK: add x3, x4, #0, lsl #12 ; encoding: [0x83,0x00,0x40,0x91]
56 ; CHECK: add sp, sp, #32 ; encoding: [0xff,0x83,0x00,0x91]
59 adds w3, w4, #1024, lsl #0
60 adds w3, w4, #1024, lsl #12
62 adds x3, x4, #1024, lsl #0
63 adds x3, x4, #1024, lsl #12
65 ; CHECK: adds w3, w4, #1024 ; encoding: [0x83,0x00,0x10,0x31]
66 ; CHECK: adds w3, w4, #1024 ; encoding: [0x83,0x00,0x10,0x31]
67 ; CHECK: adds w3, w4, #1024, lsl #12 ; encoding: [0x83,0x00,0x50,0x31]
68 ; CHECK: adds x3, x4, #1024 ; encoding: [0x83,0x00,0x10,0xb1]
69 ; CHECK: adds x3, x4, #1024 ; encoding: [0x83,0x00,0x10,0xb1]
70 ; CHECK: adds x3, x4, #1024, lsl #12 ; encoding: [0x83,0x00,0x50,0xb1]
73 sub w3, w4, #1024, lsl #0
74 sub w3, w4, #1024, lsl #12
76 sub x3, x4, #1024, lsl #0
77 sub x3, x4, #1024, lsl #12
80 ; CHECK: sub w3, w4, #1024 ; encoding: [0x83,0x00,0x10,0x51]
81 ; CHECK: sub w3, w4, #1024 ; encoding: [0x83,0x00,0x10,0x51]
82 ; CHECK: sub w3, w4, #1024, lsl #12 ; encoding: [0x83,0x00,0x50,0x51]
83 ; CHECK: sub x3, x4, #1024 ; encoding: [0x83,0x00,0x10,0xd1]
84 ; CHECK: sub x3, x4, #1024 ; encoding: [0x83,0x00,0x10,0xd1]
85 ; CHECK: sub x3, x4, #1024, lsl #12 ; encoding: [0x83,0x00,0x50,0xd1]
86 ; CHECK: sub sp, sp, #32 ; encoding: [0xff,0x83,0x00,0xd1]
89 subs w3, w4, #1024, lsl #0
90 subs w3, w4, #1024, lsl #12
92 subs x3, x4, #1024, lsl #0
93 subs x3, x4, #1024, lsl #12
95 ; CHECK: subs w3, w4, #1024 ; encoding: [0x83,0x00,0x10,0x71]
96 ; CHECK: subs w3, w4, #1024 ; encoding: [0x83,0x00,0x10,0x71]
97 ; CHECK: subs w3, w4, #1024, lsl #12 ; encoding: [0x83,0x00,0x50,0x71]
98 ; CHECK: subs x3, x4, #1024 ; encoding: [0x83,0x00,0x10,0xf1]
99 ; CHECK: subs x3, x4, #1024 ; encoding: [0x83,0x00,0x10,0xf1]
100 ; CHECK: subs x3, x4, #1024, lsl #12 ; encoding: [0x83,0x00,0x50,0xf1]
102 ;==---------------------------------------------------------------------------==
103 ; Add/Subtract register with (optional) shift
104 ;==---------------------------------------------------------------------------==
108 add w12, w13, w14, lsl #12
109 add x12, x13, x14, lsl #12
110 add x12, x13, x14, lsr #42
111 add x12, x13, x14, asr #39
113 ; CHECK: add w12, w13, w14 ; encoding: [0xac,0x01,0x0e,0x0b]
114 ; CHECK: add x12, x13, x14 ; encoding: [0xac,0x01,0x0e,0x8b]
115 ; CHECK: add w12, w13, w14, lsl #12 ; encoding: [0xac,0x31,0x0e,0x0b]
116 ; CHECK: add x12, x13, x14, lsl #12 ; encoding: [0xac,0x31,0x0e,0x8b]
117 ; CHECK: add x12, x13, x14, lsr #42 ; encoding: [0xac,0xa9,0x4e,0x8b]
118 ; CHECK: add x12, x13, x14, asr #39 ; encoding: [0xac,0x9d,0x8e,0x8b]
122 sub w12, w13, w14, lsl #12
123 sub x12, x13, x14, lsl #12
124 sub x12, x13, x14, lsr #42
125 sub x12, x13, x14, asr #39
127 ; CHECK: sub w12, w13, w14 ; encoding: [0xac,0x01,0x0e,0x4b]
128 ; CHECK: sub x12, x13, x14 ; encoding: [0xac,0x01,0x0e,0xcb]
129 ; CHECK: sub w12, w13, w14, lsl #12 ; encoding: [0xac,0x31,0x0e,0x4b]
130 ; CHECK: sub x12, x13, x14, lsl #12 ; encoding: [0xac,0x31,0x0e,0xcb]
131 ; CHECK: sub x12, x13, x14, lsr #42 ; encoding: [0xac,0xa9,0x4e,0xcb]
132 ; CHECK: sub x12, x13, x14, asr #39 ; encoding: [0xac,0x9d,0x8e,0xcb]
136 adds w12, w13, w14, lsl #12
137 adds x12, x13, x14, lsl #12
138 adds x12, x13, x14, lsr #42
139 adds x12, x13, x14, asr #39
141 ; CHECK: adds w12, w13, w14 ; encoding: [0xac,0x01,0x0e,0x2b]
142 ; CHECK: adds x12, x13, x14 ; encoding: [0xac,0x01,0x0e,0xab]
143 ; CHECK: adds w12, w13, w14, lsl #12 ; encoding: [0xac,0x31,0x0e,0x2b]
144 ; CHECK: adds x12, x13, x14, lsl #12 ; encoding: [0xac,0x31,0x0e,0xab]
145 ; CHECK: adds x12, x13, x14, lsr #42 ; encoding: [0xac,0xa9,0x4e,0xab]
146 ; CHECK: adds x12, x13, x14, asr #39 ; encoding: [0xac,0x9d,0x8e,0xab]
150 subs w12, w13, w14, lsl #12
151 subs x12, x13, x14, lsl #12
152 subs x12, x13, x14, lsr #42
153 subs x12, x13, x14, asr #39
155 ; CHECK: subs w12, w13, w14 ; encoding: [0xac,0x01,0x0e,0x6b]
156 ; CHECK: subs x12, x13, x14 ; encoding: [0xac,0x01,0x0e,0xeb]
157 ; CHECK: subs w12, w13, w14, lsl #12 ; encoding: [0xac,0x31,0x0e,0x6b]
158 ; CHECK: subs x12, x13, x14, lsl #12 ; encoding: [0xac,0x31,0x0e,0xeb]
159 ; CHECK: subs x12, x13, x14, lsr #42 ; encoding: [0xac,0xa9,0x4e,0xeb]
160 ; CHECK: subs x12, x13, x14, asr #39 ; encoding: [0xac,0x9d,0x8e,0xeb]
162 ; Check use of upper case register names rdar://14354073
164 ; CHECK: add x2, x2, x2 ; encoding: [0x42,0x00,0x02,0x8b]
166 ;==---------------------------------------------------------------------------==
167 ; Add/Subtract with (optional) extend
168 ;==---------------------------------------------------------------------------==
179 ; CHECK: add w1, w2, w3, uxtb ; encoding: [0x41,0x00,0x23,0x0b]
180 ; CHECK: add w1, w2, w3, uxth ; encoding: [0x41,0x20,0x23,0x0b]
181 ; CHECK: add w1, w2, w3, uxtw ; encoding: [0x41,0x40,0x23,0x0b]
182 ; CHECK: add w1, w2, w3, uxtx ; encoding: [0x41,0x60,0x23,0x0b]
183 ; CHECK: add w1, w2, w3, sxtb ; encoding: [0x41,0x80,0x23,0x0b]
184 ; CHECK: add w1, w2, w3, sxth ; encoding: [0x41,0xa0,0x23,0x0b]
185 ; CHECK: add w1, w2, w3, sxtw ; encoding: [0x41,0xc0,0x23,0x0b]
186 ; CHECK: add w1, w2, w3, sxtx ; encoding: [0x41,0xe0,0x23,0x0b]
195 ; CHECK: add x1, x2, w3, uxtb ; encoding: [0x41,0x00,0x23,0x8b]
196 ; CHECK: add x1, x2, w3, uxth ; encoding: [0x41,0x20,0x23,0x8b]
197 ; CHECK: add x1, x2, w3, uxtw ; encoding: [0x41,0x40,0x23,0x8b]
198 ; CHECK: add x1, x2, w3, sxtb ; encoding: [0x41,0x80,0x23,0x8b]
199 ; CHECK: add x1, x2, w3, sxth ; encoding: [0x41,0xa0,0x23,0x8b]
200 ; CHECK: add x1, x2, w3, sxtw ; encoding: [0x41,0xc0,0x23,0x8b]
203 add w1, wsp, w3, uxtw #0
204 add w2, wsp, w3, lsl #1
206 add sp, x2, x3, uxtx #0
208 ; CHECK: add w1, wsp, w3 ; encoding: [0xe1,0x43,0x23,0x0b]
209 ; CHECK: add w1, wsp, w3 ; encoding: [0xe1,0x43,0x23,0x0b]
210 ; CHECK: add w2, wsp, w3, lsl #1 ; encoding: [0xe2,0x47,0x23,0x0b]
211 ; CHECK: add sp, x2, x3 ; encoding: [0x5f,0x60,0x23,0x8b]
212 ; CHECK: add sp, x2, x3 ; encoding: [0x5f,0x60,0x23,0x8b]
223 ; CHECK: sub w1, w2, w3, uxtb ; encoding: [0x41,0x00,0x23,0x4b]
224 ; CHECK: sub w1, w2, w3, uxth ; encoding: [0x41,0x20,0x23,0x4b]
225 ; CHECK: sub w1, w2, w3, uxtw ; encoding: [0x41,0x40,0x23,0x4b]
226 ; CHECK: sub w1, w2, w3, uxtx ; encoding: [0x41,0x60,0x23,0x4b]
227 ; CHECK: sub w1, w2, w3, sxtb ; encoding: [0x41,0x80,0x23,0x4b]
228 ; CHECK: sub w1, w2, w3, sxth ; encoding: [0x41,0xa0,0x23,0x4b]
229 ; CHECK: sub w1, w2, w3, sxtw ; encoding: [0x41,0xc0,0x23,0x4b]
230 ; CHECK: sub w1, w2, w3, sxtx ; encoding: [0x41,0xe0,0x23,0x4b]
239 ; CHECK: sub x1, x2, w3, uxtb ; encoding: [0x41,0x00,0x23,0xcb]
240 ; CHECK: sub x1, x2, w3, uxth ; encoding: [0x41,0x20,0x23,0xcb]
241 ; CHECK: sub x1, x2, w3, uxtw ; encoding: [0x41,0x40,0x23,0xcb]
242 ; CHECK: sub x1, x2, w3, sxtb ; encoding: [0x41,0x80,0x23,0xcb]
243 ; CHECK: sub x1, x2, w3, sxth ; encoding: [0x41,0xa0,0x23,0xcb]
244 ; CHECK: sub x1, x2, w3, sxtw ; encoding: [0x41,0xc0,0x23,0xcb]
247 sub w1, wsp, w3, uxtw #0
249 sub sp, x2, x3, uxtx #0
250 sub sp, x3, x7, lsl #4
252 ; CHECK: sub w1, wsp, w3 ; encoding: [0xe1,0x43,0x23,0x4b]
253 ; CHECK: sub w1, wsp, w3 ; encoding: [0xe1,0x43,0x23,0x4b]
254 ; CHECK: sub sp, x2, x3 ; encoding: [0x5f,0x60,0x23,0xcb]
255 ; CHECK: sub sp, x2, x3 ; encoding: [0x5f,0x60,0x23,0xcb]
256 ; CHECK: sp, x3, x7, lsl #4 ; encoding: [0x7f,0x70,0x27,0xcb]
258 adds w1, w2, w3, uxtb
259 adds w1, w2, w3, uxth
260 adds w1, w2, w3, uxtw
261 adds w1, w2, w3, uxtx
262 adds w1, w2, w3, sxtb
263 adds w1, w2, w3, sxth
264 adds w1, w2, w3, sxtw
265 adds w1, w2, w3, sxtx
267 ; CHECK: adds w1, w2, w3, uxtb ; encoding: [0x41,0x00,0x23,0x2b]
268 ; CHECK: adds w1, w2, w3, uxth ; encoding: [0x41,0x20,0x23,0x2b]
269 ; CHECK: adds w1, w2, w3, uxtw ; encoding: [0x41,0x40,0x23,0x2b]
270 ; CHECK: adds w1, w2, w3, uxtx ; encoding: [0x41,0x60,0x23,0x2b]
271 ; CHECK: adds w1, w2, w3, sxtb ; encoding: [0x41,0x80,0x23,0x2b]
272 ; CHECK: adds w1, w2, w3, sxth ; encoding: [0x41,0xa0,0x23,0x2b]
273 ; CHECK: adds w1, w2, w3, sxtw ; encoding: [0x41,0xc0,0x23,0x2b]
274 ; CHECK: adds w1, w2, w3, sxtx ; encoding: [0x41,0xe0,0x23,0x2b]
276 adds x1, x2, w3, uxtb
277 adds x1, x2, w3, uxth
278 adds x1, x2, w3, uxtw
279 adds x1, x2, w3, uxtx
280 adds x1, x2, w3, sxtb
281 adds x1, x2, w3, sxth
282 adds x1, x2, w3, sxtw
283 adds x1, x2, w3, sxtx
285 ; CHECK: adds x1, x2, w3, uxtb ; encoding: [0x41,0x00,0x23,0xab]
286 ; CHECK: adds x1, x2, w3, uxth ; encoding: [0x41,0x20,0x23,0xab]
287 ; CHECK: adds x1, x2, w3, uxtw ; encoding: [0x41,0x40,0x23,0xab]
288 ; CHECK: adds x1, x2, w3, uxtx ; encoding: [0x41,0x60,0x23,0xab]
289 ; CHECK: adds x1, x2, w3, sxtb ; encoding: [0x41,0x80,0x23,0xab]
290 ; CHECK: adds x1, x2, w3, sxth ; encoding: [0x41,0xa0,0x23,0xab]
291 ; CHECK: adds x1, x2, w3, sxtw ; encoding: [0x41,0xc0,0x23,0xab]
292 ; CHECK: adds x1, x2, w3, sxtx ; encoding: [0x41,0xe0,0x23,0xab]
295 adds w1, wsp, w3, uxtw #0
296 adds wzr, wsp, w3, lsl #4
298 ; CHECK: adds w1, wsp, w3 ; encoding: [0xe1,0x43,0x23,0x2b]
299 ; CHECK: adds w1, wsp, w3 ; encoding: [0xe1,0x43,0x23,0x2b]
300 ; CHECK: cmn wsp, w3, lsl #4 ; encoding: [0xff,0x53,0x23,0x2b]
302 subs w1, w2, w3, uxtb
303 subs w1, w2, w3, uxth
304 subs w1, w2, w3, uxtw
305 subs w1, w2, w3, uxtx
306 subs w1, w2, w3, sxtb
307 subs w1, w2, w3, sxth
308 subs w1, w2, w3, sxtw
309 subs w1, w2, w3, sxtx
311 ; CHECK: subs w1, w2, w3, uxtb ; encoding: [0x41,0x00,0x23,0x6b]
312 ; CHECK: subs w1, w2, w3, uxth ; encoding: [0x41,0x20,0x23,0x6b]
313 ; CHECK: subs w1, w2, w3, uxtw ; encoding: [0x41,0x40,0x23,0x6b]
314 ; CHECK: subs w1, w2, w3, uxtx ; encoding: [0x41,0x60,0x23,0x6b]
315 ; CHECK: subs w1, w2, w3, sxtb ; encoding: [0x41,0x80,0x23,0x6b]
316 ; CHECK: subs w1, w2, w3, sxth ; encoding: [0x41,0xa0,0x23,0x6b]
317 ; CHECK: subs w1, w2, w3, sxtw ; encoding: [0x41,0xc0,0x23,0x6b]
318 ; CHECK: subs w1, w2, w3, sxtx ; encoding: [0x41,0xe0,0x23,0x6b]
320 subs x1, x2, w3, uxtb
321 subs x1, x2, w3, uxth
322 subs x1, x2, w3, uxtw
323 subs x1, x2, w3, uxtx
324 subs x1, x2, w3, sxtb
325 subs x1, x2, w3, sxth
326 subs x1, x2, w3, sxtw
327 subs x1, x2, w3, sxtx
329 ; CHECK: subs x1, x2, w3, uxtb ; encoding: [0x41,0x00,0x23,0xeb]
330 ; CHECK: subs x1, x2, w3, uxth ; encoding: [0x41,0x20,0x23,0xeb]
331 ; CHECK: subs x1, x2, w3, uxtw ; encoding: [0x41,0x40,0x23,0xeb]
332 ; CHECK: subs x1, x2, w3, uxtx ; encoding: [0x41,0x60,0x23,0xeb]
333 ; CHECK: subs x1, x2, w3, sxtb ; encoding: [0x41,0x80,0x23,0xeb]
334 ; CHECK: subs x1, x2, w3, sxth ; encoding: [0x41,0xa0,0x23,0xeb]
335 ; CHECK: subs x1, x2, w3, sxtw ; encoding: [0x41,0xc0,0x23,0xeb]
336 ; CHECK: subs x1, x2, w3, sxtx ; encoding: [0x41,0xe0,0x23,0xeb]
339 subs w1, wsp, w3, uxtw #0
341 ; CHECK: subs w1, wsp, w3 ; encoding: [0xe1,0x43,0x23,0x6b]
342 ; CHECK: subs w1, wsp, w3 ; encoding: [0xe1,0x43,0x23,0x6b]
345 subs x3, sp, x9, lsl #2
347 subs wzr, wsp, w8, uxtw
349 subs xzr, sp, w8, uxtw
351 ; CHECK: cmp wsp, w9 ; encoding: [0xff,0x43,0x29,0x6b]
352 ; CHECK: subs x3, sp, x9, lsl #2 ; encoding: [0xe3,0x6b,0x29,0xeb]
353 ; CHECK: cmp wsp, w8 ; encoding: [0xff,0x43,0x28,0x6b]
354 ; CHECK: cmp wsp, w8 ; encoding: [0xff,0x43,0x28,0x6b]
355 ; CHECK: cmp sp, w8, uxtw ; encoding: [0xff,0x43,0x28,0xeb]
356 ; CHECK: cmp sp, w8, uxtw ; encoding: [0xff,0x43,0x28,0xeb]
358 sub wsp, w9, w8, uxtw
359 sub w1, wsp, w8, uxtw
360 sub wsp, wsp, w8, uxtw
364 subs w1, wsp, w8, uxtw
365 subs x1, sp, w8, uxtw
367 ; CHECK: sub wsp, w9, w8 ; encoding: [0x3f,0x41,0x28,0x4b]
368 ; CHECK: sub w1, wsp, w8 ; encoding: [0xe1,0x43,0x28,0x4b]
369 ; CHECK: sub wsp, wsp, w8 ; encoding: [0xff,0x43,0x28,0x4b]
370 ; CHECK: sub sp, x9, w8, uxtw ; encoding: [0x3f,0x41,0x28,0xcb]
371 ; CHECK: sub x1, sp, w8, uxtw ; encoding: [0xe1,0x43,0x28,0xcb]
372 ; CHECK: sub sp, sp, w8, uxtw ; encoding: [0xff,0x43,0x28,0xcb]
373 ; CHECK: subs w1, wsp, w8 ; encoding: [0xe1,0x43,0x28,0x6b]
374 ; CHECK: subs x1, sp, w8, uxtw ; encoding: [0xe1,0x43,0x28,0xeb]
376 ;==---------------------------------------------------------------------------==
377 ; Signed/Unsigned divide
378 ;==---------------------------------------------------------------------------==
385 ; CHECK: sdiv w1, w2, w3 ; encoding: [0x41,0x0c,0xc3,0x1a]
386 ; CHECK: sdiv x1, x2, x3 ; encoding: [0x41,0x0c,0xc3,0x9a]
387 ; CHECK: udiv w1, w2, w3 ; encoding: [0x41,0x08,0xc3,0x1a]
388 ; CHECK: udiv x1, x2, x3 ; encoding: [0x41,0x08,0xc3,0x9a]
390 ;==---------------------------------------------------------------------------==
392 ;==---------------------------------------------------------------------------==
411 ; CHECK: encoding: [0x41,0x28,0xc3,0x1a]
412 ; CHECK: encoding: [0x41,0x28,0xc3,0x9a]
413 ; CHECK: encoding: [0x41,0x28,0xc3,0x1a]
414 ; CHECK: encoding: [0x41,0x28,0xc3,0x9a]
415 ; CHECK: encoding: [0x41,0x20,0xc3,0x1a]
416 ; CHECK: encoding: [0x41,0x20,0xc3,0x9a]
417 ; CHECK: encoding: [0x41,0x20,0xc3,0x1a]
418 ; CHECK: encoding: [0x41,0x20,0xc3,0x9a]
419 ; CHECK: encoding: [0x41,0x24,0xc3,0x1a]
420 ; CHECK: encoding: [0x41,0x24,0xc3,0x9a]
421 ; CHECK: encoding: [0x41,0x24,0xc3,0x1a]
422 ; CHECK: encoding: [0x41,0x24,0xc3,0x9a]
423 ; CHECK: encoding: [0x41,0x2c,0xc3,0x1a]
424 ; CHECK: encoding: [0x41,0x2c,0xc3,0x9a]
425 ; CHECK: encoding: [0x41,0x2c,0xc3,0x1a]
426 ; CHECK: encoding: [0x41,0x2c,0xc3,0x9a]
428 ;==---------------------------------------------------------------------------==
429 ; One operand instructions
430 ;==---------------------------------------------------------------------------==
444 ; CHECK: encoding: [0x41,0x14,0xc0,0x5a]
445 ; CHECK: encoding: [0x41,0x14,0xc0,0xda]
446 ; CHECK: encoding: [0x41,0x10,0xc0,0x5a]
447 ; CHECK: encoding: [0x41,0x10,0xc0,0xda]
448 ; CHECK: encoding: [0x41,0x00,0xc0,0x5a]
449 ; CHECK: encoding: [0x41,0x00,0xc0,0xda]
450 ; CHECK: encoding: [0x41,0x08,0xc0,0x5a]
451 ; CHECK: encoding: [0x41,0x0c,0xc0,0xda]
452 ; CHECK: encoding: [0x41,0x04,0xc0,0x5a]
453 ; CHECK: encoding: [0x41,0x04,0xc0,0xda]
454 ; CHECK: encoding: [0x41,0x08,0xc0,0xda]
456 ;==---------------------------------------------------------------------------==
457 ; 6.6.1 Multiply-add instructions
458 ;==---------------------------------------------------------------------------==
464 smaddl x1, w2, w3, x4
465 smsubl x1, w2, w3, x4
466 umaddl x1, w2, w3, x4
467 umsubl x1, w2, w3, x4
469 ; CHECK: madd w1, w2, w3, w4 ; encoding: [0x41,0x10,0x03,0x1b]
470 ; CHECK: madd x1, x2, x3, x4 ; encoding: [0x41,0x10,0x03,0x9b]
471 ; CHECK: msub w1, w2, w3, w4 ; encoding: [0x41,0x90,0x03,0x1b]
472 ; CHECK: msub x1, x2, x3, x4 ; encoding: [0x41,0x90,0x03,0x9b]
473 ; CHECK: smaddl x1, w2, w3, x4 ; encoding: [0x41,0x10,0x23,0x9b]
474 ; CHECK: smsubl x1, w2, w3, x4 ; encoding: [0x41,0x90,0x23,0x9b]
475 ; CHECK: umaddl x1, w2, w3, x4 ; encoding: [0x41,0x10,0xa3,0x9b]
476 ; CHECK: umsubl x1, w2, w3, x4 ; encoding: [0x41,0x90,0xa3,0x9b]
478 ;==---------------------------------------------------------------------------==
479 ; Multiply-high instructions
480 ;==---------------------------------------------------------------------------==
485 ; CHECK: smulh x1, x2, x3 ; encoding: [0x41,0x7c,0x43,0x9b]
486 ; CHECK: umulh x1, x2, x3 ; encoding: [0x41,0x7c,0xc3,0x9b]
488 ;==---------------------------------------------------------------------------==
489 ; Move immediate instructions
490 ;==---------------------------------------------------------------------------==
497 ; CHECK: movz w0, #0x1 ; encoding: [0x20,0x00,0x80,0x52]
498 ; CHECK: movz x0, #0x1 ; encoding: [0x20,0x00,0x80,0xd2]
499 ; CHECK: movz w0, #0x1, lsl #16 ; encoding: [0x20,0x00,0xa0,0x52]
500 ; CHECK: movz x0, #0x1, lsl #16 ; encoding: [0x20,0x00,0xa0,0xd2]
507 ; CHECK: movn w0, #0x2 ; encoding: [0x40,0x00,0x80,0x12]
508 ; CHECK: movn x0, #0x2 ; encoding: [0x40,0x00,0x80,0x92]
509 ; CHECK: movn w0, #0x2, lsl #16 ; encoding: [0x40,0x00,0xa0,0x12]
510 ; CHECK: movn x0, #0x2, lsl #16 ; encoding: [0x40,0x00,0xa0,0x92]
517 ; CHECK: movk w0, #0x1 ; encoding: [0x20,0x00,0x80,0x72]
518 ; CHECK: movk x0, #0x1 ; encoding: [0x20,0x00,0x80,0xf2]
519 ; CHECK: movk w0, #0x1, lsl #16 ; encoding: [0x20,0x00,0xa0,0x72]
520 ; CHECK: movk x0, #0x1, lsl #16 ; encoding: [0x20,0x00,0xa0,0xf2]
522 ;==---------------------------------------------------------------------------==
523 ; Conditionally set flags instructions
524 ;==---------------------------------------------------------------------------==
531 ; CHECK: encoding: [0x23,0x08,0x42,0x3a]
532 ; CHECK: encoding: [0x23,0x08,0x42,0xba]
533 ; CHECK: encoding: [0x23,0x08,0x42,0x7a]
534 ; CHECK: encoding: [0x23,0x08,0x42,0xfa]
541 ; CHECK: encoding: [0x23,0x00,0x42,0x3a]
542 ; CHECK: encoding: [0x23,0x00,0x42,0xba]
543 ; CHECK: encoding: [0x23,0x00,0x42,0x7a]
544 ; CHECK: encoding: [0x23,0x00,0x42,0xfa]
546 ;==---------------------------------------------------------------------------==
547 ; Conditional select instructions
548 ;==---------------------------------------------------------------------------==
559 ; CHECK: encoding: [0x41,0x00,0x83,0x1a]
560 ; CHECK: encoding: [0x41,0x00,0x83,0x9a]
561 ; CHECK: encoding: [0x41,0x04,0x83,0x1a]
562 ; CHECK: encoding: [0x41,0x04,0x83,0x9a]
563 ; CHECK: encoding: [0x41,0x00,0x83,0x5a]
564 ; CHECK: encoding: [0x41,0x00,0x83,0xda]
565 ; CHECK: encoding: [0x41,0x04,0x83,0x5a]
566 ; CHECK: encoding: [0x41,0x04,0x83,0xda]
568 ; Make sure we handle upper case, too. In particular, condition codes.
569 CSEL W16, W7, W27, EQ
570 CSEL W15, W6, W26, NE
571 CSEL W14, W5, W25, CS
572 CSEL W13, W4, W24, HS
573 csel w12, w3, w23, CC
574 csel w11, w2, w22, LO
575 csel w10, w1, w21, MI
585 csel x10, x1, x20, AL
587 ; CHECK: csel w16, w7, w27, eq ; encoding: [0xf0,0x00,0x9b,0x1a]
588 ; CHECK: csel w15, w6, w26, ne ; encoding: [0xcf,0x10,0x9a,0x1a]
589 ; CHECK: csel w14, w5, w25, hs ; encoding: [0xae,0x20,0x99,0x1a]
590 ; CHECK: csel w13, w4, w24, hs ; encoding: [0x8d,0x20,0x98,0x1a]
591 ; CHECK: csel w12, w3, w23, lo ; encoding: [0x6c,0x30,0x97,0x1a]
592 ; CHECK: csel w11, w2, w22, lo ; encoding: [0x4b,0x30,0x96,0x1a]
593 ; CHECK: csel w10, w1, w21, mi ; encoding: [0x2a,0x40,0x95,0x1a]
594 ; CHECK: csel x9, x9, x1, pl ; encoding: [0x29,0x51,0x81,0x9a]
595 ; CHECK: csel x8, x8, x2, vs ; encoding: [0x08,0x61,0x82,0x9a]
596 ; CHECK: csel x7, x7, x3, vc ; encoding: [0xe7,0x70,0x83,0x9a]
597 ; CHECK: csel x6, x7, x4, hi ; encoding: [0xe6,0x80,0x84,0x9a]
598 ; CHECK: csel x5, x6, x5, ls ; encoding: [0xc5,0x90,0x85,0x9a]
599 ; CHECK: csel x4, x5, x6, ge ; encoding: [0xa4,0xa0,0x86,0x9a]
600 ; CHECK: csel x3, x4, x7, lt ; encoding: [0x83,0xb0,0x87,0x9a]
601 ; CHECK: csel x2, x3, x8, gt ; encoding: [0x62,0xc0,0x88,0x9a]
602 ; CHECK: csel x1, x2, x9, le ; encoding: [0x41,0xd0,0x89,0x9a]
603 ; CHECK: csel x10, x1, x20, al ; encoding: [0x2a,0xe0,0x94,0x9a]
606 ;==---------------------------------------------------------------------------==
607 ; Scalar saturating arithmetic
608 ;==---------------------------------------------------------------------------==
613 ; CHECK: uqxtn b4, h2 ; encoding: [0x44,0x48,0x21,0x7e]
614 ; CHECK: uqxtn h2, s3 ; encoding: [0x62,0x48,0x61,0x7e]
615 ; CHECK: uqxtn s9, d2 ; encoding: [0x49,0x48,0xa1,0x7e]