1 ; Test 32-bit floating-point stores.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 ; Test the low end of the STE range.
6 define void @f1(float *%ptr, float %val) {
8 ; CHECK: ste %f0, 0(%r2)
10 store float %val, float *%ptr
14 ; Test the high end of the STE range.
15 define void @f2(float *%src, float %val) {
17 ; CHECK: ste %f0, 4092(%r2)
19 %ptr = getelementptr float, float *%src, i64 1023
20 store float %val, float *%ptr
24 ; Check the next word up, which should use STEY instead of STE.
25 define void @f3(float *%src, float %val) {
27 ; CHECK: stey %f0, 4096(%r2)
29 %ptr = getelementptr float, float *%src, i64 1024
30 store float %val, float *%ptr
34 ; Check the high end of the aligned STEY range.
35 define void @f4(float *%src, float %val) {
37 ; CHECK: stey %f0, 524284(%r2)
39 %ptr = getelementptr float, float *%src, i64 131071
40 store float %val, float *%ptr
44 ; Check the next word up, which needs separate address logic.
45 ; Other sequences besides this one would be OK.
46 define void @f5(float *%src, float %val) {
48 ; CHECK: agfi %r2, 524288
49 ; CHECK: ste %f0, 0(%r2)
51 %ptr = getelementptr float, float *%src, i64 131072
52 store float %val, float *%ptr
56 ; Check the high end of the negative aligned STEY range.
57 define void @f6(float *%src, float %val) {
59 ; CHECK: stey %f0, -4(%r2)
61 %ptr = getelementptr float, float *%src, i64 -1
62 store float %val, float *%ptr
66 ; Check the low end of the STEY range.
67 define void @f7(float *%src, float %val) {
69 ; CHECK: stey %f0, -524288(%r2)
71 %ptr = getelementptr float, float *%src, i64 -131072
72 store float %val, float *%ptr
76 ; Check the next word down, which needs separate address logic.
77 ; Other sequences besides this one would be OK.
78 define void @f8(float *%src, float %val) {
80 ; CHECK: agfi %r2, -524292
81 ; CHECK: ste %f0, 0(%r2)
83 %ptr = getelementptr float, float *%src, i64 -131073
84 store float %val, float *%ptr
88 ; Check that STE allows an index.
89 define void @f9(i64 %src, i64 %index, float %val) {
91 ; CHECK: ste %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 store float %val, float *%ptr
100 ; Check that STEY allows an index.
101 define void @f10(i64 %src, i64 %index, float %val) {
103 ; CHECK: stey %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 store float %val, float *%ptr