1 ; Test 64-bit floating-point loads.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 ; Test the low end of the LD range.
6 define double @f1(double *%src) {
8 ; CHECK: ld %f0, 0(%r2)
10 %val = load double *%src
14 ; Test the high end of the LD range.
15 define double @f2(double *%src) {
17 ; CHECK: ld %f0, 4088(%r2)
19 %ptr = getelementptr double *%src, i64 511
20 %val = load double *%ptr
24 ; Check the next doubleword up, which should use LDY instead of LD.
25 define double @f3(double *%src) {
27 ; CHECK: ldy %f0, 4096(%r2)
29 %ptr = getelementptr double *%src, i64 512
30 %val = load double *%ptr
34 ; Check the high end of the aligned LDY range.
35 define double @f4(double *%src) {
37 ; CHECK: ldy %f0, 524280(%r2)
39 %ptr = getelementptr double *%src, i64 65535
40 %val = load double *%ptr
44 ; Check the next doubleword up, which needs separate address logic.
45 ; Other sequences besides this one would be OK.
46 define double @f5(double *%src) {
48 ; CHECK: agfi %r2, 524288
49 ; CHECK: ld %f0, 0(%r2)
51 %ptr = getelementptr double *%src, i64 65536
52 %val = load double *%ptr
56 ; Check the high end of the negative aligned LDY range.
57 define double @f6(double *%src) {
59 ; CHECK: ldy %f0, -8(%r2)
61 %ptr = getelementptr double *%src, i64 -1
62 %val = load double *%ptr
66 ; Check the low end of the LDY range.
67 define double @f7(double *%src) {
69 ; CHECK: ldy %f0, -524288(%r2)
71 %ptr = getelementptr double *%src, i64 -65536
72 %val = load double *%ptr
76 ; Check the next doubleword down, which needs separate address logic.
77 ; Other sequences besides this one would be OK.
78 define double @f8(double *%src) {
80 ; CHECK: agfi %r2, -524296
81 ; CHECK: ld %f0, 0(%r2)
83 %ptr = getelementptr double *%src, i64 -65537
84 %val = load double *%ptr
88 ; Check that LD allows an index.
89 define double @f9(i64 %src, i64 %index) {
91 ; CHECK: ld %f0, 4095({{%r3,%r2|%r2,%r3}})
93 %add1 = add i64 %src, %index
94 %add2 = add i64 %add1, 4095
95 %ptr = inttoptr i64 %add2 to double *
96 %val = load double *%ptr
100 ; Check that LDY allows an index.
101 define double @f10(i64 %src, i64 %index) {
103 ; CHECK: ldy %f0, 4096({{%r3,%r2|%r2,%r3}})
105 %add1 = add i64 %src, %index
106 %add2 = add i64 %add1, 4096
107 %ptr = inttoptr i64 %add2 to double *
108 %val = load double *%ptr