]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/SystemZ/int-const-02.ll
Vendor import of llvm tags/RELEASE_33/final r183502 (effectively, 3.3
[FreeBSD/FreeBSD.git] / test / CodeGen / SystemZ / int-const-02.ll
1 ; Test loading of 64-bit constants.
2 ;
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4
5 ; Check 0.
6 define i64 @f1() {
7 ; CHECK: f1:
8 ; CHECK: lghi %r2, 0
9 ; CHECK-NEXT: br %r14
10   ret i64 0
11 }
12
13 ; Check the high end of the LGHI range.
14 define i64 @f2() {
15 ; CHECK: f2:
16 ; CHECK: lghi %r2, 32767
17 ; CHECK-NEXT: br %r14
18   ret i64 32767
19 }
20
21 ; Check the next value up, which must use LLILL instead.
22 define i64 @f3() {
23 ; CHECK: f3:
24 ; CHECK: llill %r2, 32768
25 ; CHECK-NEXT: br %r14
26   ret i64 32768
27 }
28
29 ; Check the high end of the LLILL range.
30 define i64 @f4() {
31 ; CHECK: f4:
32 ; CHECK: llill %r2, 65535
33 ; CHECK-NEXT: br %r14
34   ret i64 65535
35 }
36
37 ; Check the first useful LLILH value, which is the next one up.
38 define i64 @f5() {
39 ; CHECK: f5:
40 ; CHECK: llilh %r2, 1
41 ; CHECK-NEXT: br %r14
42   ret i64 65536
43 }
44
45 ; Check the first useful LGFI value, which is the next one up again.
46 define i64 @f6() {
47 ; CHECK: f6:
48 ; CHECK: lgfi %r2, 65537
49 ; CHECK-NEXT: br %r14
50   ret i64 65537
51 }
52
53 ; Check the high end of the LGFI range.
54 define i64 @f7() {
55 ; CHECK: f7:
56 ; CHECK: lgfi %r2, 2147483647
57 ; CHECK-NEXT: br %r14
58   ret i64 2147483647
59 }
60
61 ; Check the next value up, which should use LLILH instead.
62 define i64 @f8() {
63 ; CHECK: f8:
64 ; CHECK: llilh %r2, 32768
65 ; CHECK-NEXT: br %r14
66   ret i64 2147483648
67 }
68
69 ; Check the next value up again, which should use LLILF.
70 define i64 @f9() {
71 ; CHECK: f9:
72 ; CHECK: llilf %r2, 2147483649
73 ; CHECK-NEXT: br %r14
74   ret i64 2147483649
75 }
76
77 ; Check the high end of the LLILH range.
78 define i64 @f10() {
79 ; CHECK: f10:
80 ; CHECK: llilh %r2, 65535
81 ; CHECK-NEXT: br %r14
82   ret i64 4294901760
83 }
84
85 ; Check the next value up, which must use LLILF.
86 define i64 @f11() {
87 ; CHECK: f11:
88 ; CHECK: llilf %r2, 4294901761
89 ; CHECK-NEXT: br %r14
90   ret i64 4294901761
91 }
92
93 ; Check the high end of the LLILF range.
94 define i64 @f12() {
95 ; CHECK: f12:
96 ; CHECK: llilf %r2, 4294967295
97 ; CHECK-NEXT: br %r14
98   ret i64 4294967295
99 }
100
101 ; Check the lowest useful LLIHL value, which is the next one up.
102 define i64 @f13() {
103 ; CHECK: f13:
104 ; CHECK: llihl %r2, 1
105 ; CHECK-NEXT: br %r14
106   ret i64 4294967296
107 }
108
109 ; Check the next value up, which must use a combination of two instructions.
110 define i64 @f14() {
111 ; CHECK: f14:
112 ; CHECK: llihl %r2, 1
113 ; CHECK-NEXT: oill %r2, 1
114 ; CHECK-NEXT: br %r14
115   ret i64 4294967297
116 }
117
118 ; Check the high end of the OILL range.
119 define i64 @f15() {
120 ; CHECK: f15:
121 ; CHECK: llihl %r2, 1
122 ; CHECK-NEXT: oill %r2, 65535
123 ; CHECK-NEXT: br %r14
124   ret i64 4295032831
125 }
126
127 ; Check the next value up, which should use OILH instead.
128 define i64 @f16() {
129 ; CHECK: f16:
130 ; CHECK: llihl %r2, 1
131 ; CHECK-NEXT: oilh %r2, 1
132 ; CHECK-NEXT: br %r14
133   ret i64 4295032832
134 }
135
136 ; Check the next value up again, which should use OILF.
137 define i64 @f17() {
138 ; CHECK: f17:
139 ; CHECK: llihl %r2, 1
140 ; CHECK-NEXT: oilf %r2, 65537
141 ; CHECK-NEXT: br %r14
142   ret i64 4295032833
143 }
144
145 ; Check the high end of the OILH range.
146 define i64 @f18() {
147 ; CHECK: f18:
148 ; CHECK: llihl %r2, 1
149 ; CHECK-NEXT: oilh %r2, 65535
150 ; CHECK-NEXT: br %r14
151   ret i64 8589869056
152 }
153
154 ; Check the high end of the OILF range.
155 define i64 @f19() {
156 ; CHECK: f19:
157 ; CHECK: llihl %r2, 1
158 ; CHECK-NEXT: oilf %r2, 4294967295
159 ; CHECK-NEXT: br %r14
160   ret i64 8589934591
161 }
162
163 ; Check the high end of the LLIHL range.
164 define i64 @f20() {
165 ; CHECK: f20:
166 ; CHECK: llihl %r2, 65535
167 ; CHECK-NEXT: br %r14
168   ret i64 281470681743360
169 }
170
171 ; Check the lowest useful LLIHH value, which is 1<<32 greater than the above.
172 define i64 @f21() {
173 ; CHECK: f21:
174 ; CHECK: llihh %r2, 1
175 ; CHECK-NEXT: br %r14
176   ret i64 281474976710656
177 }
178
179 ; Check the lowest useful LLIHF value, which is 1<<32 greater again.
180 define i64 @f22() {
181 ; CHECK: f22:
182 ; CHECK: llihf %r2, 65537
183 ; CHECK-NEXT: br %r14
184   ret i64 281479271677952
185 }
186
187 ; Check the highest end of the LLIHH range.
188 define i64 @f23() {
189 ; CHECK: f23:
190 ; CHECK: llihh %r2, 65535
191 ; CHECK-NEXT: br %r14
192   ret i64 -281474976710656
193 }
194
195 ; Check the next value up, which must use OILL too.
196 define i64 @f24() {
197 ; CHECK: f24:
198 ; CHECK: llihh %r2, 65535
199 ; CHECK-NEXT: oill %r2, 1
200 ; CHECK-NEXT: br %r14
201   ret i64 -281474976710655
202 }
203
204 ; Check the high end of the LLIHF range.
205 define i64 @f25() {
206 ; CHECK: f25:
207 ; CHECK: llihf %r2, 4294967295
208 ; CHECK-NEXT: br %r14
209   ret i64 -4294967296
210 }
211
212 ; Check -1.
213 define i64 @f26() {
214 ; CHECK: f26:
215 ; CHECK: lghi %r2, -1
216 ; CHECK-NEXT: br %r14
217   ret i64 -1
218 }
219
220 ; Check the low end of the LGHI range.
221 define i64 @f27() {
222 ; CHECK: f27:
223 ; CHECK: lghi %r2, -32768
224 ; CHECK-NEXT: br %r14
225   ret i64 -32768
226 }
227
228 ; Check the next value down, which must use LGFI instead.
229 define i64 @f28() {
230 ; CHECK: f28:
231 ; CHECK: lgfi %r2, -32769
232 ; CHECK-NEXT: br %r14
233   ret i64 -32769
234 }
235
236 ; Check the low end of the LGFI range.
237 define i64 @f29() {
238 ; CHECK: f29:
239 ; CHECK: lgfi %r2, -2147483648
240 ; CHECK-NEXT: br %r14
241   ret i64 -2147483648
242 }
243
244 ; Check the next value down, which needs a two-instruction sequence.
245 define i64 @f30() {
246 ; CHECK: f30:
247 ; CHECK: llihf %r2, 4294967295
248 ; CHECK-NEXT: oilf %r2, 2147483647
249 ; CHECK-NEXT: br %r14
250   ret i64 -2147483649
251 }