1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc < %s -mtriple=riscv64 -mattr=+v -verify-machineinstrs | FileCheck %s
4 define <vscale x 1 x i1> @sew1_srli(<vscale x 1 x i1> %a, <vscale x 1 x i1> %b) {
5 ; CHECK-LABEL: sew1_srli:
7 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
8 ; CHECK-NEXT: vmand.mm v0, v0, v8
10 %vlmax = call i32 @llvm.vscale()
11 %x = call <vscale x 1 x i1> @llvm.vp.and.nxv1i1(<vscale x 1 x i1> %a, <vscale x 1 x i1> %b, <vscale x 1 x i1> splat (i1 true), i32 %vlmax)
12 ret <vscale x 1 x i1> %x
15 define <vscale x 1 x i64> @sew64_srli(<vscale x 1 x i64> %a, <vscale x 1 x i64> %b) {
16 ; CHECK-LABEL: sew64_srli:
18 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
19 ; CHECK-NEXT: vadd.vv v8, v8, v9
21 %vlmax = call i32 @llvm.vscale()
22 %x = call <vscale x 1 x i64> @llvm.vp.add.nxv1i64(<vscale x 1 x i64> %a, <vscale x 1 x i64> %b, <vscale x 1 x i1> splat (i1 true), i32 %vlmax)
23 ret <vscale x 1 x i64> %x
26 define <vscale x 8 x i64> @sew64(<vscale x 8 x i64> %a, <vscale x 8 x i64> %b) {
29 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
30 ; CHECK-NEXT: vadd.vv v8, v8, v16
32 %vscale = call i32 @llvm.vscale()
33 %vlmax = shl i32 %vscale, 3
34 %x = call <vscale x 8 x i64> @llvm.vp.add.nxv8i64(<vscale x 8 x i64> %a, <vscale x 8 x i64> %b, <vscale x 8 x i1> splat (i1 true), i32 %vlmax)
35 ret <vscale x 8 x i64> %x
38 define <vscale x 16 x i32> @sew32_sll(<vscale x 16 x i32> %a, <vscale x 16 x i32> %b) {
39 ; CHECK-LABEL: sew32_sll:
41 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
42 ; CHECK-NEXT: vadd.vv v8, v8, v16
44 %vscale = call i32 @llvm.vscale()
45 %vlmax = shl i32 %vscale, 4
46 %x = call <vscale x 16 x i32> @llvm.vp.add.nxv16i32(<vscale x 16 x i32> %a, <vscale x 16 x i32> %b, <vscale x 16 x i1> splat (i1 true), i32 %vlmax)
47 ret <vscale x 16 x i32> %x