xref: /aosp_15_r20/external/llvm/test/CodeGen/AArch64/arm64-shifted-sext.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=arm64 -mtriple=arm64-apple-ios < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker;
3*9880d681SAndroid Build Coastguard Worker; <rdar://problem/13820218>
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdefine signext i16 @extendedLeftShiftcharToshortBy4(i8 signext %a) nounwind readnone ssp {
6*9880d681SAndroid Build Coastguard Workerentry:
7*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedLeftShiftcharToshortBy4:
8*9880d681SAndroid Build Coastguard Worker; CHECK: add [[REG:w[0-9]+]], w0, #1
9*9880d681SAndroid Build Coastguard Worker; CHECK: sbfiz w0, [[REG]], #4, #8
10*9880d681SAndroid Build Coastguard Worker  %inc = add i8 %a, 1
11*9880d681SAndroid Build Coastguard Worker  %conv1 = sext i8 %inc to i32
12*9880d681SAndroid Build Coastguard Worker  %shl = shl nsw i32 %conv1, 4
13*9880d681SAndroid Build Coastguard Worker  %conv2 = trunc i32 %shl to i16
14*9880d681SAndroid Build Coastguard Worker  ret i16 %conv2
15*9880d681SAndroid Build Coastguard Worker}
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Workerdefine signext i16 @extendedRightShiftcharToshortBy4(i8 signext %a) nounwind readnone ssp {
18*9880d681SAndroid Build Coastguard Workerentry:
19*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedRightShiftcharToshortBy4:
20*9880d681SAndroid Build Coastguard Worker; CHECK: add [[REG:w[0-9]+]], w0, #1
21*9880d681SAndroid Build Coastguard Worker; CHECK: sbfx w0, [[REG]], #4, #4
22*9880d681SAndroid Build Coastguard Worker  %inc = add i8 %a, 1
23*9880d681SAndroid Build Coastguard Worker  %conv1 = sext i8 %inc to i32
24*9880d681SAndroid Build Coastguard Worker  %shr4 = lshr i32 %conv1, 4
25*9880d681SAndroid Build Coastguard Worker  %conv2 = trunc i32 %shr4 to i16
26*9880d681SAndroid Build Coastguard Worker  ret i16 %conv2
27*9880d681SAndroid Build Coastguard Worker}
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Workerdefine signext i16 @extendedLeftShiftcharToshortBy8(i8 signext %a) nounwind readnone ssp {
30*9880d681SAndroid Build Coastguard Workerentry:
31*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedLeftShiftcharToshortBy8:
32*9880d681SAndroid Build Coastguard Worker; CHECK: add [[REG:w[0-9]+]], w0, #1
33*9880d681SAndroid Build Coastguard Worker; CHECK: sbfiz w0, [[REG]], #8, #8
34*9880d681SAndroid Build Coastguard Worker  %inc = add i8 %a, 1
35*9880d681SAndroid Build Coastguard Worker  %conv1 = sext i8 %inc to i32
36*9880d681SAndroid Build Coastguard Worker  %shl = shl nsw i32 %conv1, 8
37*9880d681SAndroid Build Coastguard Worker  %conv2 = trunc i32 %shl to i16
38*9880d681SAndroid Build Coastguard Worker  ret i16 %conv2
39*9880d681SAndroid Build Coastguard Worker}
40*9880d681SAndroid Build Coastguard Worker
41*9880d681SAndroid Build Coastguard Workerdefine signext i16 @extendedRightShiftcharToshortBy8(i8 signext %a) nounwind readnone ssp {
42*9880d681SAndroid Build Coastguard Workerentry:
43*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedRightShiftcharToshortBy8:
44*9880d681SAndroid Build Coastguard Worker; CHECK: add [[REG:w[0-9]+]], w0, #1
45*9880d681SAndroid Build Coastguard Worker; CHECK: sxtb [[REG]], [[REG]]
46*9880d681SAndroid Build Coastguard Worker; CHECK: asr w0, [[REG]], #8
47*9880d681SAndroid Build Coastguard Worker  %inc = add i8 %a, 1
48*9880d681SAndroid Build Coastguard Worker  %conv1 = sext i8 %inc to i32
49*9880d681SAndroid Build Coastguard Worker  %shr4 = lshr i32 %conv1, 8
50*9880d681SAndroid Build Coastguard Worker  %conv2 = trunc i32 %shr4 to i16
51*9880d681SAndroid Build Coastguard Worker  ret i16 %conv2
52*9880d681SAndroid Build Coastguard Worker}
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard Workerdefine i32 @extendedLeftShiftcharTointBy4(i8 signext %a) nounwind readnone ssp {
55*9880d681SAndroid Build Coastguard Workerentry:
56*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedLeftShiftcharTointBy4:
57*9880d681SAndroid Build Coastguard Worker; CHECK: add [[REG:w[0-9]+]], w0, #1
58*9880d681SAndroid Build Coastguard Worker; CHECK: sbfiz w0, [[REG]], #4, #8
59*9880d681SAndroid Build Coastguard Worker  %inc = add i8 %a, 1
60*9880d681SAndroid Build Coastguard Worker  %conv = sext i8 %inc to i32
61*9880d681SAndroid Build Coastguard Worker  %shl = shl nsw i32 %conv, 4
62*9880d681SAndroid Build Coastguard Worker  ret i32 %shl
63*9880d681SAndroid Build Coastguard Worker}
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard Workerdefine i32 @extendedRightShiftcharTointBy4(i8 signext %a) nounwind readnone ssp {
66*9880d681SAndroid Build Coastguard Workerentry:
67*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedRightShiftcharTointBy4:
68*9880d681SAndroid Build Coastguard Worker; CHECK: add [[REG:w[0-9]+]], w0, #1
69*9880d681SAndroid Build Coastguard Worker; CHECK: sbfx w0, [[REG]], #4, #4
70*9880d681SAndroid Build Coastguard Worker  %inc = add i8 %a, 1
71*9880d681SAndroid Build Coastguard Worker  %conv = sext i8 %inc to i32
72*9880d681SAndroid Build Coastguard Worker  %shr = ashr i32 %conv, 4
73*9880d681SAndroid Build Coastguard Worker  ret i32 %shr
74*9880d681SAndroid Build Coastguard Worker}
75*9880d681SAndroid Build Coastguard Worker
76*9880d681SAndroid Build Coastguard Workerdefine i32 @extendedLeftShiftcharTointBy8(i8 signext %a) nounwind readnone ssp {
77*9880d681SAndroid Build Coastguard Workerentry:
78*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedLeftShiftcharTointBy8:
79*9880d681SAndroid Build Coastguard Worker; CHECK: add [[REG:w[0-9]+]], w0, #1
80*9880d681SAndroid Build Coastguard Worker; CHECK: sbfiz w0, [[REG]], #8, #8
81*9880d681SAndroid Build Coastguard Worker  %inc = add i8 %a, 1
82*9880d681SAndroid Build Coastguard Worker  %conv = sext i8 %inc to i32
83*9880d681SAndroid Build Coastguard Worker  %shl = shl nsw i32 %conv, 8
84*9880d681SAndroid Build Coastguard Worker  ret i32 %shl
85*9880d681SAndroid Build Coastguard Worker}
86*9880d681SAndroid Build Coastguard Worker
87*9880d681SAndroid Build Coastguard Workerdefine i32 @extendedRightShiftcharTointBy8(i8 signext %a) nounwind readnone ssp {
88*9880d681SAndroid Build Coastguard Workerentry:
89*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedRightShiftcharTointBy8:
90*9880d681SAndroid Build Coastguard Worker; CHECK: add [[REG:w[0-9]+]], w0, #1
91*9880d681SAndroid Build Coastguard Worker; CHECK: sxtb [[REG]], [[REG]]
92*9880d681SAndroid Build Coastguard Worker; CHECK: asr w0, [[REG]], #8
93*9880d681SAndroid Build Coastguard Worker  %inc = add i8 %a, 1
94*9880d681SAndroid Build Coastguard Worker  %conv = sext i8 %inc to i32
95*9880d681SAndroid Build Coastguard Worker  %shr = ashr i32 %conv, 8
96*9880d681SAndroid Build Coastguard Worker  ret i32 %shr
97*9880d681SAndroid Build Coastguard Worker}
98*9880d681SAndroid Build Coastguard Worker
99*9880d681SAndroid Build Coastguard Workerdefine i64 @extendedLeftShiftcharToint64By4(i8 signext %a) nounwind readnone ssp {
100*9880d681SAndroid Build Coastguard Workerentry:
101*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedLeftShiftcharToint64By4:
102*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[REG:[0-9]+]], w0, #1
103*9880d681SAndroid Build Coastguard Worker; CHECK: sbfiz x0, x[[REG]], #4, #8
104*9880d681SAndroid Build Coastguard Worker  %inc = add i8 %a, 1
105*9880d681SAndroid Build Coastguard Worker  %conv = sext i8 %inc to i64
106*9880d681SAndroid Build Coastguard Worker  %shl = shl nsw i64 %conv, 4
107*9880d681SAndroid Build Coastguard Worker  ret i64 %shl
108*9880d681SAndroid Build Coastguard Worker}
109*9880d681SAndroid Build Coastguard Worker
110*9880d681SAndroid Build Coastguard Workerdefine i64 @extendedRightShiftcharToint64By4(i8 signext %a) nounwind readnone ssp {
111*9880d681SAndroid Build Coastguard Workerentry:
112*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedRightShiftcharToint64By4:
113*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[REG:[0-9]+]], w0, #1
114*9880d681SAndroid Build Coastguard Worker; CHECK: sbfx x0, x[[REG]], #4, #4
115*9880d681SAndroid Build Coastguard Worker  %inc = add i8 %a, 1
116*9880d681SAndroid Build Coastguard Worker  %conv = sext i8 %inc to i64
117*9880d681SAndroid Build Coastguard Worker  %shr = ashr i64 %conv, 4
118*9880d681SAndroid Build Coastguard Worker  ret i64 %shr
119*9880d681SAndroid Build Coastguard Worker}
120*9880d681SAndroid Build Coastguard Worker
121*9880d681SAndroid Build Coastguard Workerdefine i64 @extendedLeftShiftcharToint64By8(i8 signext %a) nounwind readnone ssp {
122*9880d681SAndroid Build Coastguard Workerentry:
123*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedLeftShiftcharToint64By8:
124*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[REG:[0-9]+]], w0, #1
125*9880d681SAndroid Build Coastguard Worker; CHECK: sbfiz x0, x[[REG]], #8, #8
126*9880d681SAndroid Build Coastguard Worker  %inc = add i8 %a, 1
127*9880d681SAndroid Build Coastguard Worker  %conv = sext i8 %inc to i64
128*9880d681SAndroid Build Coastguard Worker  %shl = shl nsw i64 %conv, 8
129*9880d681SAndroid Build Coastguard Worker  ret i64 %shl
130*9880d681SAndroid Build Coastguard Worker}
131*9880d681SAndroid Build Coastguard Worker
132*9880d681SAndroid Build Coastguard Workerdefine i64 @extendedRightShiftcharToint64By8(i8 signext %a) nounwind readnone ssp {
133*9880d681SAndroid Build Coastguard Workerentry:
134*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedRightShiftcharToint64By8:
135*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[REG:[0-9]+]], w0, #1
136*9880d681SAndroid Build Coastguard Worker; CHECK: sxtb x[[REG]], w[[REG]]
137*9880d681SAndroid Build Coastguard Worker; CHECK: asr x0, x[[REG]], #8
138*9880d681SAndroid Build Coastguard Worker  %inc = add i8 %a, 1
139*9880d681SAndroid Build Coastguard Worker  %conv = sext i8 %inc to i64
140*9880d681SAndroid Build Coastguard Worker  %shr = ashr i64 %conv, 8
141*9880d681SAndroid Build Coastguard Worker  ret i64 %shr
142*9880d681SAndroid Build Coastguard Worker}
143*9880d681SAndroid Build Coastguard Worker
144*9880d681SAndroid Build Coastguard Workerdefine i32 @extendedLeftShiftshortTointBy4(i16 signext %a) nounwind readnone ssp {
145*9880d681SAndroid Build Coastguard Workerentry:
146*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedLeftShiftshortTointBy4:
147*9880d681SAndroid Build Coastguard Worker; CHECK: add [[REG:w[0-9]+]], w0, #1
148*9880d681SAndroid Build Coastguard Worker; CHECK: sbfiz w0, [[REG]], #4, #16
149*9880d681SAndroid Build Coastguard Worker  %inc = add i16 %a, 1
150*9880d681SAndroid Build Coastguard Worker  %conv = sext i16 %inc to i32
151*9880d681SAndroid Build Coastguard Worker  %shl = shl nsw i32 %conv, 4
152*9880d681SAndroid Build Coastguard Worker  ret i32 %shl
153*9880d681SAndroid Build Coastguard Worker}
154*9880d681SAndroid Build Coastguard Worker
155*9880d681SAndroid Build Coastguard Workerdefine i32 @extendedRightShiftshortTointBy4(i16 signext %a) nounwind readnone ssp {
156*9880d681SAndroid Build Coastguard Workerentry:
157*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedRightShiftshortTointBy4:
158*9880d681SAndroid Build Coastguard Worker; CHECK: add [[REG:w[0-9]+]], w0, #1
159*9880d681SAndroid Build Coastguard Worker; CHECK: sbfx w0, [[REG]], #4, #12
160*9880d681SAndroid Build Coastguard Worker  %inc = add i16 %a, 1
161*9880d681SAndroid Build Coastguard Worker  %conv = sext i16 %inc to i32
162*9880d681SAndroid Build Coastguard Worker  %shr = ashr i32 %conv, 4
163*9880d681SAndroid Build Coastguard Worker  ret i32 %shr
164*9880d681SAndroid Build Coastguard Worker}
165*9880d681SAndroid Build Coastguard Worker
166*9880d681SAndroid Build Coastguard Workerdefine i32 @extendedLeftShiftshortTointBy16(i16 signext %a) nounwind readnone ssp {
167*9880d681SAndroid Build Coastguard Workerentry:
168*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedLeftShiftshortTointBy16:
169*9880d681SAndroid Build Coastguard Worker; CHECK: lsl [[REG:w[0-9]+]], w0, #16
170*9880d681SAndroid Build Coastguard Worker; CHECK: add w0, [[REG]], #16, lsl #12
171*9880d681SAndroid Build Coastguard Worker  %inc = add i16 %a, 1
172*9880d681SAndroid Build Coastguard Worker  %conv2 = zext i16 %inc to i32
173*9880d681SAndroid Build Coastguard Worker  %shl = shl nuw i32 %conv2, 16
174*9880d681SAndroid Build Coastguard Worker  ret i32 %shl
175*9880d681SAndroid Build Coastguard Worker}
176*9880d681SAndroid Build Coastguard Worker
177*9880d681SAndroid Build Coastguard Workerdefine i32 @extendedRightShiftshortTointBy16(i16 signext %a) nounwind readnone ssp {
178*9880d681SAndroid Build Coastguard Workerentry:
179*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedRightShiftshortTointBy16:
180*9880d681SAndroid Build Coastguard Worker; CHECK: add [[REG:w[0-9]+]], w0, #1
181*9880d681SAndroid Build Coastguard Worker; CHECK: sxth [[REG]], [[REG]]
182*9880d681SAndroid Build Coastguard Worker; CHECK: asr w0, [[REG]], #16
183*9880d681SAndroid Build Coastguard Worker  %inc = add i16 %a, 1
184*9880d681SAndroid Build Coastguard Worker  %conv = sext i16 %inc to i32
185*9880d681SAndroid Build Coastguard Worker  %shr = ashr i32 %conv, 16
186*9880d681SAndroid Build Coastguard Worker  ret i32 %shr
187*9880d681SAndroid Build Coastguard Worker}
188*9880d681SAndroid Build Coastguard Worker
189*9880d681SAndroid Build Coastguard Workerdefine i64 @extendedLeftShiftshortToint64By4(i16 signext %a) nounwind readnone ssp {
190*9880d681SAndroid Build Coastguard Workerentry:
191*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedLeftShiftshortToint64By4:
192*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[REG:[0-9]+]], w0, #1
193*9880d681SAndroid Build Coastguard Worker; CHECK: sbfiz x0, x[[REG]], #4, #16
194*9880d681SAndroid Build Coastguard Worker  %inc = add i16 %a, 1
195*9880d681SAndroid Build Coastguard Worker  %conv = sext i16 %inc to i64
196*9880d681SAndroid Build Coastguard Worker  %shl = shl nsw i64 %conv, 4
197*9880d681SAndroid Build Coastguard Worker  ret i64 %shl
198*9880d681SAndroid Build Coastguard Worker}
199*9880d681SAndroid Build Coastguard Worker
200*9880d681SAndroid Build Coastguard Workerdefine i64 @extendedRightShiftshortToint64By4(i16 signext %a) nounwind readnone ssp {
201*9880d681SAndroid Build Coastguard Workerentry:
202*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedRightShiftshortToint64By4:
203*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[REG:[0-9]+]], w0, #1
204*9880d681SAndroid Build Coastguard Worker; CHECK: sbfx x0, x[[REG]], #4, #12
205*9880d681SAndroid Build Coastguard Worker  %inc = add i16 %a, 1
206*9880d681SAndroid Build Coastguard Worker  %conv = sext i16 %inc to i64
207*9880d681SAndroid Build Coastguard Worker  %shr = ashr i64 %conv, 4
208*9880d681SAndroid Build Coastguard Worker  ret i64 %shr
209*9880d681SAndroid Build Coastguard Worker}
210*9880d681SAndroid Build Coastguard Worker
211*9880d681SAndroid Build Coastguard Workerdefine i64 @extendedLeftShiftshortToint64By16(i16 signext %a) nounwind readnone ssp {
212*9880d681SAndroid Build Coastguard Workerentry:
213*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedLeftShiftshortToint64By16:
214*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[REG:[0-9]+]], w0, #1
215*9880d681SAndroid Build Coastguard Worker; CHECK: sbfiz x0, x[[REG]], #16, #16
216*9880d681SAndroid Build Coastguard Worker  %inc = add i16 %a, 1
217*9880d681SAndroid Build Coastguard Worker  %conv = sext i16 %inc to i64
218*9880d681SAndroid Build Coastguard Worker  %shl = shl nsw i64 %conv, 16
219*9880d681SAndroid Build Coastguard Worker  ret i64 %shl
220*9880d681SAndroid Build Coastguard Worker}
221*9880d681SAndroid Build Coastguard Worker
222*9880d681SAndroid Build Coastguard Workerdefine i64 @extendedRightShiftshortToint64By16(i16 signext %a) nounwind readnone ssp {
223*9880d681SAndroid Build Coastguard Workerentry:
224*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedRightShiftshortToint64By16:
225*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[REG:[0-9]+]], w0, #1
226*9880d681SAndroid Build Coastguard Worker; CHECK: sxth x[[REG]], w[[REG]]
227*9880d681SAndroid Build Coastguard Worker; CHECK: asr x0, x[[REG]], #16
228*9880d681SAndroid Build Coastguard Worker  %inc = add i16 %a, 1
229*9880d681SAndroid Build Coastguard Worker  %conv = sext i16 %inc to i64
230*9880d681SAndroid Build Coastguard Worker  %shr = ashr i64 %conv, 16
231*9880d681SAndroid Build Coastguard Worker  ret i64 %shr
232*9880d681SAndroid Build Coastguard Worker}
233*9880d681SAndroid Build Coastguard Worker
234*9880d681SAndroid Build Coastguard Workerdefine i64 @extendedLeftShiftintToint64By4(i32 %a) nounwind readnone ssp {
235*9880d681SAndroid Build Coastguard Workerentry:
236*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedLeftShiftintToint64By4:
237*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[REG:[0-9]+]], w0, #1
238*9880d681SAndroid Build Coastguard Worker; CHECK: sbfiz x0, x[[REG]], #4, #32
239*9880d681SAndroid Build Coastguard Worker  %inc = add nsw i32 %a, 1
240*9880d681SAndroid Build Coastguard Worker  %conv = sext i32 %inc to i64
241*9880d681SAndroid Build Coastguard Worker  %shl = shl nsw i64 %conv, 4
242*9880d681SAndroid Build Coastguard Worker  ret i64 %shl
243*9880d681SAndroid Build Coastguard Worker}
244*9880d681SAndroid Build Coastguard Worker
245*9880d681SAndroid Build Coastguard Workerdefine i64 @extendedRightShiftintToint64By4(i32 %a) nounwind readnone ssp {
246*9880d681SAndroid Build Coastguard Workerentry:
247*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedRightShiftintToint64By4:
248*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[REG:[0-9]+]], w0, #1
249*9880d681SAndroid Build Coastguard Worker; CHECK: sbfx x0, x[[REG]], #4, #28
250*9880d681SAndroid Build Coastguard Worker  %inc = add nsw i32 %a, 1
251*9880d681SAndroid Build Coastguard Worker  %conv = sext i32 %inc to i64
252*9880d681SAndroid Build Coastguard Worker  %shr = ashr i64 %conv, 4
253*9880d681SAndroid Build Coastguard Worker  ret i64 %shr
254*9880d681SAndroid Build Coastguard Worker}
255*9880d681SAndroid Build Coastguard Worker
256*9880d681SAndroid Build Coastguard Workerdefine i64 @extendedLeftShiftintToint64By32(i32 %a) nounwind readnone ssp {
257*9880d681SAndroid Build Coastguard Workerentry:
258*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedLeftShiftintToint64By32:
259*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[REG:[0-9]+]], w0, #1
260*9880d681SAndroid Build Coastguard Worker; CHECK: lsl x0, x[[REG]], #32
261*9880d681SAndroid Build Coastguard Worker  %inc = add nsw i32 %a, 1
262*9880d681SAndroid Build Coastguard Worker  %conv2 = zext i32 %inc to i64
263*9880d681SAndroid Build Coastguard Worker  %shl = shl nuw i64 %conv2, 32
264*9880d681SAndroid Build Coastguard Worker  ret i64 %shl
265*9880d681SAndroid Build Coastguard Worker}
266*9880d681SAndroid Build Coastguard Worker
267*9880d681SAndroid Build Coastguard Workerdefine i64 @extendedRightShiftintToint64By32(i32 %a) nounwind readnone ssp {
268*9880d681SAndroid Build Coastguard Workerentry:
269*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: extendedRightShiftintToint64By32:
270*9880d681SAndroid Build Coastguard Worker; CHECK: add w[[REG:[0-9]+]], w0, #1
271*9880d681SAndroid Build Coastguard Worker; CHECK: sxtw x[[REG]], w[[REG]]
272*9880d681SAndroid Build Coastguard Worker; CHECK: asr x0, x[[REG]], #32
273*9880d681SAndroid Build Coastguard Worker  %inc = add nsw i32 %a, 1
274*9880d681SAndroid Build Coastguard Worker  %conv = sext i32 %inc to i64
275*9880d681SAndroid Build Coastguard Worker  %shr = ashr i64 %conv, 32
276*9880d681SAndroid Build Coastguard Worker  ret i64 %shr
277*9880d681SAndroid Build Coastguard Worker}
278