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