1 ; RUN: llc -mtriple=s390x-linux-gnu < %s | FileCheck %s
3 @Addr = global i64 0, align 8
4 @A = global ptr null, align 8
5 @Idx = global i64 0, align 8
7 define i64 @fun_BD12_Q() {
8 ; CHECK-LABEL: fun_BD12_Q:
10 ; CHECK: lay %r2, 800(%r1)
13 %arrayidx = getelementptr inbounds i64, ptr %0, i64 100
14 %1 = tail call i64 asm "lay $0, $1", "=r,^ZQ"(ptr nonnull %arrayidx)
15 store i64 %1, ptr @Addr
19 define i64 @fun_BD12_R() {
20 ; CHECK-LABEL: fun_BD12_R:
22 ; CHECK: lay %r2, 800(%r1)
25 %arrayidx = getelementptr inbounds i64, ptr %0, i64 100
26 %1 = tail call i64 asm "lay $0, $1", "=r,^ZR"(ptr nonnull %arrayidx)
27 store i64 %1, ptr @Addr
31 define i64 @fun_BD12_S() {
32 ; CHECK-LABEL: fun_BD12_S:
34 ; CHECK: lay %r2, 800(%r1)
37 %arrayidx = getelementptr inbounds i64, ptr %0, i64 100
38 %1 = tail call i64 asm "lay $0, $1", "=r,^ZS"(ptr nonnull %arrayidx)
39 store i64 %1, ptr @Addr
43 define i64 @fun_BD12_T() {
44 ; CHECK-LABEL: fun_BD12_T:
46 ; CHECK: lay %r2, 800(%r1)
49 %arrayidx = getelementptr inbounds i64, ptr %0, i64 100
50 %1 = tail call i64 asm "lay $0, $1", "=r,^ZT"(ptr nonnull %arrayidx)
51 store i64 %1, ptr @Addr
55 define i64 @fun_BD12_p() {
56 ; CHECK-LABEL: fun_BD12_p:
58 ; CHECK: lay %r2, 800(%r1)
61 %arrayidx = getelementptr inbounds i64, ptr %0, i64 100
62 %1 = tail call i64 asm "lay $0, $1", "=r,p"(ptr nonnull %arrayidx)
63 store i64 %1, ptr @Addr
67 define i64 @fun_BDX12_Q() {
68 ; CHECK-LABEL: fun_BDX12_Q:
70 ; CHECK: lay %r2, 800(%r2)
73 %1 = load i64, ptr @Idx
74 %add = add nsw i64 %1, 100
75 %arrayidx = getelementptr inbounds i64, ptr %0, i64 %add
76 %2 = tail call i64 asm "lay $0, $1", "=r,^ZQ"(ptr %arrayidx)
77 store i64 %2, ptr @Addr
81 define i64 @fun_BDX12_R() {
82 ; CHECK-LABEL: fun_BDX12_R:
84 ; CHECK: lay %r2, 800(%r1,%r2)
87 %1 = load i64, ptr @Idx
88 %add = add nsw i64 %1, 100
89 %arrayidx = getelementptr inbounds i64, ptr %0, i64 %add
90 %2 = tail call i64 asm "lay $0, $1", "=r,^ZR"(ptr %arrayidx)
91 store i64 %2, ptr @Addr
95 define i64 @fun_BDX12_S() {
96 ; CHECK-LABEL: fun_BDX12_S:
98 ; CHECK: lay %r2, 800(%r2)
100 %0 = load ptr, ptr @A
101 %1 = load i64, ptr @Idx
102 %add = add nsw i64 %1, 100
103 %arrayidx = getelementptr inbounds i64, ptr %0, i64 %add
104 %2 = tail call i64 asm "lay $0, $1", "=r,^ZS"(ptr %arrayidx)
105 store i64 %2, ptr @Addr
109 define i64 @fun_BDX12_T() {
110 ; CHECK-LABEL: fun_BDX12_T:
112 ; CHECK: lay %r2, 800(%r1,%r2)
114 %0 = load ptr, ptr @A
115 %1 = load i64, ptr @Idx
116 %add = add nsw i64 %1, 100
117 %arrayidx = getelementptr inbounds i64, ptr %0, i64 %add
118 %2 = tail call i64 asm "lay $0, $1", "=r,^ZT"(ptr %arrayidx)
119 store i64 %2, ptr @Addr
123 define i64 @fun_BDX12_p() {
124 ; CHECK-LABEL: fun_BDX12_p:
126 ; CHECK: lay %r2, 800(%r1,%r2)
128 %0 = load ptr, ptr @A
129 %1 = load i64, ptr @Idx
130 %add = add nsw i64 %1, 100
131 %arrayidx = getelementptr inbounds i64, ptr %0, i64 %add
132 %2 = tail call i64 asm "lay $0, $1", "=r,p"(ptr %arrayidx)
133 store i64 %2, ptr @Addr
137 define i64 @fun_BD20_Q() {
138 ; CHECK-LABEL: fun_BD20_Q:
140 ; CHECK: lay %r2, 0(%r2)
142 %0 = load ptr, ptr @A
143 %arrayidx = getelementptr inbounds i64, ptr %0, i64 1000
144 %1 = tail call i64 asm "lay $0, $1", "=r,^ZQ"(ptr nonnull %arrayidx)
145 store i64 %1, ptr @Addr
149 define i64 @fun_BD20_R() {
150 ; CHECK-LABEL: fun_BD20_R:
152 ; CHECK: lay %r2, 0(%r2)
154 %0 = load ptr, ptr @A
155 %arrayidx = getelementptr inbounds i64, ptr %0, i64 1000
156 %1 = tail call i64 asm "lay $0, $1", "=r,^ZR"(ptr nonnull %arrayidx)
157 store i64 %1, ptr @Addr
161 define i64 @fun_BD20_S() {
162 ; CHECK-LABEL: fun_BD20_S:
164 ; CHECK: lay %r2, 8000(%r1)
166 %0 = load ptr, ptr @A
167 %arrayidx = getelementptr inbounds i64, ptr %0, i64 1000
168 %1 = tail call i64 asm "lay $0, $1", "=r,^ZS"(ptr nonnull %arrayidx)
169 store i64 %1, ptr @Addr
173 define i64 @fun_BD20_T() {
174 ; CHECK-LABEL: fun_BD20_T:
176 ; CHECK: lay %r2, 8000(%r1)
178 %0 = load ptr, ptr @A
179 %arrayidx = getelementptr inbounds i64, ptr %0, i64 1000
180 %1 = tail call i64 asm "lay $0, $1", "=r,^ZT"(ptr nonnull %arrayidx)
181 store i64 %1, ptr @Addr
185 define i64 @fun_BD20_p() {
186 ; CHECK-LABEL: fun_BD20_p:
188 ; CHECK: lay %r2, 8000(%r1)
190 %0 = load ptr, ptr @A
191 %arrayidx = getelementptr inbounds i64, ptr %0, i64 1000
192 %1 = tail call i64 asm "lay $0, $1", "=r,p"(ptr nonnull %arrayidx)
193 store i64 %1, ptr @Addr
197 define i64 @fun_BDX20_Q() {
198 ; CHECK-LABEL: fun_BDX20_Q:
200 ; CHECK: lay %r2, 0(%r1)
202 %0 = load ptr, ptr @A
203 %1 = load i64, ptr @Idx
204 %add = add nsw i64 %1, 1000
205 %arrayidx = getelementptr inbounds i64, ptr %0, i64 %add
206 %2 = tail call i64 asm "lay $0, $1", "=r,^ZQ"(ptr %arrayidx)
207 store i64 %2, ptr @Addr
211 define i64 @fun_BDX20_R() {
212 ; CHECK-LABEL: fun_BDX20_R:
214 ; CHECK: lay %r2, 0(%r1)
216 %0 = load ptr, ptr @A
217 %1 = load i64, ptr @Idx
218 %add = add nsw i64 %1, 1000
219 %arrayidx = getelementptr inbounds i64, ptr %0, i64 %add
220 %2 = tail call i64 asm "lay $0, $1", "=r,^ZR"(ptr %arrayidx)
221 store i64 %2, ptr @Addr
225 define i64 @fun_BDX20_S() {
226 ; CHECK-LABEL: fun_BDX20_S:
228 ; CHECK: lay %r2, 8000(%r2)
230 %0 = load ptr, ptr @A
231 %1 = load i64, ptr @Idx
232 %add = add nsw i64 %1, 1000
233 %arrayidx = getelementptr inbounds i64, ptr %0, i64 %add
234 %2 = tail call i64 asm "lay $0, $1", "=r,^ZS"(ptr %arrayidx)
235 store i64 %2, ptr @Addr
239 define i64 @fun_BDX20_T() {
240 ; CHECK-LABEL: fun_BDX20_T:
242 ; CHECK: lay %r2, 8000(%r1,%r2)
244 %0 = load ptr, ptr @A
245 %1 = load i64, ptr @Idx
246 %add = add nsw i64 %1, 1000
247 %arrayidx = getelementptr inbounds i64, ptr %0, i64 %add
248 %2 = tail call i64 asm "lay $0, $1", "=r,^ZT"(ptr %arrayidx)
249 store i64 %2, ptr @Addr
253 define i64 @fun_BDX20_p() {
254 ; CHECK-LABEL: fun_BDX20_p:
256 ; CHECK: lay %r2, 8000(%r1,%r2)
258 %0 = load ptr, ptr @A
259 %1 = load i64, ptr @Idx
260 %add = add nsw i64 %1, 1000
261 %arrayidx = getelementptr inbounds i64, ptr %0, i64 %add
262 %2 = tail call i64 asm "lay $0, $1", "=r,p"(ptr %arrayidx)
263 store i64 %2, ptr @Addr