1 ; Test loading of 32-bit constants.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 declare void @foo(i32, i32, i32, i32)
15 ; Check the high end of the LHI range.
18 ; CHECK: lhi %r2, 32767
23 ; Check the next value up, which must use LLILL instead.
26 ; CHECK: llill %r2, 32768
31 ; Check the high end of the LLILL range.
34 ; CHECK: llill %r2, 65535
39 ; Check the first useful LLILH value, which is the next one up.
47 ; Check the first useful IILF value, which is the next one up again.
50 ; CHECK: iilf %r2, 65537
55 ; Check the high end of the LLILH range.
58 ; CHECK: llilh %r2, 65535
63 ; Check the next value up, which must use IILF.
66 ; CHECK: iilf %r2, 4294901761
71 ; Check the highest useful IILF value, 0xffff7fff
74 ; CHECK: iilf %r2, 4294934527
79 ; Check the next value up, which should use LHI.
82 ; CHECK: lhi %r2, -32768
95 ; Check that constant loads are rematerialized.
98 ; CHECK-DAG: lhi %r2, 42
99 ; CHECK-DAG: llill %r3, 32768
100 ; CHECK-DAG: llilh %r4, 1
101 ; CHECK-DAG: iilf %r5, 65537
102 ; CHECK: brasl %r14, foo@PLT
103 ; CHECK-DAG: lhi %r2, 42
104 ; CHECK-DAG: llill %r3, 32768
105 ; CHECK-DAG: llilh %r4, 1
106 ; CHECK-DAG: iilf %r5, 65537
107 ; CHECK: brasl %r14, foo@PLT
110 call void @foo(i32 42, i32 32768, i32 65536, i32 65537)
111 call void @foo(i32 42, i32 32768, i32 65536, i32 65537)