1 ; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
3 define i64 @func1(i64 %a, i32 %b) {
6 ; CHECK-NEXT: srl %s2, %s0, %s1
7 ; CHECK-NEXT: lea %s3, 64
8 ; CHECK-NEXT: subs.w.sx %s1, %s3, %s1
9 ; CHECK-NEXT: sll %s0, %s0, %s1
10 ; CHECK-NEXT: or %s0, %s0, %s2
11 ; CHECK-NEXT: b.l.t (, %s10)
12 %b64 = zext i32 %b to i64
13 %a.lr = lshr i64 %a, %b64
14 %b.inv = sub nsw i32 64, %b
15 %b.inv64 = zext i32 %b.inv to i64
16 %a.sl = shl i64 %a, %b.inv64
17 %r = or i64 %a.sl, %a.lr
21 define i32 @func2(i32 %a, i32 %b) {
24 ; CHECK-NEXT: and %s2, %s0, (32)0
25 ; CHECK-NEXT: srl %s2, %s2, %s1
26 ; CHECK-NEXT: subs.w.sx %s1, 32, %s1
27 ; CHECK-NEXT: sla.w.sx %s0, %s0, %s1
28 ; CHECK-NEXT: or %s0, %s0, %s2
29 ; CHECK-NEXT: b.l.t (, %s10)
30 %a.lr = lshr i32 %a, %b
31 %b.inv = sub nsw i32 32, %b
32 %a.sl = shl i32 %a, %b.inv
33 %r = or i32 %a.sl, %a.lr