1 ; Test 64-bit floating-point stores.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
6 ; Test the low end of the STD range.
7 define void @f1(double *%src, double %val) {
9 ; CHECK: std %f0, 0(%r2)
11 store double %val, double *%src
15 ; Test the high end of the STD range.
16 define void @f2(double *%src, double %val) {
18 ; CHECK: std %f0, 4088(%r2)
20 %ptr = getelementptr double, double *%src, i64 511
21 store double %val, double *%ptr
25 ; Check the next doubleword up, which should use STDY instead of STD.
26 define void @f3(double *%src, double %val) {
28 ; CHECK: stdy %f0, 4096(%r2)
30 %ptr = getelementptr double, double *%src, i64 512
31 store double %val, double *%ptr
35 ; Check the high end of the aligned STDY range.
36 define void @f4(double *%src, double %val) {
38 ; CHECK: stdy %f0, 524280(%r2)
40 %ptr = getelementptr double, double *%src, i64 65535
41 store double %val, double *%ptr
45 ; Check the next doubleword up, which needs separate address logic.
46 ; Other sequences besides this one would be OK.
47 define void @f5(double *%src, double %val) {
49 ; CHECK: agfi %r2, 524288
50 ; CHECK: std %f0, 0(%r2)
52 %ptr = getelementptr double, double *%src, i64 65536
53 store double %val, double *%ptr
57 ; Check the high end of the negative aligned STDY range.
58 define void @f6(double *%src, double %val) {
60 ; CHECK: stdy %f0, -8(%r2)
62 %ptr = getelementptr double, double *%src, i64 -1
63 store double %val, double *%ptr
67 ; Check the low end of the STDY range.
68 define void @f7(double *%src, double %val) {
70 ; CHECK: stdy %f0, -524288(%r2)
72 %ptr = getelementptr double, double *%src, i64 -65536
73 store double %val, double *%ptr
77 ; Check the next doubleword down, which needs separate address logic.
78 ; Other sequences besides this one would be OK.
79 define void @f8(double *%src, double %val) {
81 ; CHECK: agfi %r2, -524296
82 ; CHECK: std %f0, 0(%r2)
84 %ptr = getelementptr double, double *%src, i64 -65537
85 store double %val, double *%ptr
89 ; Check that STD allows an index.
90 define void @f9(i64 %src, i64 %index, double %val) {
92 ; CHECK: std %f0, 4095({{%r3,%r2|%r2,%r3}})
94 %add1 = add i64 %src, %index
95 %add2 = add i64 %add1, 4095
96 %ptr = inttoptr i64 %add2 to double *
97 store double %val, double *%ptr
101 ; Check that STDY allows an index.
102 define void @f10(i64 %src, i64 %index, double %val) {
104 ; CHECK: stdy %f0, 4096({{%r3,%r2|%r2,%r3}})
106 %add1 = add i64 %src, %index
107 %add2 = add i64 %add1, 4096
108 %ptr = inttoptr i64 %add2 to double *
109 store double %val, double *%ptr