1 ; RUN: llc -mtriple=aarch64 %s -o - | FileCheck %s
3 @x = common dso_local global i128 0
4 @y = common dso_local global i128 0
9 ; CHECK-NEXT: adrp x8, x
10 ; CHECK-NEXT: add x8, x8, :lo12:x
11 ; CHECK-NEXT: ldp x8, x9, [x8]
12 ; CHECK-NEXT: adrp x10, y
13 ; CHECK-NEXT: add x10, x10, :lo12:y
14 ; CHECK-NEXT: stp x8, x9, [x10]
16 %tmp = load volatile i128, i128* @x
17 store volatile i128 %tmp, i128* @y
21 define void @test2() {
24 ; CHECK-NEXT: adrp x8, x
25 ; CHECK-NEXT: add x8, x8, :lo12:x
26 ; CHECK-NEXT: ldp x8, x9, [x8, #504]
27 ; CHECK-NEXT: adrp x10, y
28 ; CHECK-NEXT: add x10, x10, :lo12:y
29 ; CHECK-NEXT: stp x8, x9, [x10, #504]
31 %tmp = load volatile i128, i128* bitcast (i8* getelementptr (i8, i8* bitcast (i128* @x to i8*), i64 504) to i128*)
32 store volatile i128 %tmp, i128* bitcast (i8* getelementptr (i8, i8* bitcast (i128* @y to i8*), i64 504) to i128*)
36 define void @test3() {
39 ; CHECK-NEXT: adrp x8, x
40 ; CHECK-NEXT: add x8, x8, :lo12:x
41 ; CHECK-NEXT: add x8, x8, #512
42 ; CHECK-NEXT: ldp x8, x9, [x8]
43 ; CHECK-NEXT: adrp x10, y
44 ; CHECK-NEXT: add x10, x10, :lo12:y
45 ; CHECK-NEXT: add x10, x10, #512
46 ; CHECK-NEXT: stp x8, x9, [x10]
48 %tmp = load volatile i128, i128* bitcast (i8* getelementptr (i8, i8* bitcast (i128* @x to i8*), i64 512) to i128*)
49 store volatile i128 %tmp, i128* bitcast (i8* getelementptr (i8, i8* bitcast (i128* @y to i8*), i64 512) to i128*)
53 define void @test4() {
56 ; CHECK-NEXT: adrp x8, x
57 ; CHECK-NEXT: add x8, x8, :lo12:x
58 ; CHECK-NEXT: ldp x8, x9, [x8, #-512]
59 ; CHECK-NEXT: adrp x10, y
60 ; CHECK-NEXT: add x10, x10, :lo12:y
61 ; CHECK-NEXT: stp x8, x9, [x10, #-512]
63 %tmp = load volatile i128, i128* bitcast (i8* getelementptr (i8, i8* bitcast (i128* @x to i8*), i64 -512) to i128*)
64 store volatile i128 %tmp, i128* bitcast (i8* getelementptr (i8, i8* bitcast (i128* @y to i8*), i64 -512) to i128*)
68 define void @test5() {
71 ; CHECK-NEXT: adrp x8, x
72 ; CHECK-NEXT: add x8, x8, :lo12:x
73 ; CHECK-NEXT: sub x8, x8, #520
74 ; CHECK-NEXT: ldp x8, x9, [x8]
75 ; CHECK-NEXT: adrp x10, y
76 ; CHECK-NEXT: add x10, x10, :lo12:y
77 ; CHECK-NEXT: sub x10, x10, #520
78 ; CHECK-NEXT: stp x8, x9, [x10]
80 %tmp = load volatile i128, i128* bitcast (i8* getelementptr (i8, i8* bitcast (i128* @x to i8*), i64 -520) to i128*)
81 store volatile i128 %tmp, i128* bitcast (i8* getelementptr (i8, i8* bitcast (i128* @y to i8*), i64 -520) to i128*)
85 define void @test6() {
88 ; CHECK-NEXT: adrp x8, x
89 ; CHECK-NEXT: add x8, x8, :lo12:x
90 ; CHECK-NEXT: sub x8, x8, #520
91 ; CHECK-NEXT: ldp x8, x9, [x8]
92 ; CHECK-NEXT: adrp x10, y
93 ; CHECK-NEXT: add x10, x10, :lo12:y
94 ; CHECK-NEXT: sub x10, x10, #520
95 ; CHECK-NEXT: stp x8, x9, [x10]
97 %tmp = load volatile i128, i128* bitcast (i8* getelementptr (i8, i8* bitcast (i128* @x to i8*), i64 -520) to i128*)
98 store volatile i128 %tmp, i128* bitcast (i8* getelementptr (i8, i8* bitcast (i128* @y to i8*), i64 -520) to i128*)
102 define void @test7() {
103 ; CHECK-LABEL: test7:
105 ; CHECK-NEXT: adrp x8, x
106 ; CHECK-NEXT: add x8, x8, :lo12:x
107 ; CHECK-NEXT: add x8, x8, #503
108 ; CHECK-NEXT: ldp x8, x9, [x8]
109 ; CHECK-NEXT: adrp x10, y
110 ; CHECK-NEXT: add x10, x10, :lo12:y
111 ; CHECK-NEXT: add x10, x10, #503
112 ; CHECK-NEXT: stp x8, x9, [x10]
114 %tmp = load volatile i128, i128* bitcast (i8* getelementptr (i8, i8* bitcast (i128* @x to i8*), i64 503) to i128*)
115 store volatile i128 %tmp, i128* bitcast (i8* getelementptr (i8, i8* bitcast (i128* @y to i8*), i64 503) to i128*)