1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
; Test spilling of FPRs.
;
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
; We need to save and restore 8 of the 16 FPRs and allocate an additional
; 4-byte spill slot, rounded to 8 bytes. The frame size should be exactly
; 160 + 8 * 8 = 232.
define void @f1(float *%ptr) {
; CHECK-LABEL: f1:
; CHECK: aghi %r15, -232
; CHECK: std %f8, 224(%r15)
; CHECK: std %f9, 216(%r15)
; CHECK: std %f10, 208(%r15)
; CHECK: std %f11, 200(%r15)
; CHECK: std %f12, 192(%r15)
; CHECK: std %f13, 184(%r15)
; CHECK: std %f14, 176(%r15)
; CHECK: std %f15, 168(%r15)
; CHECK-NOT: 160(%r15)
; CHECK: ste [[REGISTER:%f[0-9]+]], 164(%r15)
; CHECK-NOT: 160(%r15)
; CHECK: le [[REGISTER]], 164(%r15)
; CHECK-NOT: 160(%r15)
; CHECK: ld %f8, 224(%r15)
; CHECK: ld %f9, 216(%r15)
; CHECK: ld %f10, 208(%r15)
; CHECK: ld %f11, 200(%r15)
; CHECK: ld %f12, 192(%r15)
; CHECK: ld %f13, 184(%r15)
; CHECK: ld %f14, 176(%r15)
; CHECK: ld %f15, 168(%r15)
; CHECK: aghi %r15, 232
; CHECK: br %r14
%l0 = load volatile float *%ptr
%l1 = load volatile float *%ptr
%l2 = load volatile float *%ptr
%l3 = load volatile float *%ptr
%l4 = load volatile float *%ptr
%l5 = load volatile float *%ptr
%l6 = load volatile float *%ptr
%l7 = load volatile float *%ptr
%l8 = load volatile float *%ptr
%l9 = load volatile float *%ptr
%l10 = load volatile float *%ptr
%l11 = load volatile float *%ptr
%l12 = load volatile float *%ptr
%l13 = load volatile float *%ptr
%l14 = load volatile float *%ptr
%l15 = load volatile float *%ptr
%lx = load volatile float *%ptr
store volatile float %lx, float *%ptr
store volatile float %l15, float *%ptr
store volatile float %l14, float *%ptr
store volatile float %l13, float *%ptr
store volatile float %l12, float *%ptr
store volatile float %l11, float *%ptr
store volatile float %l10, float *%ptr
store volatile float %l9, float *%ptr
store volatile float %l8, float *%ptr
store volatile float %l7, float *%ptr
store volatile float %l6, float *%ptr
store volatile float %l5, float *%ptr
store volatile float %l4, float *%ptr
store volatile float %l3, float *%ptr
store volatile float %l2, float *%ptr
store volatile float %l1, float *%ptr
store volatile float %l0, float *%ptr
ret void
}
; Same for doubles, except that the full spill slot is used.
define void @f2(double *%ptr) {
; CHECK-LABEL: f2:
; CHECK: aghi %r15, -232
; CHECK: std %f8, 224(%r15)
; CHECK: std %f9, 216(%r15)
; CHECK: std %f10, 208(%r15)
; CHECK: std %f11, 200(%r15)
; CHECK: std %f12, 192(%r15)
; CHECK: std %f13, 184(%r15)
; CHECK: std %f14, 176(%r15)
; CHECK: std %f15, 168(%r15)
; CHECK: std [[REGISTER:%f[0-9]+]], 160(%r15)
; CHECK: ld [[REGISTER]], 160(%r15)
; CHECK: ld %f8, 224(%r15)
; CHECK: ld %f9, 216(%r15)
; CHECK: ld %f10, 208(%r15)
; CHECK: ld %f11, 200(%r15)
; CHECK: ld %f12, 192(%r15)
; CHECK: ld %f13, 184(%r15)
; CHECK: ld %f14, 176(%r15)
; CHECK: ld %f15, 168(%r15)
; CHECK: aghi %r15, 232
; CHECK: br %r14
%l0 = load volatile double *%ptr
%l1 = load volatile double *%ptr
%l2 = load volatile double *%ptr
%l3 = load volatile double *%ptr
%l4 = load volatile double *%ptr
%l5 = load volatile double *%ptr
%l6 = load volatile double *%ptr
%l7 = load volatile double *%ptr
%l8 = load volatile double *%ptr
%l9 = load volatile double *%ptr
%l10 = load volatile double *%ptr
%l11 = load volatile double *%ptr
%l12 = load volatile double *%ptr
%l13 = load volatile double *%ptr
%l14 = load volatile double *%ptr
%l15 = load volatile double *%ptr
%lx = load volatile double *%ptr
store volatile double %lx, double *%ptr
store volatile double %l15, double *%ptr
store volatile double %l14, double *%ptr
store volatile double %l13, double *%ptr
store volatile double %l12, double *%ptr
store volatile double %l11, double *%ptr
store volatile double %l10, double *%ptr
store volatile double %l9, double *%ptr
store volatile double %l8, double *%ptr
store volatile double %l7, double *%ptr
store volatile double %l6, double *%ptr
store volatile double %l5, double *%ptr
store volatile double %l4, double *%ptr
store volatile double %l3, double *%ptr
store volatile double %l2, double *%ptr
store volatile double %l1, double *%ptr
store volatile double %l0, double *%ptr
ret void
}
; The long double case needs a 16-byte spill slot.
define void @f3(fp128 *%ptr) {
; CHECK-LABEL: f3:
; CHECK: aghi %r15, -240
; CHECK: std %f8, 232(%r15)
; CHECK: std %f9, 224(%r15)
; CHECK: std %f10, 216(%r15)
; CHECK: std %f11, 208(%r15)
; CHECK: std %f12, 200(%r15)
; CHECK: std %f13, 192(%r15)
; CHECK: std %f14, 184(%r15)
; CHECK: std %f15, 176(%r15)
; CHECK: std [[REGISTER1:%f[0-9]+]], 160(%r15)
; CHECK: std [[REGISTER2:%f[0-9]+]], 168(%r15)
; CHECK: ld [[REGISTER1]], 160(%r15)
; CHECK: ld [[REGISTER2]], 168(%r15)
; CHECK: ld %f8, 232(%r15)
; CHECK: ld %f9, 224(%r15)
; CHECK: ld %f10, 216(%r15)
; CHECK: ld %f11, 208(%r15)
; CHECK: ld %f12, 200(%r15)
; CHECK: ld %f13, 192(%r15)
; CHECK: ld %f14, 184(%r15)
; CHECK: ld %f15, 176(%r15)
; CHECK: aghi %r15, 240
; CHECK: br %r14
%l0 = load volatile fp128 *%ptr
%l1 = load volatile fp128 *%ptr
%l4 = load volatile fp128 *%ptr
%l5 = load volatile fp128 *%ptr
%l8 = load volatile fp128 *%ptr
%l9 = load volatile fp128 *%ptr
%l12 = load volatile fp128 *%ptr
%l13 = load volatile fp128 *%ptr
%lx = load volatile fp128 *%ptr
store volatile fp128 %lx, fp128 *%ptr
store volatile fp128 %l13, fp128 *%ptr
store volatile fp128 %l12, fp128 *%ptr
store volatile fp128 %l9, fp128 *%ptr
store volatile fp128 %l8, fp128 *%ptr
store volatile fp128 %l5, fp128 *%ptr
store volatile fp128 %l4, fp128 *%ptr
store volatile fp128 %l1, fp128 *%ptr
store volatile fp128 %l0, fp128 *%ptr
ret void
}
|