From cebbfd3d255552b48cb3681a326bcbd23aaca1ec Mon Sep 17 00:00:00 2001 From: wangpc Date: Wed, 30 Mar 2022 19:28:38 +0800 Subject: [PATCH] [RISCV] Add index check for vset/vget Index of vset/vget must be a constant integer and be located in right range. Reviewed By: kito-cheng Differential Revision: https://reviews.llvm.org/D122629 --- clang/lib/Sema/SemaChecking.cpp | 24 ++ .../RISCV/rvv-intrinsics/vget-index-out-of-range.c | 341 +++++++++++++++++++++ .../RISCV/rvv-intrinsics/vset-index-out-of-range.c | 341 +++++++++++++++++++++ 3 files changed, 706 insertions(+) create mode 100644 clang/test/CodeGen/RISCV/rvv-intrinsics/vget-index-out-of-range.c create mode 100644 clang/test/CodeGen/RISCV/rvv-intrinsics/vset-index-out-of-range.c diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 14e82e5..7e73988 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -4098,6 +4098,30 @@ bool Sema::CheckRISCVBuiltinFunctionCall(const TargetInfo &TI, case RISCVVector::BI__builtin_rvv_vsetvlimax: return SemaBuiltinConstantArgRange(TheCall, 0, 0, 3) || CheckRISCVLMUL(TheCall, 1); + case RISCVVector::BI__builtin_rvv_vget_v: { + ASTContext::BuiltinVectorTypeInfo ResVecInfo = + Context.getBuiltinVectorTypeInfo(cast( + TheCall->getType().getCanonicalType().getTypePtr())); + ASTContext::BuiltinVectorTypeInfo VecInfo = + Context.getBuiltinVectorTypeInfo(cast( + TheCall->getArg(0)->getType().getCanonicalType().getTypePtr())); + unsigned MaxIndex = + (VecInfo.EC.getKnownMinValue() * VecInfo.NumVectors) / + (ResVecInfo.EC.getKnownMinValue() * ResVecInfo.NumVectors); + return SemaBuiltinConstantArgRange(TheCall, 1, 0, MaxIndex - 1); + } + case RISCVVector::BI__builtin_rvv_vset_v: { + ASTContext::BuiltinVectorTypeInfo ResVecInfo = + Context.getBuiltinVectorTypeInfo(cast( + TheCall->getType().getCanonicalType().getTypePtr())); + ASTContext::BuiltinVectorTypeInfo VecInfo = + Context.getBuiltinVectorTypeInfo(cast( + TheCall->getArg(2)->getType().getCanonicalType().getTypePtr())); + unsigned MaxIndex = + (ResVecInfo.EC.getKnownMinValue() * ResVecInfo.NumVectors) / + (VecInfo.EC.getKnownMinValue() * VecInfo.NumVectors); + return SemaBuiltinConstantArgRange(TheCall, 1, 0, MaxIndex - 1); + } // Check if byteselect is in [0, 3] case RISCV::BI__builtin_riscv_aes32dsi_32: case RISCV::BI__builtin_riscv_aes32dsmi_32: diff --git a/clang/test/CodeGen/RISCV/rvv-intrinsics/vget-index-out-of-range.c b/clang/test/CodeGen/RISCV/rvv-intrinsics/vget-index-out-of-range.c new file mode 100644 index 0000000..c8c0866 --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv-intrinsics/vget-index-out-of-range.c @@ -0,0 +1,341 @@ +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +f -target-feature +d \ +// RUN: -target-feature +v -target-feature +zfh -target-feature +experimental-zvfh \ +// RUN: -fsyntax-only -verify %s + +#include + +vint8m1_t test_vget_v_index_not_constant(vint8m2_t src, int index) { + // expected-error@+1 {{argument to 'vget_v_i8m2_i8m1' must be a constant integer}} + return vget_v_i8m2_i8m1(src, index); +} + +vint8m1_t test_vget_v_i8m2_i8m1(vint8m2_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_i8m2_i8m1(src, 2); +} + +vint8m1_t test_vget_v_i8m4_i8m1(vint8m4_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_i8m4_i8m1(src, 4); +} + +vint8m2_t test_vget_v_i8m4_i8m2(vint8m4_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_i8m4_i8m2(src, 2); +} + +vint8m1_t test_vget_v_i8m8_i8m1(vint8m8_t src) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vget_v_i8m8_i8m1(src, 8); +} + +vint8m2_t test_vget_v_i8m8_i8m2(vint8m8_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_i8m8_i8m2(src, 4); +} + +vint8m4_t test_vget_v_i8m8_i8m4(vint8m8_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_i8m8_i8m4(src, 2); +} + +vint16m1_t test_vget_v_i16m2_i16m1(vint16m2_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_i16m2_i16m1(src, 2); +} + +vint16m1_t test_vget_v_i16m4_i16m1(vint16m4_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_i16m4_i16m1(src, 4); +} + +vint16m2_t test_vget_v_i16m4_i16m2(vint16m4_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_i16m4_i16m2(src, 2); +} + +vint16m1_t test_vget_v_i16m8_i16m1(vint16m8_t src) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vget_v_i16m8_i16m1(src, 8); +} + +vint16m2_t test_vget_v_i16m8_i16m2(vint16m8_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_i16m8_i16m2(src, 4); +} + +vint16m4_t test_vget_v_i16m8_i16m4(vint16m8_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_i16m8_i16m4(src, 2); +} + +vint32m1_t test_vget_v_i32m2_i32m1(vint32m2_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_i32m2_i32m1(src, 2); +} + +vint32m1_t test_vget_v_i32m4_i32m1(vint32m4_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_i32m4_i32m1(src, 4); +} + +vint32m2_t test_vget_v_i32m4_i32m2(vint32m4_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_i32m4_i32m2(src, 2); +} + +vint32m1_t test_vget_v_i32m8_i32m1(vint32m8_t src) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vget_v_i32m8_i32m1(src, 8); +} + +vint32m2_t test_vget_v_i32m8_i32m2(vint32m8_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_i32m8_i32m2(src, 4); +} + +vint32m4_t test_vget_v_i32m8_i32m4(vint32m8_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_i32m8_i32m4(src, 2); +} + +vint64m1_t test_vget_v_i64m2_i64m1(vint64m2_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_i64m2_i64m1(src, 2); +} + +vint64m1_t test_vget_v_i64m4_i64m1(vint64m4_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_i64m4_i64m1(src, 4); +} + +vint64m2_t test_vget_v_i64m4_i64m2(vint64m4_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_i64m4_i64m2(src, 2); +} + +vint64m1_t test_vget_v_i64m8_i64m1(vint64m8_t src) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vget_v_i64m8_i64m1(src, 8); +} + +vint64m2_t test_vget_v_i64m8_i64m2(vint64m8_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_i64m8_i64m2(src, 4); +} + +vint64m4_t test_vget_v_i64m8_i64m4(vint64m8_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_i64m8_i64m4(src, 2); +} + +vuint8m1_t test_vget_v_u8m2_u8m1(vuint8m2_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_u8m2_u8m1(src, 2); +} + +vuint8m1_t test_vget_v_u8m4_u8m1(vuint8m4_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_u8m4_u8m1(src, 4); +} + +vuint8m2_t test_vget_v_u8m4_u8m2(vuint8m4_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_u8m4_u8m2(src, 2); +} + +vuint8m1_t test_vget_v_u8m8_u8m1(vuint8m8_t src) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vget_v_u8m8_u8m1(src, 8); +} + +vuint8m2_t test_vget_v_u8m8_u8m2(vuint8m8_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_u8m8_u8m2(src, 4); +} + +vuint8m4_t test_vget_v_u8m8_u8m4(vuint8m8_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_u8m8_u8m4(src, 2); +} + +vuint16m1_t test_vget_v_u16m2_u16m1(vuint16m2_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_u16m2_u16m1(src, 2); +} + +vuint16m1_t test_vget_v_u16m4_u16m1(vuint16m4_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_u16m4_u16m1(src, 4); +} + +vuint16m2_t test_vget_v_u16m4_u16m2(vuint16m4_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_u16m4_u16m2(src, 2); +} + +vuint16m1_t test_vget_v_u16m8_u16m1(vuint16m8_t src) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vget_v_u16m8_u16m1(src, 8); +} + +vuint16m2_t test_vget_v_u16m8_u16m2(vuint16m8_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_u16m8_u16m2(src, 4); +} + +vuint16m4_t test_vget_v_u16m8_u16m4(vuint16m8_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_u16m8_u16m4(src, 2); +} + +vuint32m1_t test_vget_v_u32m2_u32m1(vuint32m2_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_u32m2_u32m1(src, 2); +} + +vuint32m1_t test_vget_v_u32m4_u32m1(vuint32m4_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_u32m4_u32m1(src, 4); +} + +vuint32m2_t test_vget_v_u32m4_u32m2(vuint32m4_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_u32m4_u32m2(src, 2); +} + +vuint32m1_t test_vget_v_u32m8_u32m1(vuint32m8_t src) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vget_v_u32m8_u32m1(src, 8); +} + +vuint32m2_t test_vget_v_u32m8_u32m2(vuint32m8_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_u32m8_u32m2(src, 4); +} + +vuint32m4_t test_vget_v_u32m8_u32m4(vuint32m8_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_u32m8_u32m4(src, 2); +} + +vuint64m1_t test_vget_v_u64m2_u64m1(vuint64m2_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_u64m2_u64m1(src, 2); +} + +vuint64m1_t test_vget_v_u64m4_u64m1(vuint64m4_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_u64m4_u64m1(src, 4); +} + +vuint64m2_t test_vget_v_u64m4_u64m2(vuint64m4_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_u64m4_u64m2(src, 2); +} + +vuint64m1_t test_vget_v_u64m8_u64m1(vuint64m8_t src) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vget_v_u64m8_u64m1(src, 8); +} + +vuint64m2_t test_vget_v_u64m8_u64m2(vuint64m8_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_u64m8_u64m2(src, 4); +} + +vuint64m4_t test_vget_v_u64m8_u64m4(vuint64m8_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_u64m8_u64m4(src, 2); +} + +vfloat32m1_t test_vget_v_f32m2_f32m1(vfloat32m2_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_f32m2_f32m1(src, 2); +} + +vfloat32m1_t test_vget_v_f32m4_f32m1(vfloat32m4_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_f32m4_f32m1(src, 4); +} + +vfloat32m2_t test_vget_v_f32m4_f32m2(vfloat32m4_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_f32m4_f32m2(src, 2); +} + +vfloat32m1_t test_vget_v_f32m8_f32m1(vfloat32m8_t src) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vget_v_f32m8_f32m1(src, 8); +} + +vfloat32m2_t test_vget_v_f32m8_f32m2(vfloat32m8_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_f32m8_f32m2(src, 4); +} + +vfloat32m4_t test_vget_v_f32m8_f32m4(vfloat32m8_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_f32m8_f32m4(src, 2); +} + +vfloat64m1_t test_vget_v_f64m2_f64m1(vfloat64m2_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_f64m2_f64m1(src, 2); +} + +vfloat64m1_t test_vget_v_f64m4_f64m1(vfloat64m4_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_f64m4_f64m1(src, 4); +} + +vfloat64m2_t test_vget_v_f64m4_f64m2(vfloat64m4_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_f64m4_f64m2(src, 2); +} + +vfloat64m1_t test_vget_v_f64m8_f64m1(vfloat64m8_t src) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vget_v_f64m8_f64m1(src, 8); +} + +vfloat64m2_t test_vget_v_f64m8_f64m2(vfloat64m8_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_f64m8_f64m2(src, 4); +} + +vfloat64m4_t test_vget_v_f64m8_f64m4(vfloat64m8_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_f64m8_f64m4(src, 2); +} + +vfloat16m1_t test_vget_v_f16m2_f16m1(vfloat16m2_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_f16m2_f16m1(src, 2); +} + +vfloat16m1_t test_vget_v_f16m4_f16m1(vfloat16m4_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_f16m4_f16m1(src, 4); +} + +vfloat16m1_t test_vget_v_f16m8_f16m1(vfloat16m8_t src) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vget_v_f16m8_f16m1(src, 8); +} + +vfloat16m2_t test_vget_v_f16m4_f16m2(vfloat16m4_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_f16m4_f16m2(src, 2); +} + +vfloat16m2_t test_vget_v_f16m8_f16m2(vfloat16m8_t src) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vget_v_f16m8_f16m2(src, 4); +} + +vfloat16m4_t test_vget_v_f16m8_f16m4(vfloat16m8_t src) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vget_v_f16m8_f16m4(src, 2); +} diff --git a/clang/test/CodeGen/RISCV/rvv-intrinsics/vset-index-out-of-range.c b/clang/test/CodeGen/RISCV/rvv-intrinsics/vset-index-out-of-range.c new file mode 100644 index 0000000..0bb86e1 --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv-intrinsics/vset-index-out-of-range.c @@ -0,0 +1,341 @@ +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +f -target-feature +d \ +// RUN: -target-feature +v -target-feature +zfh -target-feature +experimental-zvfh \ +// RUN: -fsyntax-only -verify %s + +#include + +vint8m1_t test_vset_v_index_not_constant(vint8m2_t dest, vint8m1_t val, int index) { + // expected-error@+1 {{argument to 'vset_v_i8m1_i8m2' must be a constant integer}} + return vset_v_i8m1_i8m2(dest, index, val); +} + +vint8m2_t test_vset_v_i8m1_i8m2(vint8m2_t dest, vint8m1_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_i8m1_i8m2(dest, 2, val); +} + +vint8m4_t test_vset_v_i8m1_i8m4(vint8m4_t dest, vint8m1_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_i8m1_i8m4(dest, 4, val); +} + +vint8m4_t test_vset_v_i8m2_i8m4(vint8m4_t dest, vint8m2_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_i8m2_i8m4(dest, 2, val); +} + +vint8m8_t test_vset_v_i8m1_i8m8(vint8m8_t dest, vint8m1_t val) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vset_v_i8m1_i8m8(dest, 8, val); +} + +vint8m8_t test_vset_v_i8m2_i8m8(vint8m8_t dest, vint8m2_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_i8m2_i8m8(dest, 4, val); +} + +vint8m8_t test_vset_v_i8m4_i8m8(vint8m8_t dest, vint8m4_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_i8m4_i8m8(dest, 2, val); +} + +vint16m2_t test_vset_v_i16m1_i16m2(vint16m2_t dest, vint16m1_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_i16m1_i16m2(dest, 2, val); +} + +vint16m4_t test_vset_v_i16m1_i16m4(vint16m4_t dest, vint16m1_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_i16m1_i16m4(dest, 4, val); +} + +vint16m4_t test_vset_v_i16m2_i16m4(vint16m4_t dest, vint16m2_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_i16m2_i16m4(dest, 2, val); +} + +vint16m8_t test_vset_v_i16m1_i16m8(vint16m8_t dest, vint16m1_t val) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vset_v_i16m1_i16m8(dest, 8, val); +} + +vint16m8_t test_vset_v_i16m2_i16m8(vint16m8_t dest, vint16m2_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_i16m2_i16m8(dest, 4, val); +} + +vint16m8_t test_vset_v_i16m4_i16m8(vint16m8_t dest, vint16m4_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_i16m4_i16m8(dest, 2, val); +} + +vint32m2_t test_vset_v_i32m1_i32m2(vint32m2_t dest, vint32m1_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_i32m1_i32m2(dest, 2, val); +} + +vint32m4_t test_vset_v_i32m1_i32m4(vint32m4_t dest, vint32m1_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_i32m1_i32m4(dest, 4, val); +} + +vint32m4_t test_vset_v_i32m2_i32m4(vint32m4_t dest, vint32m2_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_i32m2_i32m4(dest, 2, val); +} + +vint32m8_t test_vset_v_i32m1_i32m8(vint32m8_t dest, vint32m1_t val) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vset_v_i32m1_i32m8(dest, 8, val); +} + +vint32m8_t test_vset_v_i32m2_i32m8(vint32m8_t dest, vint32m2_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_i32m2_i32m8(dest, 4, val); +} + +vint32m8_t test_vset_v_i32m4_i32m8(vint32m8_t dest, vint32m4_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_i32m4_i32m8(dest, 2, val); +} + +vint64m2_t test_vset_v_i64m1_i64m2(vint64m2_t dest, vint64m1_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_i64m1_i64m2(dest, 2, val); +} + +vint64m4_t test_vset_v_i64m1_i64m4(vint64m4_t dest, vint64m1_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_i64m1_i64m4(dest, 4, val); +} + +vint64m4_t test_vset_v_i64m2_i64m4(vint64m4_t dest, vint64m2_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_i64m2_i64m4(dest, 2, val); +} + +vint64m8_t test_vset_v_i64m1_i64m8(vint64m8_t dest, vint64m1_t val) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vset_v_i64m1_i64m8(dest, 8, val); +} + +vint64m8_t test_vset_v_i64m2_i64m8(vint64m8_t dest, vint64m2_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_i64m2_i64m8(dest, 4, val); +} + +vint64m8_t test_vset_v_i64m4_i64m8(vint64m8_t dest, vint64m4_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_i64m4_i64m8(dest, 2, val); +} + +vuint8m2_t test_vset_v_u8m1_u8m2(vuint8m2_t dest, vuint8m1_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_u8m1_u8m2(dest, 2, val); +} + +vuint8m4_t test_vset_v_u8m1_u8m4(vuint8m4_t dest, vuint8m1_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_u8m1_u8m4(dest, 4, val); +} + +vuint8m4_t test_vset_v_u8m2_u8m4(vuint8m4_t dest, vuint8m2_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_u8m2_u8m4(dest, 2, val); +} + +vuint8m8_t test_vset_v_u8m1_u8m8(vuint8m8_t dest, vuint8m1_t val) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vset_v_u8m1_u8m8(dest, 8, val); +} + +vuint8m8_t test_vset_v_u8m2_u8m8(vuint8m8_t dest, vuint8m2_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_u8m2_u8m8(dest, 4, val); +} + +vuint8m8_t test_vset_v_u8m4_u8m8(vuint8m8_t dest, vuint8m4_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_u8m4_u8m8(dest, 2, val); +} + +vuint16m2_t test_vset_v_u16m1_u16m2(vuint16m2_t dest, vuint16m1_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_u16m1_u16m2(dest, 2, val); +} + +vuint16m4_t test_vset_v_u16m1_u16m4(vuint16m4_t dest, vuint16m1_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_u16m1_u16m4(dest, 4, val); +} + +vuint16m4_t test_vset_v_u16m2_u16m4(vuint16m4_t dest, vuint16m2_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_u16m2_u16m4(dest, 2, val); +} + +vuint16m8_t test_vset_v_u16m1_u16m8(vuint16m8_t dest, vuint16m1_t val) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vset_v_u16m1_u16m8(dest, 8, val); +} + +vuint16m8_t test_vset_v_u16m2_u16m8(vuint16m8_t dest, vuint16m2_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_u16m2_u16m8(dest, 4, val); +} + +vuint16m8_t test_vset_v_u16m4_u16m8(vuint16m8_t dest, vuint16m4_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_u16m4_u16m8(dest, 2, val); +} + +vuint32m2_t test_vset_v_u32m1_u32m2(vuint32m2_t dest, vuint32m1_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_u32m1_u32m2(dest, 2, val); +} + +vuint32m4_t test_vset_v_u32m1_u32m4(vuint32m4_t dest, vuint32m1_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_u32m1_u32m4(dest, 4, val); +} + +vuint32m4_t test_vset_v_u32m2_u32m4(vuint32m4_t dest, vuint32m2_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_u32m2_u32m4(dest, 2, val); +} + +vuint32m8_t test_vset_v_u32m1_u32m8(vuint32m8_t dest, vuint32m1_t val) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vset_v_u32m1_u32m8(dest, 8, val); +} + +vuint32m8_t test_vset_v_u32m2_u32m8(vuint32m8_t dest, vuint32m2_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_u32m2_u32m8(dest, 4, val); +} + +vuint32m8_t test_vset_v_u32m4_u32m8(vuint32m8_t dest, vuint32m4_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_u32m4_u32m8(dest, 2, val); +} + +vuint64m2_t test_vset_v_u64m1_u64m2(vuint64m2_t dest, vuint64m1_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_u64m1_u64m2(dest, 2, val); +} + +vuint64m4_t test_vset_v_u64m1_u64m4(vuint64m4_t dest, vuint64m1_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_u64m1_u64m4(dest, 4, val); +} + +vuint64m4_t test_vset_v_u64m2_u64m4(vuint64m4_t dest, vuint64m2_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_u64m2_u64m4(dest, 2, val); +} + +vuint64m8_t test_vset_v_u64m1_u64m8(vuint64m8_t dest, vuint64m1_t val) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vset_v_u64m1_u64m8(dest, 8, val); +} + +vuint64m8_t test_vset_v_u64m2_u64m8(vuint64m8_t dest, vuint64m2_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_u64m2_u64m8(dest, 4, val); +} + +vuint64m8_t test_vset_v_u64m4_u64m8(vuint64m8_t dest, vuint64m4_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_u64m4_u64m8(dest, 2, val); +} + +vfloat32m2_t test_vset_v_f32m1_f32m2(vfloat32m2_t dest, vfloat32m1_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_f32m1_f32m2(dest, 2, val); +} + +vfloat32m4_t test_vset_v_f32m1_f32m4(vfloat32m4_t dest, vfloat32m1_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_f32m1_f32m4(dest, 4, val); +} + +vfloat32m4_t test_vset_v_f32m2_f32m4(vfloat32m4_t dest, vfloat32m2_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_f32m2_f32m4(dest, 2, val); +} + +vfloat32m8_t test_vset_v_f32m1_f32m8(vfloat32m8_t dest, vfloat32m1_t val) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vset_v_f32m1_f32m8(dest, 8, val); +} + +vfloat32m8_t test_vset_v_f32m2_f32m8(vfloat32m8_t dest, vfloat32m2_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_f32m2_f32m8(dest, 4, val); +} + +vfloat32m8_t test_vset_v_f32m4_f32m8(vfloat32m8_t dest, vfloat32m4_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_f32m4_f32m8(dest, 2, val); +} + +vfloat64m2_t test_vset_v_f64m1_f64m2(vfloat64m2_t dest, vfloat64m1_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_f64m1_f64m2(dest, 2, val); +} + +vfloat64m4_t test_vset_v_f64m1_f64m4(vfloat64m4_t dest, vfloat64m1_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_f64m1_f64m4(dest, 4, val); +} + +vfloat64m4_t test_vset_v_f64m2_f64m4(vfloat64m4_t dest, vfloat64m2_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_f64m2_f64m4(dest, 2, val); +} + +vfloat64m8_t test_vset_v_f64m1_f64m8(vfloat64m8_t dest, vfloat64m1_t val) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vset_v_f64m1_f64m8(dest, 8, val); +} + +vfloat64m8_t test_vset_v_f64m2_f64m8(vfloat64m8_t dest, vfloat64m2_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_f64m2_f64m8(dest, 4, val); +} + +vfloat64m8_t test_vset_v_f64m4_f64m8(vfloat64m8_t dest, vfloat64m4_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_f64m4_f64m8(dest, 2, val); +} + +vfloat16m2_t test_vset_v_f16m1_f16m2(vfloat16m2_t dest, vfloat16m1_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_f16m1_f16m2(dest, 2, val); +} + +vfloat16m4_t test_vset_v_f16m1_f16m4(vfloat16m4_t dest, vfloat16m1_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_f16m1_f16m4(dest, 4, val); +} + +vfloat16m4_t test_vset_v_f16m2_f16m4(vfloat16m4_t dest, vfloat16m2_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_f16m2_f16m4(dest, 2, val); +} + +vfloat16m8_t test_vset_v_f16m1_f16m8(vfloat16m8_t dest, vfloat16m1_t val) { + // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}} + return vset_v_f16m1_f16m8(dest, 8, val); +} + +vfloat16m8_t test_vset_v_f16m2_f16m8(vfloat16m8_t dest, vfloat16m2_t val) { + // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}} + return vset_v_f16m2_f16m8(dest, 4, val); +} + +vfloat16m8_t test_vset_v_f16m4_f16m8(vfloat16m8_t dest, vfloat16m4_t val) { + // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}} + return vset_v_f16m4_f16m8(dest, 2, val); +} -- 2.7.4