1 # RUN: llvm-mc --disassemble -triple arm64-apple-darwin < %s | FileCheck %s
3 #-----------------------------------------------------------------------------
5 #-----------------------------------------------------------------------------
19 # CHECK: ldr w5, [x4, #20]
21 # CHECK: ldr x2, [sp, #32]
22 # CHECK: ldr b5, [sp, #1]
23 # CHECK: ldr h6, [sp, #2]
24 # CHECK: ldr s7, [sp, #4]
25 # CHECK: ldr d8, [sp, #8]
26 # CHECK: ldr q9, [sp, #16]
27 # CHECK: ldrb w4, [x3]
28 # CHECK: ldrsw x0, [x1, x0, lsl #2]
29 # CHECK: ldrb w5, [x4, #20]
30 # CHECK: ldrsb w9, [x3]
31 # CHECK: ldrsb x2, [sp, #128]
32 # CHECK: ldrh w2, [sp, #32]
33 # CHECK: ldrsh w3, [sp, #32]
34 # CHECK: ldrsh x5, [x9, #24]
35 # CHECK: ldrsw x9, [sp, #512]
36 # CHECK: prfm pldl3strm, [sp, #32]
58 # CHECK: prfm pldl1keep, [x2]
59 # CHECK: prfm pldl1strm, [x2]
60 # CHECK: prfm pldl2keep, [x2]
61 # CHECK: prfm pldl2strm, [x2]
62 # CHECK: prfm pldl3keep, [x2]
63 # CHECK: prfm pldl3strm, [x2]
64 # CHECK: prfm pstl1keep, [x2]
65 # CHECK: prfm pstl1strm, [x2]
66 # CHECK: prfm pstl2keep, [x2]
67 # CHECK: prfm pstl2strm, [x2]
68 # CHECK: prfm pstl3keep, [x2]
69 # CHECK: prfm pstl3strm, [x2]
71 #-----------------------------------------------------------------------------
73 #-----------------------------------------------------------------------------
90 # CHECK: str x2, [sp, #32]
91 # CHECK: str w5, [x4, #20]
92 # CHECK: str b5, [sp, #1]
93 # CHECK: str h6, [sp, #2]
94 # CHECK: str s7, [sp, #4]
95 # CHECK: str d8, [sp, #8]
96 # CHECK: str q9, [sp, #16]
97 # CHECK: strb w4, [x3]
98 # CHECK: strb w5, [x4, #20]
99 # CHECK: strh w2, [sp, #32]
100 # CHECK: strb w0, [x0, x0, sxtx]
101 # CHECK: strb w0, [x0, w0, uxtw]
103 #-----------------------------------------------------------------------------
104 # Unscaled immediate loads and stores
105 #-----------------------------------------------------------------------------
122 # CHECK: ldur w2, [x3]
123 # CHECK: ldur w2, [sp, #24]
124 # CHECK: ldur x2, [x3]
125 # CHECK: ldur x2, [sp, #24]
126 # CHECK: ldur b5, [sp, #1]
127 # CHECK: ldur h6, [sp, #2]
128 # CHECK: ldur s7, [sp, #4]
129 # CHECK: ldur d8, [sp, #8]
130 # CHECK: ldur q9, [sp, #16]
131 # CHECK: ldursb w9, [x3]
132 # CHECK: ldursb x2, [sp, #128]
133 # CHECK: ldursh w3, [sp, #32]
134 # CHECK: ldursh x5, [x9, #24]
135 # CHECK: ldursw x9, [sp, #-128]
152 # CHECK: stur w4, [x3]
153 # CHECK: stur w2, [sp, #32]
154 # CHECK: stur x4, [x3]
155 # CHECK: stur x2, [sp, #32]
156 # CHECK: stur w5, [x4, #20]
157 # CHECK: stur b5, [sp, #1]
158 # CHECK: stur h6, [sp, #2]
159 # CHECK: stur s7, [sp, #4]
160 # CHECK: stur d8, [sp, #8]
161 # CHECK: stur q9, [sp, #16]
162 # CHECK: sturb w4, [x3]
163 # CHECK: sturb w5, [x4, #20]
164 # CHECK: sturh w2, [sp, #32]
165 # CHECK: prfum pldl3strm, [sp, #32]
167 #-----------------------------------------------------------------------------
168 # Unprivileged loads and stores
169 #-----------------------------------------------------------------------------
181 # CHECK: ldtr w3, [x4, #16]
182 # CHECK: ldtr x3, [x4, #16]
183 # CHECK: ldtrb w3, [x4, #16]
184 # CHECK: ldtrsb w9, [x3]
185 # CHECK: ldtrsb x2, [sp, #128]
186 # CHECK: ldtrh w3, [x4, #16]
187 # CHECK: ldtrsh w3, [sp, #32]
188 # CHECK: ldtrsh x5, [x9, #24]
189 # CHECK: ldtrsw x9, [sp, #-128]
198 # CHECK: sttr w5, [x4, #20]
199 # CHECK: sttr x4, [x3]
200 # CHECK: sttr x2, [sp, #32]
201 # CHECK: sttrb w4, [x3]
202 # CHECK: sttrb w5, [x4, #20]
203 # CHECK: sttrh w2, [sp, #32]
205 #-----------------------------------------------------------------------------
206 # Pre-indexed loads and stores
207 #-----------------------------------------------------------------------------
217 # CHECK: ldr x29, [x7, #8]!
218 # CHECK: ldr x30, [x7, #8]!
219 # CHECK: ldr b5, [x0, #1]!
220 # CHECK: ldr h6, [x0, #2]!
221 # CHECK: ldr s7, [x0, #4]!
222 # CHECK: ldr d8, [x0, #8]!
223 # CHECK: ldr q9, [x0, #16]!
233 # CHECK: str x30, [x7, #-8]!
234 # CHECK: str x29, [x7, #-8]!
235 # CHECK: str b5, [x0, #-1]!
236 # CHECK: str h6, [x0, #-2]!
237 # CHECK: str s7, [x0, #-4]!
238 # CHECK: str d8, [x0, #-8]!
239 # CHECK: str q9, [x0, #-16]!
241 #-----------------------------------------------------------------------------
242 # post-indexed loads and stores
243 #-----------------------------------------------------------------------------
253 # CHECK: str x30, [x7], #-8
254 # CHECK: str x29, [x7], #-8
255 # CHECK: str b5, [x0], #-1
256 # CHECK: str h6, [x0], #-2
257 # CHECK: str s7, [x0], #-4
258 # CHECK: str d8, [x0], #-8
259 # CHECK: str q9, [x0], #-16
269 # CHECK: ldr x29, [x7], #8
270 # CHECK: ldr x30, [x7], #8
271 # CHECK: ldr b5, [x0], #1
272 # CHECK: ldr h6, [x0], #2
273 # CHECK: ldr s7, [x0], #4
274 # CHECK: ldr d8, [x0], #8
275 # CHECK: ldr q9, [x0], #16
277 #-----------------------------------------------------------------------------
278 # Load/Store pair (indexed offset)
279 #-----------------------------------------------------------------------------
288 # CHECK: ldp w3, w2, [x15, #16]
289 # CHECK: ldp x4, x9, [sp, #-16]
290 # CHECK: ldpsw x2, x3, [x14, #16]
291 # CHECK: ldpsw x2, x3, [sp, #-16]
292 # CHECK: ldp s10, s1, [x2, #64]
293 # CHECK: ldp d10, d1, [x2]
300 # CHECK: stp w3, w2, [x15, #16]
301 # CHECK: stp x4, x9, [sp, #-16]
302 # CHECK: stp s10, s1, [x2, #64]
303 # CHECK: stp d10, d1, [x2]
305 #-----------------------------------------------------------------------------
306 # Load/Store pair (pre-indexed)
307 #-----------------------------------------------------------------------------
316 # CHECK: ldp w3, w2, [x15, #16]!
317 # CHECK: ldp x4, x9, [sp, #-16]!
318 # CHECK: ldpsw x2, x3, [x14, #16]!
319 # CHECK: ldpsw x2, x3, [sp, #-16]!
320 # CHECK: ldp s10, s1, [x2, #64]!
321 # CHECK: ldp d10, d1, [x2, #16]!
328 # CHECK: stp w3, w2, [x15, #16]!
329 # CHECK: stp x4, x9, [sp, #-16]!
330 # CHECK: stp s10, s1, [x2, #64]!
331 # CHECK: stp d10, d1, [x2, #16]!
333 #-----------------------------------------------------------------------------
334 # Load/Store pair (post-indexed)
335 #-----------------------------------------------------------------------------
344 # CHECK: ldp w3, w2, [x15], #16
345 # CHECK: ldp x4, x9, [sp], #-16
346 # CHECK: ldpsw x2, x3, [x14], #16
347 # CHECK: ldpsw x2, x3, [sp], #-16
348 # CHECK: ldp s10, s1, [x2], #64
349 # CHECK: ldp d10, d1, [x2], #16
356 # CHECK: stp w3, w2, [x15], #16
357 # CHECK: stp x4, x9, [sp], #-16
358 # CHECK: stp s10, s1, [x2], #64
359 # CHECK: stp d10, d1, [x2], #16
361 #-----------------------------------------------------------------------------
362 # Load/Store pair (no-allocate)
363 #-----------------------------------------------------------------------------
370 # CHECK: ldnp w3, w2, [x15, #16]
371 # CHECK: ldnp x4, x9, [sp, #-16]
372 # CHECK: ldnp s10, s1, [x2, #64]
373 # CHECK: ldnp d10, d1, [x2]
380 # CHECK: stnp w3, w2, [x15, #16]
381 # CHECK: stnp x4, x9, [sp, #-16]
382 # CHECK: stnp s10, s1, [x2, #64]
383 # CHECK: stnp d10, d1, [x2]
385 #-----------------------------------------------------------------------------
386 # Load/Store register offset
387 #-----------------------------------------------------------------------------
395 # CHECK: ldr w0, [x0, x0]
396 # CHECK: ldr w0, [x0, x0, lsl #2]
397 # CHECK: ldr x0, [x0, x0]
398 # CHECK: ldr x0, [x0, x0, lsl #3]
399 # CHECK: ldr x0, [x0, x0, sxtx]
412 # CHECK: ldr b1, [x1, x2]
413 # CHECK: ldr b1, [x1, x2, lsl #0]
414 # CHECK: ldr h1, [x1, x2]
415 # CHECK: ldr h1, [x1, x2, lsl #1]
416 # CHECK: ldr s1, [x1, x2]
417 # CHECK: ldr s1, [x1, x2, lsl #2]
418 # CHECK: ldr d1, [x1, x2]
419 # CHECK: ldr d1, [x1, x2, lsl #3]
420 # CHECK: ldr q1, [x1, x2]
421 # CHECK: ldr q1, [x1, x2, lsl #4]
429 # CHECK: str h0, [x0, w0, uxtw]
430 # CHECK: str d1, [sp, x3]
431 # CHECK: str d1, [sp, w3, uxtw #3]
432 # CHECK: str q1, [sp, x3]
433 # CHECK: str q1, [sp, w3, uxtw #4]
435 #-----------------------------------------------------------------------------
436 # Load/Store exclusive
437 #-----------------------------------------------------------------------------
444 # CHECK: ldxrb w6, [x1]
445 # CHECK: ldxrh w6, [x1]
446 # CHECK: ldxp w7, w3, [x9]
447 # CHECK: ldxp x7, x3, [x9]
456 # CHECK: stxr w1, x4, [x3]
457 # CHECK: stxr w1, w4, [x3]
458 # CHECK: stxrb w1, w4, [x3]
459 # CHECK: stxrh w1, w4, [x3]
460 # CHECK: stxp w1, x2, x6, [x1]
461 # CHECK: stxp w1, w2, w6, [x1]
463 #-----------------------------------------------------------------------------
464 # Load-acquire/Store-release non-exclusive
465 #-----------------------------------------------------------------------------
472 # CHECK: ldar w4, [sp]
473 # CHECK: ldar x4, [sp]
474 # CHECK: ldarb w4, [sp]
475 # CHECK: ldarh w4, [sp]
482 # CHECK: stlr w3, [x6]
483 # CHECK: stlr x3, [x6]
484 # CHECK: stlrb w3, [x6]
485 # CHECK: stlrh w3, [x6]
487 #-----------------------------------------------------------------------------
488 # Load-acquire/Store-release exclusive
489 #-----------------------------------------------------------------------------
498 # CHECK: ldaxr w2, [x4]
499 # CHECK: ldaxr x2, [x4]
500 # CHECK: ldaxrb w2, [x4]
501 # CHECK: ldaxrh w2, [x4]
502 # CHECK: ldaxp w2, w6, [x1]
503 # CHECK: ldaxp x2, x6, [x1]
512 # CHECK: stlxr w8, x7, [x1]
513 # CHECK: stlxr w8, w7, [x1]
514 # CHECK: stlxrb w8, w7, [x1]
515 # CHECK: stlxrh w8, w7, [x1]
516 # CHECK: stlxp w1, x2, x6, [x1]
517 # CHECK: stlxp w1, w2, w6, [x1]
519 #-----------------------------------------------------------------------------
520 # Load/Store with explicit LSL values
521 #-----------------------------------------------------------------------------
544 # CHECK: ldrsw x0, [x1, x0, lsl #2]
545 # CHECK: ldr x0, [x1, x0, lsl #3]
546 # CHECK: str x0, [x1, x0, lsl #3]
547 # CHECK: ldr w0, [x1, x0, lsl #2]
548 # CHECK: str w0, [x1, x0, lsl #2]
549 # CHECK: ldr q0, [x1, x0, lsl #4]
550 # CHECK: str q0, [x1, x0, lsl #4]
551 # CHECK: ldr d0, [x1, x0, lsl #3]
552 # CHECK: str d0, [x1, x0, lsl #3]
553 # CHECK: ldr s0, [x1, x0, lsl #2]
554 # CHECK: str s0, [x1, x0, lsl #2]
555 # CHECK: ldr h0, [x1, x0, lsl #1]
556 # CHECK: ldr b0, [x1, x0, lsl #0]
557 # CHECK: ldrb w0, [x1, x0, lsl #0]
558 # CHECK: strb w0, [x1, x0, lsl #0]
559 # CHECK: ldrsb w0, [x1, x0, lsl #0]
560 # CHECK: ldrh w0, [x1, x0, lsl #1]
561 # CHECK: strh w0, [x1, x0, lsl #1]
562 # CHECK: ldrsh w0, [x1, x0, lsl #1]
563 # CHECK: ldrsb x0, [x1, x0, lsl #0]
564 # CHECK: ldrsh x0, [x1, x0, lsl #1]