1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s
5 define <vscale x 1 x i32> @fshr(<vscale x 1 x i32> %a, <vscale x 1 x i32> %b, <vscale x 1 x i32> %c) {
8 ; CHECK-NEXT: li a0, 31
9 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
10 ; CHECK-NEXT: vand.vx v11, v10, a0
11 ; CHECK-NEXT: vsrl.vv v9, v9, v11
12 ; CHECK-NEXT: vnot.v v10, v10
13 ; CHECK-NEXT: vand.vx v10, v10, a0
14 ; CHECK-NEXT: vadd.vv v8, v8, v8
15 ; CHECK-NEXT: vsll.vv v8, v8, v10
16 ; CHECK-NEXT: vor.vv v8, v8, v9
18 %res = call <vscale x 1 x i32> @llvm.fshr.v4i32(<vscale x 1 x i32> %a, <vscale x 1 x i32> %b, <vscale x 1 x i32> %c)
19 ret <vscale x 1 x i32> %res
22 define <vscale x 1 x i32> @fshl(<vscale x 1 x i32> %a, <vscale x 1 x i32> %b, <vscale x 1 x i32> %c) {
25 ; CHECK-NEXT: li a0, 31
26 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
27 ; CHECK-NEXT: vand.vx v11, v10, a0
28 ; CHECK-NEXT: vsll.vv v8, v8, v11
29 ; CHECK-NEXT: vnot.v v10, v10
30 ; CHECK-NEXT: vand.vx v10, v10, a0
31 ; CHECK-NEXT: vsrl.vi v9, v9, 1
32 ; CHECK-NEXT: vsrl.vv v9, v9, v10
33 ; CHECK-NEXT: vor.vv v8, v8, v9
35 %res = call <vscale x 1 x i32> @llvm.fshl.v4i32(<vscale x 1 x i32> %a, <vscale x 1 x i32> %b, <vscale x 1 x i32> %c)
36 ret <vscale x 1 x i32> %res
39 declare <vscale x 1 x i32> @llvm.fshr.v4i32(<vscale x 1 x i32> %a, <vscale x 1 x i32> %b, <vscale x 1 x i32> %c)
40 declare <vscale x 1 x i32> @llvm.fshl.v4i32(<vscale x 1 x i32> %a, <vscale x 1 x i32> %b, <vscale x 1 x i32> %c)