1 ; Test loading of 64-bit constants.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
13 ; Check the high end of the LGHI range.
16 ; CHECK: lghi %r2, 32767
21 ; Check the next value up, which must use LLILL instead.
24 ; CHECK: llill %r2, 32768
29 ; Check the high end of the LLILL range.
32 ; CHECK: llill %r2, 65535
37 ; Check the first useful LLILH value, which is the next one up.
45 ; Check the first useful LGFI value, which is the next one up again.
48 ; CHECK: lgfi %r2, 65537
53 ; Check the high end of the LGFI range.
56 ; CHECK: lgfi %r2, 2147483647
61 ; Check the next value up, which should use LLILH instead.
64 ; CHECK: llilh %r2, 32768
69 ; Check the next value up again, which should use LLILF.
72 ; CHECK: llilf %r2, 2147483649
77 ; Check the high end of the LLILH range.
80 ; CHECK: llilh %r2, 65535
85 ; Check the next value up, which must use LLILF.
88 ; CHECK: llilf %r2, 4294901761
93 ; Check the high end of the LLILF range.
96 ; CHECK: llilf %r2, 4294967295
101 ; Check the lowest useful LLIHL value, which is the next one up.
104 ; CHECK: llihl %r2, 1
105 ; CHECK-NEXT: br %r14
109 ; Check the next value up, which must use a combination of two instructions.
112 ; CHECK: llihl %r2, 1
113 ; CHECK-NEXT: oill %r2, 1
114 ; CHECK-NEXT: br %r14
118 ; Check the high end of the OILL range.
121 ; CHECK: llihl %r2, 1
122 ; CHECK-NEXT: oill %r2, 65535
123 ; CHECK-NEXT: br %r14
127 ; Check the next value up, which should use OILH instead.
130 ; CHECK: llihl %r2, 1
131 ; CHECK-NEXT: oilh %r2, 1
132 ; CHECK-NEXT: br %r14
136 ; Check the next value up again, which should use OILF.
139 ; CHECK: llihl %r2, 1
140 ; CHECK-NEXT: oilf %r2, 65537
141 ; CHECK-NEXT: br %r14
145 ; Check the high end of the OILH range.
148 ; CHECK: llihl %r2, 1
149 ; CHECK-NEXT: oilh %r2, 65535
150 ; CHECK-NEXT: br %r14
154 ; Check the high end of the OILF range.
157 ; CHECK: llihl %r2, 1
158 ; CHECK-NEXT: oilf %r2, 4294967295
159 ; CHECK-NEXT: br %r14
163 ; Check the high end of the LLIHL range.
166 ; CHECK: llihl %r2, 65535
167 ; CHECK-NEXT: br %r14
168 ret i64 281470681743360
171 ; Check the lowest useful LLIHH value, which is 1<<32 greater than the above.
174 ; CHECK: llihh %r2, 1
175 ; CHECK-NEXT: br %r14
176 ret i64 281474976710656
179 ; Check the lowest useful LLIHF value, which is 1<<32 greater again.
182 ; CHECK: llihf %r2, 65537
183 ; CHECK-NEXT: br %r14
184 ret i64 281479271677952
187 ; Check the highest end of the LLIHH range.
190 ; CHECK: llihh %r2, 65535
191 ; CHECK-NEXT: br %r14
192 ret i64 -281474976710656
195 ; Check the next value up, which must use OILL too.
198 ; CHECK: llihh %r2, 65535
199 ; CHECK-NEXT: oill %r2, 1
200 ; CHECK-NEXT: br %r14
201 ret i64 -281474976710655
204 ; Check the high end of the LLIHF range.
207 ; CHECK: llihf %r2, 4294967295
208 ; CHECK-NEXT: br %r14
215 ; CHECK: lghi %r2, -1
216 ; CHECK-NEXT: br %r14
220 ; Check the low end of the LGHI range.
223 ; CHECK: lghi %r2, -32768
224 ; CHECK-NEXT: br %r14
228 ; Check the next value down, which must use LGFI instead.
231 ; CHECK: lgfi %r2, -32769
232 ; CHECK-NEXT: br %r14
236 ; Check the low end of the LGFI range.
239 ; CHECK: lgfi %r2, -2147483648
240 ; CHECK-NEXT: br %r14
244 ; Check the next value down, which needs a two-instruction sequence.
247 ; CHECK: llihf %r2, 4294967295
248 ; CHECK-NEXT: oilf %r2, 2147483647
249 ; CHECK-NEXT: br %r14