1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2
2 // REQUIRES: riscv-registered-target
3 // RUN: %clang_cc1 -triple riscv64 -target-feature +v -disable-O0-optnone \
4 // RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \
5 // RUN: FileCheck --check-prefix=CHECK-RV64 %s
7 #include <riscv_vector.h>
9 // CHECK-RV64-LABEL: define dso_local void @test_vsm_v_b1
10 // CHECK-RV64-SAME: (ptr noundef [[BASE:%.*]], <vscale x 64 x i1> [[VALUE:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] {
11 // CHECK-RV64-NEXT: entry:
12 // CHECK-RV64-NEXT: call void @llvm.riscv.vsm.nxv64i1.i64(<vscale x 64 x i1> [[VALUE]], ptr [[BASE]], i64 [[VL]])
13 // CHECK-RV64-NEXT: ret void
15 void test_vsm_v_b1(uint8_t *base
, vbool1_t value
, size_t vl
) {
16 return __riscv_vsm_v_b1(base
, value
, vl
);
19 // CHECK-RV64-LABEL: define dso_local void @test_vsm_v_b2
20 // CHECK-RV64-SAME: (ptr noundef [[BASE:%.*]], <vscale x 32 x i1> [[VALUE:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
21 // CHECK-RV64-NEXT: entry:
22 // CHECK-RV64-NEXT: call void @llvm.riscv.vsm.nxv32i1.i64(<vscale x 32 x i1> [[VALUE]], ptr [[BASE]], i64 [[VL]])
23 // CHECK-RV64-NEXT: ret void
25 void test_vsm_v_b2(uint8_t *base
, vbool2_t value
, size_t vl
) {
26 return __riscv_vsm_v_b2(base
, value
, vl
);
29 // CHECK-RV64-LABEL: define dso_local void @test_vsm_v_b4
30 // CHECK-RV64-SAME: (ptr noundef [[BASE:%.*]], <vscale x 16 x i1> [[VALUE:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
31 // CHECK-RV64-NEXT: entry:
32 // CHECK-RV64-NEXT: call void @llvm.riscv.vsm.nxv16i1.i64(<vscale x 16 x i1> [[VALUE]], ptr [[BASE]], i64 [[VL]])
33 // CHECK-RV64-NEXT: ret void
35 void test_vsm_v_b4(uint8_t *base
, vbool4_t value
, size_t vl
) {
36 return __riscv_vsm_v_b4(base
, value
, vl
);
39 // CHECK-RV64-LABEL: define dso_local void @test_vsm_v_b8
40 // CHECK-RV64-SAME: (ptr noundef [[BASE:%.*]], <vscale x 8 x i1> [[VALUE:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
41 // CHECK-RV64-NEXT: entry:
42 // CHECK-RV64-NEXT: call void @llvm.riscv.vsm.nxv8i1.i64(<vscale x 8 x i1> [[VALUE]], ptr [[BASE]], i64 [[VL]])
43 // CHECK-RV64-NEXT: ret void
45 void test_vsm_v_b8(uint8_t *base
, vbool8_t value
, size_t vl
) {
46 return __riscv_vsm_v_b8(base
, value
, vl
);
49 // CHECK-RV64-LABEL: define dso_local void @test_vsm_v_b16
50 // CHECK-RV64-SAME: (ptr noundef [[BASE:%.*]], <vscale x 4 x i1> [[VALUE:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
51 // CHECK-RV64-NEXT: entry:
52 // CHECK-RV64-NEXT: call void @llvm.riscv.vsm.nxv4i1.i64(<vscale x 4 x i1> [[VALUE]], ptr [[BASE]], i64 [[VL]])
53 // CHECK-RV64-NEXT: ret void
55 void test_vsm_v_b16(uint8_t *base
, vbool16_t value
, size_t vl
) {
56 return __riscv_vsm_v_b16(base
, value
, vl
);
59 // CHECK-RV64-LABEL: define dso_local void @test_vsm_v_b32
60 // CHECK-RV64-SAME: (ptr noundef [[BASE:%.*]], <vscale x 2 x i1> [[VALUE:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
61 // CHECK-RV64-NEXT: entry:
62 // CHECK-RV64-NEXT: call void @llvm.riscv.vsm.nxv2i1.i64(<vscale x 2 x i1> [[VALUE]], ptr [[BASE]], i64 [[VL]])
63 // CHECK-RV64-NEXT: ret void
65 void test_vsm_v_b32(uint8_t *base
, vbool32_t value
, size_t vl
) {
66 return __riscv_vsm_v_b32(base
, value
, vl
);
69 // CHECK-RV64-LABEL: define dso_local void @test_vsm_v_b64
70 // CHECK-RV64-SAME: (ptr noundef [[BASE:%.*]], <vscale x 1 x i1> [[VALUE:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
71 // CHECK-RV64-NEXT: entry:
72 // CHECK-RV64-NEXT: call void @llvm.riscv.vsm.nxv1i1.i64(<vscale x 1 x i1> [[VALUE]], ptr [[BASE]], i64 [[VL]])
73 // CHECK-RV64-NEXT: ret void
75 void test_vsm_v_b64(uint8_t *base
, vbool64_t value
, size_t vl
) {
76 return __riscv_vsm_v_b64(base
, value
, vl
);