1 ; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
3 define signext i16 @func1() {
5 ; CHECK: .LBB{{[0-9]+}}_2:
6 ; CHECK-NEXT: ld1b.sx %s0, 15(, %s11)
7 ; CHECK-NEXT: adds.l %s11, 16, %s11
8 ; CHECK-NEXT: b.l.t (, %s10)
9 %a = alloca i8, align 1
10 %a.val = load i8, ptr %a, align 1
11 %a.conv = sext i8 %a.val to i16
17 ; CHECK: .LBB{{[0-9]+}}_2:
18 ; CHECK-NEXT: ld1b.sx %s0, 15(, %s11)
19 ; CHECK-NEXT: adds.l %s11, 16, %s11
20 ; CHECK-NEXT: b.l.t (, %s10)
21 %a = alloca i8, align 1
22 %a.val = load i8, ptr %a, align 1
23 %a.conv = sext i8 %a.val to i32
29 ; CHECK: .LBB{{[0-9]+}}_2:
30 ; CHECK-NEXT: ld1b.sx %s0, 15(, %s11)
31 ; CHECK-NEXT: adds.l %s11, 16, %s11
32 ; CHECK-NEXT: b.l.t (, %s10)
33 %a = alloca i8, align 1
34 %a.val = load i8, ptr %a, align 1
35 %a.conv = sext i8 %a.val to i64
39 define zeroext i16 @func5() {
41 ; CHECK: .LBB{{[0-9]+}}_2:
42 ; CHECK-NEXT: ld1b.sx %s0, 15(, %s11)
43 ; CHECK-NEXT: and %s0, %s0, (48)0
44 ; CHECK-NEXT: adds.l %s11, 16, %s11
45 ; CHECK-NEXT: b.l.t (, %s10)
46 %a = alloca i8, align 1
47 %a.val = load i8, ptr %a, align 1
48 %a.conv = sext i8 %a.val to i16
54 ; CHECK: .LBB{{[0-9]+}}_2:
55 ; CHECK-NEXT: ld1b.sx %s0, 15(, %s11)
56 ; CHECK-NEXT: adds.l %s11, 16, %s11
57 ; CHECK-NEXT: b.l.t (, %s10)
58 %a = alloca i8, align 1
59 %a.val = load i8, ptr %a, align 1
60 %a.conv = sext i8 %a.val to i32
66 ; CHECK: .LBB{{[0-9]+}}_2:
67 ; CHECK-NEXT: ld1b.sx %s0, 15(, %s11)
68 ; CHECK-NEXT: adds.l %s11, 16, %s11
69 ; CHECK-NEXT: b.l.t (, %s10)
70 %a = alloca i8, align 1
71 %a.val = load i8, ptr %a, align 1
72 %a.conv = sext i8 %a.val to i64
76 define signext i16 @func9() {
78 ; CHECK: .LBB{{[0-9]+}}_2:
79 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
80 ; CHECK-NEXT: adds.l %s11, 16, %s11
81 ; CHECK-NEXT: b.l.t (, %s10)
82 %a = alloca i8, align 1
83 %a.val = load i8, ptr %a, align 1
84 %a.conv = zext i8 %a.val to i16
88 define i32 @func10() {
89 ; CHECK-LABEL: func10:
90 ; CHECK: .LBB{{[0-9]+}}_2:
91 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
92 ; CHECK-NEXT: adds.l %s11, 16, %s11
93 ; CHECK-NEXT: b.l.t (, %s10)
94 %a = alloca i8, align 1
95 %a.val = load i8, ptr %a, align 1
96 %a.conv = zext i8 %a.val to i32
100 define i64 @func11() {
101 ; CHECK-LABEL: func11:
102 ; CHECK: .LBB{{[0-9]+}}_2:
103 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
104 ; CHECK-NEXT: adds.l %s11, 16, %s11
105 ; CHECK-NEXT: b.l.t (, %s10)
106 %a = alloca i8, align 1
107 %a.val = load i8, ptr %a, align 1
108 %a.conv = zext i8 %a.val to i64
112 define zeroext i16 @func13() {
113 ; CHECK-LABEL: func13:
114 ; CHECK: .LBB{{[0-9]+}}_2:
115 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
116 ; CHECK-NEXT: adds.l %s11, 16, %s11
117 ; CHECK-NEXT: b.l.t (, %s10)
118 %a = alloca i8, align 1
119 %a.val = load i8, ptr %a, align 1
120 %a.conv = zext i8 %a.val to i16
124 define zeroext i16 @func14() {
125 ; CHECK-LABEL: func14:
126 ; CHECK: .LBB{{[0-9]+}}_2:
127 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
128 ; CHECK-NEXT: adds.l %s11, 16, %s11
129 ; CHECK-NEXT: b.l.t (, %s10)
130 %a = alloca i8, align 1
131 %a.val = load i8, ptr %a, align 1
132 %a.conv = zext i8 %a.val to i16
136 define i64 @func15() {
137 ; CHECK-LABEL: func15:
138 ; CHECK: .LBB{{[0-9]+}}_2:
139 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
140 ; CHECK-NEXT: adds.l %s11, 16, %s11
141 ; CHECK-NEXT: b.l.t (, %s10)
142 %a = alloca i8, align 1
143 %a.val = load i8, ptr %a, align 1
144 %a.conv = zext i8 %a.val to i64
148 define i32 @func17() {
149 ; CHECK-LABEL: func17:
150 ; CHECK: .LBB{{[0-9]+}}_2:
151 ; CHECK-NEXT: ld2b.sx %s0, 14(, %s11)
152 ; CHECK-NEXT: adds.l %s11, 16, %s11
153 ; CHECK-NEXT: b.l.t (, %s10)
154 %a = alloca i16, align 2
155 %a.val = load i16, ptr %a, align 2
156 %a.conv = sext i16 %a.val to i32
160 define i64 @func18() {
161 ; CHECK-LABEL: func18:
162 ; CHECK: .LBB{{[0-9]+}}_2:
163 ; CHECK-NEXT: ld2b.sx %s0, 14(, %s11)
164 ; CHECK-NEXT: adds.l %s11, 16, %s11
165 ; CHECK-NEXT: b.l.t (, %s10)
166 %a = alloca i16, align 2
167 %a.val = load i16, ptr %a, align 2
168 %a.conv = sext i16 %a.val to i64
172 define zeroext i16 @func20() {
173 ; CHECK-LABEL: func20:
174 ; CHECK: .LBB{{[0-9]+}}_2:
175 ; CHECK-NEXT: ld2b.zx %s0, 14(, %s11)
176 ; CHECK-NEXT: adds.l %s11, 16, %s11
177 ; CHECK-NEXT: b.l.t (, %s10)
178 %a = alloca i16, align 2
179 %a.conv = load i16, ptr %a, align 2
183 define i64 @func21() {
184 ; CHECK-LABEL: func21:
185 ; CHECK: .LBB{{[0-9]+}}_2:
186 ; CHECK-NEXT: ld2b.sx %s0, 14(, %s11)
187 ; CHECK-NEXT: adds.l %s11, 16, %s11
188 ; CHECK-NEXT: b.l.t (, %s10)
189 %a = alloca i16, align 2
190 %a.val = load i16, ptr %a, align 2
191 %a.conv = sext i16 %a.val to i64
195 define i32 @func23() {
196 ; CHECK-LABEL: func23:
197 ; CHECK: .LBB{{[0-9]+}}_2:
198 ; CHECK-NEXT: ld2b.zx %s0, 14(, %s11)
199 ; CHECK-NEXT: adds.l %s11, 16, %s11
200 ; CHECK-NEXT: b.l.t (, %s10)
201 %a = alloca i16, align 2
202 %a.val = load i16, ptr %a, align 2
203 %a.conv = zext i16 %a.val to i32
207 define i64 @func24() {
208 ; CHECK-LABEL: func24:
209 ; CHECK: .LBB{{[0-9]+}}_2:
210 ; CHECK-NEXT: ld2b.zx %s0, 14(, %s11)
211 ; CHECK-NEXT: adds.l %s11, 16, %s11
212 ; CHECK-NEXT: b.l.t (, %s10)
213 %a = alloca i16, align 2
214 %a.val = load i16, ptr %a, align 2
215 %a.conv = zext i16 %a.val to i64
219 define zeroext i16 @func26() {
220 ; CHECK-LABEL: func26:
221 ; CHECK: .LBB{{[0-9]+}}_2:
222 ; CHECK-NEXT: ld2b.zx %s0, 14(, %s11)
223 ; CHECK-NEXT: adds.l %s11, 16, %s11
224 ; CHECK-NEXT: b.l.t (, %s10)
225 %a = alloca i16, align 2
226 %a.conv = load i16, ptr %a, align 2
230 define i64 @func27() {
231 ; CHECK-LABEL: func27:
232 ; CHECK: .LBB{{[0-9]+}}_2:
233 ; CHECK-NEXT: ld2b.zx %s0, 14(, %s11)
234 ; CHECK-NEXT: adds.l %s11, 16, %s11
235 ; CHECK-NEXT: b.l.t (, %s10)
236 %a = alloca i16, align 2
237 %a.val = load i16, ptr %a, align 2
238 %a.conv = zext i16 %a.val to i64
242 define i64 @func29() {
243 ; CHECK-LABEL: func29:
244 ; CHECK: .LBB{{[0-9]+}}_2:
245 ; CHECK-NEXT: ldl.sx %s0, 12(, %s11)
246 ; CHECK-NEXT: adds.l %s11, 16, %s11
247 ; CHECK-NEXT: b.l.t (, %s10)
248 %a = alloca i32, align 4
249 %a.val = load i32, ptr %a, align 4
250 %a.conv = sext i32 %a.val to i64
254 define i64 @func31() {
255 ; CHECK-LABEL: func31:
256 ; CHECK: .LBB{{[0-9]+}}_2:
257 ; CHECK-NEXT: ldl.sx %s0, 12(, %s11)
258 ; CHECK-NEXT: adds.l %s11, 16, %s11
259 ; CHECK-NEXT: b.l.t (, %s10)
260 %a = alloca i32, align 4
261 %a.val = load i32, ptr %a, align 4
262 %a.conv = sext i32 %a.val to i64
266 define i64 @func33() {
267 ; CHECK-LABEL: func33:
268 ; CHECK: .LBB{{[0-9]+}}_2:
269 ; CHECK-NEXT: ldl.zx %s0, 12(, %s11)
270 ; CHECK-NEXT: adds.l %s11, 16, %s11
271 ; CHECK-NEXT: b.l.t (, %s10)
272 %a = alloca i32, align 4
273 %a.val = load i32, ptr %a, align 4
274 %a.conv = zext i32 %a.val to i64
278 define i64 @func35() {
279 ; CHECK-LABEL: func35:
280 ; CHECK: .LBB{{[0-9]+}}_2:
281 ; CHECK-NEXT: ldl.zx %s0, 12(, %s11)
282 ; CHECK-NEXT: adds.l %s11, 16, %s11
283 ; CHECK-NEXT: b.l.t (, %s10)
284 %a = alloca i32, align 4
285 %a.val = load i32, ptr %a, align 4
286 %a.conv = zext i32 %a.val to i64
290 define signext i8 @func37() {
291 ; CHECK-LABEL: func37:
292 ; CHECK: .LBB{{[0-9]+}}_2:
293 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
294 ; CHECK-NEXT: sll %s0, %s0, 63
295 ; CHECK-NEXT: sra.l %s0, %s0, 63
296 ; CHECK-NEXT: adds.l %s11, 16, %s11
297 ; CHECK-NEXT: b.l.t (, %s10)
298 %a = alloca i1, align 1
299 %a.val = load i1, ptr %a, align 1
300 %a.conv = sext i1 %a.val to i8
304 define signext i16 @func38() {
305 ; CHECK-LABEL: func38:
306 ; CHECK: .LBB{{[0-9]+}}_2:
307 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
308 ; CHECK-NEXT: sll %s0, %s0, 63
309 ; CHECK-NEXT: sra.l %s0, %s0, 63
310 ; CHECK-NEXT: adds.l %s11, 16, %s11
311 ; CHECK-NEXT: b.l.t (, %s10)
312 %a = alloca i1, align 1
313 %a.val = load i1, ptr %a, align 1
314 %a.conv = sext i1 %a.val to i16
318 define signext i32 @func39() {
319 ; CHECK-LABEL: func39:
320 ; CHECK: .LBB{{[0-9]+}}_2:
321 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
322 ; CHECK-NEXT: sll %s0, %s0, 63
323 ; CHECK-NEXT: sra.l %s0, %s0, 63
324 ; CHECK-NEXT: adds.l %s11, 16, %s11
325 ; CHECK-NEXT: b.l.t (, %s10)
326 %a = alloca i1, align 1
327 %a.val = load i1, ptr %a, align 1
328 %a.conv = sext i1 %a.val to i32
332 define signext i64 @func40() {
333 ; CHECK-LABEL: func40:
334 ; CHECK: .LBB{{[0-9]+}}_2:
335 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
336 ; CHECK-NEXT: sll %s0, %s0, 63
337 ; CHECK-NEXT: sra.l %s0, %s0, 63
338 ; CHECK-NEXT: adds.l %s11, 16, %s11
339 ; CHECK-NEXT: b.l.t (, %s10)
340 %a = alloca i1, align 1
341 %a.val = load i1, ptr %a, align 1
342 %a.conv = sext i1 %a.val to i64
346 define signext i8 @func42() {
347 ; CHECK-LABEL: func42:
348 ; CHECK: .LBB{{[0-9]+}}_2:
349 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
350 ; CHECK-NEXT: adds.l %s11, 16, %s11
351 ; CHECK-NEXT: b.l.t (, %s10)
352 %a = alloca i1, align 1
353 %a.val = load i1, ptr %a, align 1
354 %a.conv = zext i1 %a.val to i8
358 define signext i16 @func43() {
359 ; CHECK-LABEL: func43:
360 ; CHECK: .LBB{{[0-9]+}}_2:
361 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
362 ; CHECK-NEXT: adds.l %s11, 16, %s11
363 ; CHECK-NEXT: b.l.t (, %s10)
364 %a = alloca i1, align 1
365 %a.val = load i1, ptr %a, align 1
366 %a.conv = zext i1 %a.val to i16
370 define signext i32 @func44() {
371 ; CHECK-LABEL: func44:
372 ; CHECK: .LBB{{[0-9]+}}_2:
373 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
374 ; CHECK-NEXT: adds.l %s11, 16, %s11
375 ; CHECK-NEXT: b.l.t (, %s10)
376 %a = alloca i1, align 1
377 %a.val = load i1, ptr %a, align 1
378 %a.conv = zext i1 %a.val to i32
382 define signext i64 @func45() {
383 ; CHECK-LABEL: func45:
384 ; CHECK: .LBB{{[0-9]+}}_2:
385 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
386 ; CHECK-NEXT: adds.l %s11, 16, %s11
387 ; CHECK-NEXT: b.l.t (, %s10)
388 %a = alloca i1, align 1
389 %a.val = load i1, ptr %a, align 1
390 %a.conv = zext i1 %a.val to i64