new file mode 100644
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned int u32x8_t __attribute__ ((vector_size (32)));
+typedef unsigned int u32x4_t __attribute__ ((vector_size (16)));
+typedef unsigned short u16x8_t __attribute__ ((vector_size (16)));
+
+u32x8_t
+test_group_overlap_vwmaccu_vx_undef_u16 (u32x8_t acc, unsigned int x)
+{
+ u32x4_t hi = __builtin_shufflevector (acc, acc, 4, 5, 6, 7);
+ u16x8_t narrow = (u16x8_t) hi;
+ u32x8_t widen = __builtin_convertvector (narrow, u32x8_t);
+ unsigned int nx = x & 0xffff;
+ u32x8_t vx = { nx, nx, nx, nx, nx, nx, nx, nx };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx\s+v2,a2,v3([^0-9]|$)} 1 } } */
+/* { dg-final { scan-assembler-not {vmv[0-9]+r\.v} } } */
new file mode 100644
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned int u32x16_t __attribute__ ((vector_size (64)));
+typedef unsigned int u32x8_t __attribute__ ((vector_size (32)));
+typedef unsigned short u16x16_t __attribute__ ((vector_size (32)));
+
+u32x16_t
+test_group_overlap_vwmaccu_vx_undef_u16 (u32x16_t acc, unsigned int x)
+{
+ u32x8_t hi = __builtin_shufflevector (acc, acc, 8, 9, 10, 11, 12, 13, 14, 15);
+ u16x16_t narrow = (u16x16_t) hi;
+ u32x16_t widen = __builtin_convertvector (narrow, u32x16_t);
+ unsigned int nx = x & 0xffff;
+ u32x16_t vx = {
+ nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx
+ };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx\s+v4,a2,v6([^0-9]|$)} 1 } } */
+/* { dg-final { scan-assembler-not {vmv[0-9]+r\.v} } } */
new file mode 100644
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned int u32x32_t __attribute__ ((vector_size (128)));
+typedef unsigned int u32x16_t __attribute__ ((vector_size (64)));
+typedef unsigned short u16x32_t __attribute__ ((vector_size (64)));
+
+u32x32_t
+test_group_overlap_vwmaccu_vx_undef_u16 (u32x32_t acc, unsigned int x)
+{
+ u32x16_t hi = __builtin_shufflevector (
+ acc, acc,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
+ u16x32_t narrow = (u16x32_t) hi;
+ u32x32_t widen = __builtin_convertvector (narrow, u32x32_t);
+ unsigned int nx = x & 0xffff;
+ u32x32_t vx = {
+ nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx,
+ nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx
+ };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx\s+v8,a2,v12([^0-9]|$)} 1 } } */
+/* { dg-final { scan-assembler-not {vmv[0-9]+r\.v} } } */
new file mode 100644
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned int u32x4_t __attribute__ ((vector_size (16)));
+typedef unsigned short u16x4_t __attribute__ ((vector_size (8)));
+
+u32x4_t
+test_group_overlap_vwmaccu_vx_undef_u16 (u32x4_t acc, u16x4_t narrow,
+ unsigned int x)
+{
+ u32x4_t widen = __builtin_convertvector (narrow, u32x4_t);
+ unsigned int nx = x & 0xffff;
+ u32x4_t vx = { nx, nx, nx, nx };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx} 1 } } */
+/* { dg-final { scan-assembler-not {vwmaccu\.vx\s+(v[0-9]+),[a-z0-9]+,\1([^0-9]|$)} } } */
new file mode 100644
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned int u32x2_t __attribute__ ((vector_size (8)));
+typedef unsigned short u16x2_t __attribute__ ((vector_size (4)));
+
+u32x2_t
+test_group_overlap_vwmaccu_vx_undef_u16 (u32x2_t acc, u16x2_t narrow,
+ unsigned int x)
+{
+ u32x2_t widen = __builtin_convertvector (narrow, u32x2_t);
+ unsigned int nx = x & 0xffff;
+ u32x2_t vx = { nx, nx };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx} 1 } } */
+/* { dg-final { scan-assembler-not {vwmaccu\.vx\s+(v[0-9]+),[a-z0-9]+,\1([^0-9]|$)} } } */
new file mode 100644
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned long long u64x4_t __attribute__ ((vector_size (32)));
+typedef unsigned long long u64x2_t __attribute__ ((vector_size (16)));
+typedef unsigned int u32x4_t __attribute__ ((vector_size (16)));
+
+u64x4_t
+test_group_overlap_vwmaccu_vx_undef_u32 (u64x4_t acc, unsigned long long x)
+{
+ u64x2_t hi = __builtin_shufflevector (acc, acc, 2, 3);
+ u32x4_t narrow = (u32x4_t) hi;
+ u64x4_t widen = __builtin_convertvector (narrow, u64x4_t);
+ unsigned long long nx = x & 0xffffffff;
+ u64x4_t vx = { nx, nx, nx, nx };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx\s+v2,a2,v3([^0-9]|$)} 1 } } */
+/* { dg-final { scan-assembler-not {vmv[0-9]+r\.v} } } */
new file mode 100644
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned long long u64x8_t __attribute__ ((vector_size (64)));
+typedef unsigned long long u64x4_t __attribute__ ((vector_size (32)));
+typedef unsigned int u32x8_t __attribute__ ((vector_size (32)));
+
+u64x8_t
+test_group_overlap_vwmaccu_vx_undef_u32 (u64x8_t acc, unsigned long long x)
+{
+ u64x4_t hi = __builtin_shufflevector (acc, acc, 4, 5, 6, 7);
+ u32x8_t narrow = (u32x8_t) hi;
+ u64x8_t widen = __builtin_convertvector (narrow, u64x8_t);
+ unsigned long long nx = x & 0xffffffff;
+ u64x8_t vx = { nx, nx, nx, nx, nx, nx, nx, nx };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx\s+v4,a2,v6([^0-9]|$)} 1 } } */
+/* { dg-final { scan-assembler-not {vmv[0-9]+r\.v} } } */
new file mode 100644
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned long long u64x16_t __attribute__ ((vector_size (128)));
+typedef unsigned long long u64x8_t __attribute__ ((vector_size (64)));
+typedef unsigned int u32x16_t __attribute__ ((vector_size (64)));
+
+u64x16_t
+test_group_overlap_vwmaccu_vx_undef_u32 (u64x16_t acc, unsigned long long x)
+{
+ u64x8_t hi = __builtin_shufflevector (acc, acc, 8, 9, 10, 11, 12, 13, 14, 15);
+ u32x16_t narrow = (u32x16_t) hi;
+ u64x16_t widen = __builtin_convertvector (narrow, u64x16_t);
+ unsigned long long nx = x & 0xffffffff;
+ u64x16_t vx = {
+ nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx
+ };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx\s+v8,a2,v12([^0-9]|$)} 1 } } */
+/* { dg-final { scan-assembler-not {vmv[0-9]+r\.v} } } */
new file mode 100644
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned long long u64x2_t __attribute__ ((vector_size (16)));
+typedef unsigned int u32x2_t __attribute__ ((vector_size (8)));
+
+u64x2_t
+test_group_overlap_vwmaccu_vx_undef_u32 (u64x2_t acc, u32x2_t narrow,
+ unsigned long long x)
+{
+ u64x2_t widen = __builtin_convertvector (narrow, u64x2_t);
+ unsigned long long nx = x & 0xffffffff;
+ u64x2_t vx = { nx, nx };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx} 1 } } */
+/* { dg-final { scan-assembler-not {vwmaccu\.vx\s+(v[0-9]+),[a-z0-9]+,\1([^0-9]|$)} } } */
new file mode 100644
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned short u16x16_t __attribute__ ((vector_size (32)));
+typedef unsigned short u16x8_t __attribute__ ((vector_size (16)));
+typedef unsigned char u8x16_t __attribute__ ((vector_size (16)));
+
+u16x16_t
+test_group_overlap_vwmaccu_vx_undef_u8 (u16x16_t acc, unsigned short x)
+{
+ u16x8_t hi = __builtin_shufflevector (acc, acc, 8, 9, 10, 11, 12, 13, 14, 15);
+ u8x16_t narrow = (u8x16_t) hi;
+ u16x16_t widen = __builtin_convertvector (narrow, u16x16_t);
+ unsigned short nx = x & 0xff;
+ u16x16_t vx = {
+ nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx
+ };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx\s+v2,a2,v3([^0-9]|$)} 1 } } */
+/* { dg-final { scan-assembler-not {vmv[0-9]+r\.v} } } */
new file mode 100644
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned short u16x32_t __attribute__ ((vector_size (64)));
+typedef unsigned short u16x16_t __attribute__ ((vector_size (32)));
+typedef unsigned char u8x32_t __attribute__ ((vector_size (32)));
+
+u16x32_t
+test_group_overlap_vwmaccu_vx_undef_u8 (u16x32_t acc, unsigned short x)
+{
+ u16x16_t hi = __builtin_shufflevector (
+ acc, acc,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
+ u8x32_t narrow = (u8x32_t) hi;
+ u16x32_t widen = __builtin_convertvector (narrow, u16x32_t);
+ unsigned short nx = x & 0xff;
+ u16x32_t vx = {
+ nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx,
+ nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx
+ };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx\s+v4,a2,v6([^0-9]|$)} 1 } } */
+/* { dg-final { scan-assembler-not {vmv[0-9]+r\.v} } } */
new file mode 100644
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned short u16x64_t __attribute__ ((vector_size (128)));
+typedef unsigned short u16x32_t __attribute__ ((vector_size (64)));
+typedef unsigned char u8x64_t __attribute__ ((vector_size (64)));
+
+u16x64_t
+test_group_overlap_vwmaccu_vx_undef_u8 (u16x64_t acc, unsigned short x)
+{
+ u16x32_t hi = __builtin_shufflevector (
+ acc, acc,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63);
+ u8x64_t narrow = (u8x64_t) hi;
+ u16x64_t widen = __builtin_convertvector (narrow, u16x64_t);
+ unsigned short nx = x & 0xff;
+ u16x64_t vx = {
+ nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx,
+ nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx,
+ nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx,
+ nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx, nx
+ };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx\s+v8,a2,v12([^0-9]|$)} 1 } } */
+/* { dg-final { scan-assembler-not {vmv[0-9]+r\.v} } } */
new file mode 100644
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned short u16x8_t __attribute__ ((vector_size (16)));
+typedef unsigned char u8x8_t __attribute__ ((vector_size (8)));
+
+u16x8_t
+test_group_overlap_vwmaccu_vx_undef_u8 (u16x8_t acc, u8x8_t narrow,
+ unsigned short x)
+{
+ u16x8_t widen = __builtin_convertvector (narrow, u16x8_t);
+ unsigned short nx = x & 0xff;
+ u16x8_t vx = { nx, nx, nx, nx, nx, nx, nx, nx };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx} 1 } } */
+/* { dg-final { scan-assembler-not {vwmaccu\.vx\s+(v[0-9]+),[a-z0-9]+,\1([^0-9]|$)} } } */
new file mode 100644
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned short u16x4_t __attribute__ ((vector_size (8)));
+typedef unsigned char u8x4_t __attribute__ ((vector_size (4)));
+
+u16x4_t
+test_group_overlap_vwmaccu_vx_undef_u8 (u16x4_t acc, u8x4_t narrow,
+ unsigned short x)
+{
+ u16x4_t widen = __builtin_convertvector (narrow, u16x4_t);
+ unsigned short nx = x & 0xff;
+ u16x4_t vx = { nx, nx, nx, nx };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx} 1 } } */
+/* { dg-final { scan-assembler-not {vwmaccu\.vx\s+(v[0-9]+),[a-z0-9]+,\1([^0-9]|$)} } } */
new file mode 100644
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -mrvv-vector-bits=zvl" } */
+
+typedef unsigned short u16x2_t __attribute__ ((vector_size (4)));
+typedef unsigned char u8x2_t __attribute__ ((vector_size (2)));
+
+u16x2_t
+test_group_overlap_vwmaccu_vx_undef_u8 (u16x2_t acc, u8x2_t narrow,
+ unsigned short x)
+{
+ u16x2_t widen = __builtin_convertvector (narrow, u16x2_t);
+ unsigned short nx = x & 0xff;
+ u16x2_t vx = { nx, nx };
+
+ return acc + widen * vx;
+}
+
+/* { dg-final { scan-assembler-times {vwmaccu\.vx} 1 } } */
+/* { dg-final { scan-assembler-not {vwmaccu\.vx\s+(v[0-9]+),[a-z0-9]+,\1([^0-9]|$)} } } */