1 ; RUN: llc < %s -mtriple=armv8-apple-darwin | FileCheck %s
2 ; RUN: llc < %s -mtriple=thumbv8-apple-darwin | FileCheck %s
8 define i64 @f0(ptr %p) nounwind readonly {
10 %ldaexd = tail call %0 @llvm.arm.ldaexd(ptr %p)
11 %0 = extractvalue %0 %ldaexd, 1
12 %1 = extractvalue %0 %ldaexd, 0
13 %2 = zext i32 %0 to i64
14 %3 = zext i32 %1 to i64
15 %shl = shl nuw i64 %2, 32
22 define i32 @f1(ptr %ptr, i64 %val) nounwind {
24 %tmp4 = trunc i64 %val to i32
25 %tmp6 = lshr i64 %val, 32
26 %tmp7 = trunc i64 %tmp6 to i32
27 %stlexd = tail call i32 @llvm.arm.stlexd(i32 %tmp4, i32 %tmp7, ptr %ptr)
31 declare %0 @llvm.arm.ldaexd(ptr) nounwind readonly
32 declare i32 @llvm.arm.stlexd(i32, i32, ptr) nounwind
34 ; CHECK-LABEL: test_load_i8:
35 ; CHECK: ldaexb r0, [r0]
38 define zeroext i8 @test_load_i8(ptr %addr) {
39 %val = call i32 @llvm.arm.ldaex.p0(ptr elementtype(i8) %addr)
40 %val8 = trunc i32 %val to i8
44 ; CHECK-LABEL: test_load_i16:
45 ; CHECK: ldaexh r0, [r0]
48 define zeroext i16 @test_load_i16(ptr %addr) {
49 %val = call i32 @llvm.arm.ldaex.p0(ptr elementtype(i16) %addr)
50 %val16 = trunc i32 %val to i16
54 ; CHECK-LABEL: test_load_i32:
55 ; CHECK: ldaex r0, [r0]
56 define i32 @test_load_i32(ptr %addr) {
57 %val = call i32 @llvm.arm.ldaex.p0(ptr elementtype(i32) %addr)
61 declare i32 @llvm.arm.ldaex.p0(ptr) nounwind readonly
63 ; CHECK-LABEL: test_store_i8:
65 ; CHECK: stlexb r0, r1, [r2]
66 define i32 @test_store_i8(i32, i8 %val, ptr %addr) {
67 %extval = zext i8 %val to i32
68 %res = call i32 @llvm.arm.stlex.p0(i32 %extval, ptr elementtype(i8) %addr)
72 ; CHECK-LABEL: test_store_i16:
74 ; CHECK: stlexh r0, r1, [r2]
75 define i32 @test_store_i16(i32, i16 %val, ptr %addr) {
76 %extval = zext i16 %val to i32
77 %res = call i32 @llvm.arm.stlex.p0(i32 %extval, ptr elementtype(i16) %addr)
81 ; CHECK-LABEL: test_store_i32:
82 ; CHECK: stlex r0, r1, [r2]
83 define i32 @test_store_i32(i32, i32 %val, ptr %addr) {
84 %res = call i32 @llvm.arm.stlex.p0(i32 %val, ptr elementtype(i32) %addr)
88 declare i32 @llvm.arm.stlex.p0(i32, ptr) nounwind