1; RUN: llc -O0 -mcpu=pwr7 -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
2
3define zeroext i32 @f1() {
4entry:
5  ret i32 65535
6}
7; CHECK-LABEL: @f1
8; CHECK: lis 3, 0
9; CHECK: ori 3, 3, 65535
10
11define zeroext i32 @f2() {
12entry:
13  ret i32 32768
14}
15; CHECK-LABEL: @f2
16; CHECK: lis 3, 0
17; CHECK: ori 3, 3, 32768
18
19define zeroext i32 @f3() {
20entry:
21  ret i32 32767
22}
23; CHECK-LABEL: @f3
24; CHECK: li 3, 32767
25
26define zeroext i16 @f4() {
27entry:
28  ret i16 65535
29}
30; CHECK-LABEL: @f4
31; CHECK: lis 3, 0
32; CHECK: ori 3, 3, 65535
33
34define zeroext i16 @f5() {
35entry:
36  ret i16 32768
37}
38; CHECK-LABEL: @f5
39; CHECK: lis 3, 0
40; CHECK: ori 3, 3, 32768
41
42define zeroext i16 @f6() {
43entry:
44  ret i16 32767
45}
46; CHECK-LABEL: @f6
47; CHECK: li 3, 32767
48
49define zeroext i16 @f7() {
50entry:
51  ret i16 -1
52}
53; CHECK-LABEL: @f7
54; CHECK: lis 3, 0
55; CHECK: ori 3, 3, 65535
56
57define zeroext i16 @f8() {
58entry:
59  ret i16 -32768
60}
61; CHECK-LABEL: @f8
62; CHECK: lis 3, 0
63; CHECK: ori 3, 3, 32768
64
65define signext i32 @f1s() {
66entry:
67  ret i32 65535
68}
69; CHECK-LABEL: @f1s
70; CHECK: lis 3, 0
71; CHECK: ori 3, 3, 65535
72
73define signext i32 @f2s() {
74entry:
75  ret i32 32768
76}
77; CHECK-LABEL: @f2s
78; CHECK: lis 3, 0
79; CHECK: ori 3, 3, 32768
80
81define signext i32 @f3s() {
82entry:
83  ret i32 32767
84}
85; CHECK-LABEL: @f3s
86; CHECK: li 3, 32767
87
88define signext i16 @f4s() {
89entry:
90  ret i16 32767
91}
92; CHECK-LABEL: @f4s
93; CHECK: li 3, 32767
94
95define signext i32 @f1sn() {
96entry:
97  ret i32 -65535
98}
99; CHECK-LABEL: @f1sn
100; CHECK: lis 3, -1
101; CHECK: ori 3, 3, 1
102
103define signext i32 @f2sn() {
104entry:
105  ret i32 -32768
106}
107; CHECK-LABEL: @f2sn
108; CHECK: li 3, -32768
109
110define signext i32 @f3sn() {
111entry:
112  ret i32 -32767
113}
114; CHECK-LABEL: @f3sn
115; CHECK: li 3, -32767
116
117define signext i32 @f4sn() {
118entry:
119  ret i32 -65536
120}
121; CHECK-LABEL: @f4sn
122; CHECK: lis 3, -1
123
124define signext i16 @f5sn() {
125entry:
126  ret i16 -32767
127}
128; CHECK-LABEL: @f5sn
129; CHECK: li 3, -32767
130
131define signext i16 @f6sn() {
132entry:
133  ret i16 -32768
134}
135; CHECK-LABEL: @f6sn
136; CHECK: li 3, -32768
137