blob: cc8d2e92e7e5aacf62d27d34eb765d087bcf6496 [file] [log] [blame]
Karl Schimpf4175d452015-12-17 08:06:01 -08001; Tests assembly of ldrex and strex instructions
2
3; REQUIRES: allow_dump
4
5; Compile using standalone assembler.
6; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \
7; RUN: | FileCheck %s --check-prefix=ASM
8
9; Show bytes in assembled standalone code.
10; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
11; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS
12
13; Compile using integrated assembler.
14; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \
15; RUN: | FileCheck %s --check-prefix=IASM
16
17; Show bytes in assembled integrated code.
18; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
19; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS
20
21declare i8 @llvm.nacl.atomic.rmw.i8(i32, i8*, i8, i32)
22
23declare i16 @llvm.nacl.atomic.rmw.i16(i32, i16*, i16, i32)
24
25declare i32 @llvm.nacl.atomic.rmw.i32(i32, i32*, i32, i32) #0
26
27declare i64 @llvm.nacl.atomic.rmw.i64(i32, i64*, i64, i32) #0
28
29define internal i32 @testI8Form(i32 %ptr, i32 %a) {
30; ASM-LABEL:testI8Form:
31; DIS-LABEL:00000000 <testI8Form>:
32; IASM-LABEL:testI8Form:
33
34entry:
35; ASM-NEXT:.LtestI8Form$entry:
36; IASM-NEXT:.LtestI8Form$entry:
37
38; ASM-NEXT: sub sp, sp, #28
39; DIS-NEXT: 0: e24dd01c
40; IASM-NEXT: .byte 0x1c
41; IASM-NEXT: .byte 0xd0
42; IASM-NEXT: .byte 0x4d
43; IASM-NEXT: .byte 0xe2
44
45; ASM-NEXT: str r0, [sp, #24]
46; ASM-NEXT: # [sp, #24] = def.pseudo
47; DIS-NEXT: 4: e58d0018
48; IASM-NEXT: .byte 0x18
49; IASM-NEXT: .byte 0x0
50; IASM-NEXT: .byte 0x8d
51; IASM-NEXT: .byte 0xe5
52
53; ASM-NEXT: str r1, [sp, #20]
54; ASM-NEXT: # [sp, #20] = def.pseudo
55; DIS-NEXT: 8: e58d1014
56; IASM-NEXT: .byte 0x14
57; IASM-NEXT: .byte 0x10
58; IASM-NEXT: .byte 0x8d
59; IASM-NEXT: .byte 0xe5
60
61 %ptr.asptr = inttoptr i32 %ptr to i8*
62 %a.arg_trunc = trunc i32 %a to i8
63
64; ASM-NEXT: ldr r0, [sp, #20]
65; DIS-NEXT: c: e59d0014
66; IASM-NEXT: .byte 0x14
67; IASM-NEXT: .byte 0x0
68; IASM-NEXT: .byte 0x9d
69; IASM-NEXT: .byte 0xe5
70
71; ASM-NEXT: strb r0, [sp, #16]
72; DIS-NEXT: 10: e5cd0010
73; ASM-NEXT: # [sp, #16] = def.pseudo
74; IASM-NEXT: .byte 0x10
75; IASM-NEXT: .byte 0x0
76; IASM-NEXT: .byte 0xcd
77; IASM-NEXT: .byte 0xe5
78
79 %v = call i8 @llvm.nacl.atomic.rmw.i8(i32 1, i8* %ptr.asptr,
80 i8 %a.arg_trunc, i32 6)
81
82; ASM-NEXT: ldrb r0, [sp, #16]
83; DIS-NEXT: 14: e5dd0010
84; IASM-NEXT: .byte 0x10
85; IASM-NEXT: .byte 0x0
86; IASM-NEXT: .byte 0xdd
87; IASM-NEXT: .byte 0xe5
88
89; ASM-NEXT: strb r0, [sp, #4]
90; ASM-NEXT: # [sp, #4] = def.pseudo
91; DIS-NEXT: 18: e5cd0004
92; IASM-NEXT: .byte 0x4
93; IASM-NEXT: .byte 0x0
94; IASM-NEXT: .byte 0xcd
95; IASM-NEXT: .byte 0xe5
96
97; ASM-NEXT: ldr r0, [sp, #24]
98; DIS-NEXT: 1c: e59d0018
99; IASM-NEXT: .byte 0x18
100; IASM-NEXT: .byte 0x0
101; IASM-NEXT: .byte 0x9d
102; IASM-NEXT: .byte 0xe5
103
104; ASM-NEXT: str r0, [sp]
105; ASM-NEXT: # [sp] = def.pseudo
106; DIS-NEXT: 20: e58d0000
107; IASM-NEXT: .byte 0x0
108; IASM-NEXT: .byte 0x0
109; IASM-NEXT: .byte 0x8d
110; IASM-NEXT: .byte 0xe5
111
112; ASM-NEXT: dmb sy
113; DIS-NEXT: 24: f57ff05f
114; IASM-NEXT: .byte 0x5f
115; IASM-NEXT: .byte 0xf0
116; IASM-NEXT: .byte 0x7f
117; IASM-NEXT: .byte 0xf5
118
119; ASM-NEXT:.LtestI8Form$local$__0:
120; IASM-NEXT:.LtestI8Form$local$__0:
121
122; ASM-NEXT: ldr r0, [sp]
123; DIS-NEXT: 28: e59d0000
124; IASM-NEXT: .byte 0x0
125; IASM-NEXT: .byte 0x0
126; IASM-NEXT: .byte 0x9d
127; IASM-NEXT: .byte 0xe5
128
129; ASM-NEXT: ldrb r1, [sp, #4]
130; DIS-NEXT: 2c: e5dd1004
131; IASM-NEXT: .byte 0x4
132; IASM-NEXT: .byte 0x10
133; IASM-NEXT: .byte 0xdd
134; IASM-NEXT: .byte 0xe5
135
136; ASM-NEXT: uxtb r1, r1
137; DIS-NEXT: 30: e6ef1071
138; IASM-NEXT: .byte 0x71
139; IASM-NEXT: .byte 0x10
140; IASM-NEXT: .byte 0xef
141; IASM-NEXT: .byte 0xe6
142
143; ***** Example of ldrexb *****
144; ASM-NEXT: ldrexb r2, [r0]
145; DIS-NEXT: 34: e1d02f9f
146; IASM-NEXT: .byte 0x9f
147; IASM-NEXT: .byte 0x2f
148; IASM-NEXT: .byte 0xd0
149; IASM-NEXT: .byte 0xe1
150
151; ASM-NEXT: add r1, r2, r1
152; ASM-NEXT: # r3 = def.pseudo
153; DIS-NEXT: 38: e0821001
154; IASM-NEXT: .byte 0x1
155; IASM-NEXT: .byte 0x10
156; IASM-NEXT: .byte 0x82
157; IASM-NEXT: .byte 0xe0
158
159; ***** Example of strexb *****
160; ASM-NEXT: strexb r3, r1, [r0]
161; DIS-NEXT: 3c: e1c03f91
162; IASM-NEXT: .byte 0x91
163; IASM-NEXT: .byte 0x3f
164; IASM-NEXT: .byte 0xc0
165; IASM-NEXT: .byte 0xe1
166
167 %retval = zext i8 %v to i32
168 ret i32 %retval
169}
170
171define internal i32 @testI16Form(i32 %ptr, i32 %a) {
172; ASM-LABEL:testI16Form:
173; DIS-LABEL:00000070 <testI16Form>:
174; IASM-LABEL:testI16Form:
175
176entry:
177; ASM-NEXT:.LtestI16Form$entry:
178; IASM-NEXT:.LtestI16Form$entry:
179
180; ASM-NEXT: sub sp, sp, #28
181; DIS-NEXT: 70: e24dd01c
182; IASM-NEXT: .byte 0x1c
183; IASM-NEXT: .byte 0xd0
184; IASM-NEXT: .byte 0x4d
185; IASM-NEXT: .byte 0xe2
186
187; ASM-NEXT: str r0, [sp, #24]
188; ASM-NEXT: # [sp, #24] = def.pseudo
189; DIS-NEXT: 74: e58d0018
190; IASM-NEXT: .byte 0x18
191; IASM-NEXT: .byte 0x0
192; IASM-NEXT: .byte 0x8d
193; IASM-NEXT: .byte 0xe5
194
195; ASM-NEXT: str r1, [sp, #20]
196; ASM-NEXT: # [sp, #20] = def.pseudo
197; DIS-NEXT: 78: e58d1014
198; IASM-NEXT: .byte 0x14
199; IASM-NEXT: .byte 0x10
200; IASM-NEXT: .byte 0x8d
201; IASM-NEXT: .byte 0xe5
202
203 %ptr.asptr = inttoptr i32 %ptr to i16*
204 %a.arg_trunc = trunc i32 %a to i16
205
206; ASM-NEXT: ldr r0, [sp, #20]
207; DIS-NEXT: 7c: e59d0014
208; IASM-NEXT: .byte 0x14
209; IASM-NEXT: .byte 0x0
210; IASM-NEXT: .byte 0x9d
211; IASM-NEXT: .byte 0xe5
212
213; ASM-NEXT: strh r0, [sp, #16]
214; ASM-NEXT: # [sp, #16] = def.pseudo
215; DIS-NEXT: 80: e1cd01b0
216; IASM-NEXT: .byte 0xb0
217; IASM-NEXT: .byte 0x1
218; IASM-NEXT: .byte 0xcd
219; IASM-NEXT: .byte 0xe1
220
221 %v = call i16 @llvm.nacl.atomic.rmw.i16(i32 1, i16* %ptr.asptr,
222 i16 %a.arg_trunc, i32 6)
223
224; ASM-NEXT: ldrh r0, [sp, #16]
225; DIS-NEXT: 84: e1dd01b0
226; IASM-NEXT: .byte 0xb0
227; IASM-NEXT: .byte 0x1
228; IASM-NEXT: .byte 0xdd
229; IASM-NEXT: .byte 0xe1
230
231; ASM-NEXT: strh r0, [sp, #4]
232; ASM-NEXT: # [sp, #4] = def.pseudo
233; DIS-NEXT: 88: e1cd00b4
234; IASM-NEXT: .byte 0xb4
235; IASM-NEXT: .byte 0x0
236; IASM-NEXT: .byte 0xcd
237; IASM-NEXT: .byte 0xe1
238
239; ASM-NEXT: ldr r0, [sp, #24]
240; DIS-NEXT: 8c: e59d0018
241; IASM-NEXT: .byte 0x18
242; IASM-NEXT: .byte 0x0
243; IASM-NEXT: .byte 0x9d
244; IASM-NEXT: .byte 0xe5
245
246; ASM-NEXT: str r0, [sp]
247; ASM-NEXT: # [sp] = def.pseudo
248; DIS-NEXT: 90: e58d0000
249; IASM-NEXT: .byte 0x0
250; IASM-NEXT: .byte 0x0
251; IASM-NEXT: .byte 0x8d
252; IASM-NEXT: .byte 0xe5
253
254; ASM-NEXT: dmb sy
255; DIS-NEXT: 94: f57ff05f
256; IASM-NEXT: .byte 0x5f
257; IASM-NEXT: .byte 0xf0
258; IASM-NEXT: .byte 0x7f
259; IASM-NEXT: .byte 0xf5
260
261; ASM-NEXT:.LtestI16Form$local$__0:
262; IASM-NEXT:.LtestI16Form$local$__0:
263
264; ASM-NEXT: ldr r0, [sp]
265; DIS-NEXT: 98: e59d0000
266; IASM-NEXT: .byte 0x0
267; IASM-NEXT: .byte 0x0
268; IASM-NEXT: .byte 0x9d
269; IASM-NEXT: .byte 0xe5
270
271; ASM-NEXT: ldrh r1, [sp, #4]
272; DIS-NEXT: 9c: e1dd10b4
273; IASM-NEXT: .byte 0xb4
274; IASM-NEXT: .byte 0x10
275; IASM-NEXT: .byte 0xdd
276; IASM-NEXT: .byte 0xe1
277
278; ASM-NEXT: uxth r1, r1
279; DIS-NEXT: a0: e6ff1071
280; IASM-NEXT: .byte 0x71
281; IASM-NEXT: .byte 0x10
282; IASM-NEXT: .byte 0xff
283; IASM-NEXT: .byte 0xe6
284
285; ***** Example of ldrexh *****
286; ASM-NEXT: ldrexh r2, [r0]
287; DIS-NEXT: a4: e1f02f9f
288; IASM-NEXT: .byte 0x9f
289; IASM-NEXT: .byte 0x2f
290; IASM-NEXT: .byte 0xf0
291; IASM-NEXT: .byte 0xe1
292
293; ASM-NEXT: add r1, r2, r1
294; ASM-NEXT: # r3 = def.pseudo
295; DIS-NEXT: a8: e0821001
296; IASM-NEXT: .byte 0x1
297; IASM-NEXT: .byte 0x10
298; IASM-NEXT: .byte 0x82
299; IASM-NEXT: .byte 0xe0
300
301; ***** Example of strexh *****
302; ASM-NEXT: strexh r3, r1, [r0]
303; DIS-NEXT: ac: e1e03f91
304; IASM-NEXT: .byte 0x91
305; IASM-NEXT: .byte 0x3f
306; IASM-NEXT: .byte 0xe0
307; IASM-NEXT: .byte 0xe1
308
309 %retval = zext i16 %v to i32
310 ret i32 %retval
311}
312
313define internal i32 @testI32Form(i32 %ptr, i32 %a) {
314; ASM-LABEL:testI32Form:
315; DIS-LABEL:000000e0 <testI32Form>:
316; IASM-LABEL:testI32Form:
317
318entry:
319; ASM-NEXT:.LtestI32Form$entry:
320; IASM-NEXT:.LtestI32Form$entry:
321
322; ASM-NEXT: sub sp, sp, #20
323; DIS-NEXT: e0: e24dd014
324; IASM-NEXT: .byte 0x14
325; IASM-NEXT: .byte 0xd0
326; IASM-NEXT: .byte 0x4d
327; IASM-NEXT: .byte 0xe2
328
329; ASM-NEXT: str r0, [sp, #16]
330; ASM-NEXT: # [sp, #16] = def.pseudo
331; DIS-NEXT: e4: e58d0010
332; IASM-NEXT: .byte 0x10
333; IASM-NEXT: .byte 0x0
334; IASM-NEXT: .byte 0x8d
335; IASM-NEXT: .byte 0xe5
336
337; ASM-NEXT: str r1, [sp, #12]
338; ASM-NEXT: # [sp, #12] = def.pseudo
339; DIS-NEXT: e8: e58d100c
340; IASM-NEXT: .byte 0xc
341; IASM-NEXT: .byte 0x10
342; IASM-NEXT: .byte 0x8d
343; IASM-NEXT: .byte 0xe5
344
345 %ptr.asptr = inttoptr i32 %ptr to i32*
346 %v = call i32 @llvm.nacl.atomic.rmw.i32(i32 1, i32* %ptr.asptr,
347 i32 %a, i32 6)
348
349; ASM-NEXT: ldr r0, [sp, #12]
350; DIS-NEXT: ec: e59d000c
351; IASM-NEXT: .byte 0xc
352; IASM-NEXT: .byte 0x0
353; IASM-NEXT: .byte 0x9d
354; IASM-NEXT: .byte 0xe5
355
356; ASM-NEXT: str r0, [sp, #4]
357; ASM-NEXT: # [sp, #4] = def.pseudo
358; DIS-NEXT: f0: e58d0004
359; IASM-NEXT: .byte 0x4
360; IASM-NEXT: .byte 0x0
361; IASM-NEXT: .byte 0x8d
362; IASM-NEXT: .byte 0xe5
363
364; ASM-NEXT: ldr r0, [sp, #16]
365; DIS-NEXT: f4: e59d0010
366; IASM-NEXT: .byte 0x10
367; IASM-NEXT: .byte 0x0
368; IASM-NEXT: .byte 0x9d
369; IASM-NEXT: .byte 0xe5
370
371; ASM-NEXT: str r0, [sp]
372; ASM-NEXT: # [sp] = def.pseudo
373; DIS-NEXT: f8: e58d0000
374; IASM-NEXT: .byte 0x0
375; IASM-NEXT: .byte 0x0
376; IASM-NEXT: .byte 0x8d
377; IASM-NEXT: .byte 0xe5
378
379; ASM-NEXT: dmb sy
380; DIS-NEXT: fc: f57ff05f
381; IASM-NEXT: .byte 0x5f
382; IASM-NEXT: .byte 0xf0
383; IASM-NEXT: .byte 0x7f
384; IASM-NEXT: .byte 0xf5
385
386; ASM-NEXT:.LtestI32Form$local$__0:
387; IASM-NEXT:.LtestI32Form$local$__0:
388
389; ASM-NEXT: ldr r0, [sp]
390; DIS-NEXT: 100: e59d0000
391; IASM-NEXT: .byte 0x0
392; IASM-NEXT: .byte 0x0
393; IASM-NEXT: .byte 0x9d
394; IASM-NEXT: .byte 0xe5
395
396; ASM-NEXT: ldr r1, [sp, #4]
397; DIS-NEXT: 104: e59d1004
398; IASM-NEXT: .byte 0x4
399; IASM-NEXT: .byte 0x10
400; IASM-NEXT: .byte 0x9d
401; IASM-NEXT: .byte 0xe5
402
403; ***** Example of ldrex *****
404; ASM-NEXT: ldrex r2, [r0]
405; DIS-NEXT: 108: e1902f9f
406; IASM-NEXT: .byte 0x9f
407; IASM-NEXT: .byte 0x2f
408; IASM-NEXT: .byte 0x90
409; IASM-NEXT: .byte 0xe1
410
411; ASM-NEXT: add r1, r2, r1
412; ASM-NEXT: # r3 = def.pseudo
413; DIS-NEXT: 10c: e0821001
414; IASM-NEXT: .byte 0x1
415; IASM-NEXT: .byte 0x10
416; IASM-NEXT: .byte 0x82
417; IASM-NEXT: .byte 0xe0
418
419; ***** Example of strex *****
420; ASM-NEXT: strex r3, r1, [r0]
421; DIS-NEXT: 110: e1803f91
422; IASM-NEXT: .byte 0x91
423; IASM-NEXT: .byte 0x3f
424; IASM-NEXT: .byte 0x80
425; IASM-NEXT: .byte 0xe1
426
427 ret i32 %v
428}
429
430define internal i64 @testI64Form(i32 %ptr, i64 %a) {
431; ASM-LABEL:testI64Form:
432; DIS-LABEL:00000130 <testI64Form>:
433; IASM-LABEL:testI64Form:
434
435entry:
436; ASM-NEXT:.LtestI64Form$entry:
437; IASM-NEXT:.LtestI64Form$entry:
438
439; ASM-NEXT: push {r4, r5}
440; DIS-NEXT: 130: e92d0030
441; IASM-NEXT: .byte 0x30
442; IASM-NEXT: .byte 0x0
443; IASM-NEXT: .byte 0x2d
444; IASM-NEXT: .byte 0xe9
445
446; ASM-NEXT: sub sp, sp, #32
447; DIS-NEXT: 134: e24dd020
448; IASM-NEXT: .byte 0x20
449; IASM-NEXT: .byte 0xd0
450; IASM-NEXT: .byte 0x4d
451; IASM-NEXT: .byte 0xe2
452
453; ASM-NEXT: str r0, [sp, #28]
454; ASM-NEXT: # [sp, #28] = def.pseudo
455; DIS-NEXT: 138: e58d001c
456; IASM-NEXT: .byte 0x1c
457; IASM-NEXT: .byte 0x0
458; IASM-NEXT: .byte 0x8d
459; IASM-NEXT: .byte 0xe5
460
461; ASM-NEXT: mov r0, r2
462; DIS-NEXT: 13c: e1a00002
463; IASM-NEXT: .byte 0x2
464; IASM-NEXT: .byte 0x0
465; IASM-NEXT: .byte 0xa0
466; IASM-NEXT: .byte 0xe1
467
468; ASM-NEXT: str r0, [sp, #24]
469; ASM-NEXT: # [sp, #24] = def.pseudo
470; DIS-NEXT: 140: e58d0018
471; IASM-NEXT: .byte 0x18
472; IASM-NEXT: .byte 0x0
473; IASM-NEXT: .byte 0x8d
474; IASM-NEXT: .byte 0xe5
475
476; ASM-NEXT: mov r0, r3
477; DIS-NEXT: 144: e1a00003
478; IASM-NEXT: .byte 0x3
479; IASM-NEXT: .byte 0x0
480; IASM-NEXT: .byte 0xa0
481; IASM-NEXT: .byte 0xe1
482
483; ASM-NEXT: str r0, [sp, #20]
484; ASM-NEXT: # [sp, #20] = def.pseudo
485; ASM-NEXT: # [sp] = def.pseudo
486; DIS-NEXT: 148: e58d0014
487; IASM-NEXT: .byte 0x14
488; IASM-NEXT: .byte 0x0
489; IASM-NEXT: .byte 0x8d
490; IASM-NEXT: .byte 0xe5
491
492 %ptr.asptr = inttoptr i32 %ptr to i64*
493 %v = call i64 @llvm.nacl.atomic.rmw.i64(i32 1, i64* %ptr.asptr,
494 i64 %a, i32 6)
495
496; ASM-NEXT: ldr r0, [sp, #24]
497; DIS-NEXT: 14c: e59d0018
498; IASM-NEXT: .byte 0x18
499; IASM-NEXT: .byte 0x0
500; IASM-NEXT: .byte 0x9d
501; IASM-NEXT: .byte 0xe5
502
503; ASM-NEXT: str r0, [sp, #8]
504; ASM-NEXT: # [sp, #8] = def.pseudo
505; DIS-NEXT: 150: e58d0008
506; IASM-NEXT: .byte 0x8
507; IASM-NEXT: .byte 0x0
508; IASM-NEXT: .byte 0x8d
509; IASM-NEXT: .byte 0xe5
510
511; ASM-NEXT: ldr r0, [sp, #20]
512; DIS-NEXT: 154: e59d0014
513; IASM-NEXT: .byte 0x14
514; IASM-NEXT: .byte 0x0
515; IASM-NEXT: .byte 0x9d
516; IASM-NEXT: .byte 0xe5
517
518; ASM-NEXT: str r0, [sp, #4]
519; ASM-NEXT: # [sp, #4] = def.pseudo
520; DIS-NEXT: 158: e58d0004
521; IASM-NEXT: .byte 0x4
522; IASM-NEXT: .byte 0x0
523; IASM-NEXT: .byte 0x8d
524; IASM-NEXT: .byte 0xe5
525
526; ASM-NEXT: ldr r0, [sp, #28]
527; DIS-NEXT: 15c: e59d001c
528; IASM-NEXT: .byte 0x1c
529; IASM-NEXT: .byte 0x0
530; IASM-NEXT: .byte 0x9d
531; IASM-NEXT: .byte 0xe5
532
533; ASM-NEXT: str r0, [sp]
534; ASM-NEXT: # [sp] = def.pseudo
535; DIS-NEXT: 160: e58d0000
536; IASM-NEXT: .byte 0x0
537; IASM-NEXT: .byte 0x0
538; IASM-NEXT: .byte 0x8d
539; IASM-NEXT: .byte 0xe5
540
541; ASM-NEXT: dmb sy
542; DIS-NEXT: 164: f57ff05f
543; IASM-NEXT: .byte 0x5f
544; IASM-NEXT: .byte 0xf0
545; IASM-NEXT: .byte 0x7f
546; IASM-NEXT: .byte 0xf5
547
548; ASM-NEXT:.LtestI64Form$local$__0:
549; IASM-NEXT:.LtestI64Form$local$__0:
550
551; ASM-NEXT: ldr r0, [sp]
552; ASM-NEXT: # r2, r3 = def.pseudo [sp]
553; DIS-NEXT: 168: e59d0000
554; IASM-NEXT: .byte 0x0
555; IASM-NEXT: .byte 0x0
556; IASM-NEXT: .byte 0x9d
557; IASM-NEXT: .byte 0xe5
558
559; ASM-NEXT: ldr r1, [sp, #8]
560; DIS-NEXT: 16c: e59d1008
561; IASM-NEXT: .byte 0x8
562; IASM-NEXT: .byte 0x10
563; IASM-NEXT: .byte 0x9d
564; IASM-NEXT: .byte 0xe5
565
566; ASM-NEXT: mov r2, r1
567; DIS-NEXT: 170: e1a02001
568; IASM-NEXT: .byte 0x1
569; IASM-NEXT: .byte 0x20
570; IASM-NEXT: .byte 0xa0
571; IASM-NEXT: .byte 0xe1
572
573; ASM-NEXT: ldr r1, [sp, #4]
574; DIS-NEXT: 174: e59d1004
575; IASM-NEXT: .byte 0x4
576; IASM-NEXT: .byte 0x10
577; IASM-NEXT: .byte 0x9d
578; IASM-NEXT: .byte 0xe5
579
580; ASM-NEXT: mov r3, r1
581; DIS-NEXT: 178: e1a03001
582; IASM-NEXT: .byte 0x1
583; IASM-NEXT: .byte 0x30
584; IASM-NEXT: .byte 0xa0
585; IASM-NEXT: .byte 0xe1
586
587; ***** Example of ldrexd *****
588; ASM-NEXT: ldrexd r4, r5, [r0]
589; ASM-NEXT: # r4 = def.pseudo r4, r5
590; ASM-NEXT: # r5 = def.pseudo r4, r5
591; ASM-NEXT: # r2, r3 = def.pseudo r2, r3
592; DIS-NEXT: 17c: e1b04f9f
593; IASM-NEXT: .byte 0x9f
594; IASM-NEXT: .byte 0x4f
595; IASM-NEXT: .byte 0xb0
596; IASM-NEXT: .byte 0xe1
597
598; ASM-NEXT: adds r2, r4, r2
599; DIS-NEXT: 180: e0942002
600; IASM-NEXT: .byte 0x2
601; IASM-NEXT: .byte 0x20
602; IASM-NEXT: .byte 0x94
603; IASM-NEXT: .byte 0xe0
604
605; ASM-NEXT: adc r3, r5, r3
606; ASM-NEXT: # r1 = def.pseudo
607; DIS-NEXT: 184: e0a53003
608; IASM-NEXT: .byte 0x3
609; IASM-NEXT: .byte 0x30
610; IASM-NEXT: .byte 0xa5
611; IASM-NEXT: .byte 0xe0
612
613; ***** Example of strexd *****
614; ASM-NEXT: strexd r1, r2, r3, [r0]
615; DIS-NEXT: 188: e1a01f92
616; IASM-NEXT: .byte 0x92
617; IASM-NEXT: .byte 0x1f
618; IASM-NEXT: .byte 0xa0
619; IASM-NEXT: .byte 0xe1
620
621 ret i64 %v
622}