1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
3 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
4 ; RUN: < %s | FileCheck %s --check-prefixes=CHECK,CHECK-P10,CHECK-LE,CHECK-P10-LE
5 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
6 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
7 ; RUN: < %s | FileCheck %s --check-prefixes=CHECK,CHECK-P10,CHECK-BE,CHECK-P10-BE
8 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
9 ; RUN: -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
10 ; RUN: < %s | FileCheck %s --check-prefixes=CHECK,CHECK-PREP10,CHECK-P9,CHECK-LE,CHECK-P9-LE
11 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
12 ; RUN: -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
13 ; RUN: < %s | FileCheck %s --check-prefixes=CHECK,CHECK-PREP10,CHECK-P9,CHECK-BE,CHECK-P9-BE
14 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
15 ; RUN: -mcpu=pwr8 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
16 ; RUN: < %s | FileCheck %s --check-prefixes=CHECK,CHECK-PREP10,CHECK-P8,CHECK-LE,CHECK-P8-LE
17 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
18 ; RUN: -mcpu=pwr8 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
19 ; RUN: < %s | FileCheck %s --check-prefixes=CHECK,CHECK-PREP10,CHECK-P8,CHECK-BE,CHECK-P8-BE
21 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
22 define dso_local signext i16 @ld_0_int16_t_int8_t(i64 %ptr) {
23 ; CHECK-LABEL: ld_0_int16_t_int8_t:
24 ; CHECK: # %bb.0: # %entry
25 ; CHECK-NEXT: lbz r3, 0(r3)
26 ; CHECK-NEXT: extsb r3, r3
29 %0 = inttoptr i64 %ptr to i8*
30 %1 = load i8, i8* %0, align 1
31 %conv = sext i8 %1 to i16
35 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
36 define dso_local signext i16 @ld_align16_int16_t_int8_t(i8* nocapture readonly %ptr) {
37 ; CHECK-LABEL: ld_align16_int16_t_int8_t:
38 ; CHECK: # %bb.0: # %entry
39 ; CHECK-NEXT: lbz r3, 8(r3)
40 ; CHECK-NEXT: extsb r3, r3
43 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
44 %0 = load i8, i8* %add.ptr, align 1
45 %conv = sext i8 %0 to i16
49 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
50 define dso_local signext i16 @ld_align32_int16_t_int8_t(i8* nocapture readonly %ptr) {
51 ; CHECK-P10-LABEL: ld_align32_int16_t_int8_t:
52 ; CHECK-P10: # %bb.0: # %entry
53 ; CHECK-P10-NEXT: pli r4, 99999000
54 ; CHECK-P10-NEXT: lbzx r3, r3, r4
55 ; CHECK-P10-NEXT: extsb r3, r3
58 ; CHECK-PREP10-LABEL: ld_align32_int16_t_int8_t:
59 ; CHECK-PREP10: # %bb.0: # %entry
60 ; CHECK-PREP10-NEXT: lis r4, 1525
61 ; CHECK-PREP10-NEXT: ori r4, r4, 56600
62 ; CHECK-PREP10-NEXT: lbzx r3, r3, r4
63 ; CHECK-PREP10-NEXT: extsb r3, r3
64 ; CHECK-PREP10-NEXT: blr
66 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
67 %0 = load i8, i8* %add.ptr, align 1
68 %conv = sext i8 %0 to i16
72 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
73 define dso_local signext i16 @ld_align64_int16_t_int8_t(i8* nocapture readonly %ptr) {
74 ; CHECK-P10-LABEL: ld_align64_int16_t_int8_t:
75 ; CHECK-P10: # %bb.0: # %entry
76 ; CHECK-P10-NEXT: pli r4, 244140625
77 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
78 ; CHECK-P10-NEXT: lbzx r3, r3, r4
79 ; CHECK-P10-NEXT: extsb r3, r3
82 ; CHECK-PREP10-LABEL: ld_align64_int16_t_int8_t:
83 ; CHECK-PREP10: # %bb.0: # %entry
84 ; CHECK-PREP10-NEXT: lis r4, 3725
85 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
86 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
87 ; CHECK-PREP10-NEXT: lbzx r3, r3, r4
88 ; CHECK-PREP10-NEXT: extsb r3, r3
89 ; CHECK-PREP10-NEXT: blr
91 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
92 %0 = load i8, i8* %add.ptr, align 1
93 %conv = sext i8 %0 to i16
97 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
98 define dso_local signext i16 @ld_reg_int16_t_int8_t(i8* nocapture readonly %ptr, i64 %off) {
99 ; CHECK-LABEL: ld_reg_int16_t_int8_t:
100 ; CHECK: # %bb.0: # %entry
101 ; CHECK-NEXT: lbzx r3, r3, r4
102 ; CHECK-NEXT: extsb r3, r3
105 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
106 %0 = load i8, i8* %add.ptr, align 1
107 %conv = sext i8 %0 to i16
111 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
112 define dso_local signext i16 @ld_or_int16_t_int8_t(i64 %ptr, i8 zeroext %off) {
113 ; CHECK-LABEL: ld_or_int16_t_int8_t:
114 ; CHECK: # %bb.0: # %entry
115 ; CHECK-NEXT: or r3, r4, r3
116 ; CHECK-NEXT: lbz r3, 0(r3)
117 ; CHECK-NEXT: extsb r3, r3
120 %conv = zext i8 %off to i64
121 %or = or i64 %conv, %ptr
122 %0 = inttoptr i64 %or to i8*
123 %1 = load i8, i8* %0, align 1
124 %conv1 = sext i8 %1 to i16
128 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
129 define dso_local signext i16 @ld_not_disjoint16_int16_t_int8_t(i64 %ptr) {
130 ; CHECK-LABEL: ld_not_disjoint16_int16_t_int8_t:
131 ; CHECK: # %bb.0: # %entry
132 ; CHECK-NEXT: ori r3, r3, 6
133 ; CHECK-NEXT: lbz r3, 0(r3)
134 ; CHECK-NEXT: extsb r3, r3
138 %0 = inttoptr i64 %or to i8*
139 %1 = load i8, i8* %0, align 1
140 %conv = sext i8 %1 to i16
144 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
145 define dso_local signext i16 @ld_disjoint_align16_int16_t_int8_t(i64 %ptr) {
146 ; CHECK-LABEL: ld_disjoint_align16_int16_t_int8_t:
147 ; CHECK: # %bb.0: # %entry
148 ; CHECK-NEXT: rldicr r3, r3, 0, 51
149 ; CHECK-NEXT: lbz r3, 24(r3)
150 ; CHECK-NEXT: extsb r3, r3
153 %and = and i64 %ptr, -4096
154 %or = or i64 %and, 24
155 %0 = inttoptr i64 %or to i8*
156 %1 = load i8, i8* %0, align 8
157 %conv = sext i8 %1 to i16
161 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
162 define dso_local signext i16 @ld_not_disjoint32_int16_t_int8_t(i64 %ptr) {
163 ; CHECK-LABEL: ld_not_disjoint32_int16_t_int8_t:
164 ; CHECK: # %bb.0: # %entry
165 ; CHECK-NEXT: ori r3, r3, 34463
166 ; CHECK-NEXT: oris r3, r3, 1
167 ; CHECK-NEXT: lbz r3, 0(r3)
168 ; CHECK-NEXT: extsb r3, r3
171 %or = or i64 %ptr, 99999
172 %0 = inttoptr i64 %or to i8*
173 %1 = load i8, i8* %0, align 1
174 %conv = sext i8 %1 to i16
178 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
179 define dso_local signext i16 @ld_disjoint_align32_int16_t_int8_t(i64 %ptr) {
180 ; CHECK-P10-LABEL: ld_disjoint_align32_int16_t_int8_t:
181 ; CHECK-P10: # %bb.0: # %entry
182 ; CHECK-P10-NEXT: lis r4, -15264
183 ; CHECK-P10-NEXT: and r3, r3, r4
184 ; CHECK-P10-NEXT: pli r4, 999990000
185 ; CHECK-P10-NEXT: lbzx r3, r3, r4
186 ; CHECK-P10-NEXT: extsb r3, r3
187 ; CHECK-P10-NEXT: blr
189 ; CHECK-P9-LABEL: ld_disjoint_align32_int16_t_int8_t:
190 ; CHECK-P9: # %bb.0: # %entry
191 ; CHECK-P9-NEXT: lis r4, -15264
192 ; CHECK-P9-NEXT: and r3, r3, r4
193 ; CHECK-P9-NEXT: lis r4, 15258
194 ; CHECK-P9-NEXT: ori r4, r4, 41712
195 ; CHECK-P9-NEXT: lbzx r3, r3, r4
196 ; CHECK-P9-NEXT: extsb r3, r3
199 ; CHECK-P8-LABEL: ld_disjoint_align32_int16_t_int8_t:
200 ; CHECK-P8: # %bb.0: # %entry
201 ; CHECK-P8-NEXT: lis r4, -15264
202 ; CHECK-P8-NEXT: lis r5, 15258
203 ; CHECK-P8-NEXT: and r3, r3, r4
204 ; CHECK-P8-NEXT: ori r4, r5, 41712
205 ; CHECK-P8-NEXT: lbzx r3, r3, r4
206 ; CHECK-P8-NEXT: extsb r3, r3
209 %and = and i64 %ptr, -1000341504
210 %or = or i64 %and, 999990000
211 %0 = inttoptr i64 %or to i8*
212 %1 = load i8, i8* %0, align 16
213 %conv = sext i8 %1 to i16
217 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
218 define dso_local signext i16 @ld_not_disjoint64_int16_t_int8_t(i64 %ptr) {
219 ; CHECK-P10-LABEL: ld_not_disjoint64_int16_t_int8_t:
220 ; CHECK-P10: # %bb.0: # %entry
221 ; CHECK-P10-NEXT: pli r4, 232
222 ; CHECK-P10-NEXT: pli r5, 3567587329
223 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
224 ; CHECK-P10-NEXT: or r3, r3, r5
225 ; CHECK-P10-NEXT: lbz r3, 0(r3)
226 ; CHECK-P10-NEXT: extsb r3, r3
227 ; CHECK-P10-NEXT: blr
229 ; CHECK-PREP10-LABEL: ld_not_disjoint64_int16_t_int8_t:
230 ; CHECK-PREP10: # %bb.0: # %entry
231 ; CHECK-PREP10-NEXT: li r4, 29
232 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
233 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
234 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
235 ; CHECK-PREP10-NEXT: or r3, r3, r4
236 ; CHECK-PREP10-NEXT: lbz r3, 0(r3)
237 ; CHECK-PREP10-NEXT: extsb r3, r3
238 ; CHECK-PREP10-NEXT: blr
240 %or = or i64 %ptr, 1000000000001
241 %0 = inttoptr i64 %or to i8*
242 %1 = load i8, i8* %0, align 1
243 %conv = sext i8 %1 to i16
247 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
248 define dso_local signext i16 @ld_disjoint_align64_int16_t_int8_t(i64 %ptr) {
249 ; CHECK-P10-LABEL: ld_disjoint_align64_int16_t_int8_t:
250 ; CHECK-P10: # %bb.0: # %entry
251 ; CHECK-P10-NEXT: pli r4, 244140625
252 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
253 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
254 ; CHECK-P10-NEXT: lbzx r3, r3, r4
255 ; CHECK-P10-NEXT: extsb r3, r3
256 ; CHECK-P10-NEXT: blr
258 ; CHECK-PREP10-LABEL: ld_disjoint_align64_int16_t_int8_t:
259 ; CHECK-PREP10: # %bb.0: # %entry
260 ; CHECK-PREP10-NEXT: lis r4, 3725
261 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
262 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
263 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
264 ; CHECK-PREP10-NEXT: lbzx r3, r3, r4
265 ; CHECK-PREP10-NEXT: extsb r3, r3
266 ; CHECK-PREP10-NEXT: blr
268 %and = and i64 %ptr, -1099511627776
269 %or = or i64 %and, 1000000000000
270 %0 = inttoptr i64 %or to i8*
271 %1 = load i8, i8* %0, align 4096
272 %conv = sext i8 %1 to i16
276 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
277 define dso_local signext i16 @ld_cst_align16_int16_t_int8_t() {
278 ; CHECK-LABEL: ld_cst_align16_int16_t_int8_t:
279 ; CHECK: # %bb.0: # %entry
280 ; CHECK-NEXT: lbz r3, 4080(0)
281 ; CHECK-NEXT: extsb r3, r3
284 %0 = load i8, i8* inttoptr (i64 4080 to i8*), align 16
285 %conv = sext i8 %0 to i16
289 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
290 define dso_local signext i16 @ld_cst_align32_int16_t_int8_t() {
291 ; CHECK-LABEL: ld_cst_align32_int16_t_int8_t:
292 ; CHECK: # %bb.0: # %entry
293 ; CHECK-NEXT: lis r3, 153
294 ; CHECK-NEXT: lbz r3, -27108(r3)
295 ; CHECK-NEXT: extsb r3, r3
298 %0 = load i8, i8* inttoptr (i64 9999900 to i8*), align 4
299 %conv = sext i8 %0 to i16
303 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
304 define dso_local signext i16 @ld_cst_align64_int16_t_int8_t() {
305 ; CHECK-P10-LABEL: ld_cst_align64_int16_t_int8_t:
306 ; CHECK-P10: # %bb.0: # %entry
307 ; CHECK-P10-NEXT: pli r3, 244140625
308 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
309 ; CHECK-P10-NEXT: lbz r3, 0(r3)
310 ; CHECK-P10-NEXT: extsb r3, r3
311 ; CHECK-P10-NEXT: blr
313 ; CHECK-PREP10-LABEL: ld_cst_align64_int16_t_int8_t:
314 ; CHECK-PREP10: # %bb.0: # %entry
315 ; CHECK-PREP10-NEXT: lis r3, 3725
316 ; CHECK-PREP10-NEXT: ori r3, r3, 19025
317 ; CHECK-PREP10-NEXT: rldic r3, r3, 12, 24
318 ; CHECK-PREP10-NEXT: lbz r3, 0(r3)
319 ; CHECK-PREP10-NEXT: extsb r3, r3
320 ; CHECK-PREP10-NEXT: blr
322 %0 = load i8, i8* inttoptr (i64 1000000000000 to i8*), align 4096
323 %conv = sext i8 %0 to i16
327 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
328 define dso_local signext i16 @ld_0_int16_t_uint16_t(i64 %ptr) {
329 ; CHECK-LABEL: ld_0_int16_t_uint16_t:
330 ; CHECK: # %bb.0: # %entry
331 ; CHECK-NEXT: lha r3, 0(r3)
334 %0 = inttoptr i64 %ptr to i16*
335 %1 = load i16, i16* %0, align 2
339 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
340 define dso_local signext i16 @ld_align16_int16_t_uint16_t(i8* nocapture readonly %ptr) {
341 ; CHECK-LABEL: ld_align16_int16_t_uint16_t:
342 ; CHECK: # %bb.0: # %entry
343 ; CHECK-NEXT: lha r3, 8(r3)
346 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
347 %0 = bitcast i8* %add.ptr to i16*
348 %1 = load i16, i16* %0, align 2
352 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
353 define dso_local signext i16 @ld_align32_int16_t_uint16_t(i8* nocapture readonly %ptr) {
354 ; CHECK-P10-LABEL: ld_align32_int16_t_uint16_t:
355 ; CHECK-P10: # %bb.0: # %entry
356 ; CHECK-P10-NEXT: pli r4, 99999000
357 ; CHECK-P10-NEXT: lhax r3, r3, r4
358 ; CHECK-P10-NEXT: blr
360 ; CHECK-PREP10-LABEL: ld_align32_int16_t_uint16_t:
361 ; CHECK-PREP10: # %bb.0: # %entry
362 ; CHECK-PREP10-NEXT: lis r4, 1525
363 ; CHECK-PREP10-NEXT: ori r4, r4, 56600
364 ; CHECK-PREP10-NEXT: lhax r3, r3, r4
365 ; CHECK-PREP10-NEXT: blr
367 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
368 %0 = bitcast i8* %add.ptr to i16*
369 %1 = load i16, i16* %0, align 2
373 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
374 define dso_local signext i16 @ld_align64_int16_t_uint16_t(i8* nocapture readonly %ptr) {
375 ; CHECK-P10-LABEL: ld_align64_int16_t_uint16_t:
376 ; CHECK-P10: # %bb.0: # %entry
377 ; CHECK-P10-NEXT: pli r4, 244140625
378 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
379 ; CHECK-P10-NEXT: lhax r3, r3, r4
380 ; CHECK-P10-NEXT: blr
382 ; CHECK-PREP10-LABEL: ld_align64_int16_t_uint16_t:
383 ; CHECK-PREP10: # %bb.0: # %entry
384 ; CHECK-PREP10-NEXT: lis r4, 3725
385 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
386 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
387 ; CHECK-PREP10-NEXT: lhax r3, r3, r4
388 ; CHECK-PREP10-NEXT: blr
390 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
391 %0 = bitcast i8* %add.ptr to i16*
392 %1 = load i16, i16* %0, align 2
396 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
397 define dso_local signext i16 @ld_reg_int16_t_uint16_t(i8* nocapture readonly %ptr, i64 %off) {
398 ; CHECK-LABEL: ld_reg_int16_t_uint16_t:
399 ; CHECK: # %bb.0: # %entry
400 ; CHECK-NEXT: lhax r3, r3, r4
403 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
404 %0 = bitcast i8* %add.ptr to i16*
405 %1 = load i16, i16* %0, align 2
409 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
410 define dso_local signext i16 @ld_or_int16_t_uint16_t(i64 %ptr, i8 zeroext %off) {
411 ; CHECK-LABEL: ld_or_int16_t_uint16_t:
412 ; CHECK: # %bb.0: # %entry
413 ; CHECK-NEXT: or r3, r4, r3
414 ; CHECK-NEXT: lha r3, 0(r3)
417 %conv = zext i8 %off to i64
418 %or = or i64 %conv, %ptr
419 %0 = inttoptr i64 %or to i16*
420 %1 = load i16, i16* %0, align 2
424 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
425 define dso_local signext i16 @ld_not_disjoint16_int16_t_uint16_t(i64 %ptr) {
426 ; CHECK-LABEL: ld_not_disjoint16_int16_t_uint16_t:
427 ; CHECK: # %bb.0: # %entry
428 ; CHECK-NEXT: ori r3, r3, 6
429 ; CHECK-NEXT: lha r3, 0(r3)
433 %0 = inttoptr i64 %or to i16*
434 %1 = load i16, i16* %0, align 2
438 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
439 define dso_local signext i16 @ld_disjoint_align16_int16_t_uint16_t(i64 %ptr) {
440 ; CHECK-LABEL: ld_disjoint_align16_int16_t_uint16_t:
441 ; CHECK: # %bb.0: # %entry
442 ; CHECK-NEXT: rldicr r3, r3, 0, 51
443 ; CHECK-NEXT: lha r3, 24(r3)
446 %and = and i64 %ptr, -4096
447 %or = or i64 %and, 24
448 %0 = inttoptr i64 %or to i16*
449 %1 = load i16, i16* %0, align 8
453 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
454 define dso_local signext i16 @ld_not_disjoint32_int16_t_uint16_t(i64 %ptr) {
455 ; CHECK-LABEL: ld_not_disjoint32_int16_t_uint16_t:
456 ; CHECK: # %bb.0: # %entry
457 ; CHECK-NEXT: ori r3, r3, 34463
458 ; CHECK-NEXT: oris r3, r3, 1
459 ; CHECK-NEXT: lha r3, 0(r3)
462 %or = or i64 %ptr, 99999
463 %0 = inttoptr i64 %or to i16*
464 %1 = load i16, i16* %0, align 2
468 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
469 define dso_local signext i16 @ld_disjoint_align32_int16_t_uint16_t(i64 %ptr) {
470 ; CHECK-P10-LABEL: ld_disjoint_align32_int16_t_uint16_t:
471 ; CHECK-P10: # %bb.0: # %entry
472 ; CHECK-P10-NEXT: lis r4, -15264
473 ; CHECK-P10-NEXT: and r3, r3, r4
474 ; CHECK-P10-NEXT: pli r4, 999990000
475 ; CHECK-P10-NEXT: lhax r3, r3, r4
476 ; CHECK-P10-NEXT: blr
478 ; CHECK-P9-LABEL: ld_disjoint_align32_int16_t_uint16_t:
479 ; CHECK-P9: # %bb.0: # %entry
480 ; CHECK-P9-NEXT: lis r4, -15264
481 ; CHECK-P9-NEXT: and r3, r3, r4
482 ; CHECK-P9-NEXT: lis r4, 15258
483 ; CHECK-P9-NEXT: ori r4, r4, 41712
484 ; CHECK-P9-NEXT: lhax r3, r3, r4
487 ; CHECK-P8-LABEL: ld_disjoint_align32_int16_t_uint16_t:
488 ; CHECK-P8: # %bb.0: # %entry
489 ; CHECK-P8-NEXT: lis r4, -15264
490 ; CHECK-P8-NEXT: lis r5, 15258
491 ; CHECK-P8-NEXT: and r3, r3, r4
492 ; CHECK-P8-NEXT: ori r4, r5, 41712
493 ; CHECK-P8-NEXT: lhax r3, r3, r4
496 %and = and i64 %ptr, -1000341504
497 %or = or i64 %and, 999990000
498 %0 = inttoptr i64 %or to i16*
499 %1 = load i16, i16* %0, align 16
503 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
504 define dso_local signext i16 @ld_not_disjoint64_int16_t_uint16_t(i64 %ptr) {
505 ; CHECK-P10-LABEL: ld_not_disjoint64_int16_t_uint16_t:
506 ; CHECK-P10: # %bb.0: # %entry
507 ; CHECK-P10-NEXT: pli r4, 232
508 ; CHECK-P10-NEXT: pli r5, 3567587329
509 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
510 ; CHECK-P10-NEXT: or r3, r3, r5
511 ; CHECK-P10-NEXT: lha r3, 0(r3)
512 ; CHECK-P10-NEXT: blr
514 ; CHECK-PREP10-LABEL: ld_not_disjoint64_int16_t_uint16_t:
515 ; CHECK-PREP10: # %bb.0: # %entry
516 ; CHECK-PREP10-NEXT: li r4, 29
517 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
518 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
519 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
520 ; CHECK-PREP10-NEXT: or r3, r3, r4
521 ; CHECK-PREP10-NEXT: lha r3, 0(r3)
522 ; CHECK-PREP10-NEXT: blr
524 %or = or i64 %ptr, 1000000000001
525 %0 = inttoptr i64 %or to i16*
526 %1 = load i16, i16* %0, align 2
530 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
531 define dso_local signext i16 @ld_disjoint_align64_int16_t_uint16_t(i64 %ptr) {
532 ; CHECK-P10-LABEL: ld_disjoint_align64_int16_t_uint16_t:
533 ; CHECK-P10: # %bb.0: # %entry
534 ; CHECK-P10-NEXT: pli r4, 244140625
535 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
536 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
537 ; CHECK-P10-NEXT: lhax r3, r3, r4
538 ; CHECK-P10-NEXT: blr
540 ; CHECK-PREP10-LABEL: ld_disjoint_align64_int16_t_uint16_t:
541 ; CHECK-PREP10: # %bb.0: # %entry
542 ; CHECK-PREP10-NEXT: lis r4, 3725
543 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
544 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
545 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
546 ; CHECK-PREP10-NEXT: lhax r3, r3, r4
547 ; CHECK-PREP10-NEXT: blr
549 %and = and i64 %ptr, -1099511627776
550 %or = or i64 %and, 1000000000000
551 %0 = inttoptr i64 %or to i16*
552 %1 = load i16, i16* %0, align 4096
556 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
557 define dso_local signext i16 @ld_cst_align16_int16_t_uint16_t() {
558 ; CHECK-LABEL: ld_cst_align16_int16_t_uint16_t:
559 ; CHECK: # %bb.0: # %entry
560 ; CHECK-NEXT: lha r3, 4080(0)
563 %0 = load i16, i16* inttoptr (i64 4080 to i16*), align 16
567 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
568 define dso_local signext i16 @ld_cst_align32_int16_t_uint16_t() {
569 ; CHECK-LABEL: ld_cst_align32_int16_t_uint16_t:
570 ; CHECK: # %bb.0: # %entry
571 ; CHECK-NEXT: lis r3, 153
572 ; CHECK-NEXT: lha r3, -27108(r3)
575 %0 = load i16, i16* inttoptr (i64 9999900 to i16*), align 4
579 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
580 define dso_local signext i16 @ld_cst_align64_int16_t_uint16_t() {
581 ; CHECK-P10-LABEL: ld_cst_align64_int16_t_uint16_t:
582 ; CHECK-P10: # %bb.0: # %entry
583 ; CHECK-P10-NEXT: pli r3, 244140625
584 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
585 ; CHECK-P10-NEXT: lha r3, 0(r3)
586 ; CHECK-P10-NEXT: blr
588 ; CHECK-PREP10-LABEL: ld_cst_align64_int16_t_uint16_t:
589 ; CHECK-PREP10: # %bb.0: # %entry
590 ; CHECK-PREP10-NEXT: lis r3, 3725
591 ; CHECK-PREP10-NEXT: ori r3, r3, 19025
592 ; CHECK-PREP10-NEXT: rldic r3, r3, 12, 24
593 ; CHECK-PREP10-NEXT: lha r3, 0(r3)
594 ; CHECK-PREP10-NEXT: blr
596 %0 = load i16, i16* inttoptr (i64 1000000000000 to i16*), align 4096
600 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
601 define dso_local signext i16 @ld_0_int16_t_uint32_t(i64 %ptr) {
602 ; CHECK-LE-LABEL: ld_0_int16_t_uint32_t:
603 ; CHECK-LE: # %bb.0: # %entry
604 ; CHECK-LE-NEXT: lha r3, 0(r3)
607 ; CHECK-BE-LABEL: ld_0_int16_t_uint32_t:
608 ; CHECK-BE: # %bb.0: # %entry
609 ; CHECK-BE-NEXT: lha r3, 2(r3)
612 %0 = inttoptr i64 %ptr to i32*
613 %1 = load i32, i32* %0, align 4
614 %conv = trunc i32 %1 to i16
618 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
619 define dso_local signext i16 @ld_align16_int16_t_uint32_t(i8* nocapture readonly %ptr) {
620 ; CHECK-LE-LABEL: ld_align16_int16_t_uint32_t:
621 ; CHECK-LE: # %bb.0: # %entry
622 ; CHECK-LE-NEXT: lha r3, 8(r3)
625 ; CHECK-BE-LABEL: ld_align16_int16_t_uint32_t:
626 ; CHECK-BE: # %bb.0: # %entry
627 ; CHECK-BE-NEXT: lha r3, 10(r3)
630 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
631 %0 = bitcast i8* %add.ptr to i32*
632 %1 = load i32, i32* %0, align 4
633 %conv = trunc i32 %1 to i16
637 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
638 define dso_local signext i16 @ld_align32_int16_t_uint32_t(i8* nocapture readonly %ptr) {
639 ; CHECK-P10-LE-LABEL: ld_align32_int16_t_uint32_t:
640 ; CHECK-P10-LE: # %bb.0: # %entry
641 ; CHECK-P10-LE-NEXT: pli r4, 99999000
642 ; CHECK-P10-LE-NEXT: lhax r3, r3, r4
643 ; CHECK-P10-LE-NEXT: blr
645 ; CHECK-P10-BE-LABEL: ld_align32_int16_t_uint32_t:
646 ; CHECK-P10-BE: # %bb.0: # %entry
647 ; CHECK-P10-BE-NEXT: pli r4, 99999002
648 ; CHECK-P10-BE-NEXT: lhax r3, r3, r4
649 ; CHECK-P10-BE-NEXT: blr
651 ; CHECK-P9-LE-LABEL: ld_align32_int16_t_uint32_t:
652 ; CHECK-P9-LE: # %bb.0: # %entry
653 ; CHECK-P9-LE-NEXT: lis r4, 1525
654 ; CHECK-P9-LE-NEXT: ori r4, r4, 56600
655 ; CHECK-P9-LE-NEXT: lhax r3, r3, r4
656 ; CHECK-P9-LE-NEXT: blr
658 ; CHECK-P9-BE-LABEL: ld_align32_int16_t_uint32_t:
659 ; CHECK-P9-BE: # %bb.0: # %entry
660 ; CHECK-P9-BE-NEXT: lis r4, 1525
661 ; CHECK-P9-BE-NEXT: ori r4, r4, 56602
662 ; CHECK-P9-BE-NEXT: lhax r3, r3, r4
663 ; CHECK-P9-BE-NEXT: blr
665 ; CHECK-P8-LE-LABEL: ld_align32_int16_t_uint32_t:
666 ; CHECK-P8-LE: # %bb.0: # %entry
667 ; CHECK-P8-LE-NEXT: lis r4, 1525
668 ; CHECK-P8-LE-NEXT: ori r4, r4, 56600
669 ; CHECK-P8-LE-NEXT: lhax r3, r3, r4
670 ; CHECK-P8-LE-NEXT: blr
672 ; CHECK-P8-BE-LABEL: ld_align32_int16_t_uint32_t:
673 ; CHECK-P8-BE: # %bb.0: # %entry
674 ; CHECK-P8-BE-NEXT: lis r4, 1525
675 ; CHECK-P8-BE-NEXT: ori r4, r4, 56602
676 ; CHECK-P8-BE-NEXT: lhax r3, r3, r4
677 ; CHECK-P8-BE-NEXT: blr
679 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
680 %0 = bitcast i8* %add.ptr to i32*
681 %1 = load i32, i32* %0, align 4
682 %conv = trunc i32 %1 to i16
686 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
687 define dso_local signext i16 @ld_align64_int16_t_uint32_t(i8* nocapture readonly %ptr) {
688 ; CHECK-P10-LE-LABEL: ld_align64_int16_t_uint32_t:
689 ; CHECK-P10-LE: # %bb.0: # %entry
690 ; CHECK-P10-LE-NEXT: pli r4, 244140625
691 ; CHECK-P10-LE-NEXT: rldic r4, r4, 12, 24
692 ; CHECK-P10-LE-NEXT: lhax r3, r3, r4
693 ; CHECK-P10-LE-NEXT: blr
695 ; CHECK-P10-BE-LABEL: ld_align64_int16_t_uint32_t:
696 ; CHECK-P10-BE: # %bb.0: # %entry
697 ; CHECK-P10-BE-NEXT: pli r4, 232
698 ; CHECK-P10-BE-NEXT: pli r5, 3567587330
699 ; CHECK-P10-BE-NEXT: rldimi r5, r4, 32, 0
700 ; CHECK-P10-BE-NEXT: lhax r3, r3, r5
701 ; CHECK-P10-BE-NEXT: blr
703 ; CHECK-P9-LE-LABEL: ld_align64_int16_t_uint32_t:
704 ; CHECK-P9-LE: # %bb.0: # %entry
705 ; CHECK-P9-LE-NEXT: lis r4, 3725
706 ; CHECK-P9-LE-NEXT: ori r4, r4, 19025
707 ; CHECK-P9-LE-NEXT: rldic r4, r4, 12, 24
708 ; CHECK-P9-LE-NEXT: lhax r3, r3, r4
709 ; CHECK-P9-LE-NEXT: blr
711 ; CHECK-P9-BE-LABEL: ld_align64_int16_t_uint32_t:
712 ; CHECK-P9-BE: # %bb.0: # %entry
713 ; CHECK-P9-BE-NEXT: li r4, 29
714 ; CHECK-P9-BE-NEXT: rldic r4, r4, 35, 24
715 ; CHECK-P9-BE-NEXT: oris r4, r4, 54437
716 ; CHECK-P9-BE-NEXT: ori r4, r4, 4098
717 ; CHECK-P9-BE-NEXT: lhax r3, r3, r4
718 ; CHECK-P9-BE-NEXT: blr
720 ; CHECK-P8-LE-LABEL: ld_align64_int16_t_uint32_t:
721 ; CHECK-P8-LE: # %bb.0: # %entry
722 ; CHECK-P8-LE-NEXT: lis r4, 3725
723 ; CHECK-P8-LE-NEXT: ori r4, r4, 19025
724 ; CHECK-P8-LE-NEXT: rldic r4, r4, 12, 24
725 ; CHECK-P8-LE-NEXT: lhax r3, r3, r4
726 ; CHECK-P8-LE-NEXT: blr
728 ; CHECK-P8-BE-LABEL: ld_align64_int16_t_uint32_t:
729 ; CHECK-P8-BE: # %bb.0: # %entry
730 ; CHECK-P8-BE-NEXT: li r4, 29
731 ; CHECK-P8-BE-NEXT: rldic r4, r4, 35, 24
732 ; CHECK-P8-BE-NEXT: oris r4, r4, 54437
733 ; CHECK-P8-BE-NEXT: ori r4, r4, 4098
734 ; CHECK-P8-BE-NEXT: lhax r3, r3, r4
735 ; CHECK-P8-BE-NEXT: blr
737 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
738 %0 = bitcast i8* %add.ptr to i32*
739 %1 = load i32, i32* %0, align 4
740 %conv = trunc i32 %1 to i16
744 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
745 define dso_local signext i16 @ld_reg_int16_t_uint32_t(i8* nocapture readonly %ptr, i64 %off) {
746 ; CHECK-LE-LABEL: ld_reg_int16_t_uint32_t:
747 ; CHECK-LE: # %bb.0: # %entry
748 ; CHECK-LE-NEXT: lhax r3, r3, r4
751 ; CHECK-BE-LABEL: ld_reg_int16_t_uint32_t:
752 ; CHECK-BE: # %bb.0: # %entry
753 ; CHECK-BE-NEXT: add r3, r3, r4
754 ; CHECK-BE-NEXT: lha r3, 2(r3)
757 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
758 %0 = bitcast i8* %add.ptr to i32*
759 %1 = load i32, i32* %0, align 4
760 %conv = trunc i32 %1 to i16
764 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
765 define dso_local signext i16 @ld_or_int16_t_uint32_t(i64 %ptr, i8 zeroext %off) {
766 ; CHECK-LE-LABEL: ld_or_int16_t_uint32_t:
767 ; CHECK-LE: # %bb.0: # %entry
768 ; CHECK-LE-NEXT: or r3, r4, r3
769 ; CHECK-LE-NEXT: lha r3, 0(r3)
772 ; CHECK-BE-LABEL: ld_or_int16_t_uint32_t:
773 ; CHECK-BE: # %bb.0: # %entry
774 ; CHECK-BE-NEXT: or r3, r4, r3
775 ; CHECK-BE-NEXT: lha r3, 2(r3)
778 %conv = zext i8 %off to i64
779 %or = or i64 %conv, %ptr
780 %0 = inttoptr i64 %or to i32*
781 %1 = load i32, i32* %0, align 4
782 %conv1 = trunc i32 %1 to i16
786 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
787 define dso_local signext i16 @ld_not_disjoint16_int16_t_uint32_t(i64 %ptr) {
788 ; CHECK-LE-LABEL: ld_not_disjoint16_int16_t_uint32_t:
789 ; CHECK-LE: # %bb.0: # %entry
790 ; CHECK-LE-NEXT: ori r3, r3, 6
791 ; CHECK-LE-NEXT: lha r3, 0(r3)
794 ; CHECK-BE-LABEL: ld_not_disjoint16_int16_t_uint32_t:
795 ; CHECK-BE: # %bb.0: # %entry
796 ; CHECK-BE-NEXT: ori r3, r3, 6
797 ; CHECK-BE-NEXT: lha r3, 2(r3)
801 %0 = inttoptr i64 %or to i32*
802 %1 = load i32, i32* %0, align 4
803 %conv = trunc i32 %1 to i16
807 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
808 define dso_local signext i16 @ld_disjoint_align16_int16_t_uint32_t(i64 %ptr) {
809 ; CHECK-LE-LABEL: ld_disjoint_align16_int16_t_uint32_t:
810 ; CHECK-LE: # %bb.0: # %entry
811 ; CHECK-LE-NEXT: rldicr r3, r3, 0, 51
812 ; CHECK-LE-NEXT: lha r3, 24(r3)
815 ; CHECK-BE-LABEL: ld_disjoint_align16_int16_t_uint32_t:
816 ; CHECK-BE: # %bb.0: # %entry
817 ; CHECK-BE-NEXT: rldicr r3, r3, 0, 51
818 ; CHECK-BE-NEXT: lha r3, 26(r3)
821 %and = and i64 %ptr, -4096
822 %or = or i64 %and, 24
823 %0 = inttoptr i64 %or to i32*
824 %1 = load i32, i32* %0, align 8
825 %conv = trunc i32 %1 to i16
829 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
830 define dso_local signext i16 @ld_not_disjoint32_int16_t_uint32_t(i64 %ptr) {
831 ; CHECK-LE-LABEL: ld_not_disjoint32_int16_t_uint32_t:
832 ; CHECK-LE: # %bb.0: # %entry
833 ; CHECK-LE-NEXT: ori r3, r3, 34463
834 ; CHECK-LE-NEXT: oris r3, r3, 1
835 ; CHECK-LE-NEXT: lha r3, 0(r3)
838 ; CHECK-BE-LABEL: ld_not_disjoint32_int16_t_uint32_t:
839 ; CHECK-BE: # %bb.0: # %entry
840 ; CHECK-BE-NEXT: ori r3, r3, 34463
841 ; CHECK-BE-NEXT: oris r3, r3, 1
842 ; CHECK-BE-NEXT: lha r3, 2(r3)
845 %or = or i64 %ptr, 99999
846 %0 = inttoptr i64 %or to i32*
847 %1 = load i32, i32* %0, align 4
848 %conv = trunc i32 %1 to i16
852 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
853 define dso_local signext i16 @ld_disjoint_align32_int16_t_uint32_t(i64 %ptr) {
854 ; CHECK-P10-LE-LABEL: ld_disjoint_align32_int16_t_uint32_t:
855 ; CHECK-P10-LE: # %bb.0: # %entry
856 ; CHECK-P10-LE-NEXT: lis r4, -15264
857 ; CHECK-P10-LE-NEXT: and r3, r3, r4
858 ; CHECK-P10-LE-NEXT: pli r4, 999990000
859 ; CHECK-P10-LE-NEXT: lhax r3, r3, r4
860 ; CHECK-P10-LE-NEXT: blr
862 ; CHECK-P10-BE-LABEL: ld_disjoint_align32_int16_t_uint32_t:
863 ; CHECK-P10-BE: # %bb.0: # %entry
864 ; CHECK-P10-BE-NEXT: lis r4, -15264
865 ; CHECK-P10-BE-NEXT: and r3, r3, r4
866 ; CHECK-P10-BE-NEXT: pli r4, 999990002
867 ; CHECK-P10-BE-NEXT: lhax r3, r3, r4
868 ; CHECK-P10-BE-NEXT: blr
870 ; CHECK-P9-LE-LABEL: ld_disjoint_align32_int16_t_uint32_t:
871 ; CHECK-P9-LE: # %bb.0: # %entry
872 ; CHECK-P9-LE-NEXT: lis r4, -15264
873 ; CHECK-P9-LE-NEXT: and r3, r3, r4
874 ; CHECK-P9-LE-NEXT: lis r4, 15258
875 ; CHECK-P9-LE-NEXT: ori r4, r4, 41712
876 ; CHECK-P9-LE-NEXT: lhax r3, r3, r4
877 ; CHECK-P9-LE-NEXT: blr
879 ; CHECK-P9-BE-LABEL: ld_disjoint_align32_int16_t_uint32_t:
880 ; CHECK-P9-BE: # %bb.0: # %entry
881 ; CHECK-P9-BE-NEXT: lis r4, -15264
882 ; CHECK-P9-BE-NEXT: and r3, r3, r4
883 ; CHECK-P9-BE-NEXT: lis r4, 15258
884 ; CHECK-P9-BE-NEXT: ori r4, r4, 41714
885 ; CHECK-P9-BE-NEXT: lhax r3, r3, r4
886 ; CHECK-P9-BE-NEXT: blr
888 ; CHECK-P8-LE-LABEL: ld_disjoint_align32_int16_t_uint32_t:
889 ; CHECK-P8-LE: # %bb.0: # %entry
890 ; CHECK-P8-LE-NEXT: lis r4, -15264
891 ; CHECK-P8-LE-NEXT: lis r5, 15258
892 ; CHECK-P8-LE-NEXT: and r3, r3, r4
893 ; CHECK-P8-LE-NEXT: ori r4, r5, 41712
894 ; CHECK-P8-LE-NEXT: lhax r3, r3, r4
895 ; CHECK-P8-LE-NEXT: blr
897 ; CHECK-P8-BE-LABEL: ld_disjoint_align32_int16_t_uint32_t:
898 ; CHECK-P8-BE: # %bb.0: # %entry
899 ; CHECK-P8-BE-NEXT: lis r4, -15264
900 ; CHECK-P8-BE-NEXT: lis r5, 15258
901 ; CHECK-P8-BE-NEXT: and r3, r3, r4
902 ; CHECK-P8-BE-NEXT: ori r4, r5, 41714
903 ; CHECK-P8-BE-NEXT: lhax r3, r3, r4
904 ; CHECK-P8-BE-NEXT: blr
906 %and = and i64 %ptr, -1000341504
907 %or = or i64 %and, 999990000
908 %0 = inttoptr i64 %or to i32*
909 %1 = load i32, i32* %0, align 16
910 %conv = trunc i32 %1 to i16
914 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
915 define dso_local signext i16 @ld_not_disjoint64_int16_t_uint32_t(i64 %ptr) {
916 ; CHECK-P10-LE-LABEL: ld_not_disjoint64_int16_t_uint32_t:
917 ; CHECK-P10-LE: # %bb.0: # %entry
918 ; CHECK-P10-LE-NEXT: pli r4, 232
919 ; CHECK-P10-LE-NEXT: pli r5, 3567587329
920 ; CHECK-P10-LE-NEXT: rldimi r5, r4, 32, 0
921 ; CHECK-P10-LE-NEXT: or r3, r3, r5
922 ; CHECK-P10-LE-NEXT: lha r3, 0(r3)
923 ; CHECK-P10-LE-NEXT: blr
925 ; CHECK-P10-BE-LABEL: ld_not_disjoint64_int16_t_uint32_t:
926 ; CHECK-P10-BE: # %bb.0: # %entry
927 ; CHECK-P10-BE-NEXT: pli r4, 232
928 ; CHECK-P10-BE-NEXT: pli r5, 3567587329
929 ; CHECK-P10-BE-NEXT: rldimi r5, r4, 32, 0
930 ; CHECK-P10-BE-NEXT: or r3, r3, r5
931 ; CHECK-P10-BE-NEXT: lha r3, 2(r3)
932 ; CHECK-P10-BE-NEXT: blr
934 ; CHECK-P9-LE-LABEL: ld_not_disjoint64_int16_t_uint32_t:
935 ; CHECK-P9-LE: # %bb.0: # %entry
936 ; CHECK-P9-LE-NEXT: li r4, 29
937 ; CHECK-P9-LE-NEXT: rldic r4, r4, 35, 24
938 ; CHECK-P9-LE-NEXT: oris r4, r4, 54437
939 ; CHECK-P9-LE-NEXT: ori r4, r4, 4097
940 ; CHECK-P9-LE-NEXT: or r3, r3, r4
941 ; CHECK-P9-LE-NEXT: lha r3, 0(r3)
942 ; CHECK-P9-LE-NEXT: blr
944 ; CHECK-P9-BE-LABEL: ld_not_disjoint64_int16_t_uint32_t:
945 ; CHECK-P9-BE: # %bb.0: # %entry
946 ; CHECK-P9-BE-NEXT: li r4, 29
947 ; CHECK-P9-BE-NEXT: rldic r4, r4, 35, 24
948 ; CHECK-P9-BE-NEXT: oris r4, r4, 54437
949 ; CHECK-P9-BE-NEXT: ori r4, r4, 4097
950 ; CHECK-P9-BE-NEXT: or r3, r3, r4
951 ; CHECK-P9-BE-NEXT: lha r3, 2(r3)
952 ; CHECK-P9-BE-NEXT: blr
954 ; CHECK-P8-LE-LABEL: ld_not_disjoint64_int16_t_uint32_t:
955 ; CHECK-P8-LE: # %bb.0: # %entry
956 ; CHECK-P8-LE-NEXT: li r4, 29
957 ; CHECK-P8-LE-NEXT: rldic r4, r4, 35, 24
958 ; CHECK-P8-LE-NEXT: oris r4, r4, 54437
959 ; CHECK-P8-LE-NEXT: ori r4, r4, 4097
960 ; CHECK-P8-LE-NEXT: or r3, r3, r4
961 ; CHECK-P8-LE-NEXT: lha r3, 0(r3)
962 ; CHECK-P8-LE-NEXT: blr
964 ; CHECK-P8-BE-LABEL: ld_not_disjoint64_int16_t_uint32_t:
965 ; CHECK-P8-BE: # %bb.0: # %entry
966 ; CHECK-P8-BE-NEXT: li r4, 29
967 ; CHECK-P8-BE-NEXT: rldic r4, r4, 35, 24
968 ; CHECK-P8-BE-NEXT: oris r4, r4, 54437
969 ; CHECK-P8-BE-NEXT: ori r4, r4, 4097
970 ; CHECK-P8-BE-NEXT: or r3, r3, r4
971 ; CHECK-P8-BE-NEXT: lha r3, 2(r3)
972 ; CHECK-P8-BE-NEXT: blr
974 %or = or i64 %ptr, 1000000000001
975 %0 = inttoptr i64 %or to i32*
976 %1 = load i32, i32* %0, align 4
977 %conv = trunc i32 %1 to i16
981 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
982 define dso_local signext i16 @ld_disjoint_align64_int16_t_uint32_t(i64 %ptr) {
983 ; CHECK-P10-LE-LABEL: ld_disjoint_align64_int16_t_uint32_t:
984 ; CHECK-P10-LE: # %bb.0: # %entry
985 ; CHECK-P10-LE-NEXT: pli r4, 244140625
986 ; CHECK-P10-LE-NEXT: rldicr r3, r3, 0, 23
987 ; CHECK-P10-LE-NEXT: rldic r4, r4, 12, 24
988 ; CHECK-P10-LE-NEXT: lhax r3, r3, r4
989 ; CHECK-P10-LE-NEXT: blr
991 ; CHECK-P10-BE-LABEL: ld_disjoint_align64_int16_t_uint32_t:
992 ; CHECK-P10-BE: # %bb.0: # %entry
993 ; CHECK-P10-BE-NEXT: pli r4, 232
994 ; CHECK-P10-BE-NEXT: pli r5, 3567587330
995 ; CHECK-P10-BE-NEXT: rldicr r3, r3, 0, 23
996 ; CHECK-P10-BE-NEXT: rldimi r5, r4, 32, 0
997 ; CHECK-P10-BE-NEXT: lhax r3, r3, r5
998 ; CHECK-P10-BE-NEXT: blr
1000 ; CHECK-P9-LE-LABEL: ld_disjoint_align64_int16_t_uint32_t:
1001 ; CHECK-P9-LE: # %bb.0: # %entry
1002 ; CHECK-P9-LE-NEXT: lis r4, 3725
1003 ; CHECK-P9-LE-NEXT: rldicr r3, r3, 0, 23
1004 ; CHECK-P9-LE-NEXT: ori r4, r4, 19025
1005 ; CHECK-P9-LE-NEXT: rldic r4, r4, 12, 24
1006 ; CHECK-P9-LE-NEXT: lhax r3, r3, r4
1007 ; CHECK-P9-LE-NEXT: blr
1009 ; CHECK-P9-BE-LABEL: ld_disjoint_align64_int16_t_uint32_t:
1010 ; CHECK-P9-BE: # %bb.0: # %entry
1011 ; CHECK-P9-BE-NEXT: li r4, 29
1012 ; CHECK-P9-BE-NEXT: rldicr r3, r3, 0, 23
1013 ; CHECK-P9-BE-NEXT: rldic r4, r4, 35, 24
1014 ; CHECK-P9-BE-NEXT: oris r4, r4, 54437
1015 ; CHECK-P9-BE-NEXT: ori r4, r4, 4098
1016 ; CHECK-P9-BE-NEXT: lhax r3, r3, r4
1017 ; CHECK-P9-BE-NEXT: blr
1019 ; CHECK-P8-LE-LABEL: ld_disjoint_align64_int16_t_uint32_t:
1020 ; CHECK-P8-LE: # %bb.0: # %entry
1021 ; CHECK-P8-LE-NEXT: lis r4, 3725
1022 ; CHECK-P8-LE-NEXT: rldicr r3, r3, 0, 23
1023 ; CHECK-P8-LE-NEXT: ori r4, r4, 19025
1024 ; CHECK-P8-LE-NEXT: rldic r4, r4, 12, 24
1025 ; CHECK-P8-LE-NEXT: lhax r3, r3, r4
1026 ; CHECK-P8-LE-NEXT: blr
1028 ; CHECK-P8-BE-LABEL: ld_disjoint_align64_int16_t_uint32_t:
1029 ; CHECK-P8-BE: # %bb.0: # %entry
1030 ; CHECK-P8-BE-NEXT: li r4, 29
1031 ; CHECK-P8-BE-NEXT: rldicr r3, r3, 0, 23
1032 ; CHECK-P8-BE-NEXT: rldic r4, r4, 35, 24
1033 ; CHECK-P8-BE-NEXT: oris r4, r4, 54437
1034 ; CHECK-P8-BE-NEXT: ori r4, r4, 4098
1035 ; CHECK-P8-BE-NEXT: lhax r3, r3, r4
1036 ; CHECK-P8-BE-NEXT: blr
1038 %and = and i64 %ptr, -1099511627776
1039 %or = or i64 %and, 1000000000000
1040 %0 = inttoptr i64 %or to i32*
1041 %1 = load i32, i32* %0, align 4096
1042 %conv = trunc i32 %1 to i16
1046 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1047 define dso_local signext i16 @ld_cst_align16_int16_t_uint32_t() {
1048 ; CHECK-LE-LABEL: ld_cst_align16_int16_t_uint32_t:
1049 ; CHECK-LE: # %bb.0: # %entry
1050 ; CHECK-LE-NEXT: lha r3, 4080(0)
1051 ; CHECK-LE-NEXT: blr
1053 ; CHECK-BE-LABEL: ld_cst_align16_int16_t_uint32_t:
1054 ; CHECK-BE: # %bb.0: # %entry
1055 ; CHECK-BE-NEXT: lha r3, 4082(0)
1056 ; CHECK-BE-NEXT: blr
1058 %0 = load i32, i32* inttoptr (i64 4080 to i32*), align 16
1059 %conv = trunc i32 %0 to i16
1063 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1064 define dso_local signext i16 @ld_cst_align32_int16_t_uint32_t() {
1065 ; CHECK-LE-LABEL: ld_cst_align32_int16_t_uint32_t:
1066 ; CHECK-LE: # %bb.0: # %entry
1067 ; CHECK-LE-NEXT: lis r3, 153
1068 ; CHECK-LE-NEXT: lha r3, -27108(r3)
1069 ; CHECK-LE-NEXT: blr
1071 ; CHECK-BE-LABEL: ld_cst_align32_int16_t_uint32_t:
1072 ; CHECK-BE: # %bb.0: # %entry
1073 ; CHECK-BE-NEXT: lis r3, 153
1074 ; CHECK-BE-NEXT: lha r3, -27106(r3)
1075 ; CHECK-BE-NEXT: blr
1077 %0 = load i32, i32* inttoptr (i64 9999900 to i32*), align 4
1078 %conv = trunc i32 %0 to i16
1082 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1083 define dso_local signext i16 @ld_cst_align64_int16_t_uint32_t() {
1084 ; CHECK-P10-LE-LABEL: ld_cst_align64_int16_t_uint32_t:
1085 ; CHECK-P10-LE: # %bb.0: # %entry
1086 ; CHECK-P10-LE-NEXT: pli r3, 244140625
1087 ; CHECK-P10-LE-NEXT: rldic r3, r3, 12, 24
1088 ; CHECK-P10-LE-NEXT: lha r3, 0(r3)
1089 ; CHECK-P10-LE-NEXT: blr
1091 ; CHECK-P10-BE-LABEL: ld_cst_align64_int16_t_uint32_t:
1092 ; CHECK-P10-BE: # %bb.0: # %entry
1093 ; CHECK-P10-BE-NEXT: pli r3, 232
1094 ; CHECK-P10-BE-NEXT: pli r4, 3567587330
1095 ; CHECK-P10-BE-NEXT: rldimi r4, r3, 32, 0
1096 ; CHECK-P10-BE-NEXT: lha r3, 0(r4)
1097 ; CHECK-P10-BE-NEXT: blr
1099 ; CHECK-P9-LE-LABEL: ld_cst_align64_int16_t_uint32_t:
1100 ; CHECK-P9-LE: # %bb.0: # %entry
1101 ; CHECK-P9-LE-NEXT: lis r3, 3725
1102 ; CHECK-P9-LE-NEXT: ori r3, r3, 19025
1103 ; CHECK-P9-LE-NEXT: rldic r3, r3, 12, 24
1104 ; CHECK-P9-LE-NEXT: lha r3, 0(r3)
1105 ; CHECK-P9-LE-NEXT: blr
1107 ; CHECK-P9-BE-LABEL: ld_cst_align64_int16_t_uint32_t:
1108 ; CHECK-P9-BE: # %bb.0: # %entry
1109 ; CHECK-P9-BE-NEXT: li r3, 29
1110 ; CHECK-P9-BE-NEXT: rldic r3, r3, 35, 24
1111 ; CHECK-P9-BE-NEXT: oris r3, r3, 54437
1112 ; CHECK-P9-BE-NEXT: ori r3, r3, 4098
1113 ; CHECK-P9-BE-NEXT: lha r3, 0(r3)
1114 ; CHECK-P9-BE-NEXT: blr
1116 ; CHECK-P8-LE-LABEL: ld_cst_align64_int16_t_uint32_t:
1117 ; CHECK-P8-LE: # %bb.0: # %entry
1118 ; CHECK-P8-LE-NEXT: lis r3, 3725
1119 ; CHECK-P8-LE-NEXT: ori r3, r3, 19025
1120 ; CHECK-P8-LE-NEXT: rldic r3, r3, 12, 24
1121 ; CHECK-P8-LE-NEXT: lha r3, 0(r3)
1122 ; CHECK-P8-LE-NEXT: blr
1124 ; CHECK-P8-BE-LABEL: ld_cst_align64_int16_t_uint32_t:
1125 ; CHECK-P8-BE: # %bb.0: # %entry
1126 ; CHECK-P8-BE-NEXT: li r3, 29
1127 ; CHECK-P8-BE-NEXT: rldic r3, r3, 35, 24
1128 ; CHECK-P8-BE-NEXT: oris r3, r3, 54437
1129 ; CHECK-P8-BE-NEXT: ori r3, r3, 4098
1130 ; CHECK-P8-BE-NEXT: lha r3, 0(r3)
1131 ; CHECK-P8-BE-NEXT: blr
1133 %0 = load i32, i32* inttoptr (i64 1000000000000 to i32*), align 4096
1134 %conv = trunc i32 %0 to i16
1138 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1139 define dso_local signext i16 @ld_0_int16_t_uint64_t(i64 %ptr) {
1140 ; CHECK-LE-LABEL: ld_0_int16_t_uint64_t:
1141 ; CHECK-LE: # %bb.0: # %entry
1142 ; CHECK-LE-NEXT: lha r3, 0(r3)
1143 ; CHECK-LE-NEXT: blr
1145 ; CHECK-BE-LABEL: ld_0_int16_t_uint64_t:
1146 ; CHECK-BE: # %bb.0: # %entry
1147 ; CHECK-BE-NEXT: lha r3, 6(r3)
1148 ; CHECK-BE-NEXT: blr
1150 %0 = inttoptr i64 %ptr to i64*
1151 %1 = load i64, i64* %0, align 8
1152 %conv = trunc i64 %1 to i16
1156 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1157 define dso_local signext i16 @ld_align16_int16_t_uint64_t(i8* nocapture readonly %ptr) {
1158 ; CHECK-LE-LABEL: ld_align16_int16_t_uint64_t:
1159 ; CHECK-LE: # %bb.0: # %entry
1160 ; CHECK-LE-NEXT: lha r3, 8(r3)
1161 ; CHECK-LE-NEXT: blr
1163 ; CHECK-BE-LABEL: ld_align16_int16_t_uint64_t:
1164 ; CHECK-BE: # %bb.0: # %entry
1165 ; CHECK-BE-NEXT: lha r3, 14(r3)
1166 ; CHECK-BE-NEXT: blr
1168 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
1169 %0 = bitcast i8* %add.ptr to i64*
1170 %1 = load i64, i64* %0, align 8
1171 %conv = trunc i64 %1 to i16
1175 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1176 define dso_local signext i16 @ld_align32_int16_t_uint64_t(i8* nocapture readonly %ptr) {
1177 ; CHECK-P10-LE-LABEL: ld_align32_int16_t_uint64_t:
1178 ; CHECK-P10-LE: # %bb.0: # %entry
1179 ; CHECK-P10-LE-NEXT: pli r4, 99999000
1180 ; CHECK-P10-LE-NEXT: lhax r3, r3, r4
1181 ; CHECK-P10-LE-NEXT: blr
1183 ; CHECK-P10-BE-LABEL: ld_align32_int16_t_uint64_t:
1184 ; CHECK-P10-BE: # %bb.0: # %entry
1185 ; CHECK-P10-BE-NEXT: pli r4, 99999006
1186 ; CHECK-P10-BE-NEXT: lhax r3, r3, r4
1187 ; CHECK-P10-BE-NEXT: blr
1189 ; CHECK-P9-LE-LABEL: ld_align32_int16_t_uint64_t:
1190 ; CHECK-P9-LE: # %bb.0: # %entry
1191 ; CHECK-P9-LE-NEXT: lis r4, 1525
1192 ; CHECK-P9-LE-NEXT: ori r4, r4, 56600
1193 ; CHECK-P9-LE-NEXT: lhax r3, r3, r4
1194 ; CHECK-P9-LE-NEXT: blr
1196 ; CHECK-P9-BE-LABEL: ld_align32_int16_t_uint64_t:
1197 ; CHECK-P9-BE: # %bb.0: # %entry
1198 ; CHECK-P9-BE-NEXT: lis r4, 1525
1199 ; CHECK-P9-BE-NEXT: ori r4, r4, 56606
1200 ; CHECK-P9-BE-NEXT: lhax r3, r3, r4
1201 ; CHECK-P9-BE-NEXT: blr
1203 ; CHECK-P8-LE-LABEL: ld_align32_int16_t_uint64_t:
1204 ; CHECK-P8-LE: # %bb.0: # %entry
1205 ; CHECK-P8-LE-NEXT: lis r4, 1525
1206 ; CHECK-P8-LE-NEXT: ori r4, r4, 56600
1207 ; CHECK-P8-LE-NEXT: lhax r3, r3, r4
1208 ; CHECK-P8-LE-NEXT: blr
1210 ; CHECK-P8-BE-LABEL: ld_align32_int16_t_uint64_t:
1211 ; CHECK-P8-BE: # %bb.0: # %entry
1212 ; CHECK-P8-BE-NEXT: lis r4, 1525
1213 ; CHECK-P8-BE-NEXT: ori r4, r4, 56606
1214 ; CHECK-P8-BE-NEXT: lhax r3, r3, r4
1215 ; CHECK-P8-BE-NEXT: blr
1217 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
1218 %0 = bitcast i8* %add.ptr to i64*
1219 %1 = load i64, i64* %0, align 8
1220 %conv = trunc i64 %1 to i16
1224 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1225 define dso_local signext i16 @ld_align64_int16_t_uint64_t(i8* nocapture readonly %ptr) {
1226 ; CHECK-P10-LE-LABEL: ld_align64_int16_t_uint64_t:
1227 ; CHECK-P10-LE: # %bb.0: # %entry
1228 ; CHECK-P10-LE-NEXT: pli r4, 244140625
1229 ; CHECK-P10-LE-NEXT: rldic r4, r4, 12, 24
1230 ; CHECK-P10-LE-NEXT: lhax r3, r3, r4
1231 ; CHECK-P10-LE-NEXT: blr
1233 ; CHECK-P10-BE-LABEL: ld_align64_int16_t_uint64_t:
1234 ; CHECK-P10-BE: # %bb.0: # %entry
1235 ; CHECK-P10-BE-NEXT: pli r4, 232
1236 ; CHECK-P10-BE-NEXT: pli r5, 3567587334
1237 ; CHECK-P10-BE-NEXT: rldimi r5, r4, 32, 0
1238 ; CHECK-P10-BE-NEXT: lhax r3, r3, r5
1239 ; CHECK-P10-BE-NEXT: blr
1241 ; CHECK-P9-LE-LABEL: ld_align64_int16_t_uint64_t:
1242 ; CHECK-P9-LE: # %bb.0: # %entry
1243 ; CHECK-P9-LE-NEXT: lis r4, 3725
1244 ; CHECK-P9-LE-NEXT: ori r4, r4, 19025
1245 ; CHECK-P9-LE-NEXT: rldic r4, r4, 12, 24
1246 ; CHECK-P9-LE-NEXT: lhax r3, r3, r4
1247 ; CHECK-P9-LE-NEXT: blr
1249 ; CHECK-P9-BE-LABEL: ld_align64_int16_t_uint64_t:
1250 ; CHECK-P9-BE: # %bb.0: # %entry
1251 ; CHECK-P9-BE-NEXT: li r4, 29
1252 ; CHECK-P9-BE-NEXT: rldic r4, r4, 35, 24
1253 ; CHECK-P9-BE-NEXT: oris r4, r4, 54437
1254 ; CHECK-P9-BE-NEXT: ori r4, r4, 4102
1255 ; CHECK-P9-BE-NEXT: lhax r3, r3, r4
1256 ; CHECK-P9-BE-NEXT: blr
1258 ; CHECK-P8-LE-LABEL: ld_align64_int16_t_uint64_t:
1259 ; CHECK-P8-LE: # %bb.0: # %entry
1260 ; CHECK-P8-LE-NEXT: lis r4, 3725
1261 ; CHECK-P8-LE-NEXT: ori r4, r4, 19025
1262 ; CHECK-P8-LE-NEXT: rldic r4, r4, 12, 24
1263 ; CHECK-P8-LE-NEXT: lhax r3, r3, r4
1264 ; CHECK-P8-LE-NEXT: blr
1266 ; CHECK-P8-BE-LABEL: ld_align64_int16_t_uint64_t:
1267 ; CHECK-P8-BE: # %bb.0: # %entry
1268 ; CHECK-P8-BE-NEXT: li r4, 29
1269 ; CHECK-P8-BE-NEXT: rldic r4, r4, 35, 24
1270 ; CHECK-P8-BE-NEXT: oris r4, r4, 54437
1271 ; CHECK-P8-BE-NEXT: ori r4, r4, 4102
1272 ; CHECK-P8-BE-NEXT: lhax r3, r3, r4
1273 ; CHECK-P8-BE-NEXT: blr
1275 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
1276 %0 = bitcast i8* %add.ptr to i64*
1277 %1 = load i64, i64* %0, align 8
1278 %conv = trunc i64 %1 to i16
1282 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1283 define dso_local signext i16 @ld_reg_int16_t_uint64_t(i8* nocapture readonly %ptr, i64 %off) {
1284 ; CHECK-LE-LABEL: ld_reg_int16_t_uint64_t:
1285 ; CHECK-LE: # %bb.0: # %entry
1286 ; CHECK-LE-NEXT: lhax r3, r3, r4
1287 ; CHECK-LE-NEXT: blr
1289 ; CHECK-BE-LABEL: ld_reg_int16_t_uint64_t:
1290 ; CHECK-BE: # %bb.0: # %entry
1291 ; CHECK-BE-NEXT: add r3, r3, r4
1292 ; CHECK-BE-NEXT: lha r3, 6(r3)
1293 ; CHECK-BE-NEXT: blr
1295 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
1296 %0 = bitcast i8* %add.ptr to i64*
1297 %1 = load i64, i64* %0, align 8
1298 %conv = trunc i64 %1 to i16
1302 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1303 define dso_local signext i16 @ld_or_int16_t_uint64_t(i64 %ptr, i8 zeroext %off) {
1304 ; CHECK-LE-LABEL: ld_or_int16_t_uint64_t:
1305 ; CHECK-LE: # %bb.0: # %entry
1306 ; CHECK-LE-NEXT: or r3, r4, r3
1307 ; CHECK-LE-NEXT: lha r3, 0(r3)
1308 ; CHECK-LE-NEXT: blr
1310 ; CHECK-BE-LABEL: ld_or_int16_t_uint64_t:
1311 ; CHECK-BE: # %bb.0: # %entry
1312 ; CHECK-BE-NEXT: or r3, r4, r3
1313 ; CHECK-BE-NEXT: lha r3, 6(r3)
1314 ; CHECK-BE-NEXT: blr
1316 %conv = zext i8 %off to i64
1317 %or = or i64 %conv, %ptr
1318 %0 = inttoptr i64 %or to i64*
1319 %1 = load i64, i64* %0, align 8
1320 %conv1 = trunc i64 %1 to i16
1324 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1325 define dso_local signext i16 @ld_not_disjoint16_int16_t_uint64_t(i64 %ptr) {
1326 ; CHECK-LE-LABEL: ld_not_disjoint16_int16_t_uint64_t:
1327 ; CHECK-LE: # %bb.0: # %entry
1328 ; CHECK-LE-NEXT: ori r3, r3, 6
1329 ; CHECK-LE-NEXT: lha r3, 0(r3)
1330 ; CHECK-LE-NEXT: blr
1332 ; CHECK-BE-LABEL: ld_not_disjoint16_int16_t_uint64_t:
1333 ; CHECK-BE: # %bb.0: # %entry
1334 ; CHECK-BE-NEXT: ori r3, r3, 6
1335 ; CHECK-BE-NEXT: lha r3, 6(r3)
1336 ; CHECK-BE-NEXT: blr
1338 %or = or i64 %ptr, 6
1339 %0 = inttoptr i64 %or to i64*
1340 %1 = load i64, i64* %0, align 8
1341 %conv = trunc i64 %1 to i16
1345 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1346 define dso_local signext i16 @ld_disjoint_align16_int16_t_uint64_t(i64 %ptr) {
1347 ; CHECK-LE-LABEL: ld_disjoint_align16_int16_t_uint64_t:
1348 ; CHECK-LE: # %bb.0: # %entry
1349 ; CHECK-LE-NEXT: rldicr r3, r3, 0, 51
1350 ; CHECK-LE-NEXT: lha r3, 24(r3)
1351 ; CHECK-LE-NEXT: blr
1353 ; CHECK-BE-LABEL: ld_disjoint_align16_int16_t_uint64_t:
1354 ; CHECK-BE: # %bb.0: # %entry
1355 ; CHECK-BE-NEXT: rldicr r3, r3, 0, 51
1356 ; CHECK-BE-NEXT: lha r3, 30(r3)
1357 ; CHECK-BE-NEXT: blr
1359 %and = and i64 %ptr, -4096
1360 %or = or i64 %and, 24
1361 %0 = inttoptr i64 %or to i64*
1362 %1 = load i64, i64* %0, align 8
1363 %conv = trunc i64 %1 to i16
1367 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1368 define dso_local signext i16 @ld_not_disjoint32_int16_t_uint64_t(i64 %ptr) {
1369 ; CHECK-LE-LABEL: ld_not_disjoint32_int16_t_uint64_t:
1370 ; CHECK-LE: # %bb.0: # %entry
1371 ; CHECK-LE-NEXT: ori r3, r3, 34463
1372 ; CHECK-LE-NEXT: oris r3, r3, 1
1373 ; CHECK-LE-NEXT: lha r3, 0(r3)
1374 ; CHECK-LE-NEXT: blr
1376 ; CHECK-BE-LABEL: ld_not_disjoint32_int16_t_uint64_t:
1377 ; CHECK-BE: # %bb.0: # %entry
1378 ; CHECK-BE-NEXT: ori r3, r3, 34463
1379 ; CHECK-BE-NEXT: oris r3, r3, 1
1380 ; CHECK-BE-NEXT: lha r3, 6(r3)
1381 ; CHECK-BE-NEXT: blr
1383 %or = or i64 %ptr, 99999
1384 %0 = inttoptr i64 %or to i64*
1385 %1 = load i64, i64* %0, align 8
1386 %conv = trunc i64 %1 to i16
1390 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1391 define dso_local signext i16 @ld_disjoint_align32_int16_t_uint64_t(i64 %ptr) {
1392 ; CHECK-P10-LE-LABEL: ld_disjoint_align32_int16_t_uint64_t:
1393 ; CHECK-P10-LE: # %bb.0: # %entry
1394 ; CHECK-P10-LE-NEXT: lis r4, -15264
1395 ; CHECK-P10-LE-NEXT: and r3, r3, r4
1396 ; CHECK-P10-LE-NEXT: pli r4, 999990000
1397 ; CHECK-P10-LE-NEXT: lhax r3, r3, r4
1398 ; CHECK-P10-LE-NEXT: blr
1400 ; CHECK-P10-BE-LABEL: ld_disjoint_align32_int16_t_uint64_t:
1401 ; CHECK-P10-BE: # %bb.0: # %entry
1402 ; CHECK-P10-BE-NEXT: lis r4, -15264
1403 ; CHECK-P10-BE-NEXT: and r3, r3, r4
1404 ; CHECK-P10-BE-NEXT: pli r4, 999990006
1405 ; CHECK-P10-BE-NEXT: lhax r3, r3, r4
1406 ; CHECK-P10-BE-NEXT: blr
1408 ; CHECK-P9-LE-LABEL: ld_disjoint_align32_int16_t_uint64_t:
1409 ; CHECK-P9-LE: # %bb.0: # %entry
1410 ; CHECK-P9-LE-NEXT: lis r4, -15264
1411 ; CHECK-P9-LE-NEXT: and r3, r3, r4
1412 ; CHECK-P9-LE-NEXT: lis r4, 15258
1413 ; CHECK-P9-LE-NEXT: ori r4, r4, 41712
1414 ; CHECK-P9-LE-NEXT: lhax r3, r3, r4
1415 ; CHECK-P9-LE-NEXT: blr
1417 ; CHECK-P9-BE-LABEL: ld_disjoint_align32_int16_t_uint64_t:
1418 ; CHECK-P9-BE: # %bb.0: # %entry
1419 ; CHECK-P9-BE-NEXT: lis r4, -15264
1420 ; CHECK-P9-BE-NEXT: and r3, r3, r4
1421 ; CHECK-P9-BE-NEXT: lis r4, 15258
1422 ; CHECK-P9-BE-NEXT: ori r4, r4, 41718
1423 ; CHECK-P9-BE-NEXT: lhax r3, r3, r4
1424 ; CHECK-P9-BE-NEXT: blr
1426 ; CHECK-P8-LE-LABEL: ld_disjoint_align32_int16_t_uint64_t:
1427 ; CHECK-P8-LE: # %bb.0: # %entry
1428 ; CHECK-P8-LE-NEXT: lis r4, -15264
1429 ; CHECK-P8-LE-NEXT: lis r5, 15258
1430 ; CHECK-P8-LE-NEXT: and r3, r3, r4
1431 ; CHECK-P8-LE-NEXT: ori r4, r5, 41712
1432 ; CHECK-P8-LE-NEXT: lhax r3, r3, r4
1433 ; CHECK-P8-LE-NEXT: blr
1435 ; CHECK-P8-BE-LABEL: ld_disjoint_align32_int16_t_uint64_t:
1436 ; CHECK-P8-BE: # %bb.0: # %entry
1437 ; CHECK-P8-BE-NEXT: lis r4, -15264
1438 ; CHECK-P8-BE-NEXT: lis r5, 15258
1439 ; CHECK-P8-BE-NEXT: and r3, r3, r4
1440 ; CHECK-P8-BE-NEXT: ori r4, r5, 41718
1441 ; CHECK-P8-BE-NEXT: lhax r3, r3, r4
1442 ; CHECK-P8-BE-NEXT: blr
1444 %and = and i64 %ptr, -1000341504
1445 %or = or i64 %and, 999990000
1446 %0 = inttoptr i64 %or to i64*
1447 %1 = load i64, i64* %0, align 16
1448 %conv = trunc i64 %1 to i16
1452 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1453 define dso_local signext i16 @ld_not_disjoint64_int16_t_uint64_t(i64 %ptr) {
1454 ; CHECK-P10-LE-LABEL: ld_not_disjoint64_int16_t_uint64_t:
1455 ; CHECK-P10-LE: # %bb.0: # %entry
1456 ; CHECK-P10-LE-NEXT: pli r4, 232
1457 ; CHECK-P10-LE-NEXT: pli r5, 3567587329
1458 ; CHECK-P10-LE-NEXT: rldimi r5, r4, 32, 0
1459 ; CHECK-P10-LE-NEXT: or r3, r3, r5
1460 ; CHECK-P10-LE-NEXT: lha r3, 0(r3)
1461 ; CHECK-P10-LE-NEXT: blr
1463 ; CHECK-P10-BE-LABEL: ld_not_disjoint64_int16_t_uint64_t:
1464 ; CHECK-P10-BE: # %bb.0: # %entry
1465 ; CHECK-P10-BE-NEXT: pli r4, 232
1466 ; CHECK-P10-BE-NEXT: pli r5, 3567587329
1467 ; CHECK-P10-BE-NEXT: rldimi r5, r4, 32, 0
1468 ; CHECK-P10-BE-NEXT: or r3, r3, r5
1469 ; CHECK-P10-BE-NEXT: lha r3, 6(r3)
1470 ; CHECK-P10-BE-NEXT: blr
1472 ; CHECK-P9-LE-LABEL: ld_not_disjoint64_int16_t_uint64_t:
1473 ; CHECK-P9-LE: # %bb.0: # %entry
1474 ; CHECK-P9-LE-NEXT: li r4, 29
1475 ; CHECK-P9-LE-NEXT: rldic r4, r4, 35, 24
1476 ; CHECK-P9-LE-NEXT: oris r4, r4, 54437
1477 ; CHECK-P9-LE-NEXT: ori r4, r4, 4097
1478 ; CHECK-P9-LE-NEXT: or r3, r3, r4
1479 ; CHECK-P9-LE-NEXT: lha r3, 0(r3)
1480 ; CHECK-P9-LE-NEXT: blr
1482 ; CHECK-P9-BE-LABEL: ld_not_disjoint64_int16_t_uint64_t:
1483 ; CHECK-P9-BE: # %bb.0: # %entry
1484 ; CHECK-P9-BE-NEXT: li r4, 29
1485 ; CHECK-P9-BE-NEXT: rldic r4, r4, 35, 24
1486 ; CHECK-P9-BE-NEXT: oris r4, r4, 54437
1487 ; CHECK-P9-BE-NEXT: ori r4, r4, 4097
1488 ; CHECK-P9-BE-NEXT: or r3, r3, r4
1489 ; CHECK-P9-BE-NEXT: lha r3, 6(r3)
1490 ; CHECK-P9-BE-NEXT: blr
1492 ; CHECK-P8-LE-LABEL: ld_not_disjoint64_int16_t_uint64_t:
1493 ; CHECK-P8-LE: # %bb.0: # %entry
1494 ; CHECK-P8-LE-NEXT: li r4, 29
1495 ; CHECK-P8-LE-NEXT: rldic r4, r4, 35, 24
1496 ; CHECK-P8-LE-NEXT: oris r4, r4, 54437
1497 ; CHECK-P8-LE-NEXT: ori r4, r4, 4097
1498 ; CHECK-P8-LE-NEXT: or r3, r3, r4
1499 ; CHECK-P8-LE-NEXT: lha r3, 0(r3)
1500 ; CHECK-P8-LE-NEXT: blr
1502 ; CHECK-P8-BE-LABEL: ld_not_disjoint64_int16_t_uint64_t:
1503 ; CHECK-P8-BE: # %bb.0: # %entry
1504 ; CHECK-P8-BE-NEXT: li r4, 29
1505 ; CHECK-P8-BE-NEXT: rldic r4, r4, 35, 24
1506 ; CHECK-P8-BE-NEXT: oris r4, r4, 54437
1507 ; CHECK-P8-BE-NEXT: ori r4, r4, 4097
1508 ; CHECK-P8-BE-NEXT: or r3, r3, r4
1509 ; CHECK-P8-BE-NEXT: lha r3, 6(r3)
1510 ; CHECK-P8-BE-NEXT: blr
1512 %or = or i64 %ptr, 1000000000001
1513 %0 = inttoptr i64 %or to i64*
1514 %1 = load i64, i64* %0, align 8
1515 %conv = trunc i64 %1 to i16
1519 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1520 define dso_local signext i16 @ld_disjoint_align64_int16_t_uint64_t(i64 %ptr) {
1521 ; CHECK-P10-LE-LABEL: ld_disjoint_align64_int16_t_uint64_t:
1522 ; CHECK-P10-LE: # %bb.0: # %entry
1523 ; CHECK-P10-LE-NEXT: pli r4, 244140625
1524 ; CHECK-P10-LE-NEXT: rldicr r3, r3, 0, 23
1525 ; CHECK-P10-LE-NEXT: rldic r4, r4, 12, 24
1526 ; CHECK-P10-LE-NEXT: lhax r3, r3, r4
1527 ; CHECK-P10-LE-NEXT: blr
1529 ; CHECK-P10-BE-LABEL: ld_disjoint_align64_int16_t_uint64_t:
1530 ; CHECK-P10-BE: # %bb.0: # %entry
1531 ; CHECK-P10-BE-NEXT: pli r4, 232
1532 ; CHECK-P10-BE-NEXT: pli r5, 3567587334
1533 ; CHECK-P10-BE-NEXT: rldicr r3, r3, 0, 23
1534 ; CHECK-P10-BE-NEXT: rldimi r5, r4, 32, 0
1535 ; CHECK-P10-BE-NEXT: lhax r3, r3, r5
1536 ; CHECK-P10-BE-NEXT: blr
1538 ; CHECK-P9-LE-LABEL: ld_disjoint_align64_int16_t_uint64_t:
1539 ; CHECK-P9-LE: # %bb.0: # %entry
1540 ; CHECK-P9-LE-NEXT: lis r4, 3725
1541 ; CHECK-P9-LE-NEXT: rldicr r3, r3, 0, 23
1542 ; CHECK-P9-LE-NEXT: ori r4, r4, 19025
1543 ; CHECK-P9-LE-NEXT: rldic r4, r4, 12, 24
1544 ; CHECK-P9-LE-NEXT: lhax r3, r3, r4
1545 ; CHECK-P9-LE-NEXT: blr
1547 ; CHECK-P9-BE-LABEL: ld_disjoint_align64_int16_t_uint64_t:
1548 ; CHECK-P9-BE: # %bb.0: # %entry
1549 ; CHECK-P9-BE-NEXT: li r4, 29
1550 ; CHECK-P9-BE-NEXT: rldicr r3, r3, 0, 23
1551 ; CHECK-P9-BE-NEXT: rldic r4, r4, 35, 24
1552 ; CHECK-P9-BE-NEXT: oris r4, r4, 54437
1553 ; CHECK-P9-BE-NEXT: ori r4, r4, 4102
1554 ; CHECK-P9-BE-NEXT: lhax r3, r3, r4
1555 ; CHECK-P9-BE-NEXT: blr
1557 ; CHECK-P8-LE-LABEL: ld_disjoint_align64_int16_t_uint64_t:
1558 ; CHECK-P8-LE: # %bb.0: # %entry
1559 ; CHECK-P8-LE-NEXT: lis r4, 3725
1560 ; CHECK-P8-LE-NEXT: rldicr r3, r3, 0, 23
1561 ; CHECK-P8-LE-NEXT: ori r4, r4, 19025
1562 ; CHECK-P8-LE-NEXT: rldic r4, r4, 12, 24
1563 ; CHECK-P8-LE-NEXT: lhax r3, r3, r4
1564 ; CHECK-P8-LE-NEXT: blr
1566 ; CHECK-P8-BE-LABEL: ld_disjoint_align64_int16_t_uint64_t:
1567 ; CHECK-P8-BE: # %bb.0: # %entry
1568 ; CHECK-P8-BE-NEXT: li r4, 29
1569 ; CHECK-P8-BE-NEXT: rldicr r3, r3, 0, 23
1570 ; CHECK-P8-BE-NEXT: rldic r4, r4, 35, 24
1571 ; CHECK-P8-BE-NEXT: oris r4, r4, 54437
1572 ; CHECK-P8-BE-NEXT: ori r4, r4, 4102
1573 ; CHECK-P8-BE-NEXT: lhax r3, r3, r4
1574 ; CHECK-P8-BE-NEXT: blr
1576 %and = and i64 %ptr, -1099511627776
1577 %or = or i64 %and, 1000000000000
1578 %0 = inttoptr i64 %or to i64*
1579 %1 = load i64, i64* %0, align 4096
1580 %conv = trunc i64 %1 to i16
1584 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1585 define dso_local signext i16 @ld_cst_align16_int16_t_uint64_t() {
1586 ; CHECK-LE-LABEL: ld_cst_align16_int16_t_uint64_t:
1587 ; CHECK-LE: # %bb.0: # %entry
1588 ; CHECK-LE-NEXT: lha r3, 4080(0)
1589 ; CHECK-LE-NEXT: blr
1591 ; CHECK-BE-LABEL: ld_cst_align16_int16_t_uint64_t:
1592 ; CHECK-BE: # %bb.0: # %entry
1593 ; CHECK-BE-NEXT: lha r3, 4086(0)
1594 ; CHECK-BE-NEXT: blr
1596 %0 = load i64, i64* inttoptr (i64 4080 to i64*), align 16
1597 %conv = trunc i64 %0 to i16
1601 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1602 define dso_local signext i16 @ld_cst_align32_int16_t_uint64_t() {
1603 ; CHECK-LE-LABEL: ld_cst_align32_int16_t_uint64_t:
1604 ; CHECK-LE: # %bb.0: # %entry
1605 ; CHECK-LE-NEXT: lis r3, 153
1606 ; CHECK-LE-NEXT: lha r3, -27108(r3)
1607 ; CHECK-LE-NEXT: blr
1609 ; CHECK-BE-LABEL: ld_cst_align32_int16_t_uint64_t:
1610 ; CHECK-BE: # %bb.0: # %entry
1611 ; CHECK-BE-NEXT: lis r3, 153
1612 ; CHECK-BE-NEXT: lha r3, -27102(r3)
1613 ; CHECK-BE-NEXT: blr
1615 %0 = load i64, i64* inttoptr (i64 9999900 to i64*), align 8
1616 %conv = trunc i64 %0 to i16
1620 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1621 define dso_local signext i16 @ld_cst_align64_int16_t_uint64_t() {
1622 ; CHECK-P10-LE-LABEL: ld_cst_align64_int16_t_uint64_t:
1623 ; CHECK-P10-LE: # %bb.0: # %entry
1624 ; CHECK-P10-LE-NEXT: pli r3, 244140625
1625 ; CHECK-P10-LE-NEXT: rldic r3, r3, 12, 24
1626 ; CHECK-P10-LE-NEXT: lha r3, 0(r3)
1627 ; CHECK-P10-LE-NEXT: blr
1629 ; CHECK-P10-BE-LABEL: ld_cst_align64_int16_t_uint64_t:
1630 ; CHECK-P10-BE: # %bb.0: # %entry
1631 ; CHECK-P10-BE-NEXT: pli r3, 232
1632 ; CHECK-P10-BE-NEXT: pli r4, 3567587334
1633 ; CHECK-P10-BE-NEXT: rldimi r4, r3, 32, 0
1634 ; CHECK-P10-BE-NEXT: lha r3, 0(r4)
1635 ; CHECK-P10-BE-NEXT: blr
1637 ; CHECK-P9-LE-LABEL: ld_cst_align64_int16_t_uint64_t:
1638 ; CHECK-P9-LE: # %bb.0: # %entry
1639 ; CHECK-P9-LE-NEXT: lis r3, 3725
1640 ; CHECK-P9-LE-NEXT: ori r3, r3, 19025
1641 ; CHECK-P9-LE-NEXT: rldic r3, r3, 12, 24
1642 ; CHECK-P9-LE-NEXT: lha r3, 0(r3)
1643 ; CHECK-P9-LE-NEXT: blr
1645 ; CHECK-P9-BE-LABEL: ld_cst_align64_int16_t_uint64_t:
1646 ; CHECK-P9-BE: # %bb.0: # %entry
1647 ; CHECK-P9-BE-NEXT: li r3, 29
1648 ; CHECK-P9-BE-NEXT: rldic r3, r3, 35, 24
1649 ; CHECK-P9-BE-NEXT: oris r3, r3, 54437
1650 ; CHECK-P9-BE-NEXT: ori r3, r3, 4102
1651 ; CHECK-P9-BE-NEXT: lha r3, 0(r3)
1652 ; CHECK-P9-BE-NEXT: blr
1654 ; CHECK-P8-LE-LABEL: ld_cst_align64_int16_t_uint64_t:
1655 ; CHECK-P8-LE: # %bb.0: # %entry
1656 ; CHECK-P8-LE-NEXT: lis r3, 3725
1657 ; CHECK-P8-LE-NEXT: ori r3, r3, 19025
1658 ; CHECK-P8-LE-NEXT: rldic r3, r3, 12, 24
1659 ; CHECK-P8-LE-NEXT: lha r3, 0(r3)
1660 ; CHECK-P8-LE-NEXT: blr
1662 ; CHECK-P8-BE-LABEL: ld_cst_align64_int16_t_uint64_t:
1663 ; CHECK-P8-BE: # %bb.0: # %entry
1664 ; CHECK-P8-BE-NEXT: li r3, 29
1665 ; CHECK-P8-BE-NEXT: rldic r3, r3, 35, 24
1666 ; CHECK-P8-BE-NEXT: oris r3, r3, 54437
1667 ; CHECK-P8-BE-NEXT: ori r3, r3, 4102
1668 ; CHECK-P8-BE-NEXT: lha r3, 0(r3)
1669 ; CHECK-P8-BE-NEXT: blr
1671 %0 = load i64, i64* inttoptr (i64 1000000000000 to i64*), align 4096
1672 %conv = trunc i64 %0 to i16
1676 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1677 define dso_local signext i16 @ld_0_int16_t_float(i64 %ptr) {
1678 ; CHECK-LABEL: ld_0_int16_t_float:
1679 ; CHECK: # %bb.0: # %entry
1680 ; CHECK-NEXT: lfs f0, 0(r3)
1681 ; CHECK-NEXT: xscvdpsxws f0, f0
1682 ; CHECK-NEXT: mffprwz r3, f0
1683 ; CHECK-NEXT: extsw r3, r3
1686 %0 = inttoptr i64 %ptr to float*
1687 %1 = load float, float* %0, align 4
1688 %conv = fptosi float %1 to i16
1692 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1693 define dso_local signext i16 @ld_align16_int16_t_float(i8* nocapture readonly %ptr) {
1694 ; CHECK-LABEL: ld_align16_int16_t_float:
1695 ; CHECK: # %bb.0: # %entry
1696 ; CHECK-NEXT: lfs f0, 8(r3)
1697 ; CHECK-NEXT: xscvdpsxws f0, f0
1698 ; CHECK-NEXT: mffprwz r3, f0
1699 ; CHECK-NEXT: extsw r3, r3
1702 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
1703 %0 = bitcast i8* %add.ptr to float*
1704 %1 = load float, float* %0, align 4
1705 %conv = fptosi float %1 to i16
1709 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1710 define dso_local signext i16 @ld_align32_int16_t_float(i8* nocapture readonly %ptr) {
1711 ; CHECK-P10-LABEL: ld_align32_int16_t_float:
1712 ; CHECK-P10: # %bb.0: # %entry
1713 ; CHECK-P10-NEXT: pli r4, 99999000
1714 ; CHECK-P10-NEXT: lfsx f0, r3, r4
1715 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
1716 ; CHECK-P10-NEXT: mffprwz r3, f0
1717 ; CHECK-P10-NEXT: extsw r3, r3
1718 ; CHECK-P10-NEXT: blr
1720 ; CHECK-PREP10-LABEL: ld_align32_int16_t_float:
1721 ; CHECK-PREP10: # %bb.0: # %entry
1722 ; CHECK-PREP10-NEXT: lis r4, 1525
1723 ; CHECK-PREP10-NEXT: ori r4, r4, 56600
1724 ; CHECK-PREP10-NEXT: lfsx f0, r3, r4
1725 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
1726 ; CHECK-PREP10-NEXT: mffprwz r3, f0
1727 ; CHECK-PREP10-NEXT: extsw r3, r3
1728 ; CHECK-PREP10-NEXT: blr
1730 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
1731 %0 = bitcast i8* %add.ptr to float*
1732 %1 = load float, float* %0, align 4
1733 %conv = fptosi float %1 to i16
1737 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1738 define dso_local signext i16 @ld_align64_int16_t_float(i8* nocapture readonly %ptr) {
1739 ; CHECK-P10-LABEL: ld_align64_int16_t_float:
1740 ; CHECK-P10: # %bb.0: # %entry
1741 ; CHECK-P10-NEXT: pli r4, 244140625
1742 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
1743 ; CHECK-P10-NEXT: lfsx f0, r3, r4
1744 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
1745 ; CHECK-P10-NEXT: mffprwz r3, f0
1746 ; CHECK-P10-NEXT: extsw r3, r3
1747 ; CHECK-P10-NEXT: blr
1749 ; CHECK-PREP10-LABEL: ld_align64_int16_t_float:
1750 ; CHECK-PREP10: # %bb.0: # %entry
1751 ; CHECK-PREP10-NEXT: lis r4, 3725
1752 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
1753 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
1754 ; CHECK-PREP10-NEXT: lfsx f0, r3, r4
1755 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
1756 ; CHECK-PREP10-NEXT: mffprwz r3, f0
1757 ; CHECK-PREP10-NEXT: extsw r3, r3
1758 ; CHECK-PREP10-NEXT: blr
1760 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
1761 %0 = bitcast i8* %add.ptr to float*
1762 %1 = load float, float* %0, align 4
1763 %conv = fptosi float %1 to i16
1767 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1768 define dso_local signext i16 @ld_reg_int16_t_float(i8* nocapture readonly %ptr, i64 %off) {
1769 ; CHECK-LABEL: ld_reg_int16_t_float:
1770 ; CHECK: # %bb.0: # %entry
1771 ; CHECK-NEXT: lfsx f0, r3, r4
1772 ; CHECK-NEXT: xscvdpsxws f0, f0
1773 ; CHECK-NEXT: mffprwz r3, f0
1774 ; CHECK-NEXT: extsw r3, r3
1777 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
1778 %0 = bitcast i8* %add.ptr to float*
1779 %1 = load float, float* %0, align 4
1780 %conv = fptosi float %1 to i16
1784 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1785 define dso_local signext i16 @ld_or_int16_t_float(i64 %ptr, i8 zeroext %off) {
1786 ; CHECK-LABEL: ld_or_int16_t_float:
1787 ; CHECK: # %bb.0: # %entry
1788 ; CHECK-NEXT: or r3, r4, r3
1789 ; CHECK-NEXT: lfs f0, 0(r3)
1790 ; CHECK-NEXT: xscvdpsxws f0, f0
1791 ; CHECK-NEXT: mffprwz r3, f0
1792 ; CHECK-NEXT: extsw r3, r3
1795 %conv = zext i8 %off to i64
1796 %or = or i64 %conv, %ptr
1797 %0 = inttoptr i64 %or to float*
1798 %1 = load float, float* %0, align 4
1799 %conv1 = fptosi float %1 to i16
1803 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1804 define dso_local signext i16 @ld_not_disjoint16_int16_t_float(i64 %ptr) {
1805 ; CHECK-LABEL: ld_not_disjoint16_int16_t_float:
1806 ; CHECK: # %bb.0: # %entry
1807 ; CHECK-NEXT: ori r3, r3, 6
1808 ; CHECK-NEXT: lfs f0, 0(r3)
1809 ; CHECK-NEXT: xscvdpsxws f0, f0
1810 ; CHECK-NEXT: mffprwz r3, f0
1811 ; CHECK-NEXT: extsw r3, r3
1814 %or = or i64 %ptr, 6
1815 %0 = inttoptr i64 %or to float*
1816 %1 = load float, float* %0, align 4
1817 %conv = fptosi float %1 to i16
1821 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1822 define dso_local signext i16 @ld_disjoint_align16_int16_t_float(i64 %ptr) {
1823 ; CHECK-LABEL: ld_disjoint_align16_int16_t_float:
1824 ; CHECK: # %bb.0: # %entry
1825 ; CHECK-NEXT: rldicr r3, r3, 0, 51
1826 ; CHECK-NEXT: lfs f0, 24(r3)
1827 ; CHECK-NEXT: xscvdpsxws f0, f0
1828 ; CHECK-NEXT: mffprwz r3, f0
1829 ; CHECK-NEXT: extsw r3, r3
1832 %and = and i64 %ptr, -4096
1833 %or = or i64 %and, 24
1834 %0 = inttoptr i64 %or to float*
1835 %1 = load float, float* %0, align 8
1836 %conv = fptosi float %1 to i16
1840 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1841 define dso_local signext i16 @ld_not_disjoint32_int16_t_float(i64 %ptr) {
1842 ; CHECK-LABEL: ld_not_disjoint32_int16_t_float:
1843 ; CHECK: # %bb.0: # %entry
1844 ; CHECK-NEXT: ori r3, r3, 34463
1845 ; CHECK-NEXT: oris r3, r3, 1
1846 ; CHECK-NEXT: lfs f0, 0(r3)
1847 ; CHECK-NEXT: xscvdpsxws f0, f0
1848 ; CHECK-NEXT: mffprwz r3, f0
1849 ; CHECK-NEXT: extsw r3, r3
1852 %or = or i64 %ptr, 99999
1853 %0 = inttoptr i64 %or to float*
1854 %1 = load float, float* %0, align 4
1855 %conv = fptosi float %1 to i16
1859 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1860 define dso_local signext i16 @ld_disjoint_align32_int16_t_float(i64 %ptr) {
1861 ; CHECK-P10-LABEL: ld_disjoint_align32_int16_t_float:
1862 ; CHECK-P10: # %bb.0: # %entry
1863 ; CHECK-P10-NEXT: lis r4, -15264
1864 ; CHECK-P10-NEXT: and r3, r3, r4
1865 ; CHECK-P10-NEXT: pli r4, 999990000
1866 ; CHECK-P10-NEXT: lfsx f0, r3, r4
1867 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
1868 ; CHECK-P10-NEXT: mffprwz r3, f0
1869 ; CHECK-P10-NEXT: extsw r3, r3
1870 ; CHECK-P10-NEXT: blr
1872 ; CHECK-P9-LABEL: ld_disjoint_align32_int16_t_float:
1873 ; CHECK-P9: # %bb.0: # %entry
1874 ; CHECK-P9-NEXT: lis r4, -15264
1875 ; CHECK-P9-NEXT: and r3, r3, r4
1876 ; CHECK-P9-NEXT: lis r4, 15258
1877 ; CHECK-P9-NEXT: ori r4, r4, 41712
1878 ; CHECK-P9-NEXT: lfsx f0, r3, r4
1879 ; CHECK-P9-NEXT: xscvdpsxws f0, f0
1880 ; CHECK-P9-NEXT: mffprwz r3, f0
1881 ; CHECK-P9-NEXT: extsw r3, r3
1882 ; CHECK-P9-NEXT: blr
1884 ; CHECK-P8-LABEL: ld_disjoint_align32_int16_t_float:
1885 ; CHECK-P8: # %bb.0: # %entry
1886 ; CHECK-P8-NEXT: lis r4, -15264
1887 ; CHECK-P8-NEXT: lis r5, 15258
1888 ; CHECK-P8-NEXT: and r3, r3, r4
1889 ; CHECK-P8-NEXT: ori r4, r5, 41712
1890 ; CHECK-P8-NEXT: lfsx f0, r3, r4
1891 ; CHECK-P8-NEXT: xscvdpsxws f0, f0
1892 ; CHECK-P8-NEXT: mffprwz r3, f0
1893 ; CHECK-P8-NEXT: extsw r3, r3
1894 ; CHECK-P8-NEXT: blr
1896 %and = and i64 %ptr, -1000341504
1897 %or = or i64 %and, 999990000
1898 %0 = inttoptr i64 %or to float*
1899 %1 = load float, float* %0, align 16
1900 %conv = fptosi float %1 to i16
1904 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1905 define dso_local signext i16 @ld_not_disjoint64_int16_t_float(i64 %ptr) {
1906 ; CHECK-P10-LABEL: ld_not_disjoint64_int16_t_float:
1907 ; CHECK-P10: # %bb.0: # %entry
1908 ; CHECK-P10-NEXT: pli r4, 232
1909 ; CHECK-P10-NEXT: pli r5, 3567587329
1910 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
1911 ; CHECK-P10-NEXT: or r3, r3, r5
1912 ; CHECK-P10-NEXT: lfs f0, 0(r3)
1913 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
1914 ; CHECK-P10-NEXT: mffprwz r3, f0
1915 ; CHECK-P10-NEXT: extsw r3, r3
1916 ; CHECK-P10-NEXT: blr
1918 ; CHECK-PREP10-LABEL: ld_not_disjoint64_int16_t_float:
1919 ; CHECK-PREP10: # %bb.0: # %entry
1920 ; CHECK-PREP10-NEXT: li r4, 29
1921 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
1922 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
1923 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
1924 ; CHECK-PREP10-NEXT: or r3, r3, r4
1925 ; CHECK-PREP10-NEXT: lfs f0, 0(r3)
1926 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
1927 ; CHECK-PREP10-NEXT: mffprwz r3, f0
1928 ; CHECK-PREP10-NEXT: extsw r3, r3
1929 ; CHECK-PREP10-NEXT: blr
1931 %or = or i64 %ptr, 1000000000001
1932 %0 = inttoptr i64 %or to float*
1933 %1 = load float, float* %0, align 4
1934 %conv = fptosi float %1 to i16
1939 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1940 define dso_local signext i16 @ld_disjoint_align64_int16_t_float(i64 %ptr) {
1941 ; CHECK-P10-LABEL: ld_disjoint_align64_int16_t_float:
1942 ; CHECK-P10: # %bb.0: # %entry
1943 ; CHECK-P10-NEXT: pli r4, 244140625
1944 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
1945 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
1946 ; CHECK-P10-NEXT: lfsx f0, r3, r4
1947 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
1948 ; CHECK-P10-NEXT: mffprwz r3, f0
1949 ; CHECK-P10-NEXT: extsw r3, r3
1950 ; CHECK-P10-NEXT: blr
1952 ; CHECK-PREP10-LABEL: ld_disjoint_align64_int16_t_float:
1953 ; CHECK-PREP10: # %bb.0: # %entry
1954 ; CHECK-PREP10-NEXT: lis r4, 3725
1955 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
1956 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
1957 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
1958 ; CHECK-PREP10-NEXT: lfsx f0, r3, r4
1959 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
1960 ; CHECK-PREP10-NEXT: mffprwz r3, f0
1961 ; CHECK-PREP10-NEXT: extsw r3, r3
1962 ; CHECK-PREP10-NEXT: blr
1964 %and = and i64 %ptr, -1099511627776
1965 %or = or i64 %and, 1000000000000
1966 %0 = inttoptr i64 %or to float*
1967 %1 = load float, float* %0, align 4096
1968 %conv = fptosi float %1 to i16
1972 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1973 define dso_local signext i16 @ld_cst_align16_int16_t_float() {
1974 ; CHECK-LABEL: ld_cst_align16_int16_t_float:
1975 ; CHECK: # %bb.0: # %entry
1976 ; CHECK-NEXT: lfs f0, 4080(0)
1977 ; CHECK-NEXT: xscvdpsxws f0, f0
1978 ; CHECK-NEXT: mffprwz r3, f0
1979 ; CHECK-NEXT: extsw r3, r3
1982 %0 = load float, float* inttoptr (i64 4080 to float*), align 16
1983 %conv = fptosi float %0 to i16
1987 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
1988 define dso_local signext i16 @ld_cst_align32_int16_t_float() {
1989 ; CHECK-LABEL: ld_cst_align32_int16_t_float:
1990 ; CHECK: # %bb.0: # %entry
1991 ; CHECK-NEXT: lis r3, 153
1992 ; CHECK-NEXT: lfs f0, -27108(r3)
1993 ; CHECK-NEXT: xscvdpsxws f0, f0
1994 ; CHECK-NEXT: mffprwz r3, f0
1995 ; CHECK-NEXT: extsw r3, r3
1998 %0 = load float, float* inttoptr (i64 9999900 to float*), align 4
1999 %conv = fptosi float %0 to i16
2003 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2004 define dso_local signext i16 @ld_cst_align64_int16_t_float() {
2005 ; CHECK-P10-LABEL: ld_cst_align64_int16_t_float:
2006 ; CHECK-P10: # %bb.0: # %entry
2007 ; CHECK-P10-NEXT: pli r3, 244140625
2008 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
2009 ; CHECK-P10-NEXT: lfs f0, 0(r3)
2010 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
2011 ; CHECK-P10-NEXT: mffprwz r3, f0
2012 ; CHECK-P10-NEXT: extsw r3, r3
2013 ; CHECK-P10-NEXT: blr
2015 ; CHECK-PREP10-LABEL: ld_cst_align64_int16_t_float:
2016 ; CHECK-PREP10: # %bb.0: # %entry
2017 ; CHECK-PREP10-NEXT: lis r3, 3725
2018 ; CHECK-PREP10-NEXT: ori r3, r3, 19025
2019 ; CHECK-PREP10-NEXT: rldic r3, r3, 12, 24
2020 ; CHECK-PREP10-NEXT: lfs f0, 0(r3)
2021 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
2022 ; CHECK-PREP10-NEXT: mffprwz r3, f0
2023 ; CHECK-PREP10-NEXT: extsw r3, r3
2024 ; CHECK-PREP10-NEXT: blr
2026 %0 = load float, float* inttoptr (i64 1000000000000 to float*), align 4096
2027 %conv = fptosi float %0 to i16
2031 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2032 define dso_local signext i16 @ld_0_int16_t_double(i64 %ptr) {
2033 ; CHECK-LABEL: ld_0_int16_t_double:
2034 ; CHECK: # %bb.0: # %entry
2035 ; CHECK-NEXT: lfd f0, 0(r3)
2036 ; CHECK-NEXT: xscvdpsxws f0, f0
2037 ; CHECK-NEXT: mffprwz r3, f0
2038 ; CHECK-NEXT: extsw r3, r3
2041 %0 = inttoptr i64 %ptr to double*
2042 %1 = load double, double* %0, align 8
2043 %conv = fptosi double %1 to i16
2047 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2048 define dso_local signext i16 @ld_align16_int16_t_double(i8* nocapture readonly %ptr) {
2049 ; CHECK-LABEL: ld_align16_int16_t_double:
2050 ; CHECK: # %bb.0: # %entry
2051 ; CHECK-NEXT: lfd f0, 8(r3)
2052 ; CHECK-NEXT: xscvdpsxws f0, f0
2053 ; CHECK-NEXT: mffprwz r3, f0
2054 ; CHECK-NEXT: extsw r3, r3
2057 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
2058 %0 = bitcast i8* %add.ptr to double*
2059 %1 = load double, double* %0, align 8
2060 %conv = fptosi double %1 to i16
2064 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2065 define dso_local signext i16 @ld_align32_int16_t_double(i8* nocapture readonly %ptr) {
2066 ; CHECK-P10-LABEL: ld_align32_int16_t_double:
2067 ; CHECK-P10: # %bb.0: # %entry
2068 ; CHECK-P10-NEXT: pli r4, 99999000
2069 ; CHECK-P10-NEXT: lfdx f0, r3, r4
2070 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
2071 ; CHECK-P10-NEXT: mffprwz r3, f0
2072 ; CHECK-P10-NEXT: extsw r3, r3
2073 ; CHECK-P10-NEXT: blr
2075 ; CHECK-PREP10-LABEL: ld_align32_int16_t_double:
2076 ; CHECK-PREP10: # %bb.0: # %entry
2077 ; CHECK-PREP10-NEXT: lis r4, 1525
2078 ; CHECK-PREP10-NEXT: ori r4, r4, 56600
2079 ; CHECK-PREP10-NEXT: lfdx f0, r3, r4
2080 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
2081 ; CHECK-PREP10-NEXT: mffprwz r3, f0
2082 ; CHECK-PREP10-NEXT: extsw r3, r3
2083 ; CHECK-PREP10-NEXT: blr
2085 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
2086 %0 = bitcast i8* %add.ptr to double*
2087 %1 = load double, double* %0, align 8
2088 %conv = fptosi double %1 to i16
2092 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2093 define dso_local signext i16 @ld_align64_int16_t_double(i8* nocapture readonly %ptr) {
2094 ; CHECK-P10-LABEL: ld_align64_int16_t_double:
2095 ; CHECK-P10: # %bb.0: # %entry
2096 ; CHECK-P10-NEXT: pli r4, 244140625
2097 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
2098 ; CHECK-P10-NEXT: lfdx f0, r3, r4
2099 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
2100 ; CHECK-P10-NEXT: mffprwz r3, f0
2101 ; CHECK-P10-NEXT: extsw r3, r3
2102 ; CHECK-P10-NEXT: blr
2104 ; CHECK-PREP10-LABEL: ld_align64_int16_t_double:
2105 ; CHECK-PREP10: # %bb.0: # %entry
2106 ; CHECK-PREP10-NEXT: lis r4, 3725
2107 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
2108 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
2109 ; CHECK-PREP10-NEXT: lfdx f0, r3, r4
2110 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
2111 ; CHECK-PREP10-NEXT: mffprwz r3, f0
2112 ; CHECK-PREP10-NEXT: extsw r3, r3
2113 ; CHECK-PREP10-NEXT: blr
2115 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
2116 %0 = bitcast i8* %add.ptr to double*
2117 %1 = load double, double* %0, align 8
2118 %conv = fptosi double %1 to i16
2122 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2123 define dso_local signext i16 @ld_reg_int16_t_double(i8* nocapture readonly %ptr, i64 %off) {
2124 ; CHECK-LABEL: ld_reg_int16_t_double:
2125 ; CHECK: # %bb.0: # %entry
2126 ; CHECK-NEXT: lfdx f0, r3, r4
2127 ; CHECK-NEXT: xscvdpsxws f0, f0
2128 ; CHECK-NEXT: mffprwz r3, f0
2129 ; CHECK-NEXT: extsw r3, r3
2132 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
2133 %0 = bitcast i8* %add.ptr to double*
2134 %1 = load double, double* %0, align 8
2135 %conv = fptosi double %1 to i16
2139 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2140 define dso_local signext i16 @ld_or_int16_t_double(i64 %ptr, i8 zeroext %off) {
2141 ; CHECK-LABEL: ld_or_int16_t_double:
2142 ; CHECK: # %bb.0: # %entry
2143 ; CHECK-NEXT: or r3, r4, r3
2144 ; CHECK-NEXT: lfd f0, 0(r3)
2145 ; CHECK-NEXT: xscvdpsxws f0, f0
2146 ; CHECK-NEXT: mffprwz r3, f0
2147 ; CHECK-NEXT: extsw r3, r3
2150 %conv = zext i8 %off to i64
2151 %or = or i64 %conv, %ptr
2152 %0 = inttoptr i64 %or to double*
2153 %1 = load double, double* %0, align 8
2154 %conv1 = fptosi double %1 to i16
2158 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2159 define dso_local signext i16 @ld_not_disjoint16_int16_t_double(i64 %ptr) {
2160 ; CHECK-LABEL: ld_not_disjoint16_int16_t_double:
2161 ; CHECK: # %bb.0: # %entry
2162 ; CHECK-NEXT: ori r3, r3, 6
2163 ; CHECK-NEXT: lfd f0, 0(r3)
2164 ; CHECK-NEXT: xscvdpsxws f0, f0
2165 ; CHECK-NEXT: mffprwz r3, f0
2166 ; CHECK-NEXT: extsw r3, r3
2169 %or = or i64 %ptr, 6
2170 %0 = inttoptr i64 %or to double*
2171 %1 = load double, double* %0, align 8
2172 %conv = fptosi double %1 to i16
2176 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2177 define dso_local signext i16 @ld_disjoint_align16_int16_t_double(i64 %ptr) {
2178 ; CHECK-LABEL: ld_disjoint_align16_int16_t_double:
2179 ; CHECK: # %bb.0: # %entry
2180 ; CHECK-NEXT: rldicr r3, r3, 0, 51
2181 ; CHECK-NEXT: lfd f0, 24(r3)
2182 ; CHECK-NEXT: xscvdpsxws f0, f0
2183 ; CHECK-NEXT: mffprwz r3, f0
2184 ; CHECK-NEXT: extsw r3, r3
2187 %and = and i64 %ptr, -4096
2188 %or = or i64 %and, 24
2189 %0 = inttoptr i64 %or to double*
2190 %1 = load double, double* %0, align 8
2191 %conv = fptosi double %1 to i16
2195 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2196 define dso_local signext i16 @ld_not_disjoint32_int16_t_double(i64 %ptr) {
2197 ; CHECK-LABEL: ld_not_disjoint32_int16_t_double:
2198 ; CHECK: # %bb.0: # %entry
2199 ; CHECK-NEXT: ori r3, r3, 34463
2200 ; CHECK-NEXT: oris r3, r3, 1
2201 ; CHECK-NEXT: lfd f0, 0(r3)
2202 ; CHECK-NEXT: xscvdpsxws f0, f0
2203 ; CHECK-NEXT: mffprwz r3, f0
2204 ; CHECK-NEXT: extsw r3, r3
2207 %or = or i64 %ptr, 99999
2208 %0 = inttoptr i64 %or to double*
2209 %1 = load double, double* %0, align 8
2210 %conv = fptosi double %1 to i16
2214 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2215 define dso_local signext i16 @ld_disjoint_align32_int16_t_double(i64 %ptr) {
2216 ; CHECK-P10-LABEL: ld_disjoint_align32_int16_t_double:
2217 ; CHECK-P10: # %bb.0: # %entry
2218 ; CHECK-P10-NEXT: lis r4, -15264
2219 ; CHECK-P10-NEXT: and r3, r3, r4
2220 ; CHECK-P10-NEXT: pli r4, 999990000
2221 ; CHECK-P10-NEXT: lfdx f0, r3, r4
2222 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
2223 ; CHECK-P10-NEXT: mffprwz r3, f0
2224 ; CHECK-P10-NEXT: extsw r3, r3
2225 ; CHECK-P10-NEXT: blr
2227 ; CHECK-P9-LABEL: ld_disjoint_align32_int16_t_double:
2228 ; CHECK-P9: # %bb.0: # %entry
2229 ; CHECK-P9-NEXT: lis r4, -15264
2230 ; CHECK-P9-NEXT: and r3, r3, r4
2231 ; CHECK-P9-NEXT: lis r4, 15258
2232 ; CHECK-P9-NEXT: ori r4, r4, 41712
2233 ; CHECK-P9-NEXT: lfdx f0, r3, r4
2234 ; CHECK-P9-NEXT: xscvdpsxws f0, f0
2235 ; CHECK-P9-NEXT: mffprwz r3, f0
2236 ; CHECK-P9-NEXT: extsw r3, r3
2237 ; CHECK-P9-NEXT: blr
2239 ; CHECK-P8-LABEL: ld_disjoint_align32_int16_t_double:
2240 ; CHECK-P8: # %bb.0: # %entry
2241 ; CHECK-P8-NEXT: lis r4, -15264
2242 ; CHECK-P8-NEXT: lis r5, 15258
2243 ; CHECK-P8-NEXT: and r3, r3, r4
2244 ; CHECK-P8-NEXT: ori r4, r5, 41712
2245 ; CHECK-P8-NEXT: lfdx f0, r3, r4
2246 ; CHECK-P8-NEXT: xscvdpsxws f0, f0
2247 ; CHECK-P8-NEXT: mffprwz r3, f0
2248 ; CHECK-P8-NEXT: extsw r3, r3
2249 ; CHECK-P8-NEXT: blr
2251 %and = and i64 %ptr, -1000341504
2252 %or = or i64 %and, 999990000
2253 %0 = inttoptr i64 %or to double*
2254 %1 = load double, double* %0, align 16
2255 %conv = fptosi double %1 to i16
2259 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2260 define dso_local signext i16 @ld_not_disjoint64_int16_t_double(i64 %ptr) {
2261 ; CHECK-P10-LABEL: ld_not_disjoint64_int16_t_double:
2262 ; CHECK-P10: # %bb.0: # %entry
2263 ; CHECK-P10-NEXT: pli r4, 232
2264 ; CHECK-P10-NEXT: pli r5, 3567587329
2265 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
2266 ; CHECK-P10-NEXT: or r3, r3, r5
2267 ; CHECK-P10-NEXT: lfd f0, 0(r3)
2268 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
2269 ; CHECK-P10-NEXT: mffprwz r3, f0
2270 ; CHECK-P10-NEXT: extsw r3, r3
2271 ; CHECK-P10-NEXT: blr
2273 ; CHECK-PREP10-LABEL: ld_not_disjoint64_int16_t_double:
2274 ; CHECK-PREP10: # %bb.0: # %entry
2275 ; CHECK-PREP10-NEXT: li r4, 29
2276 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
2277 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
2278 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
2279 ; CHECK-PREP10-NEXT: or r3, r3, r4
2280 ; CHECK-PREP10-NEXT: lfd f0, 0(r3)
2281 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
2282 ; CHECK-PREP10-NEXT: mffprwz r3, f0
2283 ; CHECK-PREP10-NEXT: extsw r3, r3
2284 ; CHECK-PREP10-NEXT: blr
2286 %or = or i64 %ptr, 1000000000001
2287 %0 = inttoptr i64 %or to double*
2288 %1 = load double, double* %0, align 8
2289 %conv = fptosi double %1 to i16
2293 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2294 define dso_local signext i16 @ld_disjoint_align64_int16_t_double(i64 %ptr) {
2295 ; CHECK-P10-LABEL: ld_disjoint_align64_int16_t_double:
2296 ; CHECK-P10: # %bb.0: # %entry
2297 ; CHECK-P10-NEXT: pli r4, 244140625
2298 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
2299 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
2300 ; CHECK-P10-NEXT: lfdx f0, r3, r4
2301 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
2302 ; CHECK-P10-NEXT: mffprwz r3, f0
2303 ; CHECK-P10-NEXT: extsw r3, r3
2304 ; CHECK-P10-NEXT: blr
2306 ; CHECK-PREP10-LABEL: ld_disjoint_align64_int16_t_double:
2307 ; CHECK-PREP10: # %bb.0: # %entry
2308 ; CHECK-PREP10-NEXT: lis r4, 3725
2309 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
2310 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
2311 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
2312 ; CHECK-PREP10-NEXT: lfdx f0, r3, r4
2313 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
2314 ; CHECK-PREP10-NEXT: mffprwz r3, f0
2315 ; CHECK-PREP10-NEXT: extsw r3, r3
2316 ; CHECK-PREP10-NEXT: blr
2318 %and = and i64 %ptr, -1099511627776
2319 %or = or i64 %and, 1000000000000
2320 %0 = inttoptr i64 %or to double*
2321 %1 = load double, double* %0, align 4096
2322 %conv = fptosi double %1 to i16
2326 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2327 define dso_local signext i16 @ld_cst_align16_int16_t_double() {
2328 ; CHECK-LABEL: ld_cst_align16_int16_t_double:
2329 ; CHECK: # %bb.0: # %entry
2330 ; CHECK-NEXT: lfd f0, 4080(0)
2331 ; CHECK-NEXT: xscvdpsxws f0, f0
2332 ; CHECK-NEXT: mffprwz r3, f0
2333 ; CHECK-NEXT: extsw r3, r3
2336 %0 = load double, double* inttoptr (i64 4080 to double*), align 16
2337 %conv = fptosi double %0 to i16
2341 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2342 define dso_local signext i16 @ld_cst_align32_int16_t_double() {
2343 ; CHECK-LABEL: ld_cst_align32_int16_t_double:
2344 ; CHECK: # %bb.0: # %entry
2345 ; CHECK-NEXT: lis r3, 153
2346 ; CHECK-NEXT: lfd f0, -27108(r3)
2347 ; CHECK-NEXT: xscvdpsxws f0, f0
2348 ; CHECK-NEXT: mffprwz r3, f0
2349 ; CHECK-NEXT: extsw r3, r3
2352 %0 = load double, double* inttoptr (i64 9999900 to double*), align 8
2353 %conv = fptosi double %0 to i16
2357 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2358 define dso_local signext i16 @ld_cst_align64_int16_t_double() {
2359 ; CHECK-P10-LABEL: ld_cst_align64_int16_t_double:
2360 ; CHECK-P10: # %bb.0: # %entry
2361 ; CHECK-P10-NEXT: pli r3, 244140625
2362 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
2363 ; CHECK-P10-NEXT: lfd f0, 0(r3)
2364 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
2365 ; CHECK-P10-NEXT: mffprwz r3, f0
2366 ; CHECK-P10-NEXT: extsw r3, r3
2367 ; CHECK-P10-NEXT: blr
2369 ; CHECK-PREP10-LABEL: ld_cst_align64_int16_t_double:
2370 ; CHECK-PREP10: # %bb.0: # %entry
2371 ; CHECK-PREP10-NEXT: lis r3, 3725
2372 ; CHECK-PREP10-NEXT: ori r3, r3, 19025
2373 ; CHECK-PREP10-NEXT: rldic r3, r3, 12, 24
2374 ; CHECK-PREP10-NEXT: lfd f0, 0(r3)
2375 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
2376 ; CHECK-PREP10-NEXT: mffprwz r3, f0
2377 ; CHECK-PREP10-NEXT: extsw r3, r3
2378 ; CHECK-PREP10-NEXT: blr
2380 %0 = load double, double* inttoptr (i64 1000000000000 to double*), align 4096
2381 %conv = fptosi double %0 to i16
2385 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2386 define dso_local zeroext i16 @ld_0_uint16_t_uint8_t(i64 %ptr) {
2387 ; CHECK-LABEL: ld_0_uint16_t_uint8_t:
2388 ; CHECK: # %bb.0: # %entry
2389 ; CHECK-NEXT: lbz r3, 0(r3)
2392 %0 = inttoptr i64 %ptr to i8*
2393 %1 = load i8, i8* %0, align 1
2394 %conv = zext i8 %1 to i16
2398 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2399 define dso_local zeroext i16 @ld_align16_uint16_t_uint8_t(i8* nocapture readonly %ptr) {
2400 ; CHECK-LABEL: ld_align16_uint16_t_uint8_t:
2401 ; CHECK: # %bb.0: # %entry
2402 ; CHECK-NEXT: lbz r3, 8(r3)
2405 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
2406 %0 = load i8, i8* %add.ptr, align 1
2407 %conv = zext i8 %0 to i16
2411 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2412 define dso_local zeroext i16 @ld_align32_uint16_t_uint8_t(i8* nocapture readonly %ptr) {
2413 ; CHECK-P10-LABEL: ld_align32_uint16_t_uint8_t:
2414 ; CHECK-P10: # %bb.0: # %entry
2415 ; CHECK-P10-NEXT: pli r4, 99999000
2416 ; CHECK-P10-NEXT: lbzx r3, r3, r4
2417 ; CHECK-P10-NEXT: blr
2419 ; CHECK-PREP10-LABEL: ld_align32_uint16_t_uint8_t:
2420 ; CHECK-PREP10: # %bb.0: # %entry
2421 ; CHECK-PREP10-NEXT: lis r4, 1525
2422 ; CHECK-PREP10-NEXT: ori r4, r4, 56600
2423 ; CHECK-PREP10-NEXT: lbzx r3, r3, r4
2424 ; CHECK-PREP10-NEXT: blr
2426 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
2427 %0 = load i8, i8* %add.ptr, align 1
2428 %conv = zext i8 %0 to i16
2432 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2433 define dso_local zeroext i16 @ld_align64_uint16_t_uint8_t(i8* nocapture readonly %ptr) {
2434 ; CHECK-P10-LABEL: ld_align64_uint16_t_uint8_t:
2435 ; CHECK-P10: # %bb.0: # %entry
2436 ; CHECK-P10-NEXT: pli r4, 244140625
2437 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
2438 ; CHECK-P10-NEXT: lbzx r3, r3, r4
2439 ; CHECK-P10-NEXT: blr
2441 ; CHECK-PREP10-LABEL: ld_align64_uint16_t_uint8_t:
2442 ; CHECK-PREP10: # %bb.0: # %entry
2443 ; CHECK-PREP10-NEXT: lis r4, 3725
2444 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
2445 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
2446 ; CHECK-PREP10-NEXT: lbzx r3, r3, r4
2447 ; CHECK-PREP10-NEXT: blr
2449 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
2450 %0 = load i8, i8* %add.ptr, align 1
2451 %conv = zext i8 %0 to i16
2455 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2456 define dso_local zeroext i16 @ld_reg_uint16_t_uint8_t(i8* nocapture readonly %ptr, i64 %off) {
2457 ; CHECK-LABEL: ld_reg_uint16_t_uint8_t:
2458 ; CHECK: # %bb.0: # %entry
2459 ; CHECK-NEXT: lbzx r3, r3, r4
2462 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
2463 %0 = load i8, i8* %add.ptr, align 1
2464 %conv = zext i8 %0 to i16
2468 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2469 define dso_local zeroext i16 @ld_or_uint16_t_uint8_t(i64 %ptr, i8 zeroext %off) {
2470 ; CHECK-LABEL: ld_or_uint16_t_uint8_t:
2471 ; CHECK: # %bb.0: # %entry
2472 ; CHECK-NEXT: or r3, r4, r3
2473 ; CHECK-NEXT: lbz r3, 0(r3)
2476 %conv = zext i8 %off to i64
2477 %or = or i64 %conv, %ptr
2478 %0 = inttoptr i64 %or to i8*
2479 %1 = load i8, i8* %0, align 1
2480 %conv1 = zext i8 %1 to i16
2484 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2485 define dso_local zeroext i16 @ld_not_disjoint16_uint16_t_uint8_t(i64 %ptr) {
2486 ; CHECK-LABEL: ld_not_disjoint16_uint16_t_uint8_t:
2487 ; CHECK: # %bb.0: # %entry
2488 ; CHECK-NEXT: ori r3, r3, 6
2489 ; CHECK-NEXT: lbz r3, 0(r3)
2492 %or = or i64 %ptr, 6
2493 %0 = inttoptr i64 %or to i8*
2494 %1 = load i8, i8* %0, align 1
2495 %conv = zext i8 %1 to i16
2499 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2500 define dso_local zeroext i16 @ld_disjoint_align16_uint16_t_uint8_t(i64 %ptr) {
2501 ; CHECK-LABEL: ld_disjoint_align16_uint16_t_uint8_t:
2502 ; CHECK: # %bb.0: # %entry
2503 ; CHECK-NEXT: rldicr r3, r3, 0, 51
2504 ; CHECK-NEXT: lbz r3, 24(r3)
2507 %and = and i64 %ptr, -4096
2508 %or = or i64 %and, 24
2509 %0 = inttoptr i64 %or to i8*
2510 %1 = load i8, i8* %0, align 8
2511 %conv = zext i8 %1 to i16
2515 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2516 define dso_local zeroext i16 @ld_not_disjoint32_uint16_t_uint8_t(i64 %ptr) {
2517 ; CHECK-LABEL: ld_not_disjoint32_uint16_t_uint8_t:
2518 ; CHECK: # %bb.0: # %entry
2519 ; CHECK-NEXT: ori r3, r3, 34463
2520 ; CHECK-NEXT: oris r3, r3, 1
2521 ; CHECK-NEXT: lbz r3, 0(r3)
2524 %or = or i64 %ptr, 99999
2525 %0 = inttoptr i64 %or to i8*
2526 %1 = load i8, i8* %0, align 1
2527 %conv = zext i8 %1 to i16
2531 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2532 define dso_local zeroext i16 @ld_disjoint_align32_uint16_t_uint8_t(i64 %ptr) {
2533 ; CHECK-P10-LABEL: ld_disjoint_align32_uint16_t_uint8_t:
2534 ; CHECK-P10: # %bb.0: # %entry
2535 ; CHECK-P10-NEXT: lis r4, -15264
2536 ; CHECK-P10-NEXT: and r3, r3, r4
2537 ; CHECK-P10-NEXT: pli r4, 999990000
2538 ; CHECK-P10-NEXT: lbzx r3, r3, r4
2539 ; CHECK-P10-NEXT: blr
2541 ; CHECK-P9-LABEL: ld_disjoint_align32_uint16_t_uint8_t:
2542 ; CHECK-P9: # %bb.0: # %entry
2543 ; CHECK-P9-NEXT: lis r4, -15264
2544 ; CHECK-P9-NEXT: and r3, r3, r4
2545 ; CHECK-P9-NEXT: lis r4, 15258
2546 ; CHECK-P9-NEXT: ori r4, r4, 41712
2547 ; CHECK-P9-NEXT: lbzx r3, r3, r4
2548 ; CHECK-P9-NEXT: blr
2550 ; CHECK-P8-LABEL: ld_disjoint_align32_uint16_t_uint8_t:
2551 ; CHECK-P8: # %bb.0: # %entry
2552 ; CHECK-P8-NEXT: lis r4, -15264
2553 ; CHECK-P8-NEXT: lis r5, 15258
2554 ; CHECK-P8-NEXT: and r3, r3, r4
2555 ; CHECK-P8-NEXT: ori r4, r5, 41712
2556 ; CHECK-P8-NEXT: lbzx r3, r3, r4
2557 ; CHECK-P8-NEXT: blr
2559 %and = and i64 %ptr, -1000341504
2560 %or = or i64 %and, 999990000
2561 %0 = inttoptr i64 %or to i8*
2562 %1 = load i8, i8* %0, align 16
2563 %conv = zext i8 %1 to i16
2567 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2568 define dso_local zeroext i16 @ld_not_disjoint64_uint16_t_uint8_t(i64 %ptr) {
2569 ; CHECK-P10-LABEL: ld_not_disjoint64_uint16_t_uint8_t:
2570 ; CHECK-P10: # %bb.0: # %entry
2571 ; CHECK-P10-NEXT: pli r4, 232
2572 ; CHECK-P10-NEXT: pli r5, 3567587329
2573 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
2574 ; CHECK-P10-NEXT: or r3, r3, r5
2575 ; CHECK-P10-NEXT: lbz r3, 0(r3)
2576 ; CHECK-P10-NEXT: blr
2578 ; CHECK-PREP10-LABEL: ld_not_disjoint64_uint16_t_uint8_t:
2579 ; CHECK-PREP10: # %bb.0: # %entry
2580 ; CHECK-PREP10-NEXT: li r4, 29
2581 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
2582 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
2583 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
2584 ; CHECK-PREP10-NEXT: or r3, r3, r4
2585 ; CHECK-PREP10-NEXT: lbz r3, 0(r3)
2586 ; CHECK-PREP10-NEXT: blr
2588 %or = or i64 %ptr, 1000000000001
2589 %0 = inttoptr i64 %or to i8*
2590 %1 = load i8, i8* %0, align 1
2591 %conv = zext i8 %1 to i16
2595 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2596 define dso_local zeroext i16 @ld_disjoint_align64_uint16_t_uint8_t(i64 %ptr) {
2597 ; CHECK-P10-LABEL: ld_disjoint_align64_uint16_t_uint8_t:
2598 ; CHECK-P10: # %bb.0: # %entry
2599 ; CHECK-P10-NEXT: pli r4, 244140625
2600 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
2601 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
2602 ; CHECK-P10-NEXT: lbzx r3, r3, r4
2603 ; CHECK-P10-NEXT: blr
2605 ; CHECK-PREP10-LABEL: ld_disjoint_align64_uint16_t_uint8_t:
2606 ; CHECK-PREP10: # %bb.0: # %entry
2607 ; CHECK-PREP10-NEXT: lis r4, 3725
2608 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
2609 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
2610 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
2611 ; CHECK-PREP10-NEXT: lbzx r3, r3, r4
2612 ; CHECK-PREP10-NEXT: blr
2614 %and = and i64 %ptr, -1099511627776
2615 %or = or i64 %and, 1000000000000
2616 %0 = inttoptr i64 %or to i8*
2617 %1 = load i8, i8* %0, align 4096
2618 %conv = zext i8 %1 to i16
2622 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2623 define dso_local zeroext i16 @ld_cst_align16_uint16_t_uint8_t() {
2624 ; CHECK-LABEL: ld_cst_align16_uint16_t_uint8_t:
2625 ; CHECK: # %bb.0: # %entry
2626 ; CHECK-NEXT: lbz r3, 4080(0)
2629 %0 = load i8, i8* inttoptr (i64 4080 to i8*), align 16
2630 %conv = zext i8 %0 to i16
2634 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2635 define dso_local zeroext i16 @ld_cst_align32_uint16_t_uint8_t() {
2636 ; CHECK-LABEL: ld_cst_align32_uint16_t_uint8_t:
2637 ; CHECK: # %bb.0: # %entry
2638 ; CHECK-NEXT: lis r3, 153
2639 ; CHECK-NEXT: lbz r3, -27108(r3)
2642 %0 = load i8, i8* inttoptr (i64 9999900 to i8*), align 4
2643 %conv = zext i8 %0 to i16
2647 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2648 define dso_local zeroext i16 @ld_cst_align64_uint16_t_uint8_t() {
2649 ; CHECK-P10-LABEL: ld_cst_align64_uint16_t_uint8_t:
2650 ; CHECK-P10: # %bb.0: # %entry
2651 ; CHECK-P10-NEXT: pli r3, 244140625
2652 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
2653 ; CHECK-P10-NEXT: lbz r3, 0(r3)
2654 ; CHECK-P10-NEXT: blr
2656 ; CHECK-PREP10-LABEL: ld_cst_align64_uint16_t_uint8_t:
2657 ; CHECK-PREP10: # %bb.0: # %entry
2658 ; CHECK-PREP10-NEXT: lis r3, 3725
2659 ; CHECK-PREP10-NEXT: ori r3, r3, 19025
2660 ; CHECK-PREP10-NEXT: rldic r3, r3, 12, 24
2661 ; CHECK-PREP10-NEXT: lbz r3, 0(r3)
2662 ; CHECK-PREP10-NEXT: blr
2664 %0 = load i8, i8* inttoptr (i64 1000000000000 to i8*), align 4096
2665 %conv = zext i8 %0 to i16
2669 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2670 define dso_local zeroext i16 @ld_0_uint16_t_int8_t(i64 %ptr) {
2671 ; CHECK-LABEL: ld_0_uint16_t_int8_t:
2672 ; CHECK: # %bb.0: # %entry
2673 ; CHECK-NEXT: lbz r3, 0(r3)
2674 ; CHECK-NEXT: extsb r3, r3
2675 ; CHECK-NEXT: clrldi r3, r3, 48
2678 %0 = inttoptr i64 %ptr to i8*
2679 %1 = load i8, i8* %0, align 1
2680 %conv = sext i8 %1 to i16
2684 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2685 define dso_local zeroext i16 @ld_align16_uint16_t_int8_t(i8* nocapture readonly %ptr) {
2686 ; CHECK-LABEL: ld_align16_uint16_t_int8_t:
2687 ; CHECK: # %bb.0: # %entry
2688 ; CHECK-NEXT: lbz r3, 8(r3)
2689 ; CHECK-NEXT: extsb r3, r3
2690 ; CHECK-NEXT: clrldi r3, r3, 48
2693 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
2694 %0 = load i8, i8* %add.ptr, align 1
2695 %conv = sext i8 %0 to i16
2699 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2700 define dso_local zeroext i16 @ld_align32_uint16_t_int8_t(i8* nocapture readonly %ptr) {
2701 ; CHECK-P10-LABEL: ld_align32_uint16_t_int8_t:
2702 ; CHECK-P10: # %bb.0: # %entry
2703 ; CHECK-P10-NEXT: pli r4, 99999000
2704 ; CHECK-P10-NEXT: lbzx r3, r3, r4
2705 ; CHECK-P10-NEXT: extsb r3, r3
2706 ; CHECK-P10-NEXT: clrldi r3, r3, 48
2707 ; CHECK-P10-NEXT: blr
2709 ; CHECK-PREP10-LABEL: ld_align32_uint16_t_int8_t:
2710 ; CHECK-PREP10: # %bb.0: # %entry
2711 ; CHECK-PREP10-NEXT: lis r4, 1525
2712 ; CHECK-PREP10-NEXT: ori r4, r4, 56600
2713 ; CHECK-PREP10-NEXT: lbzx r3, r3, r4
2714 ; CHECK-PREP10-NEXT: extsb r3, r3
2715 ; CHECK-PREP10-NEXT: clrldi r3, r3, 48
2716 ; CHECK-PREP10-NEXT: blr
2718 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
2719 %0 = load i8, i8* %add.ptr, align 1
2720 %conv = sext i8 %0 to i16
2724 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2725 define dso_local zeroext i16 @ld_align64_uint16_t_int8_t(i8* nocapture readonly %ptr) {
2726 ; CHECK-P10-LABEL: ld_align64_uint16_t_int8_t:
2727 ; CHECK-P10: # %bb.0: # %entry
2728 ; CHECK-P10-NEXT: pli r4, 244140625
2729 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
2730 ; CHECK-P10-NEXT: lbzx r3, r3, r4
2731 ; CHECK-P10-NEXT: extsb r3, r3
2732 ; CHECK-P10-NEXT: clrldi r3, r3, 48
2733 ; CHECK-P10-NEXT: blr
2735 ; CHECK-PREP10-LABEL: ld_align64_uint16_t_int8_t:
2736 ; CHECK-PREP10: # %bb.0: # %entry
2737 ; CHECK-PREP10-NEXT: lis r4, 3725
2738 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
2739 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
2740 ; CHECK-PREP10-NEXT: lbzx r3, r3, r4
2741 ; CHECK-PREP10-NEXT: extsb r3, r3
2742 ; CHECK-PREP10-NEXT: clrldi r3, r3, 48
2743 ; CHECK-PREP10-NEXT: blr
2745 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
2746 %0 = load i8, i8* %add.ptr, align 1
2747 %conv = sext i8 %0 to i16
2751 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2752 define dso_local zeroext i16 @ld_reg_uint16_t_int8_t(i8* nocapture readonly %ptr, i64 %off) {
2753 ; CHECK-LABEL: ld_reg_uint16_t_int8_t:
2754 ; CHECK: # %bb.0: # %entry
2755 ; CHECK-NEXT: lbzx r3, r3, r4
2756 ; CHECK-NEXT: extsb r3, r3
2757 ; CHECK-NEXT: clrldi r3, r3, 48
2760 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
2761 %0 = load i8, i8* %add.ptr, align 1
2762 %conv = sext i8 %0 to i16
2766 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2767 define dso_local zeroext i16 @ld_or_uint16_t_int8_t(i64 %ptr, i8 zeroext %off) {
2768 ; CHECK-LABEL: ld_or_uint16_t_int8_t:
2769 ; CHECK: # %bb.0: # %entry
2770 ; CHECK-NEXT: or r3, r4, r3
2771 ; CHECK-NEXT: lbz r3, 0(r3)
2772 ; CHECK-NEXT: extsb r3, r3
2773 ; CHECK-NEXT: clrldi r3, r3, 48
2776 %conv = zext i8 %off to i64
2777 %or = or i64 %conv, %ptr
2778 %0 = inttoptr i64 %or to i8*
2779 %1 = load i8, i8* %0, align 1
2780 %conv1 = sext i8 %1 to i16
2784 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2785 define dso_local zeroext i16 @ld_not_disjoint16_uint16_t_int8_t(i64 %ptr) {
2786 ; CHECK-LABEL: ld_not_disjoint16_uint16_t_int8_t:
2787 ; CHECK: # %bb.0: # %entry
2788 ; CHECK-NEXT: ori r3, r3, 6
2789 ; CHECK-NEXT: lbz r3, 0(r3)
2790 ; CHECK-NEXT: extsb r3, r3
2791 ; CHECK-NEXT: clrldi r3, r3, 48
2794 %or = or i64 %ptr, 6
2795 %0 = inttoptr i64 %or to i8*
2796 %1 = load i8, i8* %0, align 1
2797 %conv = sext i8 %1 to i16
2801 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2802 define dso_local zeroext i16 @ld_disjoint_align16_uint16_t_int8_t(i64 %ptr) {
2803 ; CHECK-LABEL: ld_disjoint_align16_uint16_t_int8_t:
2804 ; CHECK: # %bb.0: # %entry
2805 ; CHECK-NEXT: rldicr r3, r3, 0, 51
2806 ; CHECK-NEXT: lbz r3, 24(r3)
2807 ; CHECK-NEXT: extsb r3, r3
2808 ; CHECK-NEXT: clrldi r3, r3, 48
2811 %and = and i64 %ptr, -4096
2812 %or = or i64 %and, 24
2813 %0 = inttoptr i64 %or to i8*
2814 %1 = load i8, i8* %0, align 8
2815 %conv = sext i8 %1 to i16
2819 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2820 define dso_local zeroext i16 @ld_not_disjoint32_uint16_t_int8_t(i64 %ptr) {
2821 ; CHECK-LABEL: ld_not_disjoint32_uint16_t_int8_t:
2822 ; CHECK: # %bb.0: # %entry
2823 ; CHECK-NEXT: ori r3, r3, 34463
2824 ; CHECK-NEXT: oris r3, r3, 1
2825 ; CHECK-NEXT: lbz r3, 0(r3)
2826 ; CHECK-NEXT: extsb r3, r3
2827 ; CHECK-NEXT: clrldi r3, r3, 48
2830 %or = or i64 %ptr, 99999
2831 %0 = inttoptr i64 %or to i8*
2832 %1 = load i8, i8* %0, align 1
2833 %conv = sext i8 %1 to i16
2837 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2838 define dso_local zeroext i16 @ld_disjoint_align32_uint16_t_int8_t(i64 %ptr) {
2839 ; CHECK-P10-LABEL: ld_disjoint_align32_uint16_t_int8_t:
2840 ; CHECK-P10: # %bb.0: # %entry
2841 ; CHECK-P10-NEXT: lis r4, -15264
2842 ; CHECK-P10-NEXT: and r3, r3, r4
2843 ; CHECK-P10-NEXT: pli r4, 999990000
2844 ; CHECK-P10-NEXT: lbzx r3, r3, r4
2845 ; CHECK-P10-NEXT: extsb r3, r3
2846 ; CHECK-P10-NEXT: clrldi r3, r3, 48
2847 ; CHECK-P10-NEXT: blr
2849 ; CHECK-P9-LABEL: ld_disjoint_align32_uint16_t_int8_t:
2850 ; CHECK-P9: # %bb.0: # %entry
2851 ; CHECK-P9-NEXT: lis r4, -15264
2852 ; CHECK-P9-NEXT: and r3, r3, r4
2853 ; CHECK-P9-NEXT: lis r4, 15258
2854 ; CHECK-P9-NEXT: ori r4, r4, 41712
2855 ; CHECK-P9-NEXT: lbzx r3, r3, r4
2856 ; CHECK-P9-NEXT: extsb r3, r3
2857 ; CHECK-P9-NEXT: clrldi r3, r3, 48
2858 ; CHECK-P9-NEXT: blr
2860 ; CHECK-P8-LABEL: ld_disjoint_align32_uint16_t_int8_t:
2861 ; CHECK-P8: # %bb.0: # %entry
2862 ; CHECK-P8-NEXT: lis r4, -15264
2863 ; CHECK-P8-NEXT: lis r5, 15258
2864 ; CHECK-P8-NEXT: and r3, r3, r4
2865 ; CHECK-P8-NEXT: ori r4, r5, 41712
2866 ; CHECK-P8-NEXT: lbzx r3, r3, r4
2867 ; CHECK-P8-NEXT: extsb r3, r3
2868 ; CHECK-P8-NEXT: clrldi r3, r3, 48
2869 ; CHECK-P8-NEXT: blr
2871 %and = and i64 %ptr, -1000341504
2872 %or = or i64 %and, 999990000
2873 %0 = inttoptr i64 %or to i8*
2874 %1 = load i8, i8* %0, align 16
2875 %conv = sext i8 %1 to i16
2879 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2880 define dso_local zeroext i16 @ld_not_disjoint64_uint16_t_int8_t(i64 %ptr) {
2881 ; CHECK-P10-LABEL: ld_not_disjoint64_uint16_t_int8_t:
2882 ; CHECK-P10: # %bb.0: # %entry
2883 ; CHECK-P10-NEXT: pli r4, 232
2884 ; CHECK-P10-NEXT: pli r5, 3567587329
2885 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
2886 ; CHECK-P10-NEXT: or r3, r3, r5
2887 ; CHECK-P10-NEXT: lbz r3, 0(r3)
2888 ; CHECK-P10-NEXT: extsb r3, r3
2889 ; CHECK-P10-NEXT: clrldi r3, r3, 48
2890 ; CHECK-P10-NEXT: blr
2892 ; CHECK-PREP10-LABEL: ld_not_disjoint64_uint16_t_int8_t:
2893 ; CHECK-PREP10: # %bb.0: # %entry
2894 ; CHECK-PREP10-NEXT: li r4, 29
2895 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
2896 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
2897 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
2898 ; CHECK-PREP10-NEXT: or r3, r3, r4
2899 ; CHECK-PREP10-NEXT: lbz r3, 0(r3)
2900 ; CHECK-PREP10-NEXT: extsb r3, r3
2901 ; CHECK-PREP10-NEXT: clrldi r3, r3, 48
2902 ; CHECK-PREP10-NEXT: blr
2904 %or = or i64 %ptr, 1000000000001
2905 %0 = inttoptr i64 %or to i8*
2906 %1 = load i8, i8* %0, align 1
2907 %conv = sext i8 %1 to i16
2911 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2912 define dso_local zeroext i16 @ld_disjoint_align64_uint16_t_int8_t(i64 %ptr) {
2913 ; CHECK-P10-LABEL: ld_disjoint_align64_uint16_t_int8_t:
2914 ; CHECK-P10: # %bb.0: # %entry
2915 ; CHECK-P10-NEXT: pli r4, 244140625
2916 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
2917 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
2918 ; CHECK-P10-NEXT: lbzx r3, r3, r4
2919 ; CHECK-P10-NEXT: extsb r3, r3
2920 ; CHECK-P10-NEXT: clrldi r3, r3, 48
2921 ; CHECK-P10-NEXT: blr
2923 ; CHECK-PREP10-LABEL: ld_disjoint_align64_uint16_t_int8_t:
2924 ; CHECK-PREP10: # %bb.0: # %entry
2925 ; CHECK-PREP10-NEXT: lis r4, 3725
2926 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
2927 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
2928 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
2929 ; CHECK-PREP10-NEXT: lbzx r3, r3, r4
2930 ; CHECK-PREP10-NEXT: extsb r3, r3
2931 ; CHECK-PREP10-NEXT: clrldi r3, r3, 48
2932 ; CHECK-PREP10-NEXT: blr
2934 %and = and i64 %ptr, -1099511627776
2935 %or = or i64 %and, 1000000000000
2936 %0 = inttoptr i64 %or to i8*
2937 %1 = load i8, i8* %0, align 4096
2938 %conv = sext i8 %1 to i16
2942 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2943 define dso_local zeroext i16 @ld_cst_align16_uint16_t_int8_t() {
2944 ; CHECK-LABEL: ld_cst_align16_uint16_t_int8_t:
2945 ; CHECK: # %bb.0: # %entry
2946 ; CHECK-NEXT: lbz r3, 4080(0)
2947 ; CHECK-NEXT: extsb r3, r3
2948 ; CHECK-NEXT: clrldi r3, r3, 48
2951 %0 = load i8, i8* inttoptr (i64 4080 to i8*), align 16
2952 %conv = sext i8 %0 to i16
2956 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2957 define dso_local zeroext i16 @ld_cst_align32_uint16_t_int8_t() {
2958 ; CHECK-LABEL: ld_cst_align32_uint16_t_int8_t:
2959 ; CHECK: # %bb.0: # %entry
2960 ; CHECK-NEXT: lis r3, 153
2961 ; CHECK-NEXT: lbz r3, -27108(r3)
2962 ; CHECK-NEXT: extsb r3, r3
2963 ; CHECK-NEXT: clrldi r3, r3, 48
2966 %0 = load i8, i8* inttoptr (i64 9999900 to i8*), align 4
2967 %conv = sext i8 %0 to i16
2971 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2972 define dso_local zeroext i16 @ld_cst_align64_uint16_t_int8_t() {
2973 ; CHECK-P10-LABEL: ld_cst_align64_uint16_t_int8_t:
2974 ; CHECK-P10: # %bb.0: # %entry
2975 ; CHECK-P10-NEXT: pli r3, 244140625
2976 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
2977 ; CHECK-P10-NEXT: lbz r3, 0(r3)
2978 ; CHECK-P10-NEXT: extsb r3, r3
2979 ; CHECK-P10-NEXT: clrldi r3, r3, 48
2980 ; CHECK-P10-NEXT: blr
2982 ; CHECK-PREP10-LABEL: ld_cst_align64_uint16_t_int8_t:
2983 ; CHECK-PREP10: # %bb.0: # %entry
2984 ; CHECK-PREP10-NEXT: lis r3, 3725
2985 ; CHECK-PREP10-NEXT: ori r3, r3, 19025
2986 ; CHECK-PREP10-NEXT: rldic r3, r3, 12, 24
2987 ; CHECK-PREP10-NEXT: lbz r3, 0(r3)
2988 ; CHECK-PREP10-NEXT: extsb r3, r3
2989 ; CHECK-PREP10-NEXT: clrldi r3, r3, 48
2990 ; CHECK-PREP10-NEXT: blr
2992 %0 = load i8, i8* inttoptr (i64 1000000000000 to i8*), align 4096
2993 %conv = sext i8 %0 to i16
2997 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
2998 define dso_local zeroext i16 @ld_0_uint16_t_uint16_t(i64 %ptr) {
2999 ; CHECK-LABEL: ld_0_uint16_t_uint16_t:
3000 ; CHECK: # %bb.0: # %entry
3001 ; CHECK-NEXT: lhz r3, 0(r3)
3004 %0 = inttoptr i64 %ptr to i16*
3005 %1 = load i16, i16* %0, align 2
3009 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3010 define dso_local zeroext i16 @ld_align16_uint16_t_uint16_t(i8* nocapture readonly %ptr) {
3011 ; CHECK-LABEL: ld_align16_uint16_t_uint16_t:
3012 ; CHECK: # %bb.0: # %entry
3013 ; CHECK-NEXT: lhz r3, 8(r3)
3016 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
3017 %0 = bitcast i8* %add.ptr to i16*
3018 %1 = load i16, i16* %0, align 2
3022 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3023 define dso_local zeroext i16 @ld_align32_uint16_t_uint16_t(i8* nocapture readonly %ptr) {
3024 ; CHECK-P10-LABEL: ld_align32_uint16_t_uint16_t:
3025 ; CHECK-P10: # %bb.0: # %entry
3026 ; CHECK-P10-NEXT: pli r4, 99999000
3027 ; CHECK-P10-NEXT: lhzx r3, r3, r4
3028 ; CHECK-P10-NEXT: blr
3030 ; CHECK-PREP10-LABEL: ld_align32_uint16_t_uint16_t:
3031 ; CHECK-PREP10: # %bb.0: # %entry
3032 ; CHECK-PREP10-NEXT: lis r4, 1525
3033 ; CHECK-PREP10-NEXT: ori r4, r4, 56600
3034 ; CHECK-PREP10-NEXT: lhzx r3, r3, r4
3035 ; CHECK-PREP10-NEXT: blr
3037 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
3038 %0 = bitcast i8* %add.ptr to i16*
3039 %1 = load i16, i16* %0, align 2
3043 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3044 define dso_local zeroext i16 @ld_align64_uint16_t_uint16_t(i8* nocapture readonly %ptr) {
3045 ; CHECK-P10-LABEL: ld_align64_uint16_t_uint16_t:
3046 ; CHECK-P10: # %bb.0: # %entry
3047 ; CHECK-P10-NEXT: pli r4, 244140625
3048 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
3049 ; CHECK-P10-NEXT: lhzx r3, r3, r4
3050 ; CHECK-P10-NEXT: blr
3052 ; CHECK-PREP10-LABEL: ld_align64_uint16_t_uint16_t:
3053 ; CHECK-PREP10: # %bb.0: # %entry
3054 ; CHECK-PREP10-NEXT: lis r4, 3725
3055 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
3056 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
3057 ; CHECK-PREP10-NEXT: lhzx r3, r3, r4
3058 ; CHECK-PREP10-NEXT: blr
3060 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
3061 %0 = bitcast i8* %add.ptr to i16*
3062 %1 = load i16, i16* %0, align 2
3066 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3067 define dso_local zeroext i16 @ld_reg_uint16_t_uint16_t(i8* nocapture readonly %ptr, i64 %off) {
3068 ; CHECK-LABEL: ld_reg_uint16_t_uint16_t:
3069 ; CHECK: # %bb.0: # %entry
3070 ; CHECK-NEXT: lhzx r3, r3, r4
3073 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
3074 %0 = bitcast i8* %add.ptr to i16*
3075 %1 = load i16, i16* %0, align 2
3079 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3080 define dso_local zeroext i16 @ld_or_uint16_t_uint16_t(i64 %ptr, i8 zeroext %off) {
3081 ; CHECK-LABEL: ld_or_uint16_t_uint16_t:
3082 ; CHECK: # %bb.0: # %entry
3083 ; CHECK-NEXT: or r3, r4, r3
3084 ; CHECK-NEXT: lhz r3, 0(r3)
3087 %conv = zext i8 %off to i64
3088 %or = or i64 %conv, %ptr
3089 %0 = inttoptr i64 %or to i16*
3090 %1 = load i16, i16* %0, align 2
3094 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3095 define dso_local zeroext i16 @ld_not_disjoint16_uint16_t_uint16_t(i64 %ptr) {
3096 ; CHECK-LABEL: ld_not_disjoint16_uint16_t_uint16_t:
3097 ; CHECK: # %bb.0: # %entry
3098 ; CHECK-NEXT: ori r3, r3, 6
3099 ; CHECK-NEXT: lhz r3, 0(r3)
3102 %or = or i64 %ptr, 6
3103 %0 = inttoptr i64 %or to i16*
3104 %1 = load i16, i16* %0, align 2
3108 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3109 define dso_local zeroext i16 @ld_disjoint_align16_uint16_t_uint16_t(i64 %ptr) {
3110 ; CHECK-LABEL: ld_disjoint_align16_uint16_t_uint16_t:
3111 ; CHECK: # %bb.0: # %entry
3112 ; CHECK-NEXT: rldicr r3, r3, 0, 51
3113 ; CHECK-NEXT: lhz r3, 24(r3)
3116 %and = and i64 %ptr, -4096
3117 %or = or i64 %and, 24
3118 %0 = inttoptr i64 %or to i16*
3119 %1 = load i16, i16* %0, align 8
3123 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3124 define dso_local zeroext i16 @ld_not_disjoint32_uint16_t_uint16_t(i64 %ptr) {
3125 ; CHECK-LABEL: ld_not_disjoint32_uint16_t_uint16_t:
3126 ; CHECK: # %bb.0: # %entry
3127 ; CHECK-NEXT: ori r3, r3, 34463
3128 ; CHECK-NEXT: oris r3, r3, 1
3129 ; CHECK-NEXT: lhz r3, 0(r3)
3132 %or = or i64 %ptr, 99999
3133 %0 = inttoptr i64 %or to i16*
3134 %1 = load i16, i16* %0, align 2
3138 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3139 define dso_local zeroext i16 @ld_disjoint_align32_uint16_t_uint16_t(i64 %ptr) {
3140 ; CHECK-P10-LABEL: ld_disjoint_align32_uint16_t_uint16_t:
3141 ; CHECK-P10: # %bb.0: # %entry
3142 ; CHECK-P10-NEXT: lis r4, -15264
3143 ; CHECK-P10-NEXT: and r3, r3, r4
3144 ; CHECK-P10-NEXT: pli r4, 999990000
3145 ; CHECK-P10-NEXT: lhzx r3, r3, r4
3146 ; CHECK-P10-NEXT: blr
3148 ; CHECK-P9-LABEL: ld_disjoint_align32_uint16_t_uint16_t:
3149 ; CHECK-P9: # %bb.0: # %entry
3150 ; CHECK-P9-NEXT: lis r4, -15264
3151 ; CHECK-P9-NEXT: and r3, r3, r4
3152 ; CHECK-P9-NEXT: lis r4, 15258
3153 ; CHECK-P9-NEXT: ori r4, r4, 41712
3154 ; CHECK-P9-NEXT: lhzx r3, r3, r4
3155 ; CHECK-P9-NEXT: blr
3157 ; CHECK-P8-LABEL: ld_disjoint_align32_uint16_t_uint16_t:
3158 ; CHECK-P8: # %bb.0: # %entry
3159 ; CHECK-P8-NEXT: lis r4, -15264
3160 ; CHECK-P8-NEXT: lis r5, 15258
3161 ; CHECK-P8-NEXT: and r3, r3, r4
3162 ; CHECK-P8-NEXT: ori r4, r5, 41712
3163 ; CHECK-P8-NEXT: lhzx r3, r3, r4
3164 ; CHECK-P8-NEXT: blr
3166 %and = and i64 %ptr, -1000341504
3167 %or = or i64 %and, 999990000
3168 %0 = inttoptr i64 %or to i16*
3169 %1 = load i16, i16* %0, align 16
3173 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3174 define dso_local zeroext i16 @ld_not_disjoint64_uint16_t_uint16_t(i64 %ptr) {
3175 ; CHECK-P10-LABEL: ld_not_disjoint64_uint16_t_uint16_t:
3176 ; CHECK-P10: # %bb.0: # %entry
3177 ; CHECK-P10-NEXT: pli r4, 232
3178 ; CHECK-P10-NEXT: pli r5, 3567587329
3179 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
3180 ; CHECK-P10-NEXT: or r3, r3, r5
3181 ; CHECK-P10-NEXT: lhz r3, 0(r3)
3182 ; CHECK-P10-NEXT: blr
3184 ; CHECK-PREP10-LABEL: ld_not_disjoint64_uint16_t_uint16_t:
3185 ; CHECK-PREP10: # %bb.0: # %entry
3186 ; CHECK-PREP10-NEXT: li r4, 29
3187 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
3188 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
3189 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
3190 ; CHECK-PREP10-NEXT: or r3, r3, r4
3191 ; CHECK-PREP10-NEXT: lhz r3, 0(r3)
3192 ; CHECK-PREP10-NEXT: blr
3194 %or = or i64 %ptr, 1000000000001
3195 %0 = inttoptr i64 %or to i16*
3196 %1 = load i16, i16* %0, align 2
3200 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3201 define dso_local zeroext i16 @ld_disjoint_align64_uint16_t_uint16_t(i64 %ptr) {
3202 ; CHECK-P10-LABEL: ld_disjoint_align64_uint16_t_uint16_t:
3203 ; CHECK-P10: # %bb.0: # %entry
3204 ; CHECK-P10-NEXT: pli r4, 244140625
3205 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
3206 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
3207 ; CHECK-P10-NEXT: lhzx r3, r3, r4
3208 ; CHECK-P10-NEXT: blr
3210 ; CHECK-PREP10-LABEL: ld_disjoint_align64_uint16_t_uint16_t:
3211 ; CHECK-PREP10: # %bb.0: # %entry
3212 ; CHECK-PREP10-NEXT: lis r4, 3725
3213 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
3214 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
3215 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
3216 ; CHECK-PREP10-NEXT: lhzx r3, r3, r4
3217 ; CHECK-PREP10-NEXT: blr
3219 %and = and i64 %ptr, -1099511627776
3220 %or = or i64 %and, 1000000000000
3221 %0 = inttoptr i64 %or to i16*
3222 %1 = load i16, i16* %0, align 4096
3226 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3227 define dso_local zeroext i16 @ld_cst_align16_uint16_t_uint16_t() {
3228 ; CHECK-LABEL: ld_cst_align16_uint16_t_uint16_t:
3229 ; CHECK: # %bb.0: # %entry
3230 ; CHECK-NEXT: lhz r3, 4080(0)
3233 %0 = load i16, i16* inttoptr (i64 4080 to i16*), align 16
3237 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3238 define dso_local zeroext i16 @ld_cst_align32_uint16_t_uint16_t() {
3239 ; CHECK-LABEL: ld_cst_align32_uint16_t_uint16_t:
3240 ; CHECK: # %bb.0: # %entry
3241 ; CHECK-NEXT: lis r3, 153
3242 ; CHECK-NEXT: lhz r3, -27108(r3)
3245 %0 = load i16, i16* inttoptr (i64 9999900 to i16*), align 4
3249 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3250 define dso_local zeroext i16 @ld_cst_align64_uint16_t_uint16_t() {
3251 ; CHECK-P10-LABEL: ld_cst_align64_uint16_t_uint16_t:
3252 ; CHECK-P10: # %bb.0: # %entry
3253 ; CHECK-P10-NEXT: pli r3, 244140625
3254 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
3255 ; CHECK-P10-NEXT: lhz r3, 0(r3)
3256 ; CHECK-P10-NEXT: blr
3258 ; CHECK-PREP10-LABEL: ld_cst_align64_uint16_t_uint16_t:
3259 ; CHECK-PREP10: # %bb.0: # %entry
3260 ; CHECK-PREP10-NEXT: lis r3, 3725
3261 ; CHECK-PREP10-NEXT: ori r3, r3, 19025
3262 ; CHECK-PREP10-NEXT: rldic r3, r3, 12, 24
3263 ; CHECK-PREP10-NEXT: lhz r3, 0(r3)
3264 ; CHECK-PREP10-NEXT: blr
3266 %0 = load i16, i16* inttoptr (i64 1000000000000 to i16*), align 4096
3270 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3271 define dso_local zeroext i16 @ld_0_uint16_t_uint32_t(i64 %ptr) {
3272 ; CHECK-LE-LABEL: ld_0_uint16_t_uint32_t:
3273 ; CHECK-LE: # %bb.0: # %entry
3274 ; CHECK-LE-NEXT: lhz r3, 0(r3)
3275 ; CHECK-LE-NEXT: blr
3277 ; CHECK-BE-LABEL: ld_0_uint16_t_uint32_t:
3278 ; CHECK-BE: # %bb.0: # %entry
3279 ; CHECK-BE-NEXT: lhz r3, 2(r3)
3280 ; CHECK-BE-NEXT: blr
3282 %0 = inttoptr i64 %ptr to i32*
3283 %1 = load i32, i32* %0, align 4
3284 %conv = trunc i32 %1 to i16
3288 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3289 define dso_local zeroext i16 @ld_align16_uint16_t_uint32_t(i8* nocapture readonly %ptr) {
3290 ; CHECK-LE-LABEL: ld_align16_uint16_t_uint32_t:
3291 ; CHECK-LE: # %bb.0: # %entry
3292 ; CHECK-LE-NEXT: lhz r3, 8(r3)
3293 ; CHECK-LE-NEXT: blr
3295 ; CHECK-BE-LABEL: ld_align16_uint16_t_uint32_t:
3296 ; CHECK-BE: # %bb.0: # %entry
3297 ; CHECK-BE-NEXT: lhz r3, 10(r3)
3298 ; CHECK-BE-NEXT: blr
3300 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
3301 %0 = bitcast i8* %add.ptr to i32*
3302 %1 = load i32, i32* %0, align 4
3303 %conv = trunc i32 %1 to i16
3307 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3308 define dso_local zeroext i16 @ld_align32_uint16_t_uint32_t(i8* nocapture readonly %ptr) {
3309 ; CHECK-P10-LE-LABEL: ld_align32_uint16_t_uint32_t:
3310 ; CHECK-P10-LE: # %bb.0: # %entry
3311 ; CHECK-P10-LE-NEXT: pli r4, 99999000
3312 ; CHECK-P10-LE-NEXT: lhzx r3, r3, r4
3313 ; CHECK-P10-LE-NEXT: blr
3315 ; CHECK-P10-BE-LABEL: ld_align32_uint16_t_uint32_t:
3316 ; CHECK-P10-BE: # %bb.0: # %entry
3317 ; CHECK-P10-BE-NEXT: pli r4, 99999002
3318 ; CHECK-P10-BE-NEXT: lhzx r3, r3, r4
3319 ; CHECK-P10-BE-NEXT: blr
3321 ; CHECK-P9-LE-LABEL: ld_align32_uint16_t_uint32_t:
3322 ; CHECK-P9-LE: # %bb.0: # %entry
3323 ; CHECK-P9-LE-NEXT: lis r4, 1525
3324 ; CHECK-P9-LE-NEXT: ori r4, r4, 56600
3325 ; CHECK-P9-LE-NEXT: lhzx r3, r3, r4
3326 ; CHECK-P9-LE-NEXT: blr
3328 ; CHECK-P9-BE-LABEL: ld_align32_uint16_t_uint32_t:
3329 ; CHECK-P9-BE: # %bb.0: # %entry
3330 ; CHECK-P9-BE-NEXT: lis r4, 1525
3331 ; CHECK-P9-BE-NEXT: ori r4, r4, 56602
3332 ; CHECK-P9-BE-NEXT: lhzx r3, r3, r4
3333 ; CHECK-P9-BE-NEXT: blr
3335 ; CHECK-P8-LE-LABEL: ld_align32_uint16_t_uint32_t:
3336 ; CHECK-P8-LE: # %bb.0: # %entry
3337 ; CHECK-P8-LE-NEXT: lis r4, 1525
3338 ; CHECK-P8-LE-NEXT: ori r4, r4, 56600
3339 ; CHECK-P8-LE-NEXT: lhzx r3, r3, r4
3340 ; CHECK-P8-LE-NEXT: blr
3342 ; CHECK-P8-BE-LABEL: ld_align32_uint16_t_uint32_t:
3343 ; CHECK-P8-BE: # %bb.0: # %entry
3344 ; CHECK-P8-BE-NEXT: lis r4, 1525
3345 ; CHECK-P8-BE-NEXT: ori r4, r4, 56602
3346 ; CHECK-P8-BE-NEXT: lhzx r3, r3, r4
3347 ; CHECK-P8-BE-NEXT: blr
3349 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
3350 %0 = bitcast i8* %add.ptr to i32*
3351 %1 = load i32, i32* %0, align 4
3352 %conv = trunc i32 %1 to i16
3356 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3357 define dso_local zeroext i16 @ld_align64_uint16_t_uint32_t(i8* nocapture readonly %ptr) {
3358 ; CHECK-P10-LE-LABEL: ld_align64_uint16_t_uint32_t:
3359 ; CHECK-P10-LE: # %bb.0: # %entry
3360 ; CHECK-P10-LE-NEXT: pli r4, 244140625
3361 ; CHECK-P10-LE-NEXT: rldic r4, r4, 12, 24
3362 ; CHECK-P10-LE-NEXT: lhzx r3, r3, r4
3363 ; CHECK-P10-LE-NEXT: blr
3365 ; CHECK-P10-BE-LABEL: ld_align64_uint16_t_uint32_t:
3366 ; CHECK-P10-BE: # %bb.0: # %entry
3367 ; CHECK-P10-BE-NEXT: pli r4, 232
3368 ; CHECK-P10-BE-NEXT: pli r5, 3567587330
3369 ; CHECK-P10-BE-NEXT: rldimi r5, r4, 32, 0
3370 ; CHECK-P10-BE-NEXT: lhzx r3, r3, r5
3371 ; CHECK-P10-BE-NEXT: blr
3373 ; CHECK-P9-LE-LABEL: ld_align64_uint16_t_uint32_t:
3374 ; CHECK-P9-LE: # %bb.0: # %entry
3375 ; CHECK-P9-LE-NEXT: lis r4, 3725
3376 ; CHECK-P9-LE-NEXT: ori r4, r4, 19025
3377 ; CHECK-P9-LE-NEXT: rldic r4, r4, 12, 24
3378 ; CHECK-P9-LE-NEXT: lhzx r3, r3, r4
3379 ; CHECK-P9-LE-NEXT: blr
3381 ; CHECK-P9-BE-LABEL: ld_align64_uint16_t_uint32_t:
3382 ; CHECK-P9-BE: # %bb.0: # %entry
3383 ; CHECK-P9-BE-NEXT: li r4, 29
3384 ; CHECK-P9-BE-NEXT: rldic r4, r4, 35, 24
3385 ; CHECK-P9-BE-NEXT: oris r4, r4, 54437
3386 ; CHECK-P9-BE-NEXT: ori r4, r4, 4098
3387 ; CHECK-P9-BE-NEXT: lhzx r3, r3, r4
3388 ; CHECK-P9-BE-NEXT: blr
3390 ; CHECK-P8-LE-LABEL: ld_align64_uint16_t_uint32_t:
3391 ; CHECK-P8-LE: # %bb.0: # %entry
3392 ; CHECK-P8-LE-NEXT: lis r4, 3725
3393 ; CHECK-P8-LE-NEXT: ori r4, r4, 19025
3394 ; CHECK-P8-LE-NEXT: rldic r4, r4, 12, 24
3395 ; CHECK-P8-LE-NEXT: lhzx r3, r3, r4
3396 ; CHECK-P8-LE-NEXT: blr
3398 ; CHECK-P8-BE-LABEL: ld_align64_uint16_t_uint32_t:
3399 ; CHECK-P8-BE: # %bb.0: # %entry
3400 ; CHECK-P8-BE-NEXT: li r4, 29
3401 ; CHECK-P8-BE-NEXT: rldic r4, r4, 35, 24
3402 ; CHECK-P8-BE-NEXT: oris r4, r4, 54437
3403 ; CHECK-P8-BE-NEXT: ori r4, r4, 4098
3404 ; CHECK-P8-BE-NEXT: lhzx r3, r3, r4
3405 ; CHECK-P8-BE-NEXT: blr
3407 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
3408 %0 = bitcast i8* %add.ptr to i32*
3409 %1 = load i32, i32* %0, align 4
3410 %conv = trunc i32 %1 to i16
3414 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3415 define dso_local zeroext i16 @ld_reg_uint16_t_uint32_t(i8* nocapture readonly %ptr, i64 %off) {
3416 ; CHECK-LE-LABEL: ld_reg_uint16_t_uint32_t:
3417 ; CHECK-LE: # %bb.0: # %entry
3418 ; CHECK-LE-NEXT: lhzx r3, r3, r4
3419 ; CHECK-LE-NEXT: blr
3421 ; CHECK-BE-LABEL: ld_reg_uint16_t_uint32_t:
3422 ; CHECK-BE: # %bb.0: # %entry
3423 ; CHECK-BE-NEXT: add r3, r3, r4
3424 ; CHECK-BE-NEXT: lhz r3, 2(r3)
3425 ; CHECK-BE-NEXT: blr
3427 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
3428 %0 = bitcast i8* %add.ptr to i32*
3429 %1 = load i32, i32* %0, align 4
3430 %conv = trunc i32 %1 to i16
3434 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3435 define dso_local zeroext i16 @ld_or_uint16_t_uint32_t(i64 %ptr, i8 zeroext %off) {
3436 ; CHECK-LE-LABEL: ld_or_uint16_t_uint32_t:
3437 ; CHECK-LE: # %bb.0: # %entry
3438 ; CHECK-LE-NEXT: or r3, r4, r3
3439 ; CHECK-LE-NEXT: lhz r3, 0(r3)
3440 ; CHECK-LE-NEXT: blr
3442 ; CHECK-BE-LABEL: ld_or_uint16_t_uint32_t:
3443 ; CHECK-BE: # %bb.0: # %entry
3444 ; CHECK-BE-NEXT: or r3, r4, r3
3445 ; CHECK-BE-NEXT: lhz r3, 2(r3)
3446 ; CHECK-BE-NEXT: blr
3448 %conv = zext i8 %off to i64
3449 %or = or i64 %conv, %ptr
3450 %0 = inttoptr i64 %or to i32*
3451 %1 = load i32, i32* %0, align 4
3452 %conv1 = trunc i32 %1 to i16
3456 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3457 define dso_local zeroext i16 @ld_not_disjoint16_uint16_t_uint32_t(i64 %ptr) {
3458 ; CHECK-LE-LABEL: ld_not_disjoint16_uint16_t_uint32_t:
3459 ; CHECK-LE: # %bb.0: # %entry
3460 ; CHECK-LE-NEXT: ori r3, r3, 6
3461 ; CHECK-LE-NEXT: lhz r3, 0(r3)
3462 ; CHECK-LE-NEXT: blr
3464 ; CHECK-BE-LABEL: ld_not_disjoint16_uint16_t_uint32_t:
3465 ; CHECK-BE: # %bb.0: # %entry
3466 ; CHECK-BE-NEXT: ori r3, r3, 6
3467 ; CHECK-BE-NEXT: lhz r3, 2(r3)
3468 ; CHECK-BE-NEXT: blr
3470 %or = or i64 %ptr, 6
3471 %0 = inttoptr i64 %or to i32*
3472 %1 = load i32, i32* %0, align 4
3473 %conv = trunc i32 %1 to i16
3477 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3478 define dso_local zeroext i16 @ld_disjoint_align16_uint16_t_uint32_t(i64 %ptr) {
3479 ; CHECK-LE-LABEL: ld_disjoint_align16_uint16_t_uint32_t:
3480 ; CHECK-LE: # %bb.0: # %entry
3481 ; CHECK-LE-NEXT: rldicr r3, r3, 0, 51
3482 ; CHECK-LE-NEXT: lhz r3, 24(r3)
3483 ; CHECK-LE-NEXT: blr
3485 ; CHECK-BE-LABEL: ld_disjoint_align16_uint16_t_uint32_t:
3486 ; CHECK-BE: # %bb.0: # %entry
3487 ; CHECK-BE-NEXT: rldicr r3, r3, 0, 51
3488 ; CHECK-BE-NEXT: lhz r3, 26(r3)
3489 ; CHECK-BE-NEXT: blr
3491 %and = and i64 %ptr, -4096
3492 %or = or i64 %and, 24
3493 %0 = inttoptr i64 %or to i32*
3494 %1 = load i32, i32* %0, align 8
3495 %conv = trunc i32 %1 to i16
3499 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3500 define dso_local zeroext i16 @ld_not_disjoint32_uint16_t_uint32_t(i64 %ptr) {
3501 ; CHECK-LE-LABEL: ld_not_disjoint32_uint16_t_uint32_t:
3502 ; CHECK-LE: # %bb.0: # %entry
3503 ; CHECK-LE-NEXT: ori r3, r3, 34463
3504 ; CHECK-LE-NEXT: oris r3, r3, 1
3505 ; CHECK-LE-NEXT: lhz r3, 0(r3)
3506 ; CHECK-LE-NEXT: blr
3508 ; CHECK-BE-LABEL: ld_not_disjoint32_uint16_t_uint32_t:
3509 ; CHECK-BE: # %bb.0: # %entry
3510 ; CHECK-BE-NEXT: ori r3, r3, 34463
3511 ; CHECK-BE-NEXT: oris r3, r3, 1
3512 ; CHECK-BE-NEXT: lhz r3, 2(r3)
3513 ; CHECK-BE-NEXT: blr
3515 %or = or i64 %ptr, 99999
3516 %0 = inttoptr i64 %or to i32*
3517 %1 = load i32, i32* %0, align 4
3518 %conv = trunc i32 %1 to i16
3522 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3523 define dso_local zeroext i16 @ld_disjoint_align32_uint16_t_uint32_t(i64 %ptr) {
3524 ; CHECK-P10-LE-LABEL: ld_disjoint_align32_uint16_t_uint32_t:
3525 ; CHECK-P10-LE: # %bb.0: # %entry
3526 ; CHECK-P10-LE-NEXT: lis r4, -15264
3527 ; CHECK-P10-LE-NEXT: and r3, r3, r4
3528 ; CHECK-P10-LE-NEXT: pli r4, 999990000
3529 ; CHECK-P10-LE-NEXT: lhzx r3, r3, r4
3530 ; CHECK-P10-LE-NEXT: blr
3532 ; CHECK-P10-BE-LABEL: ld_disjoint_align32_uint16_t_uint32_t:
3533 ; CHECK-P10-BE: # %bb.0: # %entry
3534 ; CHECK-P10-BE-NEXT: lis r4, -15264
3535 ; CHECK-P10-BE-NEXT: and r3, r3, r4
3536 ; CHECK-P10-BE-NEXT: pli r4, 999990002
3537 ; CHECK-P10-BE-NEXT: lhzx r3, r3, r4
3538 ; CHECK-P10-BE-NEXT: blr
3540 ; CHECK-P9-LE-LABEL: ld_disjoint_align32_uint16_t_uint32_t:
3541 ; CHECK-P9-LE: # %bb.0: # %entry
3542 ; CHECK-P9-LE-NEXT: lis r4, -15264
3543 ; CHECK-P9-LE-NEXT: and r3, r3, r4
3544 ; CHECK-P9-LE-NEXT: lis r4, 15258
3545 ; CHECK-P9-LE-NEXT: ori r4, r4, 41712
3546 ; CHECK-P9-LE-NEXT: lhzx r3, r3, r4
3547 ; CHECK-P9-LE-NEXT: blr
3549 ; CHECK-P9-BE-LABEL: ld_disjoint_align32_uint16_t_uint32_t:
3550 ; CHECK-P9-BE: # %bb.0: # %entry
3551 ; CHECK-P9-BE-NEXT: lis r4, -15264
3552 ; CHECK-P9-BE-NEXT: and r3, r3, r4
3553 ; CHECK-P9-BE-NEXT: lis r4, 15258
3554 ; CHECK-P9-BE-NEXT: ori r4, r4, 41714
3555 ; CHECK-P9-BE-NEXT: lhzx r3, r3, r4
3556 ; CHECK-P9-BE-NEXT: blr
3558 ; CHECK-P8-LE-LABEL: ld_disjoint_align32_uint16_t_uint32_t:
3559 ; CHECK-P8-LE: # %bb.0: # %entry
3560 ; CHECK-P8-LE-NEXT: lis r4, -15264
3561 ; CHECK-P8-LE-NEXT: lis r5, 15258
3562 ; CHECK-P8-LE-NEXT: and r3, r3, r4
3563 ; CHECK-P8-LE-NEXT: ori r4, r5, 41712
3564 ; CHECK-P8-LE-NEXT: lhzx r3, r3, r4
3565 ; CHECK-P8-LE-NEXT: blr
3567 ; CHECK-P8-BE-LABEL: ld_disjoint_align32_uint16_t_uint32_t:
3568 ; CHECK-P8-BE: # %bb.0: # %entry
3569 ; CHECK-P8-BE-NEXT: lis r4, -15264
3570 ; CHECK-P8-BE-NEXT: lis r5, 15258
3571 ; CHECK-P8-BE-NEXT: and r3, r3, r4
3572 ; CHECK-P8-BE-NEXT: ori r4, r5, 41714
3573 ; CHECK-P8-BE-NEXT: lhzx r3, r3, r4
3574 ; CHECK-P8-BE-NEXT: blr
3576 %and = and i64 %ptr, -1000341504
3577 %or = or i64 %and, 999990000
3578 %0 = inttoptr i64 %or to i32*
3579 %1 = load i32, i32* %0, align 16
3580 %conv = trunc i32 %1 to i16
3584 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3585 define dso_local zeroext i16 @ld_not_disjoint64_uint16_t_uint32_t(i64 %ptr) {
3586 ; CHECK-P10-LE-LABEL: ld_not_disjoint64_uint16_t_uint32_t:
3587 ; CHECK-P10-LE: # %bb.0: # %entry
3588 ; CHECK-P10-LE-NEXT: pli r4, 232
3589 ; CHECK-P10-LE-NEXT: pli r5, 3567587329
3590 ; CHECK-P10-LE-NEXT: rldimi r5, r4, 32, 0
3591 ; CHECK-P10-LE-NEXT: or r3, r3, r5
3592 ; CHECK-P10-LE-NEXT: lhz r3, 0(r3)
3593 ; CHECK-P10-LE-NEXT: blr
3595 ; CHECK-P10-BE-LABEL: ld_not_disjoint64_uint16_t_uint32_t:
3596 ; CHECK-P10-BE: # %bb.0: # %entry
3597 ; CHECK-P10-BE-NEXT: pli r4, 232
3598 ; CHECK-P10-BE-NEXT: pli r5, 3567587329
3599 ; CHECK-P10-BE-NEXT: rldimi r5, r4, 32, 0
3600 ; CHECK-P10-BE-NEXT: or r3, r3, r5
3601 ; CHECK-P10-BE-NEXT: lhz r3, 2(r3)
3602 ; CHECK-P10-BE-NEXT: blr
3604 ; CHECK-P9-LE-LABEL: ld_not_disjoint64_uint16_t_uint32_t:
3605 ; CHECK-P9-LE: # %bb.0: # %entry
3606 ; CHECK-P9-LE-NEXT: li r4, 29
3607 ; CHECK-P9-LE-NEXT: rldic r4, r4, 35, 24
3608 ; CHECK-P9-LE-NEXT: oris r4, r4, 54437
3609 ; CHECK-P9-LE-NEXT: ori r4, r4, 4097
3610 ; CHECK-P9-LE-NEXT: or r3, r3, r4
3611 ; CHECK-P9-LE-NEXT: lhz r3, 0(r3)
3612 ; CHECK-P9-LE-NEXT: blr
3614 ; CHECK-P9-BE-LABEL: ld_not_disjoint64_uint16_t_uint32_t:
3615 ; CHECK-P9-BE: # %bb.0: # %entry
3616 ; CHECK-P9-BE-NEXT: li r4, 29
3617 ; CHECK-P9-BE-NEXT: rldic r4, r4, 35, 24
3618 ; CHECK-P9-BE-NEXT: oris r4, r4, 54437
3619 ; CHECK-P9-BE-NEXT: ori r4, r4, 4097
3620 ; CHECK-P9-BE-NEXT: or r3, r3, r4
3621 ; CHECK-P9-BE-NEXT: lhz r3, 2(r3)
3622 ; CHECK-P9-BE-NEXT: blr
3624 ; CHECK-P8-LE-LABEL: ld_not_disjoint64_uint16_t_uint32_t:
3625 ; CHECK-P8-LE: # %bb.0: # %entry
3626 ; CHECK-P8-LE-NEXT: li r4, 29
3627 ; CHECK-P8-LE-NEXT: rldic r4, r4, 35, 24
3628 ; CHECK-P8-LE-NEXT: oris r4, r4, 54437
3629 ; CHECK-P8-LE-NEXT: ori r4, r4, 4097
3630 ; CHECK-P8-LE-NEXT: or r3, r3, r4
3631 ; CHECK-P8-LE-NEXT: lhz r3, 0(r3)
3632 ; CHECK-P8-LE-NEXT: blr
3634 ; CHECK-P8-BE-LABEL: ld_not_disjoint64_uint16_t_uint32_t:
3635 ; CHECK-P8-BE: # %bb.0: # %entry
3636 ; CHECK-P8-BE-NEXT: li r4, 29
3637 ; CHECK-P8-BE-NEXT: rldic r4, r4, 35, 24
3638 ; CHECK-P8-BE-NEXT: oris r4, r4, 54437
3639 ; CHECK-P8-BE-NEXT: ori r4, r4, 4097
3640 ; CHECK-P8-BE-NEXT: or r3, r3, r4
3641 ; CHECK-P8-BE-NEXT: lhz r3, 2(r3)
3642 ; CHECK-P8-BE-NEXT: blr
3644 %or = or i64 %ptr, 1000000000001
3645 %0 = inttoptr i64 %or to i32*
3646 %1 = load i32, i32* %0, align 4
3647 %conv = trunc i32 %1 to i16
3651 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3652 define dso_local zeroext i16 @ld_disjoint_align64_uint16_t_uint32_t(i64 %ptr) {
3653 ; CHECK-P10-LE-LABEL: ld_disjoint_align64_uint16_t_uint32_t:
3654 ; CHECK-P10-LE: # %bb.0: # %entry
3655 ; CHECK-P10-LE-NEXT: pli r4, 244140625
3656 ; CHECK-P10-LE-NEXT: rldicr r3, r3, 0, 23
3657 ; CHECK-P10-LE-NEXT: rldic r4, r4, 12, 24
3658 ; CHECK-P10-LE-NEXT: lhzx r3, r3, r4
3659 ; CHECK-P10-LE-NEXT: blr
3661 ; CHECK-P10-BE-LABEL: ld_disjoint_align64_uint16_t_uint32_t:
3662 ; CHECK-P10-BE: # %bb.0: # %entry
3663 ; CHECK-P10-BE-NEXT: pli r4, 232
3664 ; CHECK-P10-BE-NEXT: pli r5, 3567587330
3665 ; CHECK-P10-BE-NEXT: rldicr r3, r3, 0, 23
3666 ; CHECK-P10-BE-NEXT: rldimi r5, r4, 32, 0
3667 ; CHECK-P10-BE-NEXT: lhzx r3, r3, r5
3668 ; CHECK-P10-BE-NEXT: blr
3670 ; CHECK-P9-LE-LABEL: ld_disjoint_align64_uint16_t_uint32_t:
3671 ; CHECK-P9-LE: # %bb.0: # %entry
3672 ; CHECK-P9-LE-NEXT: lis r4, 3725
3673 ; CHECK-P9-LE-NEXT: rldicr r3, r3, 0, 23
3674 ; CHECK-P9-LE-NEXT: ori r4, r4, 19025
3675 ; CHECK-P9-LE-NEXT: rldic r4, r4, 12, 24
3676 ; CHECK-P9-LE-NEXT: lhzx r3, r3, r4
3677 ; CHECK-P9-LE-NEXT: blr
3679 ; CHECK-P9-BE-LABEL: ld_disjoint_align64_uint16_t_uint32_t:
3680 ; CHECK-P9-BE: # %bb.0: # %entry
3681 ; CHECK-P9-BE-NEXT: li r4, 29
3682 ; CHECK-P9-BE-NEXT: rldicr r3, r3, 0, 23
3683 ; CHECK-P9-BE-NEXT: rldic r4, r4, 35, 24
3684 ; CHECK-P9-BE-NEXT: oris r4, r4, 54437
3685 ; CHECK-P9-BE-NEXT: ori r4, r4, 4098
3686 ; CHECK-P9-BE-NEXT: lhzx r3, r3, r4
3687 ; CHECK-P9-BE-NEXT: blr
3689 ; CHECK-P8-LE-LABEL: ld_disjoint_align64_uint16_t_uint32_t:
3690 ; CHECK-P8-LE: # %bb.0: # %entry
3691 ; CHECK-P8-LE-NEXT: lis r4, 3725
3692 ; CHECK-P8-LE-NEXT: rldicr r3, r3, 0, 23
3693 ; CHECK-P8-LE-NEXT: ori r4, r4, 19025
3694 ; CHECK-P8-LE-NEXT: rldic r4, r4, 12, 24
3695 ; CHECK-P8-LE-NEXT: lhzx r3, r3, r4
3696 ; CHECK-P8-LE-NEXT: blr
3698 ; CHECK-P8-BE-LABEL: ld_disjoint_align64_uint16_t_uint32_t:
3699 ; CHECK-P8-BE: # %bb.0: # %entry
3700 ; CHECK-P8-BE-NEXT: li r4, 29
3701 ; CHECK-P8-BE-NEXT: rldicr r3, r3, 0, 23
3702 ; CHECK-P8-BE-NEXT: rldic r4, r4, 35, 24
3703 ; CHECK-P8-BE-NEXT: oris r4, r4, 54437
3704 ; CHECK-P8-BE-NEXT: ori r4, r4, 4098
3705 ; CHECK-P8-BE-NEXT: lhzx r3, r3, r4
3706 ; CHECK-P8-BE-NEXT: blr
3708 %and = and i64 %ptr, -1099511627776
3709 %or = or i64 %and, 1000000000000
3710 %0 = inttoptr i64 %or to i32*
3711 %1 = load i32, i32* %0, align 4096
3712 %conv = trunc i32 %1 to i16
3716 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3717 define dso_local zeroext i16 @ld_cst_align16_uint16_t_uint32_t() {
3718 ; CHECK-LE-LABEL: ld_cst_align16_uint16_t_uint32_t:
3719 ; CHECK-LE: # %bb.0: # %entry
3720 ; CHECK-LE-NEXT: lhz r3, 4080(0)
3721 ; CHECK-LE-NEXT: blr
3723 ; CHECK-BE-LABEL: ld_cst_align16_uint16_t_uint32_t:
3724 ; CHECK-BE: # %bb.0: # %entry
3725 ; CHECK-BE-NEXT: lhz r3, 4082(0)
3726 ; CHECK-BE-NEXT: blr
3728 %0 = load i32, i32* inttoptr (i64 4080 to i32*), align 16
3729 %conv = trunc i32 %0 to i16
3733 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3734 define dso_local zeroext i16 @ld_cst_align32_uint16_t_uint32_t() {
3735 ; CHECK-LE-LABEL: ld_cst_align32_uint16_t_uint32_t:
3736 ; CHECK-LE: # %bb.0: # %entry
3737 ; CHECK-LE-NEXT: lis r3, 153
3738 ; CHECK-LE-NEXT: lhz r3, -27108(r3)
3739 ; CHECK-LE-NEXT: blr
3741 ; CHECK-BE-LABEL: ld_cst_align32_uint16_t_uint32_t:
3742 ; CHECK-BE: # %bb.0: # %entry
3743 ; CHECK-BE-NEXT: lis r3, 153
3744 ; CHECK-BE-NEXT: lhz r3, -27106(r3)
3745 ; CHECK-BE-NEXT: blr
3747 %0 = load i32, i32* inttoptr (i64 9999900 to i32*), align 4
3748 %conv = trunc i32 %0 to i16
3752 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3753 define dso_local zeroext i16 @ld_cst_align64_uint16_t_uint32_t() {
3754 ; CHECK-P10-LE-LABEL: ld_cst_align64_uint16_t_uint32_t:
3755 ; CHECK-P10-LE: # %bb.0: # %entry
3756 ; CHECK-P10-LE-NEXT: pli r3, 244140625
3757 ; CHECK-P10-LE-NEXT: rldic r3, r3, 12, 24
3758 ; CHECK-P10-LE-NEXT: lhz r3, 0(r3)
3759 ; CHECK-P10-LE-NEXT: blr
3761 ; CHECK-P10-BE-LABEL: ld_cst_align64_uint16_t_uint32_t:
3762 ; CHECK-P10-BE: # %bb.0: # %entry
3763 ; CHECK-P10-BE-NEXT: pli r3, 232
3764 ; CHECK-P10-BE-NEXT: pli r4, 3567587330
3765 ; CHECK-P10-BE-NEXT: rldimi r4, r3, 32, 0
3766 ; CHECK-P10-BE-NEXT: lhz r3, 0(r4)
3767 ; CHECK-P10-BE-NEXT: blr
3769 ; CHECK-P9-LE-LABEL: ld_cst_align64_uint16_t_uint32_t:
3770 ; CHECK-P9-LE: # %bb.0: # %entry
3771 ; CHECK-P9-LE-NEXT: lis r3, 3725
3772 ; CHECK-P9-LE-NEXT: ori r3, r3, 19025
3773 ; CHECK-P9-LE-NEXT: rldic r3, r3, 12, 24
3774 ; CHECK-P9-LE-NEXT: lhz r3, 0(r3)
3775 ; CHECK-P9-LE-NEXT: blr
3777 ; CHECK-P9-BE-LABEL: ld_cst_align64_uint16_t_uint32_t:
3778 ; CHECK-P9-BE: # %bb.0: # %entry
3779 ; CHECK-P9-BE-NEXT: li r3, 29
3780 ; CHECK-P9-BE-NEXT: rldic r3, r3, 35, 24
3781 ; CHECK-P9-BE-NEXT: oris r3, r3, 54437
3782 ; CHECK-P9-BE-NEXT: ori r3, r3, 4098
3783 ; CHECK-P9-BE-NEXT: lhz r3, 0(r3)
3784 ; CHECK-P9-BE-NEXT: blr
3786 ; CHECK-P8-LE-LABEL: ld_cst_align64_uint16_t_uint32_t:
3787 ; CHECK-P8-LE: # %bb.0: # %entry
3788 ; CHECK-P8-LE-NEXT: lis r3, 3725
3789 ; CHECK-P8-LE-NEXT: ori r3, r3, 19025
3790 ; CHECK-P8-LE-NEXT: rldic r3, r3, 12, 24
3791 ; CHECK-P8-LE-NEXT: lhz r3, 0(r3)
3792 ; CHECK-P8-LE-NEXT: blr
3794 ; CHECK-P8-BE-LABEL: ld_cst_align64_uint16_t_uint32_t:
3795 ; CHECK-P8-BE: # %bb.0: # %entry
3796 ; CHECK-P8-BE-NEXT: li r3, 29
3797 ; CHECK-P8-BE-NEXT: rldic r3, r3, 35, 24
3798 ; CHECK-P8-BE-NEXT: oris r3, r3, 54437
3799 ; CHECK-P8-BE-NEXT: ori r3, r3, 4098
3800 ; CHECK-P8-BE-NEXT: lhz r3, 0(r3)
3801 ; CHECK-P8-BE-NEXT: blr
3803 %0 = load i32, i32* inttoptr (i64 1000000000000 to i32*), align 4096
3804 %conv = trunc i32 %0 to i16
3808 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3809 define dso_local zeroext i16 @ld_0_uint16_t_uint64_t(i64 %ptr) {
3810 ; CHECK-LE-LABEL: ld_0_uint16_t_uint64_t:
3811 ; CHECK-LE: # %bb.0: # %entry
3812 ; CHECK-LE-NEXT: lhz r3, 0(r3)
3813 ; CHECK-LE-NEXT: blr
3815 ; CHECK-BE-LABEL: ld_0_uint16_t_uint64_t:
3816 ; CHECK-BE: # %bb.0: # %entry
3817 ; CHECK-BE-NEXT: lhz r3, 6(r3)
3818 ; CHECK-BE-NEXT: blr
3820 %0 = inttoptr i64 %ptr to i64*
3821 %1 = load i64, i64* %0, align 8
3822 %conv = trunc i64 %1 to i16
3826 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3827 define dso_local zeroext i16 @ld_align16_uint16_t_uint64_t(i8* nocapture readonly %ptr) {
3828 ; CHECK-LE-LABEL: ld_align16_uint16_t_uint64_t:
3829 ; CHECK-LE: # %bb.0: # %entry
3830 ; CHECK-LE-NEXT: lhz r3, 8(r3)
3831 ; CHECK-LE-NEXT: blr
3833 ; CHECK-BE-LABEL: ld_align16_uint16_t_uint64_t:
3834 ; CHECK-BE: # %bb.0: # %entry
3835 ; CHECK-BE-NEXT: lhz r3, 14(r3)
3836 ; CHECK-BE-NEXT: blr
3838 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
3839 %0 = bitcast i8* %add.ptr to i64*
3840 %1 = load i64, i64* %0, align 8
3841 %conv = trunc i64 %1 to i16
3845 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3846 define dso_local zeroext i16 @ld_align32_uint16_t_uint64_t(i8* nocapture readonly %ptr) {
3847 ; CHECK-P10-LE-LABEL: ld_align32_uint16_t_uint64_t:
3848 ; CHECK-P10-LE: # %bb.0: # %entry
3849 ; CHECK-P10-LE-NEXT: pli r4, 99999000
3850 ; CHECK-P10-LE-NEXT: lhzx r3, r3, r4
3851 ; CHECK-P10-LE-NEXT: blr
3853 ; CHECK-P10-BE-LABEL: ld_align32_uint16_t_uint64_t:
3854 ; CHECK-P10-BE: # %bb.0: # %entry
3855 ; CHECK-P10-BE-NEXT: pli r4, 99999006
3856 ; CHECK-P10-BE-NEXT: lhzx r3, r3, r4
3857 ; CHECK-P10-BE-NEXT: blr
3859 ; CHECK-P9-LE-LABEL: ld_align32_uint16_t_uint64_t:
3860 ; CHECK-P9-LE: # %bb.0: # %entry
3861 ; CHECK-P9-LE-NEXT: lis r4, 1525
3862 ; CHECK-P9-LE-NEXT: ori r4, r4, 56600
3863 ; CHECK-P9-LE-NEXT: lhzx r3, r3, r4
3864 ; CHECK-P9-LE-NEXT: blr
3866 ; CHECK-P9-BE-LABEL: ld_align32_uint16_t_uint64_t:
3867 ; CHECK-P9-BE: # %bb.0: # %entry
3868 ; CHECK-P9-BE-NEXT: lis r4, 1525
3869 ; CHECK-P9-BE-NEXT: ori r4, r4, 56606
3870 ; CHECK-P9-BE-NEXT: lhzx r3, r3, r4
3871 ; CHECK-P9-BE-NEXT: blr
3873 ; CHECK-P8-LE-LABEL: ld_align32_uint16_t_uint64_t:
3874 ; CHECK-P8-LE: # %bb.0: # %entry
3875 ; CHECK-P8-LE-NEXT: lis r4, 1525
3876 ; CHECK-P8-LE-NEXT: ori r4, r4, 56600
3877 ; CHECK-P8-LE-NEXT: lhzx r3, r3, r4
3878 ; CHECK-P8-LE-NEXT: blr
3880 ; CHECK-P8-BE-LABEL: ld_align32_uint16_t_uint64_t:
3881 ; CHECK-P8-BE: # %bb.0: # %entry
3882 ; CHECK-P8-BE-NEXT: lis r4, 1525
3883 ; CHECK-P8-BE-NEXT: ori r4, r4, 56606
3884 ; CHECK-P8-BE-NEXT: lhzx r3, r3, r4
3885 ; CHECK-P8-BE-NEXT: blr
3887 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
3888 %0 = bitcast i8* %add.ptr to i64*
3889 %1 = load i64, i64* %0, align 8
3890 %conv = trunc i64 %1 to i16
3894 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3895 define dso_local zeroext i16 @ld_align64_uint16_t_uint64_t(i8* nocapture readonly %ptr) {
3896 ; CHECK-P10-LE-LABEL: ld_align64_uint16_t_uint64_t:
3897 ; CHECK-P10-LE: # %bb.0: # %entry
3898 ; CHECK-P10-LE-NEXT: pli r4, 244140625
3899 ; CHECK-P10-LE-NEXT: rldic r4, r4, 12, 24
3900 ; CHECK-P10-LE-NEXT: lhzx r3, r3, r4
3901 ; CHECK-P10-LE-NEXT: blr
3903 ; CHECK-P10-BE-LABEL: ld_align64_uint16_t_uint64_t:
3904 ; CHECK-P10-BE: # %bb.0: # %entry
3905 ; CHECK-P10-BE-NEXT: pli r4, 232
3906 ; CHECK-P10-BE-NEXT: pli r5, 3567587334
3907 ; CHECK-P10-BE-NEXT: rldimi r5, r4, 32, 0
3908 ; CHECK-P10-BE-NEXT: lhzx r3, r3, r5
3909 ; CHECK-P10-BE-NEXT: blr
3911 ; CHECK-P9-LE-LABEL: ld_align64_uint16_t_uint64_t:
3912 ; CHECK-P9-LE: # %bb.0: # %entry
3913 ; CHECK-P9-LE-NEXT: lis r4, 3725
3914 ; CHECK-P9-LE-NEXT: ori r4, r4, 19025
3915 ; CHECK-P9-LE-NEXT: rldic r4, r4, 12, 24
3916 ; CHECK-P9-LE-NEXT: lhzx r3, r3, r4
3917 ; CHECK-P9-LE-NEXT: blr
3919 ; CHECK-P9-BE-LABEL: ld_align64_uint16_t_uint64_t:
3920 ; CHECK-P9-BE: # %bb.0: # %entry
3921 ; CHECK-P9-BE-NEXT: li r4, 29
3922 ; CHECK-P9-BE-NEXT: rldic r4, r4, 35, 24
3923 ; CHECK-P9-BE-NEXT: oris r4, r4, 54437
3924 ; CHECK-P9-BE-NEXT: ori r4, r4, 4102
3925 ; CHECK-P9-BE-NEXT: lhzx r3, r3, r4
3926 ; CHECK-P9-BE-NEXT: blr
3928 ; CHECK-P8-LE-LABEL: ld_align64_uint16_t_uint64_t:
3929 ; CHECK-P8-LE: # %bb.0: # %entry
3930 ; CHECK-P8-LE-NEXT: lis r4, 3725
3931 ; CHECK-P8-LE-NEXT: ori r4, r4, 19025
3932 ; CHECK-P8-LE-NEXT: rldic r4, r4, 12, 24
3933 ; CHECK-P8-LE-NEXT: lhzx r3, r3, r4
3934 ; CHECK-P8-LE-NEXT: blr
3936 ; CHECK-P8-BE-LABEL: ld_align64_uint16_t_uint64_t:
3937 ; CHECK-P8-BE: # %bb.0: # %entry
3938 ; CHECK-P8-BE-NEXT: li r4, 29
3939 ; CHECK-P8-BE-NEXT: rldic r4, r4, 35, 24
3940 ; CHECK-P8-BE-NEXT: oris r4, r4, 54437
3941 ; CHECK-P8-BE-NEXT: ori r4, r4, 4102
3942 ; CHECK-P8-BE-NEXT: lhzx r3, r3, r4
3943 ; CHECK-P8-BE-NEXT: blr
3945 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
3946 %0 = bitcast i8* %add.ptr to i64*
3947 %1 = load i64, i64* %0, align 8
3948 %conv = trunc i64 %1 to i16
3952 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3953 define dso_local zeroext i16 @ld_reg_uint16_t_uint64_t(i8* nocapture readonly %ptr, i64 %off) {
3954 ; CHECK-LE-LABEL: ld_reg_uint16_t_uint64_t:
3955 ; CHECK-LE: # %bb.0: # %entry
3956 ; CHECK-LE-NEXT: lhzx r3, r3, r4
3957 ; CHECK-LE-NEXT: blr
3959 ; CHECK-BE-LABEL: ld_reg_uint16_t_uint64_t:
3960 ; CHECK-BE: # %bb.0: # %entry
3961 ; CHECK-BE-NEXT: add r3, r3, r4
3962 ; CHECK-BE-NEXT: lhz r3, 6(r3)
3963 ; CHECK-BE-NEXT: blr
3965 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
3966 %0 = bitcast i8* %add.ptr to i64*
3967 %1 = load i64, i64* %0, align 8
3968 %conv = trunc i64 %1 to i16
3972 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3973 define dso_local zeroext i16 @ld_or_uint16_t_uint64_t(i64 %ptr, i8 zeroext %off) {
3974 ; CHECK-LE-LABEL: ld_or_uint16_t_uint64_t:
3975 ; CHECK-LE: # %bb.0: # %entry
3976 ; CHECK-LE-NEXT: or r3, r4, r3
3977 ; CHECK-LE-NEXT: lhz r3, 0(r3)
3978 ; CHECK-LE-NEXT: blr
3980 ; CHECK-BE-LABEL: ld_or_uint16_t_uint64_t:
3981 ; CHECK-BE: # %bb.0: # %entry
3982 ; CHECK-BE-NEXT: or r3, r4, r3
3983 ; CHECK-BE-NEXT: lhz r3, 6(r3)
3984 ; CHECK-BE-NEXT: blr
3986 %conv = zext i8 %off to i64
3987 %or = or i64 %conv, %ptr
3988 %0 = inttoptr i64 %or to i64*
3989 %1 = load i64, i64* %0, align 8
3990 %conv1 = trunc i64 %1 to i16
3994 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
3995 define dso_local zeroext i16 @ld_not_disjoint16_uint16_t_uint64_t(i64 %ptr) {
3996 ; CHECK-LE-LABEL: ld_not_disjoint16_uint16_t_uint64_t:
3997 ; CHECK-LE: # %bb.0: # %entry
3998 ; CHECK-LE-NEXT: ori r3, r3, 6
3999 ; CHECK-LE-NEXT: lhz r3, 0(r3)
4000 ; CHECK-LE-NEXT: blr
4002 ; CHECK-BE-LABEL: ld_not_disjoint16_uint16_t_uint64_t:
4003 ; CHECK-BE: # %bb.0: # %entry
4004 ; CHECK-BE-NEXT: ori r3, r3, 6
4005 ; CHECK-BE-NEXT: lhz r3, 6(r3)
4006 ; CHECK-BE-NEXT: blr
4008 %or = or i64 %ptr, 6
4009 %0 = inttoptr i64 %or to i64*
4010 %1 = load i64, i64* %0, align 8
4011 %conv = trunc i64 %1 to i16
4015 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4016 define dso_local zeroext i16 @ld_disjoint_align16_uint16_t_uint64_t(i64 %ptr) {
4017 ; CHECK-LE-LABEL: ld_disjoint_align16_uint16_t_uint64_t:
4018 ; CHECK-LE: # %bb.0: # %entry
4019 ; CHECK-LE-NEXT: rldicr r3, r3, 0, 51
4020 ; CHECK-LE-NEXT: lhz r3, 24(r3)
4021 ; CHECK-LE-NEXT: blr
4023 ; CHECK-BE-LABEL: ld_disjoint_align16_uint16_t_uint64_t:
4024 ; CHECK-BE: # %bb.0: # %entry
4025 ; CHECK-BE-NEXT: rldicr r3, r3, 0, 51
4026 ; CHECK-BE-NEXT: lhz r3, 30(r3)
4027 ; CHECK-BE-NEXT: blr
4029 %and = and i64 %ptr, -4096
4030 %or = or i64 %and, 24
4031 %0 = inttoptr i64 %or to i64*
4032 %1 = load i64, i64* %0, align 8
4033 %conv = trunc i64 %1 to i16
4037 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4038 define dso_local zeroext i16 @ld_not_disjoint32_uint16_t_uint64_t(i64 %ptr) {
4039 ; CHECK-LE-LABEL: ld_not_disjoint32_uint16_t_uint64_t:
4040 ; CHECK-LE: # %bb.0: # %entry
4041 ; CHECK-LE-NEXT: ori r3, r3, 34463
4042 ; CHECK-LE-NEXT: oris r3, r3, 1
4043 ; CHECK-LE-NEXT: lhz r3, 0(r3)
4044 ; CHECK-LE-NEXT: blr
4046 ; CHECK-BE-LABEL: ld_not_disjoint32_uint16_t_uint64_t:
4047 ; CHECK-BE: # %bb.0: # %entry
4048 ; CHECK-BE-NEXT: ori r3, r3, 34463
4049 ; CHECK-BE-NEXT: oris r3, r3, 1
4050 ; CHECK-BE-NEXT: lhz r3, 6(r3)
4051 ; CHECK-BE-NEXT: blr
4053 %or = or i64 %ptr, 99999
4054 %0 = inttoptr i64 %or to i64*
4055 %1 = load i64, i64* %0, align 8
4056 %conv = trunc i64 %1 to i16
4060 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4061 define dso_local zeroext i16 @ld_disjoint_align32_uint16_t_uint64_t(i64 %ptr) {
4062 ; CHECK-P10-LE-LABEL: ld_disjoint_align32_uint16_t_uint64_t:
4063 ; CHECK-P10-LE: # %bb.0: # %entry
4064 ; CHECK-P10-LE-NEXT: lis r4, -15264
4065 ; CHECK-P10-LE-NEXT: and r3, r3, r4
4066 ; CHECK-P10-LE-NEXT: pli r4, 999990000
4067 ; CHECK-P10-LE-NEXT: lhzx r3, r3, r4
4068 ; CHECK-P10-LE-NEXT: blr
4070 ; CHECK-P10-BE-LABEL: ld_disjoint_align32_uint16_t_uint64_t:
4071 ; CHECK-P10-BE: # %bb.0: # %entry
4072 ; CHECK-P10-BE-NEXT: lis r4, -15264
4073 ; CHECK-P10-BE-NEXT: and r3, r3, r4
4074 ; CHECK-P10-BE-NEXT: pli r4, 999990006
4075 ; CHECK-P10-BE-NEXT: lhzx r3, r3, r4
4076 ; CHECK-P10-BE-NEXT: blr
4078 ; CHECK-P9-LE-LABEL: ld_disjoint_align32_uint16_t_uint64_t:
4079 ; CHECK-P9-LE: # %bb.0: # %entry
4080 ; CHECK-P9-LE-NEXT: lis r4, -15264
4081 ; CHECK-P9-LE-NEXT: and r3, r3, r4
4082 ; CHECK-P9-LE-NEXT: lis r4, 15258
4083 ; CHECK-P9-LE-NEXT: ori r4, r4, 41712
4084 ; CHECK-P9-LE-NEXT: lhzx r3, r3, r4
4085 ; CHECK-P9-LE-NEXT: blr
4087 ; CHECK-P9-BE-LABEL: ld_disjoint_align32_uint16_t_uint64_t:
4088 ; CHECK-P9-BE: # %bb.0: # %entry
4089 ; CHECK-P9-BE-NEXT: lis r4, -15264
4090 ; CHECK-P9-BE-NEXT: and r3, r3, r4
4091 ; CHECK-P9-BE-NEXT: lis r4, 15258
4092 ; CHECK-P9-BE-NEXT: ori r4, r4, 41718
4093 ; CHECK-P9-BE-NEXT: lhzx r3, r3, r4
4094 ; CHECK-P9-BE-NEXT: blr
4096 ; CHECK-P8-LE-LABEL: ld_disjoint_align32_uint16_t_uint64_t:
4097 ; CHECK-P8-LE: # %bb.0: # %entry
4098 ; CHECK-P8-LE-NEXT: lis r4, -15264
4099 ; CHECK-P8-LE-NEXT: lis r5, 15258
4100 ; CHECK-P8-LE-NEXT: and r3, r3, r4
4101 ; CHECK-P8-LE-NEXT: ori r4, r5, 41712
4102 ; CHECK-P8-LE-NEXT: lhzx r3, r3, r4
4103 ; CHECK-P8-LE-NEXT: blr
4105 ; CHECK-P8-BE-LABEL: ld_disjoint_align32_uint16_t_uint64_t:
4106 ; CHECK-P8-BE: # %bb.0: # %entry
4107 ; CHECK-P8-BE-NEXT: lis r4, -15264
4108 ; CHECK-P8-BE-NEXT: lis r5, 15258
4109 ; CHECK-P8-BE-NEXT: and r3, r3, r4
4110 ; CHECK-P8-BE-NEXT: ori r4, r5, 41718
4111 ; CHECK-P8-BE-NEXT: lhzx r3, r3, r4
4112 ; CHECK-P8-BE-NEXT: blr
4114 %and = and i64 %ptr, -1000341504
4115 %or = or i64 %and, 999990000
4116 %0 = inttoptr i64 %or to i64*
4117 %1 = load i64, i64* %0, align 16
4118 %conv = trunc i64 %1 to i16
4122 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4123 define dso_local zeroext i16 @ld_not_disjoint64_uint16_t_uint64_t(i64 %ptr) {
4124 ; CHECK-P10-LE-LABEL: ld_not_disjoint64_uint16_t_uint64_t:
4125 ; CHECK-P10-LE: # %bb.0: # %entry
4126 ; CHECK-P10-LE-NEXT: pli r4, 232
4127 ; CHECK-P10-LE-NEXT: pli r5, 3567587329
4128 ; CHECK-P10-LE-NEXT: rldimi r5, r4, 32, 0
4129 ; CHECK-P10-LE-NEXT: or r3, r3, r5
4130 ; CHECK-P10-LE-NEXT: lhz r3, 0(r3)
4131 ; CHECK-P10-LE-NEXT: blr
4133 ; CHECK-P10-BE-LABEL: ld_not_disjoint64_uint16_t_uint64_t:
4134 ; CHECK-P10-BE: # %bb.0: # %entry
4135 ; CHECK-P10-BE-NEXT: pli r4, 232
4136 ; CHECK-P10-BE-NEXT: pli r5, 3567587329
4137 ; CHECK-P10-BE-NEXT: rldimi r5, r4, 32, 0
4138 ; CHECK-P10-BE-NEXT: or r3, r3, r5
4139 ; CHECK-P10-BE-NEXT: lhz r3, 6(r3)
4140 ; CHECK-P10-BE-NEXT: blr
4142 ; CHECK-P9-LE-LABEL: ld_not_disjoint64_uint16_t_uint64_t:
4143 ; CHECK-P9-LE: # %bb.0: # %entry
4144 ; CHECK-P9-LE-NEXT: li r4, 29
4145 ; CHECK-P9-LE-NEXT: rldic r4, r4, 35, 24
4146 ; CHECK-P9-LE-NEXT: oris r4, r4, 54437
4147 ; CHECK-P9-LE-NEXT: ori r4, r4, 4097
4148 ; CHECK-P9-LE-NEXT: or r3, r3, r4
4149 ; CHECK-P9-LE-NEXT: lhz r3, 0(r3)
4150 ; CHECK-P9-LE-NEXT: blr
4152 ; CHECK-P9-BE-LABEL: ld_not_disjoint64_uint16_t_uint64_t:
4153 ; CHECK-P9-BE: # %bb.0: # %entry
4154 ; CHECK-P9-BE-NEXT: li r4, 29
4155 ; CHECK-P9-BE-NEXT: rldic r4, r4, 35, 24
4156 ; CHECK-P9-BE-NEXT: oris r4, r4, 54437
4157 ; CHECK-P9-BE-NEXT: ori r4, r4, 4097
4158 ; CHECK-P9-BE-NEXT: or r3, r3, r4
4159 ; CHECK-P9-BE-NEXT: lhz r3, 6(r3)
4160 ; CHECK-P9-BE-NEXT: blr
4162 ; CHECK-P8-LE-LABEL: ld_not_disjoint64_uint16_t_uint64_t:
4163 ; CHECK-P8-LE: # %bb.0: # %entry
4164 ; CHECK-P8-LE-NEXT: li r4, 29
4165 ; CHECK-P8-LE-NEXT: rldic r4, r4, 35, 24
4166 ; CHECK-P8-LE-NEXT: oris r4, r4, 54437
4167 ; CHECK-P8-LE-NEXT: ori r4, r4, 4097
4168 ; CHECK-P8-LE-NEXT: or r3, r3, r4
4169 ; CHECK-P8-LE-NEXT: lhz r3, 0(r3)
4170 ; CHECK-P8-LE-NEXT: blr
4172 ; CHECK-P8-BE-LABEL: ld_not_disjoint64_uint16_t_uint64_t:
4173 ; CHECK-P8-BE: # %bb.0: # %entry
4174 ; CHECK-P8-BE-NEXT: li r4, 29
4175 ; CHECK-P8-BE-NEXT: rldic r4, r4, 35, 24
4176 ; CHECK-P8-BE-NEXT: oris r4, r4, 54437
4177 ; CHECK-P8-BE-NEXT: ori r4, r4, 4097
4178 ; CHECK-P8-BE-NEXT: or r3, r3, r4
4179 ; CHECK-P8-BE-NEXT: lhz r3, 6(r3)
4180 ; CHECK-P8-BE-NEXT: blr
4182 %or = or i64 %ptr, 1000000000001
4183 %0 = inttoptr i64 %or to i64*
4184 %1 = load i64, i64* %0, align 8
4185 %conv = trunc i64 %1 to i16
4189 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4190 define dso_local zeroext i16 @ld_disjoint_align64_uint16_t_uint64_t(i64 %ptr) {
4191 ; CHECK-P10-LE-LABEL: ld_disjoint_align64_uint16_t_uint64_t:
4192 ; CHECK-P10-LE: # %bb.0: # %entry
4193 ; CHECK-P10-LE-NEXT: pli r4, 244140625
4194 ; CHECK-P10-LE-NEXT: rldicr r3, r3, 0, 23
4195 ; CHECK-P10-LE-NEXT: rldic r4, r4, 12, 24
4196 ; CHECK-P10-LE-NEXT: lhzx r3, r3, r4
4197 ; CHECK-P10-LE-NEXT: blr
4199 ; CHECK-P10-BE-LABEL: ld_disjoint_align64_uint16_t_uint64_t:
4200 ; CHECK-P10-BE: # %bb.0: # %entry
4201 ; CHECK-P10-BE-NEXT: pli r4, 232
4202 ; CHECK-P10-BE-NEXT: pli r5, 3567587334
4203 ; CHECK-P10-BE-NEXT: rldicr r3, r3, 0, 23
4204 ; CHECK-P10-BE-NEXT: rldimi r5, r4, 32, 0
4205 ; CHECK-P10-BE-NEXT: lhzx r3, r3, r5
4206 ; CHECK-P10-BE-NEXT: blr
4208 ; CHECK-P9-LE-LABEL: ld_disjoint_align64_uint16_t_uint64_t:
4209 ; CHECK-P9-LE: # %bb.0: # %entry
4210 ; CHECK-P9-LE-NEXT: lis r4, 3725
4211 ; CHECK-P9-LE-NEXT: rldicr r3, r3, 0, 23
4212 ; CHECK-P9-LE-NEXT: ori r4, r4, 19025
4213 ; CHECK-P9-LE-NEXT: rldic r4, r4, 12, 24
4214 ; CHECK-P9-LE-NEXT: lhzx r3, r3, r4
4215 ; CHECK-P9-LE-NEXT: blr
4217 ; CHECK-P9-BE-LABEL: ld_disjoint_align64_uint16_t_uint64_t:
4218 ; CHECK-P9-BE: # %bb.0: # %entry
4219 ; CHECK-P9-BE-NEXT: li r4, 29
4220 ; CHECK-P9-BE-NEXT: rldicr r3, r3, 0, 23
4221 ; CHECK-P9-BE-NEXT: rldic r4, r4, 35, 24
4222 ; CHECK-P9-BE-NEXT: oris r4, r4, 54437
4223 ; CHECK-P9-BE-NEXT: ori r4, r4, 4102
4224 ; CHECK-P9-BE-NEXT: lhzx r3, r3, r4
4225 ; CHECK-P9-BE-NEXT: blr
4227 ; CHECK-P8-LE-LABEL: ld_disjoint_align64_uint16_t_uint64_t:
4228 ; CHECK-P8-LE: # %bb.0: # %entry
4229 ; CHECK-P8-LE-NEXT: lis r4, 3725
4230 ; CHECK-P8-LE-NEXT: rldicr r3, r3, 0, 23
4231 ; CHECK-P8-LE-NEXT: ori r4, r4, 19025
4232 ; CHECK-P8-LE-NEXT: rldic r4, r4, 12, 24
4233 ; CHECK-P8-LE-NEXT: lhzx r3, r3, r4
4234 ; CHECK-P8-LE-NEXT: blr
4236 ; CHECK-P8-BE-LABEL: ld_disjoint_align64_uint16_t_uint64_t:
4237 ; CHECK-P8-BE: # %bb.0: # %entry
4238 ; CHECK-P8-BE-NEXT: li r4, 29
4239 ; CHECK-P8-BE-NEXT: rldicr r3, r3, 0, 23
4240 ; CHECK-P8-BE-NEXT: rldic r4, r4, 35, 24
4241 ; CHECK-P8-BE-NEXT: oris r4, r4, 54437
4242 ; CHECK-P8-BE-NEXT: ori r4, r4, 4102
4243 ; CHECK-P8-BE-NEXT: lhzx r3, r3, r4
4244 ; CHECK-P8-BE-NEXT: blr
4246 %and = and i64 %ptr, -1099511627776
4247 %or = or i64 %and, 1000000000000
4248 %0 = inttoptr i64 %or to i64*
4249 %1 = load i64, i64* %0, align 4096
4250 %conv = trunc i64 %1 to i16
4254 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4255 define dso_local zeroext i16 @ld_cst_align16_uint16_t_uint64_t() {
4256 ; CHECK-LE-LABEL: ld_cst_align16_uint16_t_uint64_t:
4257 ; CHECK-LE: # %bb.0: # %entry
4258 ; CHECK-LE-NEXT: lhz r3, 4080(0)
4259 ; CHECK-LE-NEXT: blr
4261 ; CHECK-BE-LABEL: ld_cst_align16_uint16_t_uint64_t:
4262 ; CHECK-BE: # %bb.0: # %entry
4263 ; CHECK-BE-NEXT: lhz r3, 4086(0)
4264 ; CHECK-BE-NEXT: blr
4266 %0 = load i64, i64* inttoptr (i64 4080 to i64*), align 16
4267 %conv = trunc i64 %0 to i16
4271 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4272 define dso_local zeroext i16 @ld_cst_align32_uint16_t_uint64_t() {
4273 ; CHECK-LE-LABEL: ld_cst_align32_uint16_t_uint64_t:
4274 ; CHECK-LE: # %bb.0: # %entry
4275 ; CHECK-LE-NEXT: lis r3, 153
4276 ; CHECK-LE-NEXT: lhz r3, -27108(r3)
4277 ; CHECK-LE-NEXT: blr
4279 ; CHECK-BE-LABEL: ld_cst_align32_uint16_t_uint64_t:
4280 ; CHECK-BE: # %bb.0: # %entry
4281 ; CHECK-BE-NEXT: lis r3, 153
4282 ; CHECK-BE-NEXT: lhz r3, -27102(r3)
4283 ; CHECK-BE-NEXT: blr
4285 %0 = load i64, i64* inttoptr (i64 9999900 to i64*), align 8
4286 %conv = trunc i64 %0 to i16
4290 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4291 define dso_local zeroext i16 @ld_cst_align64_uint16_t_uint64_t() {
4292 ; CHECK-P10-LE-LABEL: ld_cst_align64_uint16_t_uint64_t:
4293 ; CHECK-P10-LE: # %bb.0: # %entry
4294 ; CHECK-P10-LE-NEXT: pli r3, 244140625
4295 ; CHECK-P10-LE-NEXT: rldic r3, r3, 12, 24
4296 ; CHECK-P10-LE-NEXT: lhz r3, 0(r3)
4297 ; CHECK-P10-LE-NEXT: blr
4299 ; CHECK-P10-BE-LABEL: ld_cst_align64_uint16_t_uint64_t:
4300 ; CHECK-P10-BE: # %bb.0: # %entry
4301 ; CHECK-P10-BE-NEXT: pli r3, 232
4302 ; CHECK-P10-BE-NEXT: pli r4, 3567587334
4303 ; CHECK-P10-BE-NEXT: rldimi r4, r3, 32, 0
4304 ; CHECK-P10-BE-NEXT: lhz r3, 0(r4)
4305 ; CHECK-P10-BE-NEXT: blr
4307 ; CHECK-P9-LE-LABEL: ld_cst_align64_uint16_t_uint64_t:
4308 ; CHECK-P9-LE: # %bb.0: # %entry
4309 ; CHECK-P9-LE-NEXT: lis r3, 3725
4310 ; CHECK-P9-LE-NEXT: ori r3, r3, 19025
4311 ; CHECK-P9-LE-NEXT: rldic r3, r3, 12, 24
4312 ; CHECK-P9-LE-NEXT: lhz r3, 0(r3)
4313 ; CHECK-P9-LE-NEXT: blr
4315 ; CHECK-P9-BE-LABEL: ld_cst_align64_uint16_t_uint64_t:
4316 ; CHECK-P9-BE: # %bb.0: # %entry
4317 ; CHECK-P9-BE-NEXT: li r3, 29
4318 ; CHECK-P9-BE-NEXT: rldic r3, r3, 35, 24
4319 ; CHECK-P9-BE-NEXT: oris r3, r3, 54437
4320 ; CHECK-P9-BE-NEXT: ori r3, r3, 4102
4321 ; CHECK-P9-BE-NEXT: lhz r3, 0(r3)
4322 ; CHECK-P9-BE-NEXT: blr
4324 ; CHECK-P8-LE-LABEL: ld_cst_align64_uint16_t_uint64_t:
4325 ; CHECK-P8-LE: # %bb.0: # %entry
4326 ; CHECK-P8-LE-NEXT: lis r3, 3725
4327 ; CHECK-P8-LE-NEXT: ori r3, r3, 19025
4328 ; CHECK-P8-LE-NEXT: rldic r3, r3, 12, 24
4329 ; CHECK-P8-LE-NEXT: lhz r3, 0(r3)
4330 ; CHECK-P8-LE-NEXT: blr
4332 ; CHECK-P8-BE-LABEL: ld_cst_align64_uint16_t_uint64_t:
4333 ; CHECK-P8-BE: # %bb.0: # %entry
4334 ; CHECK-P8-BE-NEXT: li r3, 29
4335 ; CHECK-P8-BE-NEXT: rldic r3, r3, 35, 24
4336 ; CHECK-P8-BE-NEXT: oris r3, r3, 54437
4337 ; CHECK-P8-BE-NEXT: ori r3, r3, 4102
4338 ; CHECK-P8-BE-NEXT: lhz r3, 0(r3)
4339 ; CHECK-P8-BE-NEXT: blr
4341 %0 = load i64, i64* inttoptr (i64 1000000000000 to i64*), align 4096
4342 %conv = trunc i64 %0 to i16
4346 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4347 define dso_local zeroext i16 @ld_align16_uint16_t_float(i8* nocapture readonly %ptr) {
4348 ; CHECK-LABEL: ld_align16_uint16_t_float:
4349 ; CHECK: # %bb.0: # %entry
4350 ; CHECK-NEXT: lfs f0, 8(r3)
4351 ; CHECK-NEXT: xscvdpsxws f0, f0
4352 ; CHECK-NEXT: mffprwz r3, f0
4353 ; CHECK-NEXT: clrldi r3, r3, 32
4356 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
4357 %0 = bitcast i8* %add.ptr to float*
4358 %1 = load float, float* %0, align 4
4359 %conv = fptoui float %1 to i16
4363 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4364 define dso_local zeroext i16 @ld_align32_uint16_t_float(i8* nocapture readonly %ptr) {
4365 ; CHECK-P10-LABEL: ld_align32_uint16_t_float:
4366 ; CHECK-P10: # %bb.0: # %entry
4367 ; CHECK-P10-NEXT: pli r4, 99999000
4368 ; CHECK-P10-NEXT: lfsx f0, r3, r4
4369 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
4370 ; CHECK-P10-NEXT: mffprwz r3, f0
4371 ; CHECK-P10-NEXT: clrldi r3, r3, 32
4372 ; CHECK-P10-NEXT: blr
4374 ; CHECK-PREP10-LABEL: ld_align32_uint16_t_float:
4375 ; CHECK-PREP10: # %bb.0: # %entry
4376 ; CHECK-PREP10-NEXT: lis r4, 1525
4377 ; CHECK-PREP10-NEXT: ori r4, r4, 56600
4378 ; CHECK-PREP10-NEXT: lfsx f0, r3, r4
4379 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
4380 ; CHECK-PREP10-NEXT: mffprwz r3, f0
4381 ; CHECK-PREP10-NEXT: clrldi r3, r3, 32
4382 ; CHECK-PREP10-NEXT: blr
4384 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
4385 %0 = bitcast i8* %add.ptr to float*
4386 %1 = load float, float* %0, align 4
4387 %conv = fptoui float %1 to i16
4391 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4392 define dso_local zeroext i16 @ld_align64_uint16_t_float(i8* nocapture readonly %ptr) {
4393 ; CHECK-P10-LABEL: ld_align64_uint16_t_float:
4394 ; CHECK-P10: # %bb.0: # %entry
4395 ; CHECK-P10-NEXT: pli r4, 244140625
4396 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
4397 ; CHECK-P10-NEXT: lfsx f0, r3, r4
4398 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
4399 ; CHECK-P10-NEXT: mffprwz r3, f0
4400 ; CHECK-P10-NEXT: clrldi r3, r3, 32
4401 ; CHECK-P10-NEXT: blr
4403 ; CHECK-PREP10-LABEL: ld_align64_uint16_t_float:
4404 ; CHECK-PREP10: # %bb.0: # %entry
4405 ; CHECK-PREP10-NEXT: lis r4, 3725
4406 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
4407 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
4408 ; CHECK-PREP10-NEXT: lfsx f0, r3, r4
4409 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
4410 ; CHECK-PREP10-NEXT: mffprwz r3, f0
4411 ; CHECK-PREP10-NEXT: clrldi r3, r3, 32
4412 ; CHECK-PREP10-NEXT: blr
4414 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
4415 %0 = bitcast i8* %add.ptr to float*
4416 %1 = load float, float* %0, align 4
4417 %conv = fptoui float %1 to i16
4421 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4422 define dso_local zeroext i16 @ld_reg_uint16_t_float(i8* nocapture readonly %ptr, i64 %off) {
4423 ; CHECK-LABEL: ld_reg_uint16_t_float:
4424 ; CHECK: # %bb.0: # %entry
4425 ; CHECK-NEXT: lfsx f0, r3, r4
4426 ; CHECK-NEXT: xscvdpsxws f0, f0
4427 ; CHECK-NEXT: mffprwz r3, f0
4428 ; CHECK-NEXT: clrldi r3, r3, 32
4431 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
4432 %0 = bitcast i8* %add.ptr to float*
4433 %1 = load float, float* %0, align 4
4434 %conv = fptoui float %1 to i16
4438 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4439 define dso_local zeroext i16 @ld_or_uint16_t_float(i64 %ptr, i8 zeroext %off) {
4440 ; CHECK-LABEL: ld_or_uint16_t_float:
4441 ; CHECK: # %bb.0: # %entry
4442 ; CHECK-NEXT: or r3, r4, r3
4443 ; CHECK-NEXT: lfs f0, 0(r3)
4444 ; CHECK-NEXT: xscvdpsxws f0, f0
4445 ; CHECK-NEXT: mffprwz r3, f0
4446 ; CHECK-NEXT: clrldi r3, r3, 32
4449 %conv = zext i8 %off to i64
4450 %or = or i64 %conv, %ptr
4451 %0 = inttoptr i64 %or to float*
4452 %1 = load float, float* %0, align 4
4453 %conv1 = fptoui float %1 to i16
4457 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4458 define dso_local zeroext i16 @ld_not_disjoint16_uint16_t_float(i64 %ptr) {
4459 ; CHECK-LABEL: ld_not_disjoint16_uint16_t_float:
4460 ; CHECK: # %bb.0: # %entry
4461 ; CHECK-NEXT: ori r3, r3, 6
4462 ; CHECK-NEXT: lfs f0, 0(r3)
4463 ; CHECK-NEXT: xscvdpsxws f0, f0
4464 ; CHECK-NEXT: mffprwz r3, f0
4465 ; CHECK-NEXT: clrldi r3, r3, 32
4468 %or = or i64 %ptr, 6
4469 %0 = inttoptr i64 %or to float*
4470 %1 = load float, float* %0, align 4
4471 %conv = fptoui float %1 to i16
4475 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4476 define dso_local zeroext i16 @ld_disjoint_align16_uint16_t_float(i64 %ptr) {
4477 ; CHECK-LABEL: ld_disjoint_align16_uint16_t_float:
4478 ; CHECK: # %bb.0: # %entry
4479 ; CHECK-NEXT: rldicr r3, r3, 0, 51
4480 ; CHECK-NEXT: lfs f0, 24(r3)
4481 ; CHECK-NEXT: xscvdpsxws f0, f0
4482 ; CHECK-NEXT: mffprwz r3, f0
4483 ; CHECK-NEXT: clrldi r3, r3, 32
4486 %and = and i64 %ptr, -4096
4487 %or = or i64 %and, 24
4488 %0 = inttoptr i64 %or to float*
4489 %1 = load float, float* %0, align 8
4490 %conv = fptoui float %1 to i16
4494 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4495 define dso_local zeroext i16 @ld_not_disjoint32_uint16_t_float(i64 %ptr) {
4496 ; CHECK-LABEL: ld_not_disjoint32_uint16_t_float:
4497 ; CHECK: # %bb.0: # %entry
4498 ; CHECK-NEXT: ori r3, r3, 34463
4499 ; CHECK-NEXT: oris r3, r3, 1
4500 ; CHECK-NEXT: lfs f0, 0(r3)
4501 ; CHECK-NEXT: xscvdpsxws f0, f0
4502 ; CHECK-NEXT: mffprwz r3, f0
4503 ; CHECK-NEXT: clrldi r3, r3, 32
4506 %or = or i64 %ptr, 99999
4507 %0 = inttoptr i64 %or to float*
4508 %1 = load float, float* %0, align 4
4509 %conv = fptoui float %1 to i16
4513 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4514 define dso_local zeroext i16 @ld_disjoint_align32_uint16_t_float(i64 %ptr) {
4515 ; CHECK-P10-LABEL: ld_disjoint_align32_uint16_t_float:
4516 ; CHECK-P10: # %bb.0: # %entry
4517 ; CHECK-P10-NEXT: lis r4, -15264
4518 ; CHECK-P10-NEXT: and r3, r3, r4
4519 ; CHECK-P10-NEXT: pli r4, 999990000
4520 ; CHECK-P10-NEXT: lfsx f0, r3, r4
4521 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
4522 ; CHECK-P10-NEXT: mffprwz r3, f0
4523 ; CHECK-P10-NEXT: clrldi r3, r3, 32
4524 ; CHECK-P10-NEXT: blr
4526 ; CHECK-P9-LABEL: ld_disjoint_align32_uint16_t_float:
4527 ; CHECK-P9: # %bb.0: # %entry
4528 ; CHECK-P9-NEXT: lis r4, -15264
4529 ; CHECK-P9-NEXT: and r3, r3, r4
4530 ; CHECK-P9-NEXT: lis r4, 15258
4531 ; CHECK-P9-NEXT: ori r4, r4, 41712
4532 ; CHECK-P9-NEXT: lfsx f0, r3, r4
4533 ; CHECK-P9-NEXT: xscvdpsxws f0, f0
4534 ; CHECK-P9-NEXT: mffprwz r3, f0
4535 ; CHECK-P9-NEXT: clrldi r3, r3, 32
4536 ; CHECK-P9-NEXT: blr
4538 ; CHECK-P8-LABEL: ld_disjoint_align32_uint16_t_float:
4539 ; CHECK-P8: # %bb.0: # %entry
4540 ; CHECK-P8-NEXT: lis r4, -15264
4541 ; CHECK-P8-NEXT: lis r5, 15258
4542 ; CHECK-P8-NEXT: and r3, r3, r4
4543 ; CHECK-P8-NEXT: ori r4, r5, 41712
4544 ; CHECK-P8-NEXT: lfsx f0, r3, r4
4545 ; CHECK-P8-NEXT: xscvdpsxws f0, f0
4546 ; CHECK-P8-NEXT: mffprwz r3, f0
4547 ; CHECK-P8-NEXT: clrldi r3, r3, 32
4548 ; CHECK-P8-NEXT: blr
4550 %and = and i64 %ptr, -1000341504
4551 %or = or i64 %and, 999990000
4552 %0 = inttoptr i64 %or to float*
4553 %1 = load float, float* %0, align 16
4554 %conv = fptoui float %1 to i16
4558 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4559 define dso_local zeroext i16 @ld_not_disjoint64_uint16_t_float(i64 %ptr) {
4560 ; CHECK-P10-LABEL: ld_not_disjoint64_uint16_t_float:
4561 ; CHECK-P10: # %bb.0: # %entry
4562 ; CHECK-P10-NEXT: pli r4, 232
4563 ; CHECK-P10-NEXT: pli r5, 3567587329
4564 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
4565 ; CHECK-P10-NEXT: or r3, r3, r5
4566 ; CHECK-P10-NEXT: lfs f0, 0(r3)
4567 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
4568 ; CHECK-P10-NEXT: mffprwz r3, f0
4569 ; CHECK-P10-NEXT: clrldi r3, r3, 32
4570 ; CHECK-P10-NEXT: blr
4572 ; CHECK-PREP10-LABEL: ld_not_disjoint64_uint16_t_float:
4573 ; CHECK-PREP10: # %bb.0: # %entry
4574 ; CHECK-PREP10-NEXT: li r4, 29
4575 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
4576 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
4577 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
4578 ; CHECK-PREP10-NEXT: or r3, r3, r4
4579 ; CHECK-PREP10-NEXT: lfs f0, 0(r3)
4580 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
4581 ; CHECK-PREP10-NEXT: mffprwz r3, f0
4582 ; CHECK-PREP10-NEXT: clrldi r3, r3, 32
4583 ; CHECK-PREP10-NEXT: blr
4585 %or = or i64 %ptr, 1000000000001
4586 %0 = inttoptr i64 %or to float*
4587 %1 = load float, float* %0, align 4
4588 %conv = fptoui float %1 to i16
4592 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4593 define dso_local zeroext i16 @ld_disjoint_align64_uint16_t_float(i64 %ptr) {
4594 ; CHECK-P10-LABEL: ld_disjoint_align64_uint16_t_float:
4595 ; CHECK-P10: # %bb.0: # %entry
4596 ; CHECK-P10-NEXT: pli r4, 244140625
4597 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
4598 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
4599 ; CHECK-P10-NEXT: lfsx f0, r3, r4
4600 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
4601 ; CHECK-P10-NEXT: mffprwz r3, f0
4602 ; CHECK-P10-NEXT: clrldi r3, r3, 32
4603 ; CHECK-P10-NEXT: blr
4605 ; CHECK-PREP10-LABEL: ld_disjoint_align64_uint16_t_float:
4606 ; CHECK-PREP10: # %bb.0: # %entry
4607 ; CHECK-PREP10-NEXT: lis r4, 3725
4608 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
4609 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
4610 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
4611 ; CHECK-PREP10-NEXT: lfsx f0, r3, r4
4612 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
4613 ; CHECK-PREP10-NEXT: mffprwz r3, f0
4614 ; CHECK-PREP10-NEXT: clrldi r3, r3, 32
4615 ; CHECK-PREP10-NEXT: blr
4617 %and = and i64 %ptr, -1099511627776
4618 %or = or i64 %and, 1000000000000
4619 %0 = inttoptr i64 %or to float*
4620 %1 = load float, float* %0, align 4096
4621 %conv = fptoui float %1 to i16
4625 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4626 define dso_local zeroext i16 @ld_cst_align16_uint16_t_float() {
4627 ; CHECK-LABEL: ld_cst_align16_uint16_t_float:
4628 ; CHECK: # %bb.0: # %entry
4629 ; CHECK-NEXT: lfs f0, 4080(0)
4630 ; CHECK-NEXT: xscvdpsxws f0, f0
4631 ; CHECK-NEXT: mffprwz r3, f0
4632 ; CHECK-NEXT: clrldi r3, r3, 32
4635 %0 = load float, float* inttoptr (i64 4080 to float*), align 16
4636 %conv = fptoui float %0 to i16
4640 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4641 define dso_local zeroext i16 @ld_cst_align32_uint16_t_float() {
4642 ; CHECK-LABEL: ld_cst_align32_uint16_t_float:
4643 ; CHECK: # %bb.0: # %entry
4644 ; CHECK-NEXT: lis r3, 153
4645 ; CHECK-NEXT: lfs f0, -27108(r3)
4646 ; CHECK-NEXT: xscvdpsxws f0, f0
4647 ; CHECK-NEXT: mffprwz r3, f0
4648 ; CHECK-NEXT: clrldi r3, r3, 32
4651 %0 = load float, float* inttoptr (i64 9999900 to float*), align 4
4652 %conv = fptoui float %0 to i16
4656 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4657 define dso_local zeroext i16 @ld_cst_align64_uint16_t_float() {
4658 ; CHECK-P10-LABEL: ld_cst_align64_uint16_t_float:
4659 ; CHECK-P10: # %bb.0: # %entry
4660 ; CHECK-P10-NEXT: pli r3, 244140625
4661 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
4662 ; CHECK-P10-NEXT: lfs f0, 0(r3)
4663 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
4664 ; CHECK-P10-NEXT: mffprwz r3, f0
4665 ; CHECK-P10-NEXT: clrldi r3, r3, 32
4666 ; CHECK-P10-NEXT: blr
4668 ; CHECK-PREP10-LABEL: ld_cst_align64_uint16_t_float:
4669 ; CHECK-PREP10: # %bb.0: # %entry
4670 ; CHECK-PREP10-NEXT: lis r3, 3725
4671 ; CHECK-PREP10-NEXT: ori r3, r3, 19025
4672 ; CHECK-PREP10-NEXT: rldic r3, r3, 12, 24
4673 ; CHECK-PREP10-NEXT: lfs f0, 0(r3)
4674 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
4675 ; CHECK-PREP10-NEXT: mffprwz r3, f0
4676 ; CHECK-PREP10-NEXT: clrldi r3, r3, 32
4677 ; CHECK-PREP10-NEXT: blr
4679 %0 = load float, float* inttoptr (i64 1000000000000 to float*), align 4096
4680 %conv = fptoui float %0 to i16
4684 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4685 define dso_local zeroext i16 @ld_0_uint16_t_double(i64 %ptr) {
4686 ; CHECK-LABEL: ld_0_uint16_t_double:
4687 ; CHECK: # %bb.0: # %entry
4688 ; CHECK-NEXT: lfd f0, 0(r3)
4689 ; CHECK-NEXT: xscvdpsxws f0, f0
4690 ; CHECK-NEXT: mffprwz r3, f0
4691 ; CHECK-NEXT: clrldi r3, r3, 32
4694 %0 = inttoptr i64 %ptr to double*
4695 %1 = load double, double* %0, align 8
4696 %conv = fptoui double %1 to i16
4700 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4701 define dso_local zeroext i16 @ld_align16_uint16_t_double(i8* nocapture readonly %ptr) {
4702 ; CHECK-LABEL: ld_align16_uint16_t_double:
4703 ; CHECK: # %bb.0: # %entry
4704 ; CHECK-NEXT: lfd f0, 8(r3)
4705 ; CHECK-NEXT: xscvdpsxws f0, f0
4706 ; CHECK-NEXT: mffprwz r3, f0
4707 ; CHECK-NEXT: clrldi r3, r3, 32
4710 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
4711 %0 = bitcast i8* %add.ptr to double*
4712 %1 = load double, double* %0, align 8
4713 %conv = fptoui double %1 to i16
4717 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4718 define dso_local zeroext i16 @ld_align32_uint16_t_double(i8* nocapture readonly %ptr) {
4719 ; CHECK-P10-LABEL: ld_align32_uint16_t_double:
4720 ; CHECK-P10: # %bb.0: # %entry
4721 ; CHECK-P10-NEXT: pli r4, 99999000
4722 ; CHECK-P10-NEXT: lfdx f0, r3, r4
4723 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
4724 ; CHECK-P10-NEXT: mffprwz r3, f0
4725 ; CHECK-P10-NEXT: clrldi r3, r3, 32
4726 ; CHECK-P10-NEXT: blr
4728 ; CHECK-PREP10-LABEL: ld_align32_uint16_t_double:
4729 ; CHECK-PREP10: # %bb.0: # %entry
4730 ; CHECK-PREP10-NEXT: lis r4, 1525
4731 ; CHECK-PREP10-NEXT: ori r4, r4, 56600
4732 ; CHECK-PREP10-NEXT: lfdx f0, r3, r4
4733 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
4734 ; CHECK-PREP10-NEXT: mffprwz r3, f0
4735 ; CHECK-PREP10-NEXT: clrldi r3, r3, 32
4736 ; CHECK-PREP10-NEXT: blr
4738 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
4739 %0 = bitcast i8* %add.ptr to double*
4740 %1 = load double, double* %0, align 8
4741 %conv = fptoui double %1 to i16
4745 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4746 define dso_local zeroext i16 @ld_align64_uint16_t_double(i8* nocapture readonly %ptr) {
4747 ; CHECK-P10-LABEL: ld_align64_uint16_t_double:
4748 ; CHECK-P10: # %bb.0: # %entry
4749 ; CHECK-P10-NEXT: pli r4, 244140625
4750 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
4751 ; CHECK-P10-NEXT: lfdx f0, r3, r4
4752 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
4753 ; CHECK-P10-NEXT: mffprwz r3, f0
4754 ; CHECK-P10-NEXT: clrldi r3, r3, 32
4755 ; CHECK-P10-NEXT: blr
4757 ; CHECK-PREP10-LABEL: ld_align64_uint16_t_double:
4758 ; CHECK-PREP10: # %bb.0: # %entry
4759 ; CHECK-PREP10-NEXT: lis r4, 3725
4760 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
4761 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
4762 ; CHECK-PREP10-NEXT: lfdx f0, r3, r4
4763 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
4764 ; CHECK-PREP10-NEXT: mffprwz r3, f0
4765 ; CHECK-PREP10-NEXT: clrldi r3, r3, 32
4766 ; CHECK-PREP10-NEXT: blr
4768 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
4769 %0 = bitcast i8* %add.ptr to double*
4770 %1 = load double, double* %0, align 8
4771 %conv = fptoui double %1 to i16
4775 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4776 define dso_local zeroext i16 @ld_reg_uint16_t_double(i8* nocapture readonly %ptr, i64 %off) {
4777 ; CHECK-LABEL: ld_reg_uint16_t_double:
4778 ; CHECK: # %bb.0: # %entry
4779 ; CHECK-NEXT: lfdx f0, r3, r4
4780 ; CHECK-NEXT: xscvdpsxws f0, f0
4781 ; CHECK-NEXT: mffprwz r3, f0
4782 ; CHECK-NEXT: clrldi r3, r3, 32
4785 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
4786 %0 = bitcast i8* %add.ptr to double*
4787 %1 = load double, double* %0, align 8
4788 %conv = fptoui double %1 to i16
4792 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4793 define dso_local zeroext i16 @ld_or_uint16_t_double(i64 %ptr, i8 zeroext %off) {
4794 ; CHECK-LABEL: ld_or_uint16_t_double:
4795 ; CHECK: # %bb.0: # %entry
4796 ; CHECK-NEXT: or r3, r4, r3
4797 ; CHECK-NEXT: lfd f0, 0(r3)
4798 ; CHECK-NEXT: xscvdpsxws f0, f0
4799 ; CHECK-NEXT: mffprwz r3, f0
4800 ; CHECK-NEXT: clrldi r3, r3, 32
4803 %conv = zext i8 %off to i64
4804 %or = or i64 %conv, %ptr
4805 %0 = inttoptr i64 %or to double*
4806 %1 = load double, double* %0, align 8
4807 %conv1 = fptoui double %1 to i16
4811 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4812 define dso_local zeroext i16 @ld_not_disjoint16_uint16_t_double(i64 %ptr) {
4813 ; CHECK-LABEL: ld_not_disjoint16_uint16_t_double:
4814 ; CHECK: # %bb.0: # %entry
4815 ; CHECK-NEXT: ori r3, r3, 6
4816 ; CHECK-NEXT: lfd f0, 0(r3)
4817 ; CHECK-NEXT: xscvdpsxws f0, f0
4818 ; CHECK-NEXT: mffprwz r3, f0
4819 ; CHECK-NEXT: clrldi r3, r3, 32
4822 %or = or i64 %ptr, 6
4823 %0 = inttoptr i64 %or to double*
4824 %1 = load double, double* %0, align 8
4825 %conv = fptoui double %1 to i16
4829 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4830 define dso_local zeroext i16 @ld_disjoint_align16_uint16_t_double(i64 %ptr) {
4831 ; CHECK-LABEL: ld_disjoint_align16_uint16_t_double:
4832 ; CHECK: # %bb.0: # %entry
4833 ; CHECK-NEXT: rldicr r3, r3, 0, 51
4834 ; CHECK-NEXT: lfd f0, 24(r3)
4835 ; CHECK-NEXT: xscvdpsxws f0, f0
4836 ; CHECK-NEXT: mffprwz r3, f0
4837 ; CHECK-NEXT: clrldi r3, r3, 32
4840 %and = and i64 %ptr, -4096
4841 %or = or i64 %and, 24
4842 %0 = inttoptr i64 %or to double*
4843 %1 = load double, double* %0, align 8
4844 %conv = fptoui double %1 to i16
4848 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4849 define dso_local zeroext i16 @ld_not_disjoint32_uint16_t_double(i64 %ptr) {
4850 ; CHECK-LABEL: ld_not_disjoint32_uint16_t_double:
4851 ; CHECK: # %bb.0: # %entry
4852 ; CHECK-NEXT: ori r3, r3, 34463
4853 ; CHECK-NEXT: oris r3, r3, 1
4854 ; CHECK-NEXT: lfd f0, 0(r3)
4855 ; CHECK-NEXT: xscvdpsxws f0, f0
4856 ; CHECK-NEXT: mffprwz r3, f0
4857 ; CHECK-NEXT: clrldi r3, r3, 32
4860 %or = or i64 %ptr, 99999
4861 %0 = inttoptr i64 %or to double*
4862 %1 = load double, double* %0, align 8
4863 %conv = fptoui double %1 to i16
4867 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4868 define dso_local zeroext i16 @ld_disjoint_align32_uint16_t_double(i64 %ptr) {
4869 ; CHECK-P10-LABEL: ld_disjoint_align32_uint16_t_double:
4870 ; CHECK-P10: # %bb.0: # %entry
4871 ; CHECK-P10-NEXT: lis r4, -15264
4872 ; CHECK-P10-NEXT: and r3, r3, r4
4873 ; CHECK-P10-NEXT: pli r4, 999990000
4874 ; CHECK-P10-NEXT: lfdx f0, r3, r4
4875 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
4876 ; CHECK-P10-NEXT: mffprwz r3, f0
4877 ; CHECK-P10-NEXT: clrldi r3, r3, 32
4878 ; CHECK-P10-NEXT: blr
4880 ; CHECK-P9-LABEL: ld_disjoint_align32_uint16_t_double:
4881 ; CHECK-P9: # %bb.0: # %entry
4882 ; CHECK-P9-NEXT: lis r4, -15264
4883 ; CHECK-P9-NEXT: and r3, r3, r4
4884 ; CHECK-P9-NEXT: lis r4, 15258
4885 ; CHECK-P9-NEXT: ori r4, r4, 41712
4886 ; CHECK-P9-NEXT: lfdx f0, r3, r4
4887 ; CHECK-P9-NEXT: xscvdpsxws f0, f0
4888 ; CHECK-P9-NEXT: mffprwz r3, f0
4889 ; CHECK-P9-NEXT: clrldi r3, r3, 32
4890 ; CHECK-P9-NEXT: blr
4892 ; CHECK-P8-LABEL: ld_disjoint_align32_uint16_t_double:
4893 ; CHECK-P8: # %bb.0: # %entry
4894 ; CHECK-P8-NEXT: lis r4, -15264
4895 ; CHECK-P8-NEXT: lis r5, 15258
4896 ; CHECK-P8-NEXT: and r3, r3, r4
4897 ; CHECK-P8-NEXT: ori r4, r5, 41712
4898 ; CHECK-P8-NEXT: lfdx f0, r3, r4
4899 ; CHECK-P8-NEXT: xscvdpsxws f0, f0
4900 ; CHECK-P8-NEXT: mffprwz r3, f0
4901 ; CHECK-P8-NEXT: clrldi r3, r3, 32
4902 ; CHECK-P8-NEXT: blr
4904 %and = and i64 %ptr, -1000341504
4905 %or = or i64 %and, 999990000
4906 %0 = inttoptr i64 %or to double*
4907 %1 = load double, double* %0, align 16
4908 %conv = fptoui double %1 to i16
4912 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4913 define dso_local zeroext i16 @ld_not_disjoint64_uint16_t_double(i64 %ptr) {
4914 ; CHECK-P10-LABEL: ld_not_disjoint64_uint16_t_double:
4915 ; CHECK-P10: # %bb.0: # %entry
4916 ; CHECK-P10-NEXT: pli r4, 232
4917 ; CHECK-P10-NEXT: pli r5, 3567587329
4918 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
4919 ; CHECK-P10-NEXT: or r3, r3, r5
4920 ; CHECK-P10-NEXT: lfd f0, 0(r3)
4921 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
4922 ; CHECK-P10-NEXT: mffprwz r3, f0
4923 ; CHECK-P10-NEXT: clrldi r3, r3, 32
4924 ; CHECK-P10-NEXT: blr
4926 ; CHECK-PREP10-LABEL: ld_not_disjoint64_uint16_t_double:
4927 ; CHECK-PREP10: # %bb.0: # %entry
4928 ; CHECK-PREP10-NEXT: li r4, 29
4929 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
4930 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
4931 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
4932 ; CHECK-PREP10-NEXT: or r3, r3, r4
4933 ; CHECK-PREP10-NEXT: lfd f0, 0(r3)
4934 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
4935 ; CHECK-PREP10-NEXT: mffprwz r3, f0
4936 ; CHECK-PREP10-NEXT: clrldi r3, r3, 32
4937 ; CHECK-PREP10-NEXT: blr
4939 %or = or i64 %ptr, 1000000000001
4940 %0 = inttoptr i64 %or to double*
4941 %1 = load double, double* %0, align 8
4942 %conv = fptoui double %1 to i16
4946 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4947 define dso_local zeroext i16 @ld_disjoint_align64_uint16_t_double(i64 %ptr) {
4948 ; CHECK-P10-LABEL: ld_disjoint_align64_uint16_t_double:
4949 ; CHECK-P10: # %bb.0: # %entry
4950 ; CHECK-P10-NEXT: pli r4, 244140625
4951 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
4952 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
4953 ; CHECK-P10-NEXT: lfdx f0, r3, r4
4954 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
4955 ; CHECK-P10-NEXT: mffprwz r3, f0
4956 ; CHECK-P10-NEXT: clrldi r3, r3, 32
4957 ; CHECK-P10-NEXT: blr
4959 ; CHECK-PREP10-LABEL: ld_disjoint_align64_uint16_t_double:
4960 ; CHECK-PREP10: # %bb.0: # %entry
4961 ; CHECK-PREP10-NEXT: lis r4, 3725
4962 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
4963 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
4964 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
4965 ; CHECK-PREP10-NEXT: lfdx f0, r3, r4
4966 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
4967 ; CHECK-PREP10-NEXT: mffprwz r3, f0
4968 ; CHECK-PREP10-NEXT: clrldi r3, r3, 32
4969 ; CHECK-PREP10-NEXT: blr
4971 %and = and i64 %ptr, -1099511627776
4972 %or = or i64 %and, 1000000000000
4973 %0 = inttoptr i64 %or to double*
4974 %1 = load double, double* %0, align 4096
4975 %conv = fptoui double %1 to i16
4979 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4980 define dso_local zeroext i16 @ld_cst_align16_uint16_t_double() {
4981 ; CHECK-LABEL: ld_cst_align16_uint16_t_double:
4982 ; CHECK: # %bb.0: # %entry
4983 ; CHECK-NEXT: lfd f0, 4080(0)
4984 ; CHECK-NEXT: xscvdpsxws f0, f0
4985 ; CHECK-NEXT: mffprwz r3, f0
4986 ; CHECK-NEXT: clrldi r3, r3, 32
4989 %0 = load double, double* inttoptr (i64 4080 to double*), align 16
4990 %conv = fptoui double %0 to i16
4994 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
4995 define dso_local zeroext i16 @ld_cst_align32_uint16_t_double() {
4996 ; CHECK-LABEL: ld_cst_align32_uint16_t_double:
4997 ; CHECK: # %bb.0: # %entry
4998 ; CHECK-NEXT: lis r3, 153
4999 ; CHECK-NEXT: lfd f0, -27108(r3)
5000 ; CHECK-NEXT: xscvdpsxws f0, f0
5001 ; CHECK-NEXT: mffprwz r3, f0
5002 ; CHECK-NEXT: clrldi r3, r3, 32
5005 %0 = load double, double* inttoptr (i64 9999900 to double*), align 8
5006 %conv = fptoui double %0 to i16
5010 ; Function Attrs: norecurse nounwind readonly uwtable willreturn
5011 define dso_local zeroext i16 @ld_cst_align64_uint16_t_double() {
5012 ; CHECK-P10-LABEL: ld_cst_align64_uint16_t_double:
5013 ; CHECK-P10: # %bb.0: # %entry
5014 ; CHECK-P10-NEXT: pli r3, 244140625
5015 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
5016 ; CHECK-P10-NEXT: lfd f0, 0(r3)
5017 ; CHECK-P10-NEXT: xscvdpsxws f0, f0
5018 ; CHECK-P10-NEXT: mffprwz r3, f0
5019 ; CHECK-P10-NEXT: clrldi r3, r3, 32
5020 ; CHECK-P10-NEXT: blr
5022 ; CHECK-PREP10-LABEL: ld_cst_align64_uint16_t_double:
5023 ; CHECK-PREP10: # %bb.0: # %entry
5024 ; CHECK-PREP10-NEXT: lis r3, 3725
5025 ; CHECK-PREP10-NEXT: ori r3, r3, 19025
5026 ; CHECK-PREP10-NEXT: rldic r3, r3, 12, 24
5027 ; CHECK-PREP10-NEXT: lfd f0, 0(r3)
5028 ; CHECK-PREP10-NEXT: xscvdpsxws f0, f0
5029 ; CHECK-PREP10-NEXT: mffprwz r3, f0
5030 ; CHECK-PREP10-NEXT: clrldi r3, r3, 32
5031 ; CHECK-PREP10-NEXT: blr
5033 %0 = load double, double* inttoptr (i64 1000000000000 to double*), align 4096
5034 %conv = fptoui double %0 to i16
5038 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5039 define dso_local void @st_0_uint16_t_uint8_t(i64 %ptr, i16 zeroext %str) {
5040 ; CHECK-LABEL: st_0_uint16_t_uint8_t:
5041 ; CHECK: # %bb.0: # %entry
5042 ; CHECK-NEXT: stb r4, 0(r3)
5045 %conv = trunc i16 %str to i8
5046 %0 = inttoptr i64 %ptr to i8*
5047 store i8 %conv, i8* %0, align 1
5051 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5052 define dso_local void @st_align16_uint16_t_uint8_t(i8* nocapture %ptr, i16 zeroext %str) {
5053 ; CHECK-LABEL: st_align16_uint16_t_uint8_t:
5054 ; CHECK: # %bb.0: # %entry
5055 ; CHECK-NEXT: stb r4, 8(r3)
5058 %conv = trunc i16 %str to i8
5059 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
5060 store i8 %conv, i8* %add.ptr, align 1
5064 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5065 define dso_local void @st_align32_uint16_t_uint8_t(i8* nocapture %ptr, i16 zeroext %str) {
5066 ; CHECK-P10-LABEL: st_align32_uint16_t_uint8_t:
5067 ; CHECK-P10: # %bb.0: # %entry
5068 ; CHECK-P10-NEXT: pli r5, 99999000
5069 ; CHECK-P10-NEXT: stbx r4, r3, r5
5070 ; CHECK-P10-NEXT: blr
5072 ; CHECK-PREP10-LABEL: st_align32_uint16_t_uint8_t:
5073 ; CHECK-PREP10: # %bb.0: # %entry
5074 ; CHECK-PREP10-NEXT: lis r5, 1525
5075 ; CHECK-PREP10-NEXT: ori r5, r5, 56600
5076 ; CHECK-PREP10-NEXT: stbx r4, r3, r5
5077 ; CHECK-PREP10-NEXT: blr
5079 %conv = trunc i16 %str to i8
5080 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
5081 store i8 %conv, i8* %add.ptr, align 1
5085 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5086 define dso_local void @st_align64_uint16_t_uint8_t(i8* nocapture %ptr, i16 zeroext %str) {
5087 ; CHECK-P10-LABEL: st_align64_uint16_t_uint8_t:
5088 ; CHECK-P10: # %bb.0: # %entry
5089 ; CHECK-P10-NEXT: pli r5, 244140625
5090 ; CHECK-P10-NEXT: rldic r5, r5, 12, 24
5091 ; CHECK-P10-NEXT: stbx r4, r3, r5
5092 ; CHECK-P10-NEXT: blr
5094 ; CHECK-PREP10-LABEL: st_align64_uint16_t_uint8_t:
5095 ; CHECK-PREP10: # %bb.0: # %entry
5096 ; CHECK-PREP10-NEXT: lis r5, 3725
5097 ; CHECK-PREP10-NEXT: ori r5, r5, 19025
5098 ; CHECK-PREP10-NEXT: rldic r5, r5, 12, 24
5099 ; CHECK-PREP10-NEXT: stbx r4, r3, r5
5100 ; CHECK-PREP10-NEXT: blr
5102 %conv = trunc i16 %str to i8
5103 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
5104 store i8 %conv, i8* %add.ptr, align 1
5108 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5109 define dso_local void @st_reg_uint16_t_uint8_t(i8* nocapture %ptr, i64 %off, i16 zeroext %str) {
5110 ; CHECK-LABEL: st_reg_uint16_t_uint8_t:
5111 ; CHECK: # %bb.0: # %entry
5112 ; CHECK-NEXT: stbx r5, r3, r4
5115 %conv = trunc i16 %str to i8
5116 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
5117 store i8 %conv, i8* %add.ptr, align 1
5121 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5122 define dso_local void @st_or1_uint16_t_uint8_t(i64 %ptr, i8 zeroext %off, i16 zeroext %str) {
5123 ; CHECK-LABEL: st_or1_uint16_t_uint8_t:
5124 ; CHECK: # %bb.0: # %entry
5125 ; CHECK-NEXT: or r3, r4, r3
5126 ; CHECK-NEXT: stb r5, 0(r3)
5129 %conv = trunc i16 %str to i8
5130 %conv1 = zext i8 %off to i64
5131 %or = or i64 %conv1, %ptr
5132 %0 = inttoptr i64 %or to i8*
5133 store i8 %conv, i8* %0, align 1
5137 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5138 define dso_local void @st_not_disjoint16_uint16_t_uint8_t(i64 %ptr, i16 zeroext %str) {
5139 ; CHECK-LABEL: st_not_disjoint16_uint16_t_uint8_t:
5140 ; CHECK: # %bb.0: # %entry
5141 ; CHECK-NEXT: ori r3, r3, 6
5142 ; CHECK-NEXT: stb r4, 0(r3)
5145 %conv = trunc i16 %str to i8
5146 %or = or i64 %ptr, 6
5147 %0 = inttoptr i64 %or to i8*
5148 store i8 %conv, i8* %0, align 1
5152 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5153 define dso_local void @st_disjoint_align16_uint16_t_uint8_t(i64 %ptr, i16 zeroext %str) {
5154 ; CHECK-LABEL: st_disjoint_align16_uint16_t_uint8_t:
5155 ; CHECK: # %bb.0: # %entry
5156 ; CHECK-NEXT: rldicr r3, r3, 0, 51
5157 ; CHECK-NEXT: stb r4, 24(r3)
5160 %and = and i64 %ptr, -4096
5161 %conv = trunc i16 %str to i8
5162 %or = or i64 %and, 24
5163 %0 = inttoptr i64 %or to i8*
5164 store i8 %conv, i8* %0, align 8
5168 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5169 define dso_local void @st_not_disjoint32_uint16_t_uint8_t(i64 %ptr, i16 zeroext %str) {
5170 ; CHECK-LABEL: st_not_disjoint32_uint16_t_uint8_t:
5171 ; CHECK: # %bb.0: # %entry
5172 ; CHECK-NEXT: ori r3, r3, 34463
5173 ; CHECK-NEXT: oris r3, r3, 1
5174 ; CHECK-NEXT: stb r4, 0(r3)
5177 %conv = trunc i16 %str to i8
5178 %or = or i64 %ptr, 99999
5179 %0 = inttoptr i64 %or to i8*
5180 store i8 %conv, i8* %0, align 1
5184 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5185 define dso_local void @st_disjoint_align32_uint16_t_uint8_t(i64 %ptr, i16 zeroext %str) {
5186 ; CHECK-P10-LABEL: st_disjoint_align32_uint16_t_uint8_t:
5187 ; CHECK-P10: # %bb.0: # %entry
5188 ; CHECK-P10-NEXT: lis r5, -15264
5189 ; CHECK-P10-NEXT: and r3, r3, r5
5190 ; CHECK-P10-NEXT: pli r5, 999990000
5191 ; CHECK-P10-NEXT: stbx r4, r3, r5
5192 ; CHECK-P10-NEXT: blr
5194 ; CHECK-P9-LABEL: st_disjoint_align32_uint16_t_uint8_t:
5195 ; CHECK-P9: # %bb.0: # %entry
5196 ; CHECK-P9-NEXT: lis r5, -15264
5197 ; CHECK-P9-NEXT: and r3, r3, r5
5198 ; CHECK-P9-NEXT: lis r5, 15258
5199 ; CHECK-P9-NEXT: ori r5, r5, 41712
5200 ; CHECK-P9-NEXT: stbx r4, r3, r5
5201 ; CHECK-P9-NEXT: blr
5203 ; CHECK-P8-LABEL: st_disjoint_align32_uint16_t_uint8_t:
5204 ; CHECK-P8: # %bb.0: # %entry
5205 ; CHECK-P8-NEXT: lis r5, -15264
5206 ; CHECK-P8-NEXT: lis r6, 15258
5207 ; CHECK-P8-NEXT: and r3, r3, r5
5208 ; CHECK-P8-NEXT: ori r5, r6, 41712
5209 ; CHECK-P8-NEXT: stbx r4, r3, r5
5210 ; CHECK-P8-NEXT: blr
5212 %and = and i64 %ptr, -1000341504
5213 %conv = trunc i16 %str to i8
5214 %or = or i64 %and, 999990000
5215 %0 = inttoptr i64 %or to i8*
5216 store i8 %conv, i8* %0, align 16
5220 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5221 define dso_local void @st_not_disjoint64_uint16_t_uint8_t(i64 %ptr, i16 zeroext %str) {
5222 ; CHECK-P10-LABEL: st_not_disjoint64_uint16_t_uint8_t:
5223 ; CHECK-P10: # %bb.0: # %entry
5224 ; CHECK-P10-NEXT: pli r5, 232
5225 ; CHECK-P10-NEXT: pli r6, 3567587329
5226 ; CHECK-P10-NEXT: rldimi r6, r5, 32, 0
5227 ; CHECK-P10-NEXT: or r3, r3, r6
5228 ; CHECK-P10-NEXT: stb r4, 0(r3)
5229 ; CHECK-P10-NEXT: blr
5231 ; CHECK-PREP10-LABEL: st_not_disjoint64_uint16_t_uint8_t:
5232 ; CHECK-PREP10: # %bb.0: # %entry
5233 ; CHECK-PREP10-NEXT: li r5, 29
5234 ; CHECK-PREP10-NEXT: rldic r5, r5, 35, 24
5235 ; CHECK-PREP10-NEXT: oris r5, r5, 54437
5236 ; CHECK-PREP10-NEXT: ori r5, r5, 4097
5237 ; CHECK-PREP10-NEXT: or r3, r3, r5
5238 ; CHECK-PREP10-NEXT: stb r4, 0(r3)
5239 ; CHECK-PREP10-NEXT: blr
5241 %conv = trunc i16 %str to i8
5242 %or = or i64 %ptr, 1000000000001
5243 %0 = inttoptr i64 %or to i8*
5244 store i8 %conv, i8* %0, align 1
5248 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5249 define dso_local void @st_disjoint_align64_uint16_t_uint8_t(i64 %ptr, i16 zeroext %str) {
5250 ; CHECK-P10-LABEL: st_disjoint_align64_uint16_t_uint8_t:
5251 ; CHECK-P10: # %bb.0: # %entry
5252 ; CHECK-P10-NEXT: pli r5, 244140625
5253 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
5254 ; CHECK-P10-NEXT: rldic r5, r5, 12, 24
5255 ; CHECK-P10-NEXT: stbx r4, r3, r5
5256 ; CHECK-P10-NEXT: blr
5258 ; CHECK-PREP10-LABEL: st_disjoint_align64_uint16_t_uint8_t:
5259 ; CHECK-PREP10: # %bb.0: # %entry
5260 ; CHECK-PREP10-NEXT: lis r5, 3725
5261 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
5262 ; CHECK-PREP10-NEXT: ori r5, r5, 19025
5263 ; CHECK-PREP10-NEXT: rldic r5, r5, 12, 24
5264 ; CHECK-PREP10-NEXT: stbx r4, r3, r5
5265 ; CHECK-PREP10-NEXT: blr
5267 %and = and i64 %ptr, -1099511627776
5268 %conv = trunc i16 %str to i8
5269 %or = or i64 %and, 1000000000000
5270 %0 = inttoptr i64 %or to i8*
5271 store i8 %conv, i8* %0, align 4096
5275 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5276 define dso_local void @st_cst_align16_uint16_t_uint8_t(i16 zeroext %str) {
5277 ; CHECK-LABEL: st_cst_align16_uint16_t_uint8_t:
5278 ; CHECK: # %bb.0: # %entry
5279 ; CHECK-NEXT: stb r3, 4080(0)
5282 %conv = trunc i16 %str to i8
5283 store i8 %conv, i8* inttoptr (i64 4080 to i8*), align 16
5287 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5288 define dso_local void @st_cst_align32_uint16_t_uint8_t(i16 zeroext %str) {
5289 ; CHECK-LABEL: st_cst_align32_uint16_t_uint8_t:
5290 ; CHECK: # %bb.0: # %entry
5291 ; CHECK-NEXT: lis r4, 153
5292 ; CHECK-NEXT: stb r3, -27108(r4)
5295 %conv = trunc i16 %str to i8
5296 store i8 %conv, i8* inttoptr (i64 9999900 to i8*), align 4
5300 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5301 define dso_local void @st_cst_align64_uint16_t_uint8_t(i16 zeroext %str) {
5302 ; CHECK-P10-LABEL: st_cst_align64_uint16_t_uint8_t:
5303 ; CHECK-P10: # %bb.0: # %entry
5304 ; CHECK-P10-NEXT: pli r4, 244140625
5305 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
5306 ; CHECK-P10-NEXT: stb r3, 0(r4)
5307 ; CHECK-P10-NEXT: blr
5309 ; CHECK-PREP10-LABEL: st_cst_align64_uint16_t_uint8_t:
5310 ; CHECK-PREP10: # %bb.0: # %entry
5311 ; CHECK-PREP10-NEXT: lis r4, 3725
5312 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
5313 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
5314 ; CHECK-PREP10-NEXT: stb r3, 0(r4)
5315 ; CHECK-PREP10-NEXT: blr
5317 %conv = trunc i16 %str to i8
5318 store i8 %conv, i8* inttoptr (i64 1000000000000 to i8*), align 4096
5322 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5323 define dso_local void @st_0_uint16_t_uint16_t(i64 %ptr, i16 zeroext %str) {
5324 ; CHECK-LABEL: st_0_uint16_t_uint16_t:
5325 ; CHECK: # %bb.0: # %entry
5326 ; CHECK-NEXT: sth r4, 0(r3)
5329 %0 = inttoptr i64 %ptr to i16*
5330 store i16 %str, i16* %0, align 2
5334 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5335 define dso_local void @st_align16_uint16_t_uint16_t(i8* nocapture %ptr, i16 zeroext %str) {
5336 ; CHECK-LABEL: st_align16_uint16_t_uint16_t:
5337 ; CHECK: # %bb.0: # %entry
5338 ; CHECK-NEXT: sth r4, 8(r3)
5341 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
5342 %0 = bitcast i8* %add.ptr to i16*
5343 store i16 %str, i16* %0, align 2
5347 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5348 define dso_local void @st_align32_uint16_t_uint16_t(i8* nocapture %ptr, i16 zeroext %str) {
5349 ; CHECK-P10-LABEL: st_align32_uint16_t_uint16_t:
5350 ; CHECK-P10: # %bb.0: # %entry
5351 ; CHECK-P10-NEXT: pli r5, 99999000
5352 ; CHECK-P10-NEXT: sthx r4, r3, r5
5353 ; CHECK-P10-NEXT: blr
5355 ; CHECK-PREP10-LABEL: st_align32_uint16_t_uint16_t:
5356 ; CHECK-PREP10: # %bb.0: # %entry
5357 ; CHECK-PREP10-NEXT: lis r5, 1525
5358 ; CHECK-PREP10-NEXT: ori r5, r5, 56600
5359 ; CHECK-PREP10-NEXT: sthx r4, r3, r5
5360 ; CHECK-PREP10-NEXT: blr
5362 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
5363 %0 = bitcast i8* %add.ptr to i16*
5364 store i16 %str, i16* %0, align 2
5368 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5369 define dso_local void @st_align64_uint16_t_uint16_t(i8* nocapture %ptr, i16 zeroext %str) {
5370 ; CHECK-P10-LABEL: st_align64_uint16_t_uint16_t:
5371 ; CHECK-P10: # %bb.0: # %entry
5372 ; CHECK-P10-NEXT: pli r5, 244140625
5373 ; CHECK-P10-NEXT: rldic r5, r5, 12, 24
5374 ; CHECK-P10-NEXT: sthx r4, r3, r5
5375 ; CHECK-P10-NEXT: blr
5377 ; CHECK-PREP10-LABEL: st_align64_uint16_t_uint16_t:
5378 ; CHECK-PREP10: # %bb.0: # %entry
5379 ; CHECK-PREP10-NEXT: lis r5, 3725
5380 ; CHECK-PREP10-NEXT: ori r5, r5, 19025
5381 ; CHECK-PREP10-NEXT: rldic r5, r5, 12, 24
5382 ; CHECK-PREP10-NEXT: sthx r4, r3, r5
5383 ; CHECK-PREP10-NEXT: blr
5385 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
5386 %0 = bitcast i8* %add.ptr to i16*
5387 store i16 %str, i16* %0, align 2
5391 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5392 define dso_local void @st_reg_uint16_t_uint16_t(i8* nocapture %ptr, i64 %off, i16 zeroext %str) {
5393 ; CHECK-LABEL: st_reg_uint16_t_uint16_t:
5394 ; CHECK: # %bb.0: # %entry
5395 ; CHECK-NEXT: sthx r5, r3, r4
5398 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
5399 %0 = bitcast i8* %add.ptr to i16*
5400 store i16 %str, i16* %0, align 2
5404 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5405 define dso_local void @st_or1_uint16_t_uint16_t(i64 %ptr, i8 zeroext %off, i16 zeroext %str) {
5406 ; CHECK-LABEL: st_or1_uint16_t_uint16_t:
5407 ; CHECK: # %bb.0: # %entry
5408 ; CHECK-NEXT: or r3, r4, r3
5409 ; CHECK-NEXT: sth r5, 0(r3)
5412 %conv = zext i8 %off to i64
5413 %or = or i64 %conv, %ptr
5414 %0 = inttoptr i64 %or to i16*
5415 store i16 %str, i16* %0, align 2
5419 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5420 define dso_local void @st_not_disjoint16_uint16_t_uint16_t(i64 %ptr, i16 zeroext %str) {
5421 ; CHECK-LABEL: st_not_disjoint16_uint16_t_uint16_t:
5422 ; CHECK: # %bb.0: # %entry
5423 ; CHECK-NEXT: ori r3, r3, 6
5424 ; CHECK-NEXT: sth r4, 0(r3)
5427 %or = or i64 %ptr, 6
5428 %0 = inttoptr i64 %or to i16*
5429 store i16 %str, i16* %0, align 2
5433 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5434 define dso_local void @st_disjoint_align16_uint16_t_uint16_t(i64 %ptr, i16 zeroext %str) {
5435 ; CHECK-LABEL: st_disjoint_align16_uint16_t_uint16_t:
5436 ; CHECK: # %bb.0: # %entry
5437 ; CHECK-NEXT: rldicr r3, r3, 0, 51
5438 ; CHECK-NEXT: sth r4, 24(r3)
5441 %and = and i64 %ptr, -4096
5442 %or = or i64 %and, 24
5443 %0 = inttoptr i64 %or to i16*
5444 store i16 %str, i16* %0, align 8
5448 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5449 define dso_local void @st_not_disjoint32_uint16_t_uint16_t(i64 %ptr, i16 zeroext %str) {
5450 ; CHECK-LABEL: st_not_disjoint32_uint16_t_uint16_t:
5451 ; CHECK: # %bb.0: # %entry
5452 ; CHECK-NEXT: ori r3, r3, 34463
5453 ; CHECK-NEXT: oris r3, r3, 1
5454 ; CHECK-NEXT: sth r4, 0(r3)
5457 %or = or i64 %ptr, 99999
5458 %0 = inttoptr i64 %or to i16*
5459 store i16 %str, i16* %0, align 2
5463 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5464 define dso_local void @st_disjoint_align32_uint16_t_uint16_t(i64 %ptr, i16 zeroext %str) {
5465 ; CHECK-P10-LABEL: st_disjoint_align32_uint16_t_uint16_t:
5466 ; CHECK-P10: # %bb.0: # %entry
5467 ; CHECK-P10-NEXT: lis r5, -15264
5468 ; CHECK-P10-NEXT: and r3, r3, r5
5469 ; CHECK-P10-NEXT: pli r5, 999990000
5470 ; CHECK-P10-NEXT: sthx r4, r3, r5
5471 ; CHECK-P10-NEXT: blr
5473 ; CHECK-P9-LABEL: st_disjoint_align32_uint16_t_uint16_t:
5474 ; CHECK-P9: # %bb.0: # %entry
5475 ; CHECK-P9-NEXT: lis r5, -15264
5476 ; CHECK-P9-NEXT: and r3, r3, r5
5477 ; CHECK-P9-NEXT: lis r5, 15258
5478 ; CHECK-P9-NEXT: ori r5, r5, 41712
5479 ; CHECK-P9-NEXT: sthx r4, r3, r5
5480 ; CHECK-P9-NEXT: blr
5482 ; CHECK-P8-LABEL: st_disjoint_align32_uint16_t_uint16_t:
5483 ; CHECK-P8: # %bb.0: # %entry
5484 ; CHECK-P8-NEXT: lis r5, -15264
5485 ; CHECK-P8-NEXT: lis r6, 15258
5486 ; CHECK-P8-NEXT: and r3, r3, r5
5487 ; CHECK-P8-NEXT: ori r5, r6, 41712
5488 ; CHECK-P8-NEXT: sthx r4, r3, r5
5489 ; CHECK-P8-NEXT: blr
5491 %and = and i64 %ptr, -1000341504
5492 %or = or i64 %and, 999990000
5493 %0 = inttoptr i64 %or to i16*
5494 store i16 %str, i16* %0, align 16
5498 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5499 define dso_local void @st_not_disjoint64_uint16_t_uint16_t(i64 %ptr, i16 zeroext %str) {
5500 ; CHECK-P10-LABEL: st_not_disjoint64_uint16_t_uint16_t:
5501 ; CHECK-P10: # %bb.0: # %entry
5502 ; CHECK-P10-NEXT: pli r5, 232
5503 ; CHECK-P10-NEXT: pli r6, 3567587329
5504 ; CHECK-P10-NEXT: rldimi r6, r5, 32, 0
5505 ; CHECK-P10-NEXT: or r3, r3, r6
5506 ; CHECK-P10-NEXT: sth r4, 0(r3)
5507 ; CHECK-P10-NEXT: blr
5509 ; CHECK-PREP10-LABEL: st_not_disjoint64_uint16_t_uint16_t:
5510 ; CHECK-PREP10: # %bb.0: # %entry
5511 ; CHECK-PREP10-NEXT: li r5, 29
5512 ; CHECK-PREP10-NEXT: rldic r5, r5, 35, 24
5513 ; CHECK-PREP10-NEXT: oris r5, r5, 54437
5514 ; CHECK-PREP10-NEXT: ori r5, r5, 4097
5515 ; CHECK-PREP10-NEXT: or r3, r3, r5
5516 ; CHECK-PREP10-NEXT: sth r4, 0(r3)
5517 ; CHECK-PREP10-NEXT: blr
5519 %or = or i64 %ptr, 1000000000001
5520 %0 = inttoptr i64 %or to i16*
5521 store i16 %str, i16* %0, align 2
5525 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5526 define dso_local void @st_disjoint_align64_uint16_t_uint16_t(i64 %ptr, i16 zeroext %str) {
5527 ; CHECK-P10-LABEL: st_disjoint_align64_uint16_t_uint16_t:
5528 ; CHECK-P10: # %bb.0: # %entry
5529 ; CHECK-P10-NEXT: pli r5, 244140625
5530 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
5531 ; CHECK-P10-NEXT: rldic r5, r5, 12, 24
5532 ; CHECK-P10-NEXT: sthx r4, r3, r5
5533 ; CHECK-P10-NEXT: blr
5535 ; CHECK-PREP10-LABEL: st_disjoint_align64_uint16_t_uint16_t:
5536 ; CHECK-PREP10: # %bb.0: # %entry
5537 ; CHECK-PREP10-NEXT: lis r5, 3725
5538 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
5539 ; CHECK-PREP10-NEXT: ori r5, r5, 19025
5540 ; CHECK-PREP10-NEXT: rldic r5, r5, 12, 24
5541 ; CHECK-PREP10-NEXT: sthx r4, r3, r5
5542 ; CHECK-PREP10-NEXT: blr
5544 %and = and i64 %ptr, -1099511627776
5545 %or = or i64 %and, 1000000000000
5546 %0 = inttoptr i64 %or to i16*
5547 store i16 %str, i16* %0, align 4096
5551 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5552 define dso_local void @st_cst_align16_uint16_t_uint16_t(i16 zeroext %str) {
5553 ; CHECK-LABEL: st_cst_align16_uint16_t_uint16_t:
5554 ; CHECK: # %bb.0: # %entry
5555 ; CHECK-NEXT: sth r3, 4080(0)
5558 store i16 %str, i16* inttoptr (i64 4080 to i16*), align 16
5562 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5563 define dso_local void @st_cst_align32_uint16_t_uint16_t(i16 zeroext %str) {
5564 ; CHECK-LABEL: st_cst_align32_uint16_t_uint16_t:
5565 ; CHECK: # %bb.0: # %entry
5566 ; CHECK-NEXT: lis r4, 153
5567 ; CHECK-NEXT: sth r3, -27108(r4)
5570 store i16 %str, i16* inttoptr (i64 9999900 to i16*), align 4
5574 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5575 define dso_local void @st_cst_align64_uint16_t_uint16_t(i16 zeroext %str) {
5576 ; CHECK-P10-LABEL: st_cst_align64_uint16_t_uint16_t:
5577 ; CHECK-P10: # %bb.0: # %entry
5578 ; CHECK-P10-NEXT: pli r4, 244140625
5579 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
5580 ; CHECK-P10-NEXT: sth r3, 0(r4)
5581 ; CHECK-P10-NEXT: blr
5583 ; CHECK-PREP10-LABEL: st_cst_align64_uint16_t_uint16_t:
5584 ; CHECK-PREP10: # %bb.0: # %entry
5585 ; CHECK-PREP10-NEXT: lis r4, 3725
5586 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
5587 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
5588 ; CHECK-PREP10-NEXT: sth r3, 0(r4)
5589 ; CHECK-PREP10-NEXT: blr
5591 store i16 %str, i16* inttoptr (i64 1000000000000 to i16*), align 4096
5595 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5596 define dso_local void @st_0_uint16_t_uint32_t(i64 %ptr, i16 zeroext %str) {
5597 ; CHECK-LABEL: st_0_uint16_t_uint32_t:
5598 ; CHECK: # %bb.0: # %entry
5599 ; CHECK-NEXT: stw r4, 0(r3)
5602 %conv = zext i16 %str to i32
5603 %0 = inttoptr i64 %ptr to i32*
5604 store i32 %conv, i32* %0, align 4
5608 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5609 define dso_local void @st_align16_uint16_t_uint32_t(i8* nocapture %ptr, i16 zeroext %str) {
5610 ; CHECK-LABEL: st_align16_uint16_t_uint32_t:
5611 ; CHECK: # %bb.0: # %entry
5612 ; CHECK-NEXT: stw r4, 8(r3)
5615 %conv = zext i16 %str to i32
5616 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
5617 %0 = bitcast i8* %add.ptr to i32*
5618 store i32 %conv, i32* %0, align 4
5622 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5623 define dso_local void @st_align32_uint16_t_uint32_t(i8* nocapture %ptr, i16 zeroext %str) {
5624 ; CHECK-P10-LABEL: st_align32_uint16_t_uint32_t:
5625 ; CHECK-P10: # %bb.0: # %entry
5626 ; CHECK-P10-NEXT: pli r5, 99999000
5627 ; CHECK-P10-NEXT: stwx r4, r3, r5
5628 ; CHECK-P10-NEXT: blr
5630 ; CHECK-PREP10-LABEL: st_align32_uint16_t_uint32_t:
5631 ; CHECK-PREP10: # %bb.0: # %entry
5632 ; CHECK-PREP10-NEXT: lis r5, 1525
5633 ; CHECK-PREP10-NEXT: ori r5, r5, 56600
5634 ; CHECK-PREP10-NEXT: stwx r4, r3, r5
5635 ; CHECK-PREP10-NEXT: blr
5637 %conv = zext i16 %str to i32
5638 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
5639 %0 = bitcast i8* %add.ptr to i32*
5640 store i32 %conv, i32* %0, align 4
5644 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5645 define dso_local void @st_align64_uint16_t_uint32_t(i8* nocapture %ptr, i16 zeroext %str) {
5646 ; CHECK-P10-LABEL: st_align64_uint16_t_uint32_t:
5647 ; CHECK-P10: # %bb.0: # %entry
5648 ; CHECK-P10-NEXT: pli r5, 244140625
5649 ; CHECK-P10-NEXT: rldic r5, r5, 12, 24
5650 ; CHECK-P10-NEXT: stwx r4, r3, r5
5651 ; CHECK-P10-NEXT: blr
5653 ; CHECK-PREP10-LABEL: st_align64_uint16_t_uint32_t:
5654 ; CHECK-PREP10: # %bb.0: # %entry
5655 ; CHECK-PREP10-NEXT: lis r5, 3725
5656 ; CHECK-PREP10-NEXT: ori r5, r5, 19025
5657 ; CHECK-PREP10-NEXT: rldic r5, r5, 12, 24
5658 ; CHECK-PREP10-NEXT: stwx r4, r3, r5
5659 ; CHECK-PREP10-NEXT: blr
5661 %conv = zext i16 %str to i32
5662 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
5663 %0 = bitcast i8* %add.ptr to i32*
5664 store i32 %conv, i32* %0, align 4
5668 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5669 define dso_local void @st_reg_uint16_t_uint32_t(i8* nocapture %ptr, i64 %off, i16 zeroext %str) {
5670 ; CHECK-LABEL: st_reg_uint16_t_uint32_t:
5671 ; CHECK: # %bb.0: # %entry
5672 ; CHECK-NEXT: stwx r5, r3, r4
5675 %conv = zext i16 %str to i32
5676 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
5677 %0 = bitcast i8* %add.ptr to i32*
5678 store i32 %conv, i32* %0, align 4
5682 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5683 define dso_local void @st_or1_uint16_t_uint32_t(i64 %ptr, i8 zeroext %off, i16 zeroext %str) {
5684 ; CHECK-LABEL: st_or1_uint16_t_uint32_t:
5685 ; CHECK: # %bb.0: # %entry
5686 ; CHECK-NEXT: or r3, r4, r3
5687 ; CHECK-NEXT: stw r5, 0(r3)
5690 %conv = zext i16 %str to i32
5691 %conv1 = zext i8 %off to i64
5692 %or = or i64 %conv1, %ptr
5693 %0 = inttoptr i64 %or to i32*
5694 store i32 %conv, i32* %0, align 4
5698 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5699 define dso_local void @st_not_disjoint16_uint16_t_uint32_t(i64 %ptr, i16 zeroext %str) {
5700 ; CHECK-LABEL: st_not_disjoint16_uint16_t_uint32_t:
5701 ; CHECK: # %bb.0: # %entry
5702 ; CHECK-NEXT: ori r3, r3, 6
5703 ; CHECK-NEXT: stw r4, 0(r3)
5706 %conv = zext i16 %str to i32
5707 %or = or i64 %ptr, 6
5708 %0 = inttoptr i64 %or to i32*
5709 store i32 %conv, i32* %0, align 4
5713 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5714 define dso_local void @st_disjoint_align16_uint16_t_uint32_t(i64 %ptr, i16 zeroext %str) {
5715 ; CHECK-LABEL: st_disjoint_align16_uint16_t_uint32_t:
5716 ; CHECK: # %bb.0: # %entry
5717 ; CHECK-NEXT: rldicr r3, r3, 0, 51
5718 ; CHECK-NEXT: stw r4, 24(r3)
5721 %and = and i64 %ptr, -4096
5722 %conv = zext i16 %str to i32
5723 %or = or i64 %and, 24
5724 %0 = inttoptr i64 %or to i32*
5725 store i32 %conv, i32* %0, align 8
5729 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5730 define dso_local void @st_not_disjoint32_uint16_t_uint32_t(i64 %ptr, i16 zeroext %str) {
5731 ; CHECK-LABEL: st_not_disjoint32_uint16_t_uint32_t:
5732 ; CHECK: # %bb.0: # %entry
5733 ; CHECK-NEXT: ori r3, r3, 34463
5734 ; CHECK-NEXT: oris r3, r3, 1
5735 ; CHECK-NEXT: stw r4, 0(r3)
5738 %conv = zext i16 %str to i32
5739 %or = or i64 %ptr, 99999
5740 %0 = inttoptr i64 %or to i32*
5741 store i32 %conv, i32* %0, align 4
5745 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5746 define dso_local void @st_disjoint_align32_uint16_t_uint32_t(i64 %ptr, i16 zeroext %str) {
5747 ; CHECK-P10-LABEL: st_disjoint_align32_uint16_t_uint32_t:
5748 ; CHECK-P10: # %bb.0: # %entry
5749 ; CHECK-P10-NEXT: lis r5, -15264
5750 ; CHECK-P10-NEXT: and r3, r3, r5
5751 ; CHECK-P10-NEXT: pli r5, 999990000
5752 ; CHECK-P10-NEXT: stwx r4, r3, r5
5753 ; CHECK-P10-NEXT: blr
5755 ; CHECK-P9-LABEL: st_disjoint_align32_uint16_t_uint32_t:
5756 ; CHECK-P9: # %bb.0: # %entry
5757 ; CHECK-P9-NEXT: lis r5, -15264
5758 ; CHECK-P9-NEXT: and r3, r3, r5
5759 ; CHECK-P9-NEXT: lis r5, 15258
5760 ; CHECK-P9-NEXT: ori r5, r5, 41712
5761 ; CHECK-P9-NEXT: stwx r4, r3, r5
5762 ; CHECK-P9-NEXT: blr
5764 ; CHECK-P8-LABEL: st_disjoint_align32_uint16_t_uint32_t:
5765 ; CHECK-P8: # %bb.0: # %entry
5766 ; CHECK-P8-NEXT: lis r5, -15264
5767 ; CHECK-P8-NEXT: lis r6, 15258
5768 ; CHECK-P8-NEXT: and r3, r3, r5
5769 ; CHECK-P8-NEXT: ori r5, r6, 41712
5770 ; CHECK-P8-NEXT: stwx r4, r3, r5
5771 ; CHECK-P8-NEXT: blr
5773 %and = and i64 %ptr, -1000341504
5774 %conv = zext i16 %str to i32
5775 %or = or i64 %and, 999990000
5776 %0 = inttoptr i64 %or to i32*
5777 store i32 %conv, i32* %0, align 16
5781 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5782 define dso_local void @st_not_disjoint64_uint16_t_uint32_t(i64 %ptr, i16 zeroext %str) {
5783 ; CHECK-P10-LABEL: st_not_disjoint64_uint16_t_uint32_t:
5784 ; CHECK-P10: # %bb.0: # %entry
5785 ; CHECK-P10-NEXT: pli r5, 232
5786 ; CHECK-P10-NEXT: pli r6, 3567587329
5787 ; CHECK-P10-NEXT: rldimi r6, r5, 32, 0
5788 ; CHECK-P10-NEXT: or r3, r3, r6
5789 ; CHECK-P10-NEXT: stw r4, 0(r3)
5790 ; CHECK-P10-NEXT: blr
5792 ; CHECK-PREP10-LABEL: st_not_disjoint64_uint16_t_uint32_t:
5793 ; CHECK-PREP10: # %bb.0: # %entry
5794 ; CHECK-PREP10-NEXT: li r5, 29
5795 ; CHECK-PREP10-NEXT: rldic r5, r5, 35, 24
5796 ; CHECK-PREP10-NEXT: oris r5, r5, 54437
5797 ; CHECK-PREP10-NEXT: ori r5, r5, 4097
5798 ; CHECK-PREP10-NEXT: or r3, r3, r5
5799 ; CHECK-PREP10-NEXT: stw r4, 0(r3)
5800 ; CHECK-PREP10-NEXT: blr
5802 %conv = zext i16 %str to i32
5803 %or = or i64 %ptr, 1000000000001
5804 %0 = inttoptr i64 %or to i32*
5805 store i32 %conv, i32* %0, align 4
5809 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5810 define dso_local void @st_disjoint_align64_uint16_t_uint32_t(i64 %ptr, i16 zeroext %str) {
5811 ; CHECK-P10-LABEL: st_disjoint_align64_uint16_t_uint32_t:
5812 ; CHECK-P10: # %bb.0: # %entry
5813 ; CHECK-P10-NEXT: pli r5, 244140625
5814 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
5815 ; CHECK-P10-NEXT: rldic r5, r5, 12, 24
5816 ; CHECK-P10-NEXT: stwx r4, r3, r5
5817 ; CHECK-P10-NEXT: blr
5819 ; CHECK-PREP10-LABEL: st_disjoint_align64_uint16_t_uint32_t:
5820 ; CHECK-PREP10: # %bb.0: # %entry
5821 ; CHECK-PREP10-NEXT: lis r5, 3725
5822 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
5823 ; CHECK-PREP10-NEXT: ori r5, r5, 19025
5824 ; CHECK-PREP10-NEXT: rldic r5, r5, 12, 24
5825 ; CHECK-PREP10-NEXT: stwx r4, r3, r5
5826 ; CHECK-PREP10-NEXT: blr
5828 %and = and i64 %ptr, -1099511627776
5829 %conv = zext i16 %str to i32
5830 %or = or i64 %and, 1000000000000
5831 %0 = inttoptr i64 %or to i32*
5832 store i32 %conv, i32* %0, align 4096
5836 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5837 define dso_local void @st_cst_align16_uint16_t_uint32_t(i16 zeroext %str) {
5838 ; CHECK-LABEL: st_cst_align16_uint16_t_uint32_t:
5839 ; CHECK: # %bb.0: # %entry
5840 ; CHECK-NEXT: stw r3, 4080(0)
5843 %conv = zext i16 %str to i32
5844 store i32 %conv, i32* inttoptr (i64 4080 to i32*), align 16
5848 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5849 define dso_local void @st_cst_align32_uint16_t_uint32_t(i16 zeroext %str) {
5850 ; CHECK-LABEL: st_cst_align32_uint16_t_uint32_t:
5851 ; CHECK: # %bb.0: # %entry
5852 ; CHECK-NEXT: lis r4, 153
5853 ; CHECK-NEXT: stw r3, -27108(r4)
5856 %conv = zext i16 %str to i32
5857 store i32 %conv, i32* inttoptr (i64 9999900 to i32*), align 4
5861 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5862 define dso_local void @st_cst_align64_uint16_t_uint32_t(i16 zeroext %str) {
5863 ; CHECK-P10-LABEL: st_cst_align64_uint16_t_uint32_t:
5864 ; CHECK-P10: # %bb.0: # %entry
5865 ; CHECK-P10-NEXT: pli r4, 244140625
5866 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
5867 ; CHECK-P10-NEXT: stw r3, 0(r4)
5868 ; CHECK-P10-NEXT: blr
5870 ; CHECK-PREP10-LABEL: st_cst_align64_uint16_t_uint32_t:
5871 ; CHECK-PREP10: # %bb.0: # %entry
5872 ; CHECK-PREP10-NEXT: lis r4, 3725
5873 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
5874 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
5875 ; CHECK-PREP10-NEXT: stw r3, 0(r4)
5876 ; CHECK-PREP10-NEXT: blr
5878 %conv = zext i16 %str to i32
5879 store i32 %conv, i32* inttoptr (i64 1000000000000 to i32*), align 4096
5883 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5884 define dso_local void @st_0_uint16_t_uint64_t(i64 %ptr, i16 zeroext %str) {
5885 ; CHECK-LABEL: st_0_uint16_t_uint64_t:
5886 ; CHECK: # %bb.0: # %entry
5887 ; CHECK-NEXT: std r4, 0(r3)
5890 %conv = zext i16 %str to i64
5891 %0 = inttoptr i64 %ptr to i64*
5892 store i64 %conv, i64* %0, align 8
5896 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5897 define dso_local void @st_align16_uint16_t_uint64_t(i8* nocapture %ptr, i16 zeroext %str) {
5898 ; CHECK-LABEL: st_align16_uint16_t_uint64_t:
5899 ; CHECK: # %bb.0: # %entry
5900 ; CHECK-NEXT: std r4, 8(r3)
5903 %conv = zext i16 %str to i64
5904 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
5905 %0 = bitcast i8* %add.ptr to i64*
5906 store i64 %conv, i64* %0, align 8
5910 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5911 define dso_local void @st_align32_uint16_t_uint64_t(i8* nocapture %ptr, i16 zeroext %str) {
5912 ; CHECK-P10-LABEL: st_align32_uint16_t_uint64_t:
5913 ; CHECK-P10: # %bb.0: # %entry
5914 ; CHECK-P10-NEXT: pli r5, 99999000
5915 ; CHECK-P10-NEXT: stdx r4, r3, r5
5916 ; CHECK-P10-NEXT: blr
5918 ; CHECK-PREP10-LABEL: st_align32_uint16_t_uint64_t:
5919 ; CHECK-PREP10: # %bb.0: # %entry
5920 ; CHECK-PREP10-NEXT: lis r5, 1525
5921 ; CHECK-PREP10-NEXT: ori r5, r5, 56600
5922 ; CHECK-PREP10-NEXT: stdx r4, r3, r5
5923 ; CHECK-PREP10-NEXT: blr
5925 %conv = zext i16 %str to i64
5926 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
5927 %0 = bitcast i8* %add.ptr to i64*
5928 store i64 %conv, i64* %0, align 8
5932 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5933 define dso_local void @st_align64_uint16_t_uint64_t(i8* nocapture %ptr, i16 zeroext %str) {
5934 ; CHECK-P10-LABEL: st_align64_uint16_t_uint64_t:
5935 ; CHECK-P10: # %bb.0: # %entry
5936 ; CHECK-P10-NEXT: pli r5, 244140625
5937 ; CHECK-P10-NEXT: rldic r5, r5, 12, 24
5938 ; CHECK-P10-NEXT: stdx r4, r3, r5
5939 ; CHECK-P10-NEXT: blr
5941 ; CHECK-PREP10-LABEL: st_align64_uint16_t_uint64_t:
5942 ; CHECK-PREP10: # %bb.0: # %entry
5943 ; CHECK-PREP10-NEXT: lis r5, 3725
5944 ; CHECK-PREP10-NEXT: ori r5, r5, 19025
5945 ; CHECK-PREP10-NEXT: rldic r5, r5, 12, 24
5946 ; CHECK-PREP10-NEXT: stdx r4, r3, r5
5947 ; CHECK-PREP10-NEXT: blr
5949 %conv = zext i16 %str to i64
5950 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
5951 %0 = bitcast i8* %add.ptr to i64*
5952 store i64 %conv, i64* %0, align 8
5956 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5957 define dso_local void @st_reg_uint16_t_uint64_t(i8* nocapture %ptr, i64 %off, i16 zeroext %str) {
5958 ; CHECK-LABEL: st_reg_uint16_t_uint64_t:
5959 ; CHECK: # %bb.0: # %entry
5960 ; CHECK-NEXT: stdx r5, r3, r4
5963 %conv = zext i16 %str to i64
5964 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
5965 %0 = bitcast i8* %add.ptr to i64*
5966 store i64 %conv, i64* %0, align 8
5970 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5971 define dso_local void @st_or1_uint16_t_uint64_t(i64 %ptr, i8 zeroext %off, i16 zeroext %str) {
5972 ; CHECK-LABEL: st_or1_uint16_t_uint64_t:
5973 ; CHECK: # %bb.0: # %entry
5974 ; CHECK-NEXT: or r3, r4, r3
5975 ; CHECK-NEXT: std r5, 0(r3)
5978 %conv = zext i16 %str to i64
5979 %conv1 = zext i8 %off to i64
5980 %or = or i64 %conv1, %ptr
5981 %0 = inttoptr i64 %or to i64*
5982 store i64 %conv, i64* %0, align 8
5986 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
5987 define dso_local void @st_not_disjoint16_uint16_t_uint64_t(i64 %ptr, i16 zeroext %str) {
5988 ; CHECK-LABEL: st_not_disjoint16_uint16_t_uint64_t:
5989 ; CHECK: # %bb.0: # %entry
5990 ; CHECK-NEXT: ori r3, r3, 6
5991 ; CHECK-NEXT: std r4, 0(r3)
5994 %conv = zext i16 %str to i64
5995 %or = or i64 %ptr, 6
5996 %0 = inttoptr i64 %or to i64*
5997 store i64 %conv, i64* %0, align 8
6001 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6002 define dso_local void @st_disjoint_align16_uint16_t_uint64_t(i64 %ptr, i16 zeroext %str) {
6003 ; CHECK-LABEL: st_disjoint_align16_uint16_t_uint64_t:
6004 ; CHECK: # %bb.0: # %entry
6005 ; CHECK-NEXT: rldicr r3, r3, 0, 51
6006 ; CHECK-NEXT: std r4, 24(r3)
6009 %and = and i64 %ptr, -4096
6010 %conv = zext i16 %str to i64
6011 %or = or i64 %and, 24
6012 %0 = inttoptr i64 %or to i64*
6013 store i64 %conv, i64* %0, align 8
6017 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6018 define dso_local void @st_not_disjoint32_uint16_t_uint64_t(i64 %ptr, i16 zeroext %str) {
6019 ; CHECK-LABEL: st_not_disjoint32_uint16_t_uint64_t:
6020 ; CHECK: # %bb.0: # %entry
6021 ; CHECK-NEXT: ori r3, r3, 34463
6022 ; CHECK-NEXT: oris r3, r3, 1
6023 ; CHECK-NEXT: std r4, 0(r3)
6026 %conv = zext i16 %str to i64
6027 %or = or i64 %ptr, 99999
6028 %0 = inttoptr i64 %or to i64*
6029 store i64 %conv, i64* %0, align 8
6033 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6034 define dso_local void @st_disjoint_align32_uint16_t_uint64_t(i64 %ptr, i16 zeroext %str) {
6035 ; CHECK-P10-LABEL: st_disjoint_align32_uint16_t_uint64_t:
6036 ; CHECK-P10: # %bb.0: # %entry
6037 ; CHECK-P10-NEXT: lis r5, -15264
6038 ; CHECK-P10-NEXT: and r3, r3, r5
6039 ; CHECK-P10-NEXT: pli r5, 999990000
6040 ; CHECK-P10-NEXT: stdx r4, r3, r5
6041 ; CHECK-P10-NEXT: blr
6043 ; CHECK-P9-LABEL: st_disjoint_align32_uint16_t_uint64_t:
6044 ; CHECK-P9: # %bb.0: # %entry
6045 ; CHECK-P9-NEXT: lis r5, -15264
6046 ; CHECK-P9-NEXT: and r3, r3, r5
6047 ; CHECK-P9-NEXT: lis r5, 15258
6048 ; CHECK-P9-NEXT: ori r5, r5, 41712
6049 ; CHECK-P9-NEXT: stdx r4, r3, r5
6050 ; CHECK-P9-NEXT: blr
6052 ; CHECK-P8-LABEL: st_disjoint_align32_uint16_t_uint64_t:
6053 ; CHECK-P8: # %bb.0: # %entry
6054 ; CHECK-P8-NEXT: lis r5, -15264
6055 ; CHECK-P8-NEXT: lis r6, 15258
6056 ; CHECK-P8-NEXT: and r3, r3, r5
6057 ; CHECK-P8-NEXT: ori r5, r6, 41712
6058 ; CHECK-P8-NEXT: stdx r4, r3, r5
6059 ; CHECK-P8-NEXT: blr
6061 %and = and i64 %ptr, -1000341504
6062 %conv = zext i16 %str to i64
6063 %or = or i64 %and, 999990000
6064 %0 = inttoptr i64 %or to i64*
6065 store i64 %conv, i64* %0, align 16
6069 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6070 define dso_local void @st_not_disjoint64_uint16_t_uint64_t(i64 %ptr, i16 zeroext %str) {
6071 ; CHECK-P10-LABEL: st_not_disjoint64_uint16_t_uint64_t:
6072 ; CHECK-P10: # %bb.0: # %entry
6073 ; CHECK-P10-NEXT: pli r5, 232
6074 ; CHECK-P10-NEXT: pli r6, 3567587329
6075 ; CHECK-P10-NEXT: rldimi r6, r5, 32, 0
6076 ; CHECK-P10-NEXT: or r3, r3, r6
6077 ; CHECK-P10-NEXT: std r4, 0(r3)
6078 ; CHECK-P10-NEXT: blr
6080 ; CHECK-PREP10-LABEL: st_not_disjoint64_uint16_t_uint64_t:
6081 ; CHECK-PREP10: # %bb.0: # %entry
6082 ; CHECK-PREP10-NEXT: li r5, 29
6083 ; CHECK-PREP10-NEXT: rldic r5, r5, 35, 24
6084 ; CHECK-PREP10-NEXT: oris r5, r5, 54437
6085 ; CHECK-PREP10-NEXT: ori r5, r5, 4097
6086 ; CHECK-PREP10-NEXT: or r3, r3, r5
6087 ; CHECK-PREP10-NEXT: std r4, 0(r3)
6088 ; CHECK-PREP10-NEXT: blr
6090 %conv = zext i16 %str to i64
6091 %or = or i64 %ptr, 1000000000001
6092 %0 = inttoptr i64 %or to i64*
6093 store i64 %conv, i64* %0, align 8
6097 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6098 define dso_local void @st_disjoint_align64_uint16_t_uint64_t(i64 %ptr, i16 zeroext %str) {
6099 ; CHECK-P10-LABEL: st_disjoint_align64_uint16_t_uint64_t:
6100 ; CHECK-P10: # %bb.0: # %entry
6101 ; CHECK-P10-NEXT: pli r5, 244140625
6102 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
6103 ; CHECK-P10-NEXT: rldic r5, r5, 12, 24
6104 ; CHECK-P10-NEXT: stdx r4, r3, r5
6105 ; CHECK-P10-NEXT: blr
6107 ; CHECK-PREP10-LABEL: st_disjoint_align64_uint16_t_uint64_t:
6108 ; CHECK-PREP10: # %bb.0: # %entry
6109 ; CHECK-PREP10-NEXT: lis r5, 3725
6110 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
6111 ; CHECK-PREP10-NEXT: ori r5, r5, 19025
6112 ; CHECK-PREP10-NEXT: rldic r5, r5, 12, 24
6113 ; CHECK-PREP10-NEXT: stdx r4, r3, r5
6114 ; CHECK-PREP10-NEXT: blr
6116 %and = and i64 %ptr, -1099511627776
6117 %conv = zext i16 %str to i64
6118 %or = or i64 %and, 1000000000000
6119 %0 = inttoptr i64 %or to i64*
6120 store i64 %conv, i64* %0, align 4096
6124 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6125 define dso_local void @st_cst_align16_uint16_t_uint64_t(i16 zeroext %str) {
6126 ; CHECK-LABEL: st_cst_align16_uint16_t_uint64_t:
6127 ; CHECK: # %bb.0: # %entry
6128 ; CHECK-NEXT: std r3, 4080(0)
6131 %conv = zext i16 %str to i64
6132 store i64 %conv, i64* inttoptr (i64 4080 to i64*), align 16
6136 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6137 define dso_local void @st_cst_align32_uint16_t_uint64_t(i16 zeroext %str) {
6138 ; CHECK-LABEL: st_cst_align32_uint16_t_uint64_t:
6139 ; CHECK: # %bb.0: # %entry
6140 ; CHECK-NEXT: lis r4, 153
6141 ; CHECK-NEXT: std r3, -27108(r4)
6144 %conv = zext i16 %str to i64
6145 store i64 %conv, i64* inttoptr (i64 9999900 to i64*), align 8
6149 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6150 define dso_local void @st_cst_align64_uint16_t_uint64_t(i16 zeroext %str) {
6151 ; CHECK-P10-LABEL: st_cst_align64_uint16_t_uint64_t:
6152 ; CHECK-P10: # %bb.0: # %entry
6153 ; CHECK-P10-NEXT: pli r4, 244140625
6154 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
6155 ; CHECK-P10-NEXT: std r3, 0(r4)
6156 ; CHECK-P10-NEXT: blr
6158 ; CHECK-PREP10-LABEL: st_cst_align64_uint16_t_uint64_t:
6159 ; CHECK-PREP10: # %bb.0: # %entry
6160 ; CHECK-PREP10-NEXT: lis r4, 3725
6161 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
6162 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
6163 ; CHECK-PREP10-NEXT: std r3, 0(r4)
6164 ; CHECK-PREP10-NEXT: blr
6166 %conv = zext i16 %str to i64
6167 store i64 %conv, i64* inttoptr (i64 1000000000000 to i64*), align 4096
6171 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6172 define dso_local void @st_0_uint16_t_float(i64 %ptr, i16 zeroext %str) {
6173 ; CHECK-LABEL: st_0_uint16_t_float:
6174 ; CHECK: # %bb.0: # %entry
6175 ; CHECK-NEXT: mtfprwz f0, r4
6176 ; CHECK-NEXT: xscvuxdsp f0, f0
6177 ; CHECK-NEXT: stfs f0, 0(r3)
6180 %conv = uitofp i16 %str to float
6181 %0 = inttoptr i64 %ptr to float*
6182 store float %conv, float* %0, align 4
6186 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6187 define dso_local void @st_align16_uint16_t_float(i8* nocapture %ptr, i16 zeroext %str) {
6188 ; CHECK-LABEL: st_align16_uint16_t_float:
6189 ; CHECK: # %bb.0: # %entry
6190 ; CHECK-NEXT: mtfprwz f0, r4
6191 ; CHECK-NEXT: xscvuxdsp f0, f0
6192 ; CHECK-NEXT: stfs f0, 8(r3)
6195 %conv = uitofp i16 %str to float
6196 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
6197 %0 = bitcast i8* %add.ptr to float*
6198 store float %conv, float* %0, align 4
6202 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6203 define dso_local void @st_align32_uint16_t_float(i8* nocapture %ptr, i16 zeroext %str) {
6204 ; CHECK-P10-LABEL: st_align32_uint16_t_float:
6205 ; CHECK-P10: # %bb.0: # %entry
6206 ; CHECK-P10-NEXT: mtfprwz f0, r4
6207 ; CHECK-P10-NEXT: pli r4, 99999000
6208 ; CHECK-P10-NEXT: xscvuxdsp f0, f0
6209 ; CHECK-P10-NEXT: stfsx f0, r3, r4
6210 ; CHECK-P10-NEXT: blr
6212 ; CHECK-P9-LABEL: st_align32_uint16_t_float:
6213 ; CHECK-P9: # %bb.0: # %entry
6214 ; CHECK-P9-NEXT: mtfprwz f0, r4
6215 ; CHECK-P9-NEXT: lis r4, 1525
6216 ; CHECK-P9-NEXT: xscvuxdsp f0, f0
6217 ; CHECK-P9-NEXT: ori r4, r4, 56600
6218 ; CHECK-P9-NEXT: stfsx f0, r3, r4
6219 ; CHECK-P9-NEXT: blr
6221 ; CHECK-P8-LABEL: st_align32_uint16_t_float:
6222 ; CHECK-P8: # %bb.0: # %entry
6223 ; CHECK-P8-NEXT: mtfprwz f0, r4
6224 ; CHECK-P8-NEXT: lis r4, 1525
6225 ; CHECK-P8-NEXT: ori r4, r4, 56600
6226 ; CHECK-P8-NEXT: xscvuxdsp f0, f0
6227 ; CHECK-P8-NEXT: stfsx f0, r3, r4
6228 ; CHECK-P8-NEXT: blr
6230 %conv = uitofp i16 %str to float
6231 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
6232 %0 = bitcast i8* %add.ptr to float*
6233 store float %conv, float* %0, align 4
6237 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6238 define dso_local void @st_align64_uint16_t_float(i8* nocapture %ptr, i16 zeroext %str) {
6239 ; CHECK-P10-LABEL: st_align64_uint16_t_float:
6240 ; CHECK-P10: # %bb.0: # %entry
6241 ; CHECK-P10-NEXT: mtfprwz f0, r4
6242 ; CHECK-P10-NEXT: pli r4, 244140625
6243 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
6244 ; CHECK-P10-NEXT: xscvuxdsp f0, f0
6245 ; CHECK-P10-NEXT: stfsx f0, r3, r4
6246 ; CHECK-P10-NEXT: blr
6248 ; CHECK-P9-LABEL: st_align64_uint16_t_float:
6249 ; CHECK-P9: # %bb.0: # %entry
6250 ; CHECK-P9-NEXT: mtfprwz f0, r4
6251 ; CHECK-P9-NEXT: lis r4, 3725
6252 ; CHECK-P9-NEXT: xscvuxdsp f0, f0
6253 ; CHECK-P9-NEXT: ori r4, r4, 19025
6254 ; CHECK-P9-NEXT: rldic r4, r4, 12, 24
6255 ; CHECK-P9-NEXT: stfsx f0, r3, r4
6256 ; CHECK-P9-NEXT: blr
6258 ; CHECK-P8-LABEL: st_align64_uint16_t_float:
6259 ; CHECK-P8: # %bb.0: # %entry
6260 ; CHECK-P8-NEXT: mtfprwz f0, r4
6261 ; CHECK-P8-NEXT: lis r4, 3725
6262 ; CHECK-P8-NEXT: ori r4, r4, 19025
6263 ; CHECK-P8-NEXT: xscvuxdsp f0, f0
6264 ; CHECK-P8-NEXT: rldic r4, r4, 12, 24
6265 ; CHECK-P8-NEXT: stfsx f0, r3, r4
6266 ; CHECK-P8-NEXT: blr
6268 %conv = uitofp i16 %str to float
6269 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
6270 %0 = bitcast i8* %add.ptr to float*
6271 store float %conv, float* %0, align 4
6275 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6276 define dso_local void @st_reg_uint16_t_float(i8* nocapture %ptr, i64 %off, i16 zeroext %str) {
6277 ; CHECK-LABEL: st_reg_uint16_t_float:
6278 ; CHECK: # %bb.0: # %entry
6279 ; CHECK-NEXT: mtfprwz f0, r5
6280 ; CHECK-NEXT: xscvuxdsp f0, f0
6281 ; CHECK-NEXT: stfsx f0, r3, r4
6284 %conv = uitofp i16 %str to float
6285 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
6286 %0 = bitcast i8* %add.ptr to float*
6287 store float %conv, float* %0, align 4
6291 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6292 define dso_local void @st_or1_uint16_t_float(i64 %ptr, i8 zeroext %off, i16 zeroext %str) {
6293 ; CHECK-LABEL: st_or1_uint16_t_float:
6294 ; CHECK: # %bb.0: # %entry
6295 ; CHECK-NEXT: mtfprwz f0, r5
6296 ; CHECK-NEXT: or r3, r4, r3
6297 ; CHECK-NEXT: xscvuxdsp f0, f0
6298 ; CHECK-NEXT: stfs f0, 0(r3)
6301 %conv = uitofp i16 %str to float
6302 %conv1 = zext i8 %off to i64
6303 %or = or i64 %conv1, %ptr
6304 %0 = inttoptr i64 %or to float*
6305 store float %conv, float* %0, align 4
6309 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6310 define dso_local void @st_not_disjoint16_uint16_t_float(i64 %ptr, i16 zeroext %str) {
6311 ; CHECK-LABEL: st_not_disjoint16_uint16_t_float:
6312 ; CHECK: # %bb.0: # %entry
6313 ; CHECK-NEXT: mtfprwz f0, r4
6314 ; CHECK-NEXT: ori r3, r3, 6
6315 ; CHECK-NEXT: xscvuxdsp f0, f0
6316 ; CHECK-NEXT: stfs f0, 0(r3)
6319 %conv = uitofp i16 %str to float
6320 %or = or i64 %ptr, 6
6321 %0 = inttoptr i64 %or to float*
6322 store float %conv, float* %0, align 4
6326 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6327 define dso_local void @st_disjoint_align16_uint16_t_float(i64 %ptr, i16 zeroext %str) {
6328 ; CHECK-LABEL: st_disjoint_align16_uint16_t_float:
6329 ; CHECK: # %bb.0: # %entry
6330 ; CHECK-NEXT: mtfprwz f0, r4
6331 ; CHECK-NEXT: rldicr r3, r3, 0, 51
6332 ; CHECK-NEXT: xscvuxdsp f0, f0
6333 ; CHECK-NEXT: stfs f0, 24(r3)
6336 %and = and i64 %ptr, -4096
6337 %conv = uitofp i16 %str to float
6338 %or = or i64 %and, 24
6339 %0 = inttoptr i64 %or to float*
6340 store float %conv, float* %0, align 8
6344 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6345 define dso_local void @st_not_disjoint32_uint16_t_float(i64 %ptr, i16 zeroext %str) {
6346 ; CHECK-P10-LABEL: st_not_disjoint32_uint16_t_float:
6347 ; CHECK-P10: # %bb.0: # %entry
6348 ; CHECK-P10-NEXT: mtfprwz f0, r4
6349 ; CHECK-P10-NEXT: ori r3, r3, 34463
6350 ; CHECK-P10-NEXT: xscvuxdsp f0, f0
6351 ; CHECK-P10-NEXT: oris r3, r3, 1
6352 ; CHECK-P10-NEXT: stfs f0, 0(r3)
6353 ; CHECK-P10-NEXT: blr
6355 ; CHECK-P9-LABEL: st_not_disjoint32_uint16_t_float:
6356 ; CHECK-P9: # %bb.0: # %entry
6357 ; CHECK-P9-NEXT: mtfprwz f0, r4
6358 ; CHECK-P9-NEXT: ori r3, r3, 34463
6359 ; CHECK-P9-NEXT: xscvuxdsp f0, f0
6360 ; CHECK-P9-NEXT: oris r3, r3, 1
6361 ; CHECK-P9-NEXT: stfs f0, 0(r3)
6362 ; CHECK-P9-NEXT: blr
6364 ; CHECK-P8-LABEL: st_not_disjoint32_uint16_t_float:
6365 ; CHECK-P8: # %bb.0: # %entry
6366 ; CHECK-P8-NEXT: mtfprwz f0, r4
6367 ; CHECK-P8-NEXT: ori r3, r3, 34463
6368 ; CHECK-P8-NEXT: oris r3, r3, 1
6369 ; CHECK-P8-NEXT: xscvuxdsp f0, f0
6370 ; CHECK-P8-NEXT: stfs f0, 0(r3)
6371 ; CHECK-P8-NEXT: blr
6373 %conv = uitofp i16 %str to float
6374 %or = or i64 %ptr, 99999
6375 %0 = inttoptr i64 %or to float*
6376 store float %conv, float* %0, align 4
6380 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6381 define dso_local void @st_disjoint_align32_uint16_t_float(i64 %ptr, i16 zeroext %str) {
6382 ; CHECK-P10-LABEL: st_disjoint_align32_uint16_t_float:
6383 ; CHECK-P10: # %bb.0: # %entry
6384 ; CHECK-P10-NEXT: mtfprwz f0, r4
6385 ; CHECK-P10-NEXT: lis r5, -15264
6386 ; CHECK-P10-NEXT: pli r4, 999990000
6387 ; CHECK-P10-NEXT: xscvuxdsp f0, f0
6388 ; CHECK-P10-NEXT: and r3, r3, r5
6389 ; CHECK-P10-NEXT: stfsx f0, r3, r4
6390 ; CHECK-P10-NEXT: blr
6392 ; CHECK-P9-LABEL: st_disjoint_align32_uint16_t_float:
6393 ; CHECK-P9: # %bb.0: # %entry
6394 ; CHECK-P9-NEXT: mtfprwz f0, r4
6395 ; CHECK-P9-NEXT: lis r5, -15264
6396 ; CHECK-P9-NEXT: lis r4, 15258
6397 ; CHECK-P9-NEXT: xscvuxdsp f0, f0
6398 ; CHECK-P9-NEXT: and r3, r3, r5
6399 ; CHECK-P9-NEXT: ori r4, r4, 41712
6400 ; CHECK-P9-NEXT: stfsx f0, r3, r4
6401 ; CHECK-P9-NEXT: blr
6403 ; CHECK-P8-LABEL: st_disjoint_align32_uint16_t_float:
6404 ; CHECK-P8: # %bb.0: # %entry
6405 ; CHECK-P8-NEXT: mtfprwz f0, r4
6406 ; CHECK-P8-NEXT: lis r4, -15264
6407 ; CHECK-P8-NEXT: lis r5, 15258
6408 ; CHECK-P8-NEXT: and r3, r3, r4
6409 ; CHECK-P8-NEXT: ori r4, r5, 41712
6410 ; CHECK-P8-NEXT: xscvuxdsp f0, f0
6411 ; CHECK-P8-NEXT: stfsx f0, r3, r4
6412 ; CHECK-P8-NEXT: blr
6414 %and = and i64 %ptr, -1000341504
6415 %conv = uitofp i16 %str to float
6416 %or = or i64 %and, 999990000
6417 %0 = inttoptr i64 %or to float*
6418 store float %conv, float* %0, align 16
6422 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6423 define dso_local void @st_not_disjoint64_uint16_t_float(i64 %ptr, i16 zeroext %str) {
6424 ; CHECK-P10-LABEL: st_not_disjoint64_uint16_t_float:
6425 ; CHECK-P10: # %bb.0: # %entry
6426 ; CHECK-P10-NEXT: mtfprwz f0, r4
6427 ; CHECK-P10-NEXT: pli r4, 232
6428 ; CHECK-P10-NEXT: pli r5, 3567587329
6429 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
6430 ; CHECK-P10-NEXT: xscvuxdsp f0, f0
6431 ; CHECK-P10-NEXT: or r3, r3, r5
6432 ; CHECK-P10-NEXT: stfs f0, 0(r3)
6433 ; CHECK-P10-NEXT: blr
6435 ; CHECK-PREP10-LABEL: st_not_disjoint64_uint16_t_float:
6436 ; CHECK-PREP10: # %bb.0: # %entry
6437 ; CHECK-PREP10-NEXT: mtfprwz f0, r4
6438 ; CHECK-PREP10-NEXT: li r4, 29
6439 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
6440 ; CHECK-PREP10-NEXT: xscvuxdsp f0, f0
6441 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
6442 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
6443 ; CHECK-PREP10-NEXT: or r3, r3, r4
6444 ; CHECK-PREP10-NEXT: stfs f0, 0(r3)
6445 ; CHECK-PREP10-NEXT: blr
6447 %conv = uitofp i16 %str to float
6448 %or = or i64 %ptr, 1000000000001
6449 %0 = inttoptr i64 %or to float*
6450 store float %conv, float* %0, align 4
6454 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6455 define dso_local void @st_disjoint_align64_uint16_t_float(i64 %ptr, i16 zeroext %str) {
6456 ; CHECK-P10-LABEL: st_disjoint_align64_uint16_t_float:
6457 ; CHECK-P10: # %bb.0: # %entry
6458 ; CHECK-P10-NEXT: mtfprwz f0, r4
6459 ; CHECK-P10-NEXT: pli r4, 244140625
6460 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
6461 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
6462 ; CHECK-P10-NEXT: xscvuxdsp f0, f0
6463 ; CHECK-P10-NEXT: stfsx f0, r3, r4
6464 ; CHECK-P10-NEXT: blr
6466 ; CHECK-P9-LABEL: st_disjoint_align64_uint16_t_float:
6467 ; CHECK-P9: # %bb.0: # %entry
6468 ; CHECK-P9-NEXT: mtfprwz f0, r4
6469 ; CHECK-P9-NEXT: lis r4, 3725
6470 ; CHECK-P9-NEXT: rldicr r3, r3, 0, 23
6471 ; CHECK-P9-NEXT: xscvuxdsp f0, f0
6472 ; CHECK-P9-NEXT: ori r4, r4, 19025
6473 ; CHECK-P9-NEXT: rldic r4, r4, 12, 24
6474 ; CHECK-P9-NEXT: stfsx f0, r3, r4
6475 ; CHECK-P9-NEXT: blr
6477 ; CHECK-P8-LABEL: st_disjoint_align64_uint16_t_float:
6478 ; CHECK-P8: # %bb.0: # %entry
6479 ; CHECK-P8-NEXT: mtfprwz f0, r4
6480 ; CHECK-P8-NEXT: lis r5, 3725
6481 ; CHECK-P8-NEXT: rldicr r3, r3, 0, 23
6482 ; CHECK-P8-NEXT: ori r4, r5, 19025
6483 ; CHECK-P8-NEXT: xscvuxdsp f0, f0
6484 ; CHECK-P8-NEXT: rldic r4, r4, 12, 24
6485 ; CHECK-P8-NEXT: stfsx f0, r3, r4
6486 ; CHECK-P8-NEXT: blr
6488 %and = and i64 %ptr, -1099511627776
6489 %conv = uitofp i16 %str to float
6490 %or = or i64 %and, 1000000000000
6491 %0 = inttoptr i64 %or to float*
6492 store float %conv, float* %0, align 4096
6496 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6497 define dso_local void @st_cst_align16_uint16_t_float(i16 zeroext %str) {
6498 ; CHECK-LABEL: st_cst_align16_uint16_t_float:
6499 ; CHECK: # %bb.0: # %entry
6500 ; CHECK-NEXT: mtfprwz f0, r3
6501 ; CHECK-NEXT: xscvuxdsp f0, f0
6502 ; CHECK-NEXT: stfs f0, 4080(0)
6505 %conv = uitofp i16 %str to float
6506 store float %conv, float* inttoptr (i64 4080 to float*), align 16
6510 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6511 define dso_local void @st_cst_align32_uint16_t_float(i16 zeroext %str) {
6512 ; CHECK-LABEL: st_cst_align32_uint16_t_float:
6513 ; CHECK: # %bb.0: # %entry
6514 ; CHECK-NEXT: mtfprwz f0, r3
6515 ; CHECK-NEXT: lis r3, 153
6516 ; CHECK-NEXT: xscvuxdsp f0, f0
6517 ; CHECK-NEXT: stfs f0, -27108(r3)
6520 %conv = uitofp i16 %str to float
6521 store float %conv, float* inttoptr (i64 9999900 to float*), align 4
6525 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6526 define dso_local void @st_cst_align64_uint16_t_float(i16 zeroext %str) {
6527 ; CHECK-P10-LABEL: st_cst_align64_uint16_t_float:
6528 ; CHECK-P10: # %bb.0: # %entry
6529 ; CHECK-P10-NEXT: mtfprwz f0, r3
6530 ; CHECK-P10-NEXT: pli r3, 244140625
6531 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
6532 ; CHECK-P10-NEXT: xscvuxdsp f0, f0
6533 ; CHECK-P10-NEXT: stfs f0, 0(r3)
6534 ; CHECK-P10-NEXT: blr
6536 ; CHECK-P9-LABEL: st_cst_align64_uint16_t_float:
6537 ; CHECK-P9: # %bb.0: # %entry
6538 ; CHECK-P9-NEXT: mtfprwz f0, r3
6539 ; CHECK-P9-NEXT: lis r3, 3725
6540 ; CHECK-P9-NEXT: xscvuxdsp f0, f0
6541 ; CHECK-P9-NEXT: ori r3, r3, 19025
6542 ; CHECK-P9-NEXT: rldic r3, r3, 12, 24
6543 ; CHECK-P9-NEXT: stfs f0, 0(r3)
6544 ; CHECK-P9-NEXT: blr
6546 ; CHECK-P8-LABEL: st_cst_align64_uint16_t_float:
6547 ; CHECK-P8: # %bb.0: # %entry
6548 ; CHECK-P8-NEXT: mtfprwz f0, r3
6549 ; CHECK-P8-NEXT: lis r3, 3725
6550 ; CHECK-P8-NEXT: ori r3, r3, 19025
6551 ; CHECK-P8-NEXT: xscvuxdsp f0, f0
6552 ; CHECK-P8-NEXT: rldic r3, r3, 12, 24
6553 ; CHECK-P8-NEXT: stfs f0, 0(r3)
6554 ; CHECK-P8-NEXT: blr
6556 %conv = uitofp i16 %str to float
6557 store float %conv, float* inttoptr (i64 1000000000000 to float*), align 4096
6561 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6562 define dso_local void @st_0_uint16_t_double(i64 %ptr, i16 zeroext %str) {
6563 ; CHECK-LABEL: st_0_uint16_t_double:
6564 ; CHECK: # %bb.0: # %entry
6565 ; CHECK-NEXT: mtfprwz f0, r4
6566 ; CHECK-NEXT: xscvuxddp f0, f0
6567 ; CHECK-NEXT: stfd f0, 0(r3)
6570 %conv = uitofp i16 %str to double
6571 %0 = inttoptr i64 %ptr to double*
6572 store double %conv, double* %0, align 8
6576 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6577 define dso_local void @st_align16_uint16_t_double(i8* nocapture %ptr, i16 zeroext %str) {
6578 ; CHECK-LABEL: st_align16_uint16_t_double:
6579 ; CHECK: # %bb.0: # %entry
6580 ; CHECK-NEXT: mtfprwz f0, r4
6581 ; CHECK-NEXT: xscvuxddp f0, f0
6582 ; CHECK-NEXT: stfd f0, 8(r3)
6585 %conv = uitofp i16 %str to double
6586 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
6587 %0 = bitcast i8* %add.ptr to double*
6588 store double %conv, double* %0, align 8
6592 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6593 define dso_local void @st_align32_uint16_t_double(i8* nocapture %ptr, i16 zeroext %str) {
6594 ; CHECK-P10-LABEL: st_align32_uint16_t_double:
6595 ; CHECK-P10: # %bb.0: # %entry
6596 ; CHECK-P10-NEXT: mtfprwz f0, r4
6597 ; CHECK-P10-NEXT: pli r4, 99999000
6598 ; CHECK-P10-NEXT: xscvuxddp f0, f0
6599 ; CHECK-P10-NEXT: stfdx f0, r3, r4
6600 ; CHECK-P10-NEXT: blr
6602 ; CHECK-P9-LABEL: st_align32_uint16_t_double:
6603 ; CHECK-P9: # %bb.0: # %entry
6604 ; CHECK-P9-NEXT: mtfprwz f0, r4
6605 ; CHECK-P9-NEXT: lis r4, 1525
6606 ; CHECK-P9-NEXT: xscvuxddp f0, f0
6607 ; CHECK-P9-NEXT: ori r4, r4, 56600
6608 ; CHECK-P9-NEXT: stfdx f0, r3, r4
6609 ; CHECK-P9-NEXT: blr
6611 ; CHECK-P8-LABEL: st_align32_uint16_t_double:
6612 ; CHECK-P8: # %bb.0: # %entry
6613 ; CHECK-P8-NEXT: mtfprwz f0, r4
6614 ; CHECK-P8-NEXT: lis r4, 1525
6615 ; CHECK-P8-NEXT: ori r4, r4, 56600
6616 ; CHECK-P8-NEXT: xscvuxddp f0, f0
6617 ; CHECK-P8-NEXT: stfdx f0, r3, r4
6618 ; CHECK-P8-NEXT: blr
6620 %conv = uitofp i16 %str to double
6621 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
6622 %0 = bitcast i8* %add.ptr to double*
6623 store double %conv, double* %0, align 8
6627 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6628 define dso_local void @st_align64_uint16_t_double(i8* nocapture %ptr, i16 zeroext %str) {
6629 ; CHECK-P10-LABEL: st_align64_uint16_t_double:
6630 ; CHECK-P10: # %bb.0: # %entry
6631 ; CHECK-P10-NEXT: mtfprwz f0, r4
6632 ; CHECK-P10-NEXT: pli r4, 244140625
6633 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
6634 ; CHECK-P10-NEXT: xscvuxddp f0, f0
6635 ; CHECK-P10-NEXT: stfdx f0, r3, r4
6636 ; CHECK-P10-NEXT: blr
6638 ; CHECK-P9-LABEL: st_align64_uint16_t_double:
6639 ; CHECK-P9: # %bb.0: # %entry
6640 ; CHECK-P9-NEXT: mtfprwz f0, r4
6641 ; CHECK-P9-NEXT: lis r4, 3725
6642 ; CHECK-P9-NEXT: xscvuxddp f0, f0
6643 ; CHECK-P9-NEXT: ori r4, r4, 19025
6644 ; CHECK-P9-NEXT: rldic r4, r4, 12, 24
6645 ; CHECK-P9-NEXT: stfdx f0, r3, r4
6646 ; CHECK-P9-NEXT: blr
6648 ; CHECK-P8-LABEL: st_align64_uint16_t_double:
6649 ; CHECK-P8: # %bb.0: # %entry
6650 ; CHECK-P8-NEXT: mtfprwz f0, r4
6651 ; CHECK-P8-NEXT: lis r4, 3725
6652 ; CHECK-P8-NEXT: ori r4, r4, 19025
6653 ; CHECK-P8-NEXT: xscvuxddp f0, f0
6654 ; CHECK-P8-NEXT: rldic r4, r4, 12, 24
6655 ; CHECK-P8-NEXT: stfdx f0, r3, r4
6656 ; CHECK-P8-NEXT: blr
6658 %conv = uitofp i16 %str to double
6659 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
6660 %0 = bitcast i8* %add.ptr to double*
6661 store double %conv, double* %0, align 8
6665 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6666 define dso_local void @st_reg_uint16_t_double(i8* nocapture %ptr, i64 %off, i16 zeroext %str) {
6667 ; CHECK-LABEL: st_reg_uint16_t_double:
6668 ; CHECK: # %bb.0: # %entry
6669 ; CHECK-NEXT: mtfprwz f0, r5
6670 ; CHECK-NEXT: xscvuxddp f0, f0
6671 ; CHECK-NEXT: stfdx f0, r3, r4
6674 %conv = uitofp i16 %str to double
6675 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
6676 %0 = bitcast i8* %add.ptr to double*
6677 store double %conv, double* %0, align 8
6681 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6682 define dso_local void @st_or1_uint16_t_double(i64 %ptr, i8 zeroext %off, i16 zeroext %str) {
6683 ; CHECK-LABEL: st_or1_uint16_t_double:
6684 ; CHECK: # %bb.0: # %entry
6685 ; CHECK-NEXT: mtfprwz f0, r5
6686 ; CHECK-NEXT: or r3, r4, r3
6687 ; CHECK-NEXT: xscvuxddp f0, f0
6688 ; CHECK-NEXT: stfd f0, 0(r3)
6691 %conv = uitofp i16 %str to double
6692 %conv1 = zext i8 %off to i64
6693 %or = or i64 %conv1, %ptr
6694 %0 = inttoptr i64 %or to double*
6695 store double %conv, double* %0, align 8
6699 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6700 define dso_local void @st_not_disjoint16_uint16_t_double(i64 %ptr, i16 zeroext %str) {
6701 ; CHECK-LABEL: st_not_disjoint16_uint16_t_double:
6702 ; CHECK: # %bb.0: # %entry
6703 ; CHECK-NEXT: mtfprwz f0, r4
6704 ; CHECK-NEXT: ori r3, r3, 6
6705 ; CHECK-NEXT: xscvuxddp f0, f0
6706 ; CHECK-NEXT: stfd f0, 0(r3)
6709 %conv = uitofp i16 %str to double
6710 %or = or i64 %ptr, 6
6711 %0 = inttoptr i64 %or to double*
6712 store double %conv, double* %0, align 8
6716 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6717 define dso_local void @st_disjoint_align16_uint16_t_double(i64 %ptr, i16 zeroext %str) {
6718 ; CHECK-LABEL: st_disjoint_align16_uint16_t_double:
6719 ; CHECK: # %bb.0: # %entry
6720 ; CHECK-NEXT: mtfprwz f0, r4
6721 ; CHECK-NEXT: rldicr r3, r3, 0, 51
6722 ; CHECK-NEXT: xscvuxddp f0, f0
6723 ; CHECK-NEXT: stfd f0, 24(r3)
6726 %and = and i64 %ptr, -4096
6727 %conv = uitofp i16 %str to double
6728 %or = or i64 %and, 24
6729 %0 = inttoptr i64 %or to double*
6730 store double %conv, double* %0, align 8
6734 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6735 define dso_local void @st_not_disjoint32_uint16_t_double(i64 %ptr, i16 zeroext %str) {
6736 ; CHECK-P10-LABEL: st_not_disjoint32_uint16_t_double:
6737 ; CHECK-P10: # %bb.0: # %entry
6738 ; CHECK-P10-NEXT: mtfprwz f0, r4
6739 ; CHECK-P10-NEXT: ori r3, r3, 34463
6740 ; CHECK-P10-NEXT: xscvuxddp f0, f0
6741 ; CHECK-P10-NEXT: oris r3, r3, 1
6742 ; CHECK-P10-NEXT: stfd f0, 0(r3)
6743 ; CHECK-P10-NEXT: blr
6745 ; CHECK-P9-LABEL: st_not_disjoint32_uint16_t_double:
6746 ; CHECK-P9: # %bb.0: # %entry
6747 ; CHECK-P9-NEXT: mtfprwz f0, r4
6748 ; CHECK-P9-NEXT: ori r3, r3, 34463
6749 ; CHECK-P9-NEXT: xscvuxddp f0, f0
6750 ; CHECK-P9-NEXT: oris r3, r3, 1
6751 ; CHECK-P9-NEXT: stfd f0, 0(r3)
6752 ; CHECK-P9-NEXT: blr
6754 ; CHECK-P8-LABEL: st_not_disjoint32_uint16_t_double:
6755 ; CHECK-P8: # %bb.0: # %entry
6756 ; CHECK-P8-NEXT: mtfprwz f0, r4
6757 ; CHECK-P8-NEXT: ori r3, r3, 34463
6758 ; CHECK-P8-NEXT: oris r3, r3, 1
6759 ; CHECK-P8-NEXT: xscvuxddp f0, f0
6760 ; CHECK-P8-NEXT: stfd f0, 0(r3)
6761 ; CHECK-P8-NEXT: blr
6763 %conv = uitofp i16 %str to double
6764 %or = or i64 %ptr, 99999
6765 %0 = inttoptr i64 %or to double*
6766 store double %conv, double* %0, align 8
6770 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6771 define dso_local void @st_disjoint_align32_uint16_t_double(i64 %ptr, i16 zeroext %str) {
6772 ; CHECK-P10-LABEL: st_disjoint_align32_uint16_t_double:
6773 ; CHECK-P10: # %bb.0: # %entry
6774 ; CHECK-P10-NEXT: mtfprwz f0, r4
6775 ; CHECK-P10-NEXT: lis r5, -15264
6776 ; CHECK-P10-NEXT: pli r4, 999990000
6777 ; CHECK-P10-NEXT: xscvuxddp f0, f0
6778 ; CHECK-P10-NEXT: and r3, r3, r5
6779 ; CHECK-P10-NEXT: stfdx f0, r3, r4
6780 ; CHECK-P10-NEXT: blr
6782 ; CHECK-P9-LABEL: st_disjoint_align32_uint16_t_double:
6783 ; CHECK-P9: # %bb.0: # %entry
6784 ; CHECK-P9-NEXT: mtfprwz f0, r4
6785 ; CHECK-P9-NEXT: lis r5, -15264
6786 ; CHECK-P9-NEXT: lis r4, 15258
6787 ; CHECK-P9-NEXT: xscvuxddp f0, f0
6788 ; CHECK-P9-NEXT: and r3, r3, r5
6789 ; CHECK-P9-NEXT: ori r4, r4, 41712
6790 ; CHECK-P9-NEXT: stfdx f0, r3, r4
6791 ; CHECK-P9-NEXT: blr
6793 ; CHECK-P8-LABEL: st_disjoint_align32_uint16_t_double:
6794 ; CHECK-P8: # %bb.0: # %entry
6795 ; CHECK-P8-NEXT: mtfprwz f0, r4
6796 ; CHECK-P8-NEXT: lis r4, -15264
6797 ; CHECK-P8-NEXT: lis r5, 15258
6798 ; CHECK-P8-NEXT: and r3, r3, r4
6799 ; CHECK-P8-NEXT: ori r4, r5, 41712
6800 ; CHECK-P8-NEXT: xscvuxddp f0, f0
6801 ; CHECK-P8-NEXT: stfdx f0, r3, r4
6802 ; CHECK-P8-NEXT: blr
6804 %and = and i64 %ptr, -1000341504
6805 %conv = uitofp i16 %str to double
6806 %or = or i64 %and, 999990000
6807 %0 = inttoptr i64 %or to double*
6808 store double %conv, double* %0, align 16
6812 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6813 define dso_local void @st_not_disjoint64_uint16_t_double(i64 %ptr, i16 zeroext %str) {
6814 ; CHECK-P10-LABEL: st_not_disjoint64_uint16_t_double:
6815 ; CHECK-P10: # %bb.0: # %entry
6816 ; CHECK-P10-NEXT: mtfprwz f0, r4
6817 ; CHECK-P10-NEXT: pli r4, 232
6818 ; CHECK-P10-NEXT: pli r5, 3567587329
6819 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
6820 ; CHECK-P10-NEXT: xscvuxddp f0, f0
6821 ; CHECK-P10-NEXT: or r3, r3, r5
6822 ; CHECK-P10-NEXT: stfd f0, 0(r3)
6823 ; CHECK-P10-NEXT: blr
6825 ; CHECK-PREP10-LABEL: st_not_disjoint64_uint16_t_double:
6826 ; CHECK-PREP10: # %bb.0: # %entry
6827 ; CHECK-PREP10-NEXT: mtfprwz f0, r4
6828 ; CHECK-PREP10-NEXT: li r4, 29
6829 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
6830 ; CHECK-PREP10-NEXT: xscvuxddp f0, f0
6831 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
6832 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
6833 ; CHECK-PREP10-NEXT: or r3, r3, r4
6834 ; CHECK-PREP10-NEXT: stfd f0, 0(r3)
6835 ; CHECK-PREP10-NEXT: blr
6837 %conv = uitofp i16 %str to double
6838 %or = or i64 %ptr, 1000000000001
6839 %0 = inttoptr i64 %or to double*
6840 store double %conv, double* %0, align 8
6844 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6845 define dso_local void @st_disjoint_align64_uint16_t_double(i64 %ptr, i16 zeroext %str) {
6846 ; CHECK-P10-LABEL: st_disjoint_align64_uint16_t_double:
6847 ; CHECK-P10: # %bb.0: # %entry
6848 ; CHECK-P10-NEXT: mtfprwz f0, r4
6849 ; CHECK-P10-NEXT: pli r4, 244140625
6850 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
6851 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
6852 ; CHECK-P10-NEXT: xscvuxddp f0, f0
6853 ; CHECK-P10-NEXT: stfdx f0, r3, r4
6854 ; CHECK-P10-NEXT: blr
6856 ; CHECK-P9-LABEL: st_disjoint_align64_uint16_t_double:
6857 ; CHECK-P9: # %bb.0: # %entry
6858 ; CHECK-P9-NEXT: mtfprwz f0, r4
6859 ; CHECK-P9-NEXT: lis r4, 3725
6860 ; CHECK-P9-NEXT: rldicr r3, r3, 0, 23
6861 ; CHECK-P9-NEXT: xscvuxddp f0, f0
6862 ; CHECK-P9-NEXT: ori r4, r4, 19025
6863 ; CHECK-P9-NEXT: rldic r4, r4, 12, 24
6864 ; CHECK-P9-NEXT: stfdx f0, r3, r4
6865 ; CHECK-P9-NEXT: blr
6867 ; CHECK-P8-LABEL: st_disjoint_align64_uint16_t_double:
6868 ; CHECK-P8: # %bb.0: # %entry
6869 ; CHECK-P8-NEXT: mtfprwz f0, r4
6870 ; CHECK-P8-NEXT: lis r5, 3725
6871 ; CHECK-P8-NEXT: rldicr r3, r3, 0, 23
6872 ; CHECK-P8-NEXT: ori r4, r5, 19025
6873 ; CHECK-P8-NEXT: xscvuxddp f0, f0
6874 ; CHECK-P8-NEXT: rldic r4, r4, 12, 24
6875 ; CHECK-P8-NEXT: stfdx f0, r3, r4
6876 ; CHECK-P8-NEXT: blr
6878 %and = and i64 %ptr, -1099511627776
6879 %conv = uitofp i16 %str to double
6880 %or = or i64 %and, 1000000000000
6881 %0 = inttoptr i64 %or to double*
6882 store double %conv, double* %0, align 4096
6886 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6887 define dso_local void @st_cst_align16_uint16_t_double(i16 zeroext %str) {
6888 ; CHECK-LABEL: st_cst_align16_uint16_t_double:
6889 ; CHECK: # %bb.0: # %entry
6890 ; CHECK-NEXT: mtfprwz f0, r3
6891 ; CHECK-NEXT: xscvuxddp f0, f0
6892 ; CHECK-NEXT: stfd f0, 4080(0)
6895 %conv = uitofp i16 %str to double
6896 store double %conv, double* inttoptr (i64 4080 to double*), align 16
6900 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6901 define dso_local void @st_cst_align32_uint16_t_double(i16 zeroext %str) {
6902 ; CHECK-LABEL: st_cst_align32_uint16_t_double:
6903 ; CHECK: # %bb.0: # %entry
6904 ; CHECK-NEXT: mtfprwz f0, r3
6905 ; CHECK-NEXT: lis r3, 153
6906 ; CHECK-NEXT: xscvuxddp f0, f0
6907 ; CHECK-NEXT: stfd f0, -27108(r3)
6910 %conv = uitofp i16 %str to double
6911 store double %conv, double* inttoptr (i64 9999900 to double*), align 8
6915 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6916 define dso_local void @st_cst_align64_uint16_t_double(i16 zeroext %str) {
6917 ; CHECK-P10-LABEL: st_cst_align64_uint16_t_double:
6918 ; CHECK-P10: # %bb.0: # %entry
6919 ; CHECK-P10-NEXT: mtfprwz f0, r3
6920 ; CHECK-P10-NEXT: pli r3, 244140625
6921 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
6922 ; CHECK-P10-NEXT: xscvuxddp f0, f0
6923 ; CHECK-P10-NEXT: stfd f0, 0(r3)
6924 ; CHECK-P10-NEXT: blr
6926 ; CHECK-P9-LABEL: st_cst_align64_uint16_t_double:
6927 ; CHECK-P9: # %bb.0: # %entry
6928 ; CHECK-P9-NEXT: mtfprwz f0, r3
6929 ; CHECK-P9-NEXT: lis r3, 3725
6930 ; CHECK-P9-NEXT: xscvuxddp f0, f0
6931 ; CHECK-P9-NEXT: ori r3, r3, 19025
6932 ; CHECK-P9-NEXT: rldic r3, r3, 12, 24
6933 ; CHECK-P9-NEXT: stfd f0, 0(r3)
6934 ; CHECK-P9-NEXT: blr
6936 ; CHECK-P8-LABEL: st_cst_align64_uint16_t_double:
6937 ; CHECK-P8: # %bb.0: # %entry
6938 ; CHECK-P8-NEXT: mtfprwz f0, r3
6939 ; CHECK-P8-NEXT: lis r3, 3725
6940 ; CHECK-P8-NEXT: ori r3, r3, 19025
6941 ; CHECK-P8-NEXT: xscvuxddp f0, f0
6942 ; CHECK-P8-NEXT: rldic r3, r3, 12, 24
6943 ; CHECK-P8-NEXT: stfd f0, 0(r3)
6944 ; CHECK-P8-NEXT: blr
6946 %conv = uitofp i16 %str to double
6947 store double %conv, double* inttoptr (i64 1000000000000 to double*), align 4096
6951 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6952 define dso_local void @st_0_int16_t_uint32_t(i64 %ptr, i16 signext %str) {
6953 ; CHECK-LABEL: st_0_int16_t_uint32_t:
6954 ; CHECK: # %bb.0: # %entry
6955 ; CHECK-NEXT: stw r4, 0(r3)
6958 %conv = sext i16 %str to i32
6959 %0 = inttoptr i64 %ptr to i32*
6960 store i32 %conv, i32* %0, align 4
6964 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6965 define dso_local void @st_align16_int16_t_uint32_t(i8* nocapture %ptr, i16 signext %str) {
6966 ; CHECK-LABEL: st_align16_int16_t_uint32_t:
6967 ; CHECK: # %bb.0: # %entry
6968 ; CHECK-NEXT: stw r4, 8(r3)
6971 %conv = sext i16 %str to i32
6972 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
6973 %0 = bitcast i8* %add.ptr to i32*
6974 store i32 %conv, i32* %0, align 4
6978 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
6979 define dso_local void @st_align32_int16_t_uint32_t(i8* nocapture %ptr, i16 signext %str) {
6980 ; CHECK-P10-LABEL: st_align32_int16_t_uint32_t:
6981 ; CHECK-P10: # %bb.0: # %entry
6982 ; CHECK-P10-NEXT: pli r5, 99999000
6983 ; CHECK-P10-NEXT: stwx r4, r3, r5
6984 ; CHECK-P10-NEXT: blr
6986 ; CHECK-PREP10-LABEL: st_align32_int16_t_uint32_t:
6987 ; CHECK-PREP10: # %bb.0: # %entry
6988 ; CHECK-PREP10-NEXT: lis r5, 1525
6989 ; CHECK-PREP10-NEXT: ori r5, r5, 56600
6990 ; CHECK-PREP10-NEXT: stwx r4, r3, r5
6991 ; CHECK-PREP10-NEXT: blr
6993 %conv = sext i16 %str to i32
6994 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
6995 %0 = bitcast i8* %add.ptr to i32*
6996 store i32 %conv, i32* %0, align 4
7000 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7001 define dso_local void @st_align64_int16_t_uint32_t(i8* nocapture %ptr, i16 signext %str) {
7002 ; CHECK-P10-LABEL: st_align64_int16_t_uint32_t:
7003 ; CHECK-P10: # %bb.0: # %entry
7004 ; CHECK-P10-NEXT: pli r5, 244140625
7005 ; CHECK-P10-NEXT: rldic r5, r5, 12, 24
7006 ; CHECK-P10-NEXT: stwx r4, r3, r5
7007 ; CHECK-P10-NEXT: blr
7009 ; CHECK-PREP10-LABEL: st_align64_int16_t_uint32_t:
7010 ; CHECK-PREP10: # %bb.0: # %entry
7011 ; CHECK-PREP10-NEXT: lis r5, 3725
7012 ; CHECK-PREP10-NEXT: ori r5, r5, 19025
7013 ; CHECK-PREP10-NEXT: rldic r5, r5, 12, 24
7014 ; CHECK-PREP10-NEXT: stwx r4, r3, r5
7015 ; CHECK-PREP10-NEXT: blr
7017 %conv = sext i16 %str to i32
7018 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
7019 %0 = bitcast i8* %add.ptr to i32*
7020 store i32 %conv, i32* %0, align 4
7024 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7025 define dso_local void @st_reg_int16_t_uint32_t(i8* nocapture %ptr, i64 %off, i16 signext %str) {
7026 ; CHECK-LABEL: st_reg_int16_t_uint32_t:
7027 ; CHECK: # %bb.0: # %entry
7028 ; CHECK-NEXT: stwx r5, r3, r4
7031 %conv = sext i16 %str to i32
7032 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
7033 %0 = bitcast i8* %add.ptr to i32*
7034 store i32 %conv, i32* %0, align 4
7038 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7039 define dso_local void @st_or1_int16_t_uint32_t(i64 %ptr, i8 zeroext %off, i16 signext %str) {
7040 ; CHECK-LABEL: st_or1_int16_t_uint32_t:
7041 ; CHECK: # %bb.0: # %entry
7042 ; CHECK-NEXT: or r3, r4, r3
7043 ; CHECK-NEXT: stw r5, 0(r3)
7046 %conv = sext i16 %str to i32
7047 %conv1 = zext i8 %off to i64
7048 %or = or i64 %conv1, %ptr
7049 %0 = inttoptr i64 %or to i32*
7050 store i32 %conv, i32* %0, align 4
7054 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7055 define dso_local void @st_not_disjoint16_int16_t_uint32_t(i64 %ptr, i16 signext %str) {
7056 ; CHECK-LABEL: st_not_disjoint16_int16_t_uint32_t:
7057 ; CHECK: # %bb.0: # %entry
7058 ; CHECK-NEXT: ori r3, r3, 6
7059 ; CHECK-NEXT: stw r4, 0(r3)
7062 %conv = sext i16 %str to i32
7063 %or = or i64 %ptr, 6
7064 %0 = inttoptr i64 %or to i32*
7065 store i32 %conv, i32* %0, align 4
7069 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7070 define dso_local void @st_disjoint_align16_int16_t_uint32_t(i64 %ptr, i16 signext %str) {
7071 ; CHECK-LABEL: st_disjoint_align16_int16_t_uint32_t:
7072 ; CHECK: # %bb.0: # %entry
7073 ; CHECK-NEXT: rldicr r3, r3, 0, 51
7074 ; CHECK-NEXT: stw r4, 24(r3)
7077 %and = and i64 %ptr, -4096
7078 %conv = sext i16 %str to i32
7079 %or = or i64 %and, 24
7080 %0 = inttoptr i64 %or to i32*
7081 store i32 %conv, i32* %0, align 8
7085 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7086 define dso_local void @st_not_disjoint32_int16_t_uint32_t(i64 %ptr, i16 signext %str) {
7087 ; CHECK-LABEL: st_not_disjoint32_int16_t_uint32_t:
7088 ; CHECK: # %bb.0: # %entry
7089 ; CHECK-NEXT: ori r3, r3, 34463
7090 ; CHECK-NEXT: oris r3, r3, 1
7091 ; CHECK-NEXT: stw r4, 0(r3)
7094 %conv = sext i16 %str to i32
7095 %or = or i64 %ptr, 99999
7096 %0 = inttoptr i64 %or to i32*
7097 store i32 %conv, i32* %0, align 4
7101 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7102 define dso_local void @st_disjoint_align32_int16_t_uint32_t(i64 %ptr, i16 signext %str) {
7103 ; CHECK-P10-LABEL: st_disjoint_align32_int16_t_uint32_t:
7104 ; CHECK-P10: # %bb.0: # %entry
7105 ; CHECK-P10-NEXT: lis r5, -15264
7106 ; CHECK-P10-NEXT: and r3, r3, r5
7107 ; CHECK-P10-NEXT: pli r5, 999990000
7108 ; CHECK-P10-NEXT: stwx r4, r3, r5
7109 ; CHECK-P10-NEXT: blr
7111 ; CHECK-P9-LABEL: st_disjoint_align32_int16_t_uint32_t:
7112 ; CHECK-P9: # %bb.0: # %entry
7113 ; CHECK-P9-NEXT: lis r5, -15264
7114 ; CHECK-P9-NEXT: and r3, r3, r5
7115 ; CHECK-P9-NEXT: lis r5, 15258
7116 ; CHECK-P9-NEXT: ori r5, r5, 41712
7117 ; CHECK-P9-NEXT: stwx r4, r3, r5
7118 ; CHECK-P9-NEXT: blr
7120 ; CHECK-P8-LABEL: st_disjoint_align32_int16_t_uint32_t:
7121 ; CHECK-P8: # %bb.0: # %entry
7122 ; CHECK-P8-NEXT: lis r5, -15264
7123 ; CHECK-P8-NEXT: lis r6, 15258
7124 ; CHECK-P8-NEXT: and r3, r3, r5
7125 ; CHECK-P8-NEXT: ori r5, r6, 41712
7126 ; CHECK-P8-NEXT: stwx r4, r3, r5
7127 ; CHECK-P8-NEXT: blr
7129 %and = and i64 %ptr, -1000341504
7130 %conv = sext i16 %str to i32
7131 %or = or i64 %and, 999990000
7132 %0 = inttoptr i64 %or to i32*
7133 store i32 %conv, i32* %0, align 16
7137 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7138 define dso_local void @st_not_disjoint64_int16_t_uint32_t(i64 %ptr, i16 signext %str) {
7139 ; CHECK-P10-LABEL: st_not_disjoint64_int16_t_uint32_t:
7140 ; CHECK-P10: # %bb.0: # %entry
7141 ; CHECK-P10-NEXT: pli r5, 232
7142 ; CHECK-P10-NEXT: pli r6, 3567587329
7143 ; CHECK-P10-NEXT: rldimi r6, r5, 32, 0
7144 ; CHECK-P10-NEXT: or r3, r3, r6
7145 ; CHECK-P10-NEXT: stw r4, 0(r3)
7146 ; CHECK-P10-NEXT: blr
7148 ; CHECK-PREP10-LABEL: st_not_disjoint64_int16_t_uint32_t:
7149 ; CHECK-PREP10: # %bb.0: # %entry
7150 ; CHECK-PREP10-NEXT: li r5, 29
7151 ; CHECK-PREP10-NEXT: rldic r5, r5, 35, 24
7152 ; CHECK-PREP10-NEXT: oris r5, r5, 54437
7153 ; CHECK-PREP10-NEXT: ori r5, r5, 4097
7154 ; CHECK-PREP10-NEXT: or r3, r3, r5
7155 ; CHECK-PREP10-NEXT: stw r4, 0(r3)
7156 ; CHECK-PREP10-NEXT: blr
7158 %conv = sext i16 %str to i32
7159 %or = or i64 %ptr, 1000000000001
7160 %0 = inttoptr i64 %or to i32*
7161 store i32 %conv, i32* %0, align 4
7165 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7166 define dso_local void @st_disjoint_align64_int16_t_uint32_t(i64 %ptr, i16 signext %str) {
7167 ; CHECK-P10-LABEL: st_disjoint_align64_int16_t_uint32_t:
7168 ; CHECK-P10: # %bb.0: # %entry
7169 ; CHECK-P10-NEXT: pli r5, 244140625
7170 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
7171 ; CHECK-P10-NEXT: rldic r5, r5, 12, 24
7172 ; CHECK-P10-NEXT: stwx r4, r3, r5
7173 ; CHECK-P10-NEXT: blr
7175 ; CHECK-PREP10-LABEL: st_disjoint_align64_int16_t_uint32_t:
7176 ; CHECK-PREP10: # %bb.0: # %entry
7177 ; CHECK-PREP10-NEXT: lis r5, 3725
7178 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
7179 ; CHECK-PREP10-NEXT: ori r5, r5, 19025
7180 ; CHECK-PREP10-NEXT: rldic r5, r5, 12, 24
7181 ; CHECK-PREP10-NEXT: stwx r4, r3, r5
7182 ; CHECK-PREP10-NEXT: blr
7184 %and = and i64 %ptr, -1099511627776
7185 %conv = sext i16 %str to i32
7186 %or = or i64 %and, 1000000000000
7187 %0 = inttoptr i64 %or to i32*
7188 store i32 %conv, i32* %0, align 4096
7192 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7193 define dso_local void @st_cst_align16_int16_t_uint32_t(i16 signext %str) {
7194 ; CHECK-LABEL: st_cst_align16_int16_t_uint32_t:
7195 ; CHECK: # %bb.0: # %entry
7196 ; CHECK-NEXT: stw r3, 4080(0)
7199 %conv = sext i16 %str to i32
7200 store i32 %conv, i32* inttoptr (i64 4080 to i32*), align 16
7204 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7205 define dso_local void @st_cst_align32_int16_t_uint32_t(i16 signext %str) {
7206 ; CHECK-LABEL: st_cst_align32_int16_t_uint32_t:
7207 ; CHECK: # %bb.0: # %entry
7208 ; CHECK-NEXT: lis r4, 153
7209 ; CHECK-NEXT: stw r3, -27108(r4)
7212 %conv = sext i16 %str to i32
7213 store i32 %conv, i32* inttoptr (i64 9999900 to i32*), align 4
7217 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7218 define dso_local void @st_cst_align64_int16_t_uint32_t(i16 signext %str) {
7219 ; CHECK-P10-LABEL: st_cst_align64_int16_t_uint32_t:
7220 ; CHECK-P10: # %bb.0: # %entry
7221 ; CHECK-P10-NEXT: pli r4, 244140625
7222 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
7223 ; CHECK-P10-NEXT: stw r3, 0(r4)
7224 ; CHECK-P10-NEXT: blr
7226 ; CHECK-PREP10-LABEL: st_cst_align64_int16_t_uint32_t:
7227 ; CHECK-PREP10: # %bb.0: # %entry
7228 ; CHECK-PREP10-NEXT: lis r4, 3725
7229 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
7230 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
7231 ; CHECK-PREP10-NEXT: stw r3, 0(r4)
7232 ; CHECK-PREP10-NEXT: blr
7234 %conv = sext i16 %str to i32
7235 store i32 %conv, i32* inttoptr (i64 1000000000000 to i32*), align 4096
7239 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7240 define dso_local void @st_0_int16_t_uint64_t(i64 %ptr, i16 signext %str) {
7241 ; CHECK-LABEL: st_0_int16_t_uint64_t:
7242 ; CHECK: # %bb.0: # %entry
7243 ; CHECK-NEXT: std r4, 0(r3)
7246 %conv = sext i16 %str to i64
7247 %0 = inttoptr i64 %ptr to i64*
7248 store i64 %conv, i64* %0, align 8
7252 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7253 define dso_local void @st_align16_int16_t_uint64_t(i8* nocapture %ptr, i16 signext %str) {
7254 ; CHECK-LABEL: st_align16_int16_t_uint64_t:
7255 ; CHECK: # %bb.0: # %entry
7256 ; CHECK-NEXT: std r4, 8(r3)
7259 %conv = sext i16 %str to i64
7260 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
7261 %0 = bitcast i8* %add.ptr to i64*
7262 store i64 %conv, i64* %0, align 8
7266 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7267 define dso_local void @st_align32_int16_t_uint64_t(i8* nocapture %ptr, i16 signext %str) {
7268 ; CHECK-P10-LABEL: st_align32_int16_t_uint64_t:
7269 ; CHECK-P10: # %bb.0: # %entry
7270 ; CHECK-P10-NEXT: pli r5, 99999000
7271 ; CHECK-P10-NEXT: stdx r4, r3, r5
7272 ; CHECK-P10-NEXT: blr
7274 ; CHECK-PREP10-LABEL: st_align32_int16_t_uint64_t:
7275 ; CHECK-PREP10: # %bb.0: # %entry
7276 ; CHECK-PREP10-NEXT: lis r5, 1525
7277 ; CHECK-PREP10-NEXT: ori r5, r5, 56600
7278 ; CHECK-PREP10-NEXT: stdx r4, r3, r5
7279 ; CHECK-PREP10-NEXT: blr
7281 %conv = sext i16 %str to i64
7282 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
7283 %0 = bitcast i8* %add.ptr to i64*
7284 store i64 %conv, i64* %0, align 8
7288 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7289 define dso_local void @st_align64_int16_t_uint64_t(i8* nocapture %ptr, i16 signext %str) {
7290 ; CHECK-P10-LABEL: st_align64_int16_t_uint64_t:
7291 ; CHECK-P10: # %bb.0: # %entry
7292 ; CHECK-P10-NEXT: pli r5, 244140625
7293 ; CHECK-P10-NEXT: rldic r5, r5, 12, 24
7294 ; CHECK-P10-NEXT: stdx r4, r3, r5
7295 ; CHECK-P10-NEXT: blr
7297 ; CHECK-PREP10-LABEL: st_align64_int16_t_uint64_t:
7298 ; CHECK-PREP10: # %bb.0: # %entry
7299 ; CHECK-PREP10-NEXT: lis r5, 3725
7300 ; CHECK-PREP10-NEXT: ori r5, r5, 19025
7301 ; CHECK-PREP10-NEXT: rldic r5, r5, 12, 24
7302 ; CHECK-PREP10-NEXT: stdx r4, r3, r5
7303 ; CHECK-PREP10-NEXT: blr
7305 %conv = sext i16 %str to i64
7306 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
7307 %0 = bitcast i8* %add.ptr to i64*
7308 store i64 %conv, i64* %0, align 8
7312 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7313 define dso_local void @st_reg_int16_t_uint64_t(i8* nocapture %ptr, i64 %off, i16 signext %str) {
7314 ; CHECK-LABEL: st_reg_int16_t_uint64_t:
7315 ; CHECK: # %bb.0: # %entry
7316 ; CHECK-NEXT: stdx r5, r3, r4
7319 %conv = sext i16 %str to i64
7320 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
7321 %0 = bitcast i8* %add.ptr to i64*
7322 store i64 %conv, i64* %0, align 8
7326 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7327 define dso_local void @st_or1_int16_t_uint64_t(i64 %ptr, i8 zeroext %off, i16 signext %str) {
7328 ; CHECK-LABEL: st_or1_int16_t_uint64_t:
7329 ; CHECK: # %bb.0: # %entry
7330 ; CHECK-NEXT: or r3, r4, r3
7331 ; CHECK-NEXT: std r5, 0(r3)
7334 %conv = sext i16 %str to i64
7335 %conv1 = zext i8 %off to i64
7336 %or = or i64 %conv1, %ptr
7337 %0 = inttoptr i64 %or to i64*
7338 store i64 %conv, i64* %0, align 8
7342 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7343 define dso_local void @st_not_disjoint16_int16_t_uint64_t(i64 %ptr, i16 signext %str) {
7344 ; CHECK-LABEL: st_not_disjoint16_int16_t_uint64_t:
7345 ; CHECK: # %bb.0: # %entry
7346 ; CHECK-NEXT: ori r3, r3, 6
7347 ; CHECK-NEXT: std r4, 0(r3)
7350 %conv = sext i16 %str to i64
7351 %or = or i64 %ptr, 6
7352 %0 = inttoptr i64 %or to i64*
7353 store i64 %conv, i64* %0, align 8
7357 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7358 define dso_local void @st_disjoint_align16_int16_t_uint64_t(i64 %ptr, i16 signext %str) {
7359 ; CHECK-LABEL: st_disjoint_align16_int16_t_uint64_t:
7360 ; CHECK: # %bb.0: # %entry
7361 ; CHECK-NEXT: rldicr r3, r3, 0, 51
7362 ; CHECK-NEXT: std r4, 24(r3)
7365 %and = and i64 %ptr, -4096
7366 %conv = sext i16 %str to i64
7367 %or = or i64 %and, 24
7368 %0 = inttoptr i64 %or to i64*
7369 store i64 %conv, i64* %0, align 8
7373 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7374 define dso_local void @st_not_disjoint32_int16_t_uint64_t(i64 %ptr, i16 signext %str) {
7375 ; CHECK-LABEL: st_not_disjoint32_int16_t_uint64_t:
7376 ; CHECK: # %bb.0: # %entry
7377 ; CHECK-NEXT: ori r3, r3, 34463
7378 ; CHECK-NEXT: oris r3, r3, 1
7379 ; CHECK-NEXT: std r4, 0(r3)
7382 %conv = sext i16 %str to i64
7383 %or = or i64 %ptr, 99999
7384 %0 = inttoptr i64 %or to i64*
7385 store i64 %conv, i64* %0, align 8
7389 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7390 define dso_local void @st_disjoint_align32_int16_t_uint64_t(i64 %ptr, i16 signext %str) {
7391 ; CHECK-P10-LABEL: st_disjoint_align32_int16_t_uint64_t:
7392 ; CHECK-P10: # %bb.0: # %entry
7393 ; CHECK-P10-NEXT: lis r5, -15264
7394 ; CHECK-P10-NEXT: and r3, r3, r5
7395 ; CHECK-P10-NEXT: pli r5, 999990000
7396 ; CHECK-P10-NEXT: stdx r4, r3, r5
7397 ; CHECK-P10-NEXT: blr
7399 ; CHECK-P9-LABEL: st_disjoint_align32_int16_t_uint64_t:
7400 ; CHECK-P9: # %bb.0: # %entry
7401 ; CHECK-P9-NEXT: lis r5, -15264
7402 ; CHECK-P9-NEXT: and r3, r3, r5
7403 ; CHECK-P9-NEXT: lis r5, 15258
7404 ; CHECK-P9-NEXT: ori r5, r5, 41712
7405 ; CHECK-P9-NEXT: stdx r4, r3, r5
7406 ; CHECK-P9-NEXT: blr
7408 ; CHECK-P8-LABEL: st_disjoint_align32_int16_t_uint64_t:
7409 ; CHECK-P8: # %bb.0: # %entry
7410 ; CHECK-P8-NEXT: lis r5, -15264
7411 ; CHECK-P8-NEXT: lis r6, 15258
7412 ; CHECK-P8-NEXT: and r3, r3, r5
7413 ; CHECK-P8-NEXT: ori r5, r6, 41712
7414 ; CHECK-P8-NEXT: stdx r4, r3, r5
7415 ; CHECK-P8-NEXT: blr
7417 %and = and i64 %ptr, -1000341504
7418 %conv = sext i16 %str to i64
7419 %or = or i64 %and, 999990000
7420 %0 = inttoptr i64 %or to i64*
7421 store i64 %conv, i64* %0, align 16
7425 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7426 define dso_local void @st_not_disjoint64_int16_t_uint64_t(i64 %ptr, i16 signext %str) {
7427 ; CHECK-P10-LABEL: st_not_disjoint64_int16_t_uint64_t:
7428 ; CHECK-P10: # %bb.0: # %entry
7429 ; CHECK-P10-NEXT: pli r5, 232
7430 ; CHECK-P10-NEXT: pli r6, 3567587329
7431 ; CHECK-P10-NEXT: rldimi r6, r5, 32, 0
7432 ; CHECK-P10-NEXT: or r3, r3, r6
7433 ; CHECK-P10-NEXT: std r4, 0(r3)
7434 ; CHECK-P10-NEXT: blr
7436 ; CHECK-PREP10-LABEL: st_not_disjoint64_int16_t_uint64_t:
7437 ; CHECK-PREP10: # %bb.0: # %entry
7438 ; CHECK-PREP10-NEXT: li r5, 29
7439 ; CHECK-PREP10-NEXT: rldic r5, r5, 35, 24
7440 ; CHECK-PREP10-NEXT: oris r5, r5, 54437
7441 ; CHECK-PREP10-NEXT: ori r5, r5, 4097
7442 ; CHECK-PREP10-NEXT: or r3, r3, r5
7443 ; CHECK-PREP10-NEXT: std r4, 0(r3)
7444 ; CHECK-PREP10-NEXT: blr
7446 %conv = sext i16 %str to i64
7447 %or = or i64 %ptr, 1000000000001
7448 %0 = inttoptr i64 %or to i64*
7449 store i64 %conv, i64* %0, align 8
7453 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7454 define dso_local void @st_disjoint_align64_int16_t_uint64_t(i64 %ptr, i16 signext %str) {
7455 ; CHECK-P10-LABEL: st_disjoint_align64_int16_t_uint64_t:
7456 ; CHECK-P10: # %bb.0: # %entry
7457 ; CHECK-P10-NEXT: pli r5, 244140625
7458 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
7459 ; CHECK-P10-NEXT: rldic r5, r5, 12, 24
7460 ; CHECK-P10-NEXT: stdx r4, r3, r5
7461 ; CHECK-P10-NEXT: blr
7463 ; CHECK-PREP10-LABEL: st_disjoint_align64_int16_t_uint64_t:
7464 ; CHECK-PREP10: # %bb.0: # %entry
7465 ; CHECK-PREP10-NEXT: lis r5, 3725
7466 ; CHECK-PREP10-NEXT: rldicr r3, r3, 0, 23
7467 ; CHECK-PREP10-NEXT: ori r5, r5, 19025
7468 ; CHECK-PREP10-NEXT: rldic r5, r5, 12, 24
7469 ; CHECK-PREP10-NEXT: stdx r4, r3, r5
7470 ; CHECK-PREP10-NEXT: blr
7472 %and = and i64 %ptr, -1099511627776
7473 %conv = sext i16 %str to i64
7474 %or = or i64 %and, 1000000000000
7475 %0 = inttoptr i64 %or to i64*
7476 store i64 %conv, i64* %0, align 4096
7480 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7481 define dso_local void @st_cst_align16_int16_t_uint64_t(i16 signext %str) {
7482 ; CHECK-LABEL: st_cst_align16_int16_t_uint64_t:
7483 ; CHECK: # %bb.0: # %entry
7484 ; CHECK-NEXT: std r3, 4080(0)
7487 %conv = sext i16 %str to i64
7488 store i64 %conv, i64* inttoptr (i64 4080 to i64*), align 16
7492 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7493 define dso_local void @st_cst_align32_int16_t_uint64_t(i16 signext %str) {
7494 ; CHECK-LABEL: st_cst_align32_int16_t_uint64_t:
7495 ; CHECK: # %bb.0: # %entry
7496 ; CHECK-NEXT: lis r4, 153
7497 ; CHECK-NEXT: std r3, -27108(r4)
7500 %conv = sext i16 %str to i64
7501 store i64 %conv, i64* inttoptr (i64 9999900 to i64*), align 8
7505 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7506 define dso_local void @st_cst_align64_int16_t_uint64_t(i16 signext %str) {
7507 ; CHECK-P10-LABEL: st_cst_align64_int16_t_uint64_t:
7508 ; CHECK-P10: # %bb.0: # %entry
7509 ; CHECK-P10-NEXT: pli r4, 244140625
7510 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
7511 ; CHECK-P10-NEXT: std r3, 0(r4)
7512 ; CHECK-P10-NEXT: blr
7514 ; CHECK-PREP10-LABEL: st_cst_align64_int16_t_uint64_t:
7515 ; CHECK-PREP10: # %bb.0: # %entry
7516 ; CHECK-PREP10-NEXT: lis r4, 3725
7517 ; CHECK-PREP10-NEXT: ori r4, r4, 19025
7518 ; CHECK-PREP10-NEXT: rldic r4, r4, 12, 24
7519 ; CHECK-PREP10-NEXT: std r3, 0(r4)
7520 ; CHECK-PREP10-NEXT: blr
7522 %conv = sext i16 %str to i64
7523 store i64 %conv, i64* inttoptr (i64 1000000000000 to i64*), align 4096
7527 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7528 define dso_local void @st_0_int16_t_float(i64 %ptr, i16 signext %str) {
7529 ; CHECK-LABEL: st_0_int16_t_float:
7530 ; CHECK: # %bb.0: # %entry
7531 ; CHECK-NEXT: mtfprwa f0, r4
7532 ; CHECK-NEXT: xscvsxdsp f0, f0
7533 ; CHECK-NEXT: stfs f0, 0(r3)
7536 %conv = sitofp i16 %str to float
7537 %0 = inttoptr i64 %ptr to float*
7538 store float %conv, float* %0, align 4
7542 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7543 define dso_local void @st_align16_int16_t_float(i8* nocapture %ptr, i16 signext %str) {
7544 ; CHECK-LABEL: st_align16_int16_t_float:
7545 ; CHECK: # %bb.0: # %entry
7546 ; CHECK-NEXT: mtfprwa f0, r4
7547 ; CHECK-NEXT: xscvsxdsp f0, f0
7548 ; CHECK-NEXT: stfs f0, 8(r3)
7551 %conv = sitofp i16 %str to float
7552 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
7553 %0 = bitcast i8* %add.ptr to float*
7554 store float %conv, float* %0, align 4
7558 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7559 define dso_local void @st_align32_int16_t_float(i8* nocapture %ptr, i16 signext %str) {
7560 ; CHECK-P10-LABEL: st_align32_int16_t_float:
7561 ; CHECK-P10: # %bb.0: # %entry
7562 ; CHECK-P10-NEXT: mtfprwa f0, r4
7563 ; CHECK-P10-NEXT: pli r4, 99999000
7564 ; CHECK-P10-NEXT: xscvsxdsp f0, f0
7565 ; CHECK-P10-NEXT: stfsx f0, r3, r4
7566 ; CHECK-P10-NEXT: blr
7568 ; CHECK-P9-LABEL: st_align32_int16_t_float:
7569 ; CHECK-P9: # %bb.0: # %entry
7570 ; CHECK-P9-NEXT: mtfprwa f0, r4
7571 ; CHECK-P9-NEXT: lis r4, 1525
7572 ; CHECK-P9-NEXT: xscvsxdsp f0, f0
7573 ; CHECK-P9-NEXT: ori r4, r4, 56600
7574 ; CHECK-P9-NEXT: stfsx f0, r3, r4
7575 ; CHECK-P9-NEXT: blr
7577 ; CHECK-P8-LABEL: st_align32_int16_t_float:
7578 ; CHECK-P8: # %bb.0: # %entry
7579 ; CHECK-P8-NEXT: mtfprwa f0, r4
7580 ; CHECK-P8-NEXT: lis r4, 1525
7581 ; CHECK-P8-NEXT: ori r4, r4, 56600
7582 ; CHECK-P8-NEXT: xscvsxdsp f0, f0
7583 ; CHECK-P8-NEXT: stfsx f0, r3, r4
7584 ; CHECK-P8-NEXT: blr
7586 %conv = sitofp i16 %str to float
7587 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
7588 %0 = bitcast i8* %add.ptr to float*
7589 store float %conv, float* %0, align 4
7593 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7594 define dso_local void @st_align64_int16_t_float(i8* nocapture %ptr, i16 signext %str) {
7595 ; CHECK-P10-LABEL: st_align64_int16_t_float:
7596 ; CHECK-P10: # %bb.0: # %entry
7597 ; CHECK-P10-NEXT: mtfprwa f0, r4
7598 ; CHECK-P10-NEXT: pli r4, 244140625
7599 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
7600 ; CHECK-P10-NEXT: xscvsxdsp f0, f0
7601 ; CHECK-P10-NEXT: stfsx f0, r3, r4
7602 ; CHECK-P10-NEXT: blr
7604 ; CHECK-P9-LABEL: st_align64_int16_t_float:
7605 ; CHECK-P9: # %bb.0: # %entry
7606 ; CHECK-P9-NEXT: mtfprwa f0, r4
7607 ; CHECK-P9-NEXT: lis r4, 3725
7608 ; CHECK-P9-NEXT: xscvsxdsp f0, f0
7609 ; CHECK-P9-NEXT: ori r4, r4, 19025
7610 ; CHECK-P9-NEXT: rldic r4, r4, 12, 24
7611 ; CHECK-P9-NEXT: stfsx f0, r3, r4
7612 ; CHECK-P9-NEXT: blr
7614 ; CHECK-P8-LABEL: st_align64_int16_t_float:
7615 ; CHECK-P8: # %bb.0: # %entry
7616 ; CHECK-P8-NEXT: mtfprwa f0, r4
7617 ; CHECK-P8-NEXT: lis r4, 3725
7618 ; CHECK-P8-NEXT: ori r4, r4, 19025
7619 ; CHECK-P8-NEXT: xscvsxdsp f0, f0
7620 ; CHECK-P8-NEXT: rldic r4, r4, 12, 24
7621 ; CHECK-P8-NEXT: stfsx f0, r3, r4
7622 ; CHECK-P8-NEXT: blr
7624 %conv = sitofp i16 %str to float
7625 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
7626 %0 = bitcast i8* %add.ptr to float*
7627 store float %conv, float* %0, align 4
7631 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7632 define dso_local void @st_reg_int16_t_float(i8* nocapture %ptr, i64 %off, i16 signext %str) {
7633 ; CHECK-LABEL: st_reg_int16_t_float:
7634 ; CHECK: # %bb.0: # %entry
7635 ; CHECK-NEXT: mtfprwa f0, r5
7636 ; CHECK-NEXT: xscvsxdsp f0, f0
7637 ; CHECK-NEXT: stfsx f0, r3, r4
7640 %conv = sitofp i16 %str to float
7641 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
7642 %0 = bitcast i8* %add.ptr to float*
7643 store float %conv, float* %0, align 4
7647 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7648 define dso_local void @st_or1_int16_t_float(i64 %ptr, i8 zeroext %off, i16 signext %str) {
7649 ; CHECK-LABEL: st_or1_int16_t_float:
7650 ; CHECK: # %bb.0: # %entry
7651 ; CHECK-NEXT: mtfprwa f0, r5
7652 ; CHECK-NEXT: or r3, r4, r3
7653 ; CHECK-NEXT: xscvsxdsp f0, f0
7654 ; CHECK-NEXT: stfs f0, 0(r3)
7657 %conv = sitofp i16 %str to float
7658 %conv1 = zext i8 %off to i64
7659 %or = or i64 %conv1, %ptr
7660 %0 = inttoptr i64 %or to float*
7661 store float %conv, float* %0, align 4
7665 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7666 define dso_local void @st_not_disjoint16_int16_t_float(i64 %ptr, i16 signext %str) {
7667 ; CHECK-LABEL: st_not_disjoint16_int16_t_float:
7668 ; CHECK: # %bb.0: # %entry
7669 ; CHECK-NEXT: mtfprwa f0, r4
7670 ; CHECK-NEXT: ori r3, r3, 6
7671 ; CHECK-NEXT: xscvsxdsp f0, f0
7672 ; CHECK-NEXT: stfs f0, 0(r3)
7675 %conv = sitofp i16 %str to float
7676 %or = or i64 %ptr, 6
7677 %0 = inttoptr i64 %or to float*
7678 store float %conv, float* %0, align 4
7682 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7683 define dso_local void @st_disjoint_align16_int16_t_float(i64 %ptr, i16 signext %str) {
7684 ; CHECK-LABEL: st_disjoint_align16_int16_t_float:
7685 ; CHECK: # %bb.0: # %entry
7686 ; CHECK-NEXT: mtfprwa f0, r4
7687 ; CHECK-NEXT: rldicr r3, r3, 0, 51
7688 ; CHECK-NEXT: xscvsxdsp f0, f0
7689 ; CHECK-NEXT: stfs f0, 24(r3)
7692 %and = and i64 %ptr, -4096
7693 %conv = sitofp i16 %str to float
7694 %or = or i64 %and, 24
7695 %0 = inttoptr i64 %or to float*
7696 store float %conv, float* %0, align 8
7700 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7701 define dso_local void @st_not_disjoint32_int16_t_float(i64 %ptr, i16 signext %str) {
7702 ; CHECK-P10-LABEL: st_not_disjoint32_int16_t_float:
7703 ; CHECK-P10: # %bb.0: # %entry
7704 ; CHECK-P10-NEXT: mtfprwa f0, r4
7705 ; CHECK-P10-NEXT: ori r3, r3, 34463
7706 ; CHECK-P10-NEXT: xscvsxdsp f0, f0
7707 ; CHECK-P10-NEXT: oris r3, r3, 1
7708 ; CHECK-P10-NEXT: stfs f0, 0(r3)
7709 ; CHECK-P10-NEXT: blr
7711 ; CHECK-P9-LABEL: st_not_disjoint32_int16_t_float:
7712 ; CHECK-P9: # %bb.0: # %entry
7713 ; CHECK-P9-NEXT: mtfprwa f0, r4
7714 ; CHECK-P9-NEXT: ori r3, r3, 34463
7715 ; CHECK-P9-NEXT: xscvsxdsp f0, f0
7716 ; CHECK-P9-NEXT: oris r3, r3, 1
7717 ; CHECK-P9-NEXT: stfs f0, 0(r3)
7718 ; CHECK-P9-NEXT: blr
7720 ; CHECK-P8-LABEL: st_not_disjoint32_int16_t_float:
7721 ; CHECK-P8: # %bb.0: # %entry
7722 ; CHECK-P8-NEXT: mtfprwa f0, r4
7723 ; CHECK-P8-NEXT: ori r3, r3, 34463
7724 ; CHECK-P8-NEXT: oris r3, r3, 1
7725 ; CHECK-P8-NEXT: xscvsxdsp f0, f0
7726 ; CHECK-P8-NEXT: stfs f0, 0(r3)
7727 ; CHECK-P8-NEXT: blr
7729 %conv = sitofp i16 %str to float
7730 %or = or i64 %ptr, 99999
7731 %0 = inttoptr i64 %or to float*
7732 store float %conv, float* %0, align 4
7736 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7737 define dso_local void @st_disjoint_align32_int16_t_float(i64 %ptr, i16 signext %str) {
7738 ; CHECK-P10-LABEL: st_disjoint_align32_int16_t_float:
7739 ; CHECK-P10: # %bb.0: # %entry
7740 ; CHECK-P10-NEXT: mtfprwa f0, r4
7741 ; CHECK-P10-NEXT: lis r5, -15264
7742 ; CHECK-P10-NEXT: pli r4, 999990000
7743 ; CHECK-P10-NEXT: xscvsxdsp f0, f0
7744 ; CHECK-P10-NEXT: and r3, r3, r5
7745 ; CHECK-P10-NEXT: stfsx f0, r3, r4
7746 ; CHECK-P10-NEXT: blr
7748 ; CHECK-P9-LABEL: st_disjoint_align32_int16_t_float:
7749 ; CHECK-P9: # %bb.0: # %entry
7750 ; CHECK-P9-NEXT: mtfprwa f0, r4
7751 ; CHECK-P9-NEXT: lis r5, -15264
7752 ; CHECK-P9-NEXT: lis r4, 15258
7753 ; CHECK-P9-NEXT: xscvsxdsp f0, f0
7754 ; CHECK-P9-NEXT: and r3, r3, r5
7755 ; CHECK-P9-NEXT: ori r4, r4, 41712
7756 ; CHECK-P9-NEXT: stfsx f0, r3, r4
7757 ; CHECK-P9-NEXT: blr
7759 ; CHECK-P8-LABEL: st_disjoint_align32_int16_t_float:
7760 ; CHECK-P8: # %bb.0: # %entry
7761 ; CHECK-P8-NEXT: mtfprwa f0, r4
7762 ; CHECK-P8-NEXT: lis r4, -15264
7763 ; CHECK-P8-NEXT: lis r5, 15258
7764 ; CHECK-P8-NEXT: and r3, r3, r4
7765 ; CHECK-P8-NEXT: ori r4, r5, 41712
7766 ; CHECK-P8-NEXT: xscvsxdsp f0, f0
7767 ; CHECK-P8-NEXT: stfsx f0, r3, r4
7768 ; CHECK-P8-NEXT: blr
7770 %and = and i64 %ptr, -1000341504
7771 %conv = sitofp i16 %str to float
7772 %or = or i64 %and, 999990000
7773 %0 = inttoptr i64 %or to float*
7774 store float %conv, float* %0, align 16
7778 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7779 define dso_local void @st_not_disjoint64_int16_t_float(i64 %ptr, i16 signext %str) {
7780 ; CHECK-P10-LABEL: st_not_disjoint64_int16_t_float:
7781 ; CHECK-P10: # %bb.0: # %entry
7782 ; CHECK-P10-NEXT: mtfprwa f0, r4
7783 ; CHECK-P10-NEXT: pli r4, 232
7784 ; CHECK-P10-NEXT: pli r5, 3567587329
7785 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
7786 ; CHECK-P10-NEXT: xscvsxdsp f0, f0
7787 ; CHECK-P10-NEXT: or r3, r3, r5
7788 ; CHECK-P10-NEXT: stfs f0, 0(r3)
7789 ; CHECK-P10-NEXT: blr
7791 ; CHECK-PREP10-LABEL: st_not_disjoint64_int16_t_float:
7792 ; CHECK-PREP10: # %bb.0: # %entry
7793 ; CHECK-PREP10-NEXT: mtfprwa f0, r4
7794 ; CHECK-PREP10-NEXT: li r4, 29
7795 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
7796 ; CHECK-PREP10-NEXT: xscvsxdsp f0, f0
7797 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
7798 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
7799 ; CHECK-PREP10-NEXT: or r3, r3, r4
7800 ; CHECK-PREP10-NEXT: stfs f0, 0(r3)
7801 ; CHECK-PREP10-NEXT: blr
7803 %conv = sitofp i16 %str to float
7804 %or = or i64 %ptr, 1000000000001
7805 %0 = inttoptr i64 %or to float*
7806 store float %conv, float* %0, align 4
7811 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7812 define dso_local void @st_disjoint_align64_int16_t_float(i64 %ptr, i16 signext %str) {
7813 ; CHECK-P10-LABEL: st_disjoint_align64_int16_t_float:
7814 ; CHECK-P10: # %bb.0: # %entry
7815 ; CHECK-P10-NEXT: mtfprwa f0, r4
7816 ; CHECK-P10-NEXT: pli r4, 244140625
7817 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
7818 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
7819 ; CHECK-P10-NEXT: xscvsxdsp f0, f0
7820 ; CHECK-P10-NEXT: stfsx f0, r3, r4
7821 ; CHECK-P10-NEXT: blr
7823 ; CHECK-P9-LABEL: st_disjoint_align64_int16_t_float:
7824 ; CHECK-P9: # %bb.0: # %entry
7825 ; CHECK-P9-NEXT: mtfprwa f0, r4
7826 ; CHECK-P9-NEXT: lis r4, 3725
7827 ; CHECK-P9-NEXT: rldicr r3, r3, 0, 23
7828 ; CHECK-P9-NEXT: xscvsxdsp f0, f0
7829 ; CHECK-P9-NEXT: ori r4, r4, 19025
7830 ; CHECK-P9-NEXT: rldic r4, r4, 12, 24
7831 ; CHECK-P9-NEXT: stfsx f0, r3, r4
7832 ; CHECK-P9-NEXT: blr
7834 ; CHECK-P8-LABEL: st_disjoint_align64_int16_t_float:
7835 ; CHECK-P8: # %bb.0: # %entry
7836 ; CHECK-P8-NEXT: mtfprwa f0, r4
7837 ; CHECK-P8-NEXT: lis r5, 3725
7838 ; CHECK-P8-NEXT: rldicr r3, r3, 0, 23
7839 ; CHECK-P8-NEXT: ori r4, r5, 19025
7840 ; CHECK-P8-NEXT: xscvsxdsp f0, f0
7841 ; CHECK-P8-NEXT: rldic r4, r4, 12, 24
7842 ; CHECK-P8-NEXT: stfsx f0, r3, r4
7843 ; CHECK-P8-NEXT: blr
7845 %and = and i64 %ptr, -1099511627776
7846 %conv = sitofp i16 %str to float
7847 %or = or i64 %and, 1000000000000
7848 %0 = inttoptr i64 %or to float*
7849 store float %conv, float* %0, align 4096
7853 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7854 define dso_local void @st_cst_align16_int16_t_float(i16 signext %str) {
7855 ; CHECK-LABEL: st_cst_align16_int16_t_float:
7856 ; CHECK: # %bb.0: # %entry
7857 ; CHECK-NEXT: mtfprwa f0, r3
7858 ; CHECK-NEXT: xscvsxdsp f0, f0
7859 ; CHECK-NEXT: stfs f0, 4080(0)
7862 %conv = sitofp i16 %str to float
7863 store float %conv, float* inttoptr (i64 4080 to float*), align 16
7867 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7868 define dso_local void @st_cst_align32_int16_t_float(i16 signext %str) {
7869 ; CHECK-LABEL: st_cst_align32_int16_t_float:
7870 ; CHECK: # %bb.0: # %entry
7871 ; CHECK-NEXT: mtfprwa f0, r3
7872 ; CHECK-NEXT: lis r3, 153
7873 ; CHECK-NEXT: xscvsxdsp f0, f0
7874 ; CHECK-NEXT: stfs f0, -27108(r3)
7877 %conv = sitofp i16 %str to float
7878 store float %conv, float* inttoptr (i64 9999900 to float*), align 4
7882 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7883 define dso_local void @st_cst_align64_int16_t_float(i16 signext %str) {
7884 ; CHECK-P10-LABEL: st_cst_align64_int16_t_float:
7885 ; CHECK-P10: # %bb.0: # %entry
7886 ; CHECK-P10-NEXT: mtfprwa f0, r3
7887 ; CHECK-P10-NEXT: pli r3, 244140625
7888 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
7889 ; CHECK-P10-NEXT: xscvsxdsp f0, f0
7890 ; CHECK-P10-NEXT: stfs f0, 0(r3)
7891 ; CHECK-P10-NEXT: blr
7893 ; CHECK-P9-LABEL: st_cst_align64_int16_t_float:
7894 ; CHECK-P9: # %bb.0: # %entry
7895 ; CHECK-P9-NEXT: mtfprwa f0, r3
7896 ; CHECK-P9-NEXT: lis r3, 3725
7897 ; CHECK-P9-NEXT: xscvsxdsp f0, f0
7898 ; CHECK-P9-NEXT: ori r3, r3, 19025
7899 ; CHECK-P9-NEXT: rldic r3, r3, 12, 24
7900 ; CHECK-P9-NEXT: stfs f0, 0(r3)
7901 ; CHECK-P9-NEXT: blr
7903 ; CHECK-P8-LABEL: st_cst_align64_int16_t_float:
7904 ; CHECK-P8: # %bb.0: # %entry
7905 ; CHECK-P8-NEXT: mtfprwa f0, r3
7906 ; CHECK-P8-NEXT: lis r3, 3725
7907 ; CHECK-P8-NEXT: ori r3, r3, 19025
7908 ; CHECK-P8-NEXT: xscvsxdsp f0, f0
7909 ; CHECK-P8-NEXT: rldic r3, r3, 12, 24
7910 ; CHECK-P8-NEXT: stfs f0, 0(r3)
7911 ; CHECK-P8-NEXT: blr
7913 %conv = sitofp i16 %str to float
7914 store float %conv, float* inttoptr (i64 1000000000000 to float*), align 4096
7918 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7919 define dso_local void @st_0_int16_t_double(i64 %ptr, i16 signext %str) {
7920 ; CHECK-LABEL: st_0_int16_t_double:
7921 ; CHECK: # %bb.0: # %entry
7922 ; CHECK-NEXT: mtfprwa f0, r4
7923 ; CHECK-NEXT: xscvsxddp f0, f0
7924 ; CHECK-NEXT: stfd f0, 0(r3)
7927 %conv = sitofp i16 %str to double
7928 %0 = inttoptr i64 %ptr to double*
7929 store double %conv, double* %0, align 8
7933 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7934 define dso_local void @st_align16_int16_t_double(i8* nocapture %ptr, i16 signext %str) {
7935 ; CHECK-LABEL: st_align16_int16_t_double:
7936 ; CHECK: # %bb.0: # %entry
7937 ; CHECK-NEXT: mtfprwa f0, r4
7938 ; CHECK-NEXT: xscvsxddp f0, f0
7939 ; CHECK-NEXT: stfd f0, 8(r3)
7942 %conv = sitofp i16 %str to double
7943 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
7944 %0 = bitcast i8* %add.ptr to double*
7945 store double %conv, double* %0, align 8
7949 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7950 define dso_local void @st_align32_int16_t_double(i8* nocapture %ptr, i16 signext %str) {
7951 ; CHECK-P10-LABEL: st_align32_int16_t_double:
7952 ; CHECK-P10: # %bb.0: # %entry
7953 ; CHECK-P10-NEXT: mtfprwa f0, r4
7954 ; CHECK-P10-NEXT: pli r4, 99999000
7955 ; CHECK-P10-NEXT: xscvsxddp f0, f0
7956 ; CHECK-P10-NEXT: stfdx f0, r3, r4
7957 ; CHECK-P10-NEXT: blr
7959 ; CHECK-P9-LABEL: st_align32_int16_t_double:
7960 ; CHECK-P9: # %bb.0: # %entry
7961 ; CHECK-P9-NEXT: mtfprwa f0, r4
7962 ; CHECK-P9-NEXT: lis r4, 1525
7963 ; CHECK-P9-NEXT: xscvsxddp f0, f0
7964 ; CHECK-P9-NEXT: ori r4, r4, 56600
7965 ; CHECK-P9-NEXT: stfdx f0, r3, r4
7966 ; CHECK-P9-NEXT: blr
7968 ; CHECK-P8-LABEL: st_align32_int16_t_double:
7969 ; CHECK-P8: # %bb.0: # %entry
7970 ; CHECK-P8-NEXT: mtfprwa f0, r4
7971 ; CHECK-P8-NEXT: lis r4, 1525
7972 ; CHECK-P8-NEXT: ori r4, r4, 56600
7973 ; CHECK-P8-NEXT: xscvsxddp f0, f0
7974 ; CHECK-P8-NEXT: stfdx f0, r3, r4
7975 ; CHECK-P8-NEXT: blr
7977 %conv = sitofp i16 %str to double
7978 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 99999000
7979 %0 = bitcast i8* %add.ptr to double*
7980 store double %conv, double* %0, align 8
7984 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
7985 define dso_local void @st_align64_int16_t_double(i8* nocapture %ptr, i16 signext %str) {
7986 ; CHECK-P10-LABEL: st_align64_int16_t_double:
7987 ; CHECK-P10: # %bb.0: # %entry
7988 ; CHECK-P10-NEXT: mtfprwa f0, r4
7989 ; CHECK-P10-NEXT: pli r4, 244140625
7990 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
7991 ; CHECK-P10-NEXT: xscvsxddp f0, f0
7992 ; CHECK-P10-NEXT: stfdx f0, r3, r4
7993 ; CHECK-P10-NEXT: blr
7995 ; CHECK-P9-LABEL: st_align64_int16_t_double:
7996 ; CHECK-P9: # %bb.0: # %entry
7997 ; CHECK-P9-NEXT: mtfprwa f0, r4
7998 ; CHECK-P9-NEXT: lis r4, 3725
7999 ; CHECK-P9-NEXT: xscvsxddp f0, f0
8000 ; CHECK-P9-NEXT: ori r4, r4, 19025
8001 ; CHECK-P9-NEXT: rldic r4, r4, 12, 24
8002 ; CHECK-P9-NEXT: stfdx f0, r3, r4
8003 ; CHECK-P9-NEXT: blr
8005 ; CHECK-P8-LABEL: st_align64_int16_t_double:
8006 ; CHECK-P8: # %bb.0: # %entry
8007 ; CHECK-P8-NEXT: mtfprwa f0, r4
8008 ; CHECK-P8-NEXT: lis r4, 3725
8009 ; CHECK-P8-NEXT: ori r4, r4, 19025
8010 ; CHECK-P8-NEXT: xscvsxddp f0, f0
8011 ; CHECK-P8-NEXT: rldic r4, r4, 12, 24
8012 ; CHECK-P8-NEXT: stfdx f0, r3, r4
8013 ; CHECK-P8-NEXT: blr
8015 %conv = sitofp i16 %str to double
8016 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 1000000000000
8017 %0 = bitcast i8* %add.ptr to double*
8018 store double %conv, double* %0, align 8
8022 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
8023 define dso_local void @st_reg_int16_t_double(i8* nocapture %ptr, i64 %off, i16 signext %str) {
8024 ; CHECK-LABEL: st_reg_int16_t_double:
8025 ; CHECK: # %bb.0: # %entry
8026 ; CHECK-NEXT: mtfprwa f0, r5
8027 ; CHECK-NEXT: xscvsxddp f0, f0
8028 ; CHECK-NEXT: stfdx f0, r3, r4
8031 %conv = sitofp i16 %str to double
8032 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %off
8033 %0 = bitcast i8* %add.ptr to double*
8034 store double %conv, double* %0, align 8
8038 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
8039 define dso_local void @st_or1_int16_t_double(i64 %ptr, i8 zeroext %off, i16 signext %str) {
8040 ; CHECK-LABEL: st_or1_int16_t_double:
8041 ; CHECK: # %bb.0: # %entry
8042 ; CHECK-NEXT: mtfprwa f0, r5
8043 ; CHECK-NEXT: or r3, r4, r3
8044 ; CHECK-NEXT: xscvsxddp f0, f0
8045 ; CHECK-NEXT: stfd f0, 0(r3)
8048 %conv = sitofp i16 %str to double
8049 %conv1 = zext i8 %off to i64
8050 %or = or i64 %conv1, %ptr
8051 %0 = inttoptr i64 %or to double*
8052 store double %conv, double* %0, align 8
8056 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
8057 define dso_local void @st_not_disjoint16_int16_t_double(i64 %ptr, i16 signext %str) {
8058 ; CHECK-LABEL: st_not_disjoint16_int16_t_double:
8059 ; CHECK: # %bb.0: # %entry
8060 ; CHECK-NEXT: mtfprwa f0, r4
8061 ; CHECK-NEXT: ori r3, r3, 6
8062 ; CHECK-NEXT: xscvsxddp f0, f0
8063 ; CHECK-NEXT: stfd f0, 0(r3)
8066 %conv = sitofp i16 %str to double
8067 %or = or i64 %ptr, 6
8068 %0 = inttoptr i64 %or to double*
8069 store double %conv, double* %0, align 8
8073 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
8074 define dso_local void @st_disjoint_align16_int16_t_double(i64 %ptr, i16 signext %str) {
8075 ; CHECK-LABEL: st_disjoint_align16_int16_t_double:
8076 ; CHECK: # %bb.0: # %entry
8077 ; CHECK-NEXT: mtfprwa f0, r4
8078 ; CHECK-NEXT: rldicr r3, r3, 0, 51
8079 ; CHECK-NEXT: xscvsxddp f0, f0
8080 ; CHECK-NEXT: stfd f0, 24(r3)
8083 %and = and i64 %ptr, -4096
8084 %conv = sitofp i16 %str to double
8085 %or = or i64 %and, 24
8086 %0 = inttoptr i64 %or to double*
8087 store double %conv, double* %0, align 8
8091 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
8092 define dso_local void @st_not_disjoint32_int16_t_double(i64 %ptr, i16 signext %str) {
8093 ; CHECK-P10-LABEL: st_not_disjoint32_int16_t_double:
8094 ; CHECK-P10: # %bb.0: # %entry
8095 ; CHECK-P10-NEXT: mtfprwa f0, r4
8096 ; CHECK-P10-NEXT: ori r3, r3, 34463
8097 ; CHECK-P10-NEXT: xscvsxddp f0, f0
8098 ; CHECK-P10-NEXT: oris r3, r3, 1
8099 ; CHECK-P10-NEXT: stfd f0, 0(r3)
8100 ; CHECK-P10-NEXT: blr
8102 ; CHECK-P9-LABEL: st_not_disjoint32_int16_t_double:
8103 ; CHECK-P9: # %bb.0: # %entry
8104 ; CHECK-P9-NEXT: mtfprwa f0, r4
8105 ; CHECK-P9-NEXT: ori r3, r3, 34463
8106 ; CHECK-P9-NEXT: xscvsxddp f0, f0
8107 ; CHECK-P9-NEXT: oris r3, r3, 1
8108 ; CHECK-P9-NEXT: stfd f0, 0(r3)
8109 ; CHECK-P9-NEXT: blr
8111 ; CHECK-P8-LABEL: st_not_disjoint32_int16_t_double:
8112 ; CHECK-P8: # %bb.0: # %entry
8113 ; CHECK-P8-NEXT: mtfprwa f0, r4
8114 ; CHECK-P8-NEXT: ori r3, r3, 34463
8115 ; CHECK-P8-NEXT: oris r3, r3, 1
8116 ; CHECK-P8-NEXT: xscvsxddp f0, f0
8117 ; CHECK-P8-NEXT: stfd f0, 0(r3)
8118 ; CHECK-P8-NEXT: blr
8120 %conv = sitofp i16 %str to double
8121 %or = or i64 %ptr, 99999
8122 %0 = inttoptr i64 %or to double*
8123 store double %conv, double* %0, align 8
8127 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
8128 define dso_local void @st_disjoint_align32_int16_t_double(i64 %ptr, i16 signext %str) {
8129 ; CHECK-P10-LABEL: st_disjoint_align32_int16_t_double:
8130 ; CHECK-P10: # %bb.0: # %entry
8131 ; CHECK-P10-NEXT: mtfprwa f0, r4
8132 ; CHECK-P10-NEXT: lis r5, -15264
8133 ; CHECK-P10-NEXT: pli r4, 999990000
8134 ; CHECK-P10-NEXT: xscvsxddp f0, f0
8135 ; CHECK-P10-NEXT: and r3, r3, r5
8136 ; CHECK-P10-NEXT: stfdx f0, r3, r4
8137 ; CHECK-P10-NEXT: blr
8139 ; CHECK-P9-LABEL: st_disjoint_align32_int16_t_double:
8140 ; CHECK-P9: # %bb.0: # %entry
8141 ; CHECK-P9-NEXT: mtfprwa f0, r4
8142 ; CHECK-P9-NEXT: lis r5, -15264
8143 ; CHECK-P9-NEXT: lis r4, 15258
8144 ; CHECK-P9-NEXT: xscvsxddp f0, f0
8145 ; CHECK-P9-NEXT: and r3, r3, r5
8146 ; CHECK-P9-NEXT: ori r4, r4, 41712
8147 ; CHECK-P9-NEXT: stfdx f0, r3, r4
8148 ; CHECK-P9-NEXT: blr
8150 ; CHECK-P8-LABEL: st_disjoint_align32_int16_t_double:
8151 ; CHECK-P8: # %bb.0: # %entry
8152 ; CHECK-P8-NEXT: mtfprwa f0, r4
8153 ; CHECK-P8-NEXT: lis r4, -15264
8154 ; CHECK-P8-NEXT: lis r5, 15258
8155 ; CHECK-P8-NEXT: and r3, r3, r4
8156 ; CHECK-P8-NEXT: ori r4, r5, 41712
8157 ; CHECK-P8-NEXT: xscvsxddp f0, f0
8158 ; CHECK-P8-NEXT: stfdx f0, r3, r4
8159 ; CHECK-P8-NEXT: blr
8161 %and = and i64 %ptr, -1000341504
8162 %conv = sitofp i16 %str to double
8163 %or = or i64 %and, 999990000
8164 %0 = inttoptr i64 %or to double*
8165 store double %conv, double* %0, align 16
8169 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
8170 define dso_local void @st_not_disjoint64_int16_t_double(i64 %ptr, i16 signext %str) {
8171 ; CHECK-P10-LABEL: st_not_disjoint64_int16_t_double:
8172 ; CHECK-P10: # %bb.0: # %entry
8173 ; CHECK-P10-NEXT: mtfprwa f0, r4
8174 ; CHECK-P10-NEXT: pli r4, 232
8175 ; CHECK-P10-NEXT: pli r5, 3567587329
8176 ; CHECK-P10-NEXT: rldimi r5, r4, 32, 0
8177 ; CHECK-P10-NEXT: xscvsxddp f0, f0
8178 ; CHECK-P10-NEXT: or r3, r3, r5
8179 ; CHECK-P10-NEXT: stfd f0, 0(r3)
8180 ; CHECK-P10-NEXT: blr
8182 ; CHECK-PREP10-LABEL: st_not_disjoint64_int16_t_double:
8183 ; CHECK-PREP10: # %bb.0: # %entry
8184 ; CHECK-PREP10-NEXT: mtfprwa f0, r4
8185 ; CHECK-PREP10-NEXT: li r4, 29
8186 ; CHECK-PREP10-NEXT: rldic r4, r4, 35, 24
8187 ; CHECK-PREP10-NEXT: xscvsxddp f0, f0
8188 ; CHECK-PREP10-NEXT: oris r4, r4, 54437
8189 ; CHECK-PREP10-NEXT: ori r4, r4, 4097
8190 ; CHECK-PREP10-NEXT: or r3, r3, r4
8191 ; CHECK-PREP10-NEXT: stfd f0, 0(r3)
8192 ; CHECK-PREP10-NEXT: blr
8194 %conv = sitofp i16 %str to double
8195 %or = or i64 %ptr, 1000000000001
8196 %0 = inttoptr i64 %or to double*
8197 store double %conv, double* %0, align 8
8201 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
8202 define dso_local void @st_disjoint_align64_int16_t_double(i64 %ptr, i16 signext %str) {
8203 ; CHECK-P10-LABEL: st_disjoint_align64_int16_t_double:
8204 ; CHECK-P10: # %bb.0: # %entry
8205 ; CHECK-P10-NEXT: mtfprwa f0, r4
8206 ; CHECK-P10-NEXT: pli r4, 244140625
8207 ; CHECK-P10-NEXT: rldicr r3, r3, 0, 23
8208 ; CHECK-P10-NEXT: rldic r4, r4, 12, 24
8209 ; CHECK-P10-NEXT: xscvsxddp f0, f0
8210 ; CHECK-P10-NEXT: stfdx f0, r3, r4
8211 ; CHECK-P10-NEXT: blr
8213 ; CHECK-P9-LABEL: st_disjoint_align64_int16_t_double:
8214 ; CHECK-P9: # %bb.0: # %entry
8215 ; CHECK-P9-NEXT: mtfprwa f0, r4
8216 ; CHECK-P9-NEXT: lis r4, 3725
8217 ; CHECK-P9-NEXT: rldicr r3, r3, 0, 23
8218 ; CHECK-P9-NEXT: xscvsxddp f0, f0
8219 ; CHECK-P9-NEXT: ori r4, r4, 19025
8220 ; CHECK-P9-NEXT: rldic r4, r4, 12, 24
8221 ; CHECK-P9-NEXT: stfdx f0, r3, r4
8222 ; CHECK-P9-NEXT: blr
8224 ; CHECK-P8-LABEL: st_disjoint_align64_int16_t_double:
8225 ; CHECK-P8: # %bb.0: # %entry
8226 ; CHECK-P8-NEXT: mtfprwa f0, r4
8227 ; CHECK-P8-NEXT: lis r5, 3725
8228 ; CHECK-P8-NEXT: rldicr r3, r3, 0, 23
8229 ; CHECK-P8-NEXT: ori r4, r5, 19025
8230 ; CHECK-P8-NEXT: xscvsxddp f0, f0
8231 ; CHECK-P8-NEXT: rldic r4, r4, 12, 24
8232 ; CHECK-P8-NEXT: stfdx f0, r3, r4
8233 ; CHECK-P8-NEXT: blr
8235 %and = and i64 %ptr, -1099511627776
8236 %conv = sitofp i16 %str to double
8237 %or = or i64 %and, 1000000000000
8238 %0 = inttoptr i64 %or to double*
8239 store double %conv, double* %0, align 4096
8243 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
8244 define dso_local void @st_cst_align16_int16_t_double(i16 signext %str) {
8245 ; CHECK-LABEL: st_cst_align16_int16_t_double:
8246 ; CHECK: # %bb.0: # %entry
8247 ; CHECK-NEXT: mtfprwa f0, r3
8248 ; CHECK-NEXT: xscvsxddp f0, f0
8249 ; CHECK-NEXT: stfd f0, 4080(0)
8252 %conv = sitofp i16 %str to double
8253 store double %conv, double* inttoptr (i64 4080 to double*), align 16
8257 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
8258 define dso_local void @st_cst_align32_int16_t_double(i16 signext %str) {
8259 ; CHECK-LABEL: st_cst_align32_int16_t_double:
8260 ; CHECK: # %bb.0: # %entry
8261 ; CHECK-NEXT: mtfprwa f0, r3
8262 ; CHECK-NEXT: lis r3, 153
8263 ; CHECK-NEXT: xscvsxddp f0, f0
8264 ; CHECK-NEXT: stfd f0, -27108(r3)
8267 %conv = sitofp i16 %str to double
8268 store double %conv, double* inttoptr (i64 9999900 to double*), align 8
8272 ; Function Attrs: nofree norecurse nounwind uwtable willreturn writeonly
8273 define dso_local void @st_cst_align64_int16_t_double(i16 signext %str) {
8274 ; CHECK-P10-LABEL: st_cst_align64_int16_t_double:
8275 ; CHECK-P10: # %bb.0: # %entry
8276 ; CHECK-P10-NEXT: mtfprwa f0, r3
8277 ; CHECK-P10-NEXT: pli r3, 244140625
8278 ; CHECK-P10-NEXT: rldic r3, r3, 12, 24
8279 ; CHECK-P10-NEXT: xscvsxddp f0, f0
8280 ; CHECK-P10-NEXT: stfd f0, 0(r3)
8281 ; CHECK-P10-NEXT: blr
8283 ; CHECK-P9-LABEL: st_cst_align64_int16_t_double:
8284 ; CHECK-P9: # %bb.0: # %entry
8285 ; CHECK-P9-NEXT: mtfprwa f0, r3
8286 ; CHECK-P9-NEXT: lis r3, 3725
8287 ; CHECK-P9-NEXT: xscvsxddp f0, f0
8288 ; CHECK-P9-NEXT: ori r3, r3, 19025
8289 ; CHECK-P9-NEXT: rldic r3, r3, 12, 24
8290 ; CHECK-P9-NEXT: stfd f0, 0(r3)
8291 ; CHECK-P9-NEXT: blr
8293 ; CHECK-P8-LABEL: st_cst_align64_int16_t_double:
8294 ; CHECK-P8: # %bb.0: # %entry
8295 ; CHECK-P8-NEXT: mtfprwa f0, r3
8296 ; CHECK-P8-NEXT: lis r3, 3725
8297 ; CHECK-P8-NEXT: ori r3, r3, 19025
8298 ; CHECK-P8-NEXT: xscvsxddp f0, f0
8299 ; CHECK-P8-NEXT: rldic r3, r3, 12, 24
8300 ; CHECK-P8-NEXT: stfd f0, 0(r3)
8301 ; CHECK-P8-NEXT: blr
8303 %conv = sitofp i16 %str to double
8304 store double %conv, double* inttoptr (i64 1000000000000 to double*), align 4096