]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Add test for vec_duplicate + vmin.vv combine case 0 with GR2VR cost 0, 2...
authorPan Li <pan2.li@intel.com>
Tue, 17 Jun 2025 02:05:33 +0000 (10:05 +0800)
committerPan Li <pan2.li@intel.com>
Wed, 18 Jun 2025 04:42:01 +0000 (12:42 +0800)
Add asm dump check and run test for vec_duplicate + vmin.vv
combine to vmin.vx, with the GR2VR cost is 0, 2 and 15.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c: Add asm check.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i32.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i64.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i8.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i16.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i32.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i64.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i8.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i16.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i32.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i64.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i8.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Add test
helper macros.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h: Add test
data for run test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i16.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i32.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i64.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i8.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i16.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i32.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i64.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i8.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
22 files changed:
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i32.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i64.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i8.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i16.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i32.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i64.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i8.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i16.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i32.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i64.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i8.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i32.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i64.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i32.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i64.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i8.c [new file with mode: 0644]

index e18a672704a2fe666b3ad2863fbe7757126a814b..c86d77c3d4e6eff7db5cd20674b6183404b01e06 100644 (file)
@@ -17,3 +17,4 @@ TEST_BINARY_VX_SIGNED_0(T)
 /* { dg-final { scan-assembler-times {vdiv.vx} 1 } } */
 /* { dg-final { scan-assembler-times {vrem.vx} 1 } } */
 /* { dg-final { scan-assembler-times {vmax.vx} 2 } } */
+/* { dg-final { scan-assembler-times {vmin.vx} 2 } } */
index 5feec251a4cfd2e33b5e24ed5323ee673e64cfb5..f6524cb8398fa4e561d3109dc652a742fda8d0e3 100644 (file)
@@ -17,3 +17,4 @@ TEST_BINARY_VX_SIGNED_0(T)
 /* { dg-final { scan-assembler-times {vdiv.vx} 1 } } */
 /* { dg-final { scan-assembler-times {vrem.vx} 1 } } */
 /* { dg-final { scan-assembler-times {vmax.vx} 2 } } */
+/* { dg-final { scan-assembler-times {vmin.vx} 2 } } */
index 2474684aaafcf80d2cc18aedff16182bc023182f..f1e8627c8d98e7c7915ab09ad76bc644e71fd404 100644 (file)
@@ -17,3 +17,4 @@ TEST_BINARY_VX_SIGNED_0(T)
 /* { dg-final { scan-assembler-times {vdiv.vx} 1 } } */
 /* { dg-final { scan-assembler-times {vrem.vx} 1 } } */
 /* { dg-final { scan-assembler-times {vmax.vx} 2 } } */
+/* { dg-final { scan-assembler-times {vmin.vx} 2 } } */
index 6f06283140b8335c24e67ba77e955a29fc578991..9b0cbd29603aacbf3b1db4d793b4d53703c2b28f 100644 (file)
@@ -17,3 +17,4 @@ TEST_BINARY_VX_SIGNED_0(T)
 /* { dg-final { scan-assembler-times {vdiv.vx} 1 } } */
 /* { dg-final { scan-assembler-times {vrem.vx} 1 } } */
 /* { dg-final { scan-assembler-times {vmax.vx} 2 } } */
+/* { dg-final { scan-assembler-times {vmin.vx} 2 } } */
index 6726e23e03d4487ae16e76bdebb90b4985fe866a..fb1154c0ca91bbbc0494c5172b54204636b7fc7b 100644 (file)
@@ -17,3 +17,4 @@ TEST_BINARY_VX_SIGNED_0(T)
 /* { dg-final { scan-assembler-not {vdiv.vx} } } */
 /* { dg-final { scan-assembler-not {vrem.vx} } } */
 /* { dg-final { scan-assembler-not {vmax.vx} } } */
+/* { dg-final { scan-assembler-not {vmin.vx} } } */
index 8cf7ba980b4e5dec85172d2fc9a3a66672db5d04..d4baa4ba0d715618609e4ebb42cd82fe309ac537 100644 (file)
@@ -17,3 +17,4 @@ TEST_BINARY_VX_SIGNED_0(T)
 /* { dg-final { scan-assembler-not {vdiv.vx} } } */
 /* { dg-final { scan-assembler-not {vrem.vx} } } */
 /* { dg-final { scan-assembler-not {vmax.vx} } } */
+/* { dg-final { scan-assembler-not {vmin.vx} } } */
index 51514e85c0ed5ab20d22e16607798e2c3065b792..18c1a7897ed1fb7b6d3e4f84d4b7b6eae4c0610d 100644 (file)
@@ -17,3 +17,4 @@ TEST_BINARY_VX_SIGNED_0(T)
 /* { dg-final { scan-assembler-not {vdiv.vx} } } */
 /* { dg-final { scan-assembler-not {vrem.vx} } } */
 /* { dg-final { scan-assembler-not {vmax.vx} } } */
+/* { dg-final { scan-assembler-not {vmin.vx} } } */
index 12d11ba901547e9b0b8d6da94cd93db5095ab731..5ce3c88bf7759ce0b8dc27d08c4b1e98ac75358a 100644 (file)
@@ -17,3 +17,4 @@ TEST_BINARY_VX_SIGNED_0(T)
 /* { dg-final { scan-assembler-not {vdiv.vx} } } */
 /* { dg-final { scan-assembler-not {vrem.vx} } } */
 /* { dg-final { scan-assembler-not {vmax.vx} } } */
+/* { dg-final { scan-assembler-not {vmin.vx} } } */
index 20319857896c59f7b0c708a3b0e39af5feb85e77..29659248a507f7a1de37053799dbd306319bcc24 100644 (file)
@@ -17,3 +17,4 @@ TEST_BINARY_VX_SIGNED_0(T)
 /* { dg-final { scan-assembler-not {vdiv.vx} } } */
 /* { dg-final { scan-assembler-not {vrem.vx} } } */
 /* { dg-final { scan-assembler-not {vmax.vx} } } */
+/* { dg-final { scan-assembler-not {vmin.vx} } } */
index 462793ff421346aea49f3396dc2641c7e9fccba0..e7815e9b2806b573881a1b93c06677c5745ad74b 100644 (file)
@@ -17,3 +17,4 @@ TEST_BINARY_VX_SIGNED_0(T)
 /* { dg-final { scan-assembler-not {vdiv.vx} } } */
 /* { dg-final { scan-assembler-not {vrem.vx} } } */
 /* { dg-final { scan-assembler-not {vmax.vx} } } */
+/* { dg-final { scan-assembler-not {vmin.vx} } } */
index 65498e35371e377f2bb8f8f90ecaa25a9885b092..063a7a1f86f6a70dbae1b54d08d4ac70448d24fd 100644 (file)
@@ -17,3 +17,4 @@ TEST_BINARY_VX_SIGNED_0(T)
 /* { dg-final { scan-assembler-not {vdiv.vx} } } */
 /* { dg-final { scan-assembler-not {vrem.vx} } } */
 /* { dg-final { scan-assembler-not {vmax.vx} } } */
+/* { dg-final { scan-assembler-not {vmin.vx} } } */
index 908df5ea71a01d45c5502c802db8a8a9ab0abc4a..0efb60c050d77ab5fcf53cf857ee29be70fb239e 100644 (file)
@@ -17,3 +17,4 @@ TEST_BINARY_VX_SIGNED_0(T)
 /* { dg-final { scan-assembler-not {vdiv.vx} } } */
 /* { dg-final { scan-assembler-not {vrem.vx} } } */
 /* { dg-final { scan-assembler-not {vmax.vx} } } */
+/* { dg-final { scan-assembler-not {vmin.vx} } } */
index 7bc3049e1d4db01a40b050232c982fa7c97c0ae5..6a4d9485f786d8b47ad82f7edd50ac063452afc3 100644 (file)
@@ -167,6 +167,36 @@ DEF_MAX_1(uint64_t)
 #define MAX_FUNC_1(T) test_##T##_max_1
 #define MAX_FUNC_1_WARP(T) MAX_FUNC_1(T)
 
+#define DEF_MIN_0(T)        \
+static inline T             \
+test_##T##_min_0 (T a, T b) \
+{                           \
+  return a > b ? b : a;     \
+}
+
+#define DEF_MIN_1(T)        \
+static inline T             \
+test_##T##_min_1 (T a, T b) \
+{                           \
+  return a >= b ? b : a;    \
+}
+
+DEF_MIN_0(int8_t)
+DEF_MIN_0(int16_t)
+DEF_MIN_0(int32_t)
+DEF_MIN_0(int64_t)
+
+DEF_MIN_1(int8_t)
+DEF_MIN_1(int16_t)
+DEF_MIN_1(int32_t)
+DEF_MIN_1(int64_t)
+
+#define MIN_FUNC_0(T) test_##T##_min_0
+#define MIN_FUNC_0_WARP(T) MIN_FUNC_0(T)
+
+#define MIN_FUNC_1(T) test_##T##_min_1
+#define MIN_FUNC_1_WARP(T) MIN_FUNC_1(T)
+
 #define DEF_VX_BINARY_CASE_2(T, FUNC, NAME)                      \
 void                                                             \
 test_vx_binary_##NAME##_##FUNC##_##T##_case_2 (T * restrict out, \
@@ -241,7 +271,9 @@ test_vx_binary_##NAME##_##FUNC##_##T##_case_3 (T * restrict out, \
   DEF_VX_BINARY_CASE_0_WRAP(T, /, div)                  \
   DEF_VX_BINARY_CASE_0_WRAP(T, %, rem)                  \
   DEF_VX_BINARY_CASE_2_WRAP(T, MAX_FUNC_0_WARP(T), max) \
-  DEF_VX_BINARY_CASE_2_WRAP(T, MAX_FUNC_1_WARP(T), max)
+  DEF_VX_BINARY_CASE_2_WRAP(T, MAX_FUNC_1_WARP(T), max) \
+  DEF_VX_BINARY_CASE_2_WRAP(T, MIN_FUNC_0_WARP(T), min) \
+  DEF_VX_BINARY_CASE_2_WRAP(T, MIN_FUNC_1_WARP(T), min)
 
 #define TEST_BINARY_VX_UNSIGNED_0(T)                    \
   DEF_VX_BINARY_CASE_0_WRAP(T, +, add)                  \
index 41654ec38bf0c1d01c0e3700e75107012f24ac1c..7f4d2f5f0d5e3c5c502f1e339e96070baeee60df 100644 (file)
@@ -3730,4 +3730,200 @@ uint64_t TEST_BINARY_DATA(uint64_t, max)[][3][N] =
   },
 };
 
+int8_t TEST_BINARY_DATA(int8_t, min)[][3][N] =
+{
+  {
+    { 0 },
+    {
+       2,  2,  2,  2,
+       1,  1,  1,  1,
+      -1, -1, -1, -1,
+      -2, -2, -2, -2,
+    },
+    {
+       0,  0,  0,  0,
+       0,  0,  0,  0,
+      -1, -1, -1, -1,
+      -2, -2, -2, -2,
+    },
+  },
+  {
+    { 127 },
+    {
+       127,  127,  127,  127,
+        -1,   -1,   -1,   -1,
+      -128, -128, -128, -128,
+        -2,   -2,   -2,   -2,
+    },
+    {
+       127,  127,  127,  127,
+        -1,   -1,   -1,   -1,
+      -128, -128, -128, -128,
+        -2,   -2,   -2,   -2,
+    },
+  },
+  {
+    { -128 },
+    {
+      -128, -128, -128, -128,
+         1,    1,    1,    1,
+       127,  127,  127,  127,
+         2,    2,    2,    2,
+    },
+    {
+      -128, -128, -128, -128,
+      -128, -128, -128, -128,
+      -128, -128, -128, -128,
+      -128, -128, -128, -128,
+    },
+  },
+};
+
+int16_t TEST_BINARY_DATA(int16_t, min)[][3][N] =
+{
+  {
+    { 0 },
+    {
+       2,  2,  2,  2,
+       1,  1,  1,  1,
+      -1, -1, -1, -1,
+      -2, -2, -2, -2,
+    },
+    {
+       0,  0,  0,  0,
+       0,  0,  0,  0,
+      -1, -1, -1, -1,
+      -2, -2, -2, -2,
+    },
+  },
+  {
+    { 32767 },
+    {
+       32767,  32767,  32767,  32767,
+          -1,     -1,     -1,     -1,
+      -32768, -32768, -32768, -32768,
+          -2,     -2,     -2,     -2,
+    },
+    {
+       32767,  32767,  32767,  32767,
+          -1,     -1,     -1,     -1,
+      -32768, -32768, -32768, -32768,
+          -2,     -2,     -2,     -2,
+    },
+  },
+  {
+    { -32768 },
+    {
+      -32768, -32768, -32768, -32768,
+           1,      1,      1,      1,
+       32767,  32767,  32767,  32767,
+           2,      2,      2,      2,
+    },
+    {
+      -32768, -32768, -32768, -32768,
+      -32768, -32768, -32768, -32768,
+      -32768, -32768, -32768, -32768,
+      -32768, -32768, -32768, -32768,
+    },
+  },
+};
+
+int32_t TEST_BINARY_DATA(int32_t, min)[][3][N] =
+{
+  {
+    { 0 },
+    {
+       2,  2,  2,  2,
+       1,  1,  1,  1,
+      -1, -1, -1, -1,
+      -2, -2, -2, -2,
+    },
+    {
+       0,  0,  0,  0,
+       0,  0,  0,  0,
+      -1, -1, -1, -1,
+      -2, -2, -2, -2,
+    },
+  },
+  {
+    { 2147483647 },
+    {
+       2147483647,  2147483647,  2147483647,  2147483647,
+               -1,          -1,          -1,          -1,
+      -2147483648, -2147483648, -2147483648, -2147483648,
+               -2,          -2,          -2,          -2,
+    },
+    {
+       2147483647,  2147483647,  2147483647,  2147483647,
+               -1,          -1,          -1,          -1,
+      -2147483648, -2147483648, -2147483648, -2147483648,
+               -2,          -2,          -2,          -2,
+    },
+  },
+  {
+    { -2147483648 },
+    {
+      -2147483648, -2147483648, -2147483648, -2147483648,
+                1,           1,           1,           1,
+       2147483647,  2147483647,  2147483647,  2147483647,
+                2,           2,           2,           2,
+    },
+    {
+      -2147483648, -2147483648, -2147483648, -2147483648,
+      -2147483648, -2147483648, -2147483648, -2147483648,
+      -2147483648, -2147483648, -2147483648, -2147483648,
+      -2147483648, -2147483648, -2147483648, -2147483648,
+    },
+  },
+};
+
+int64_t TEST_BINARY_DATA(int64_t, min)[][3][N] =
+{
+  {
+    { 0 },
+    {
+       2,  2,  2,  2,
+       1,  1,  1,  1,
+      -1, -1, -1, -1,
+      -2, -2, -2, -2,
+    },
+    {
+       0,  0,  0,  0,
+       0,  0,  0,  0,
+      -1, -1, -1, -1,
+      -2, -2, -2, -2,
+    },
+  },
+  {
+    { 9223372036854775807ll },
+    {
+        9223372036854775807ll,   9223372036854775807ll,   9223372036854775807ll,   9223372036854775807ll,
+                           -1,                      -1,                      -1,                      -1,
+      -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull,
+                           -2,                      -2,                      -2,                      -2,
+    },
+    {
+       9223372036854775807ll,  9223372036854775807ll,  9223372036854775807ll,  9223372036854775807ll,
+                           -1,                      -1,                      -1,                      -1,
+      -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull,
+                           -2,                      -2,                      -2,                      -2,
+    },
+  },
+  {
+    { -9223372036854775808ull },
+    {
+      -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull,
+                            1,                       1,                       1,                       1,
+        9223372036854775807ll,   9223372036854775807ll,   9223372036854775807ll,   9223372036854775807ll,
+                            2,                       2,                       2,                       2,
+    },
+    {
+      -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull,
+      -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull,
+      -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull,
+      -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull,
+    },
+  },
+};
+
 #endif
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i16.c
new file mode 100644 (file)
index 0000000..180c82b
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do run { target { riscv_v } } } */
+/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */
+
+#include "vx_binary.h"
+#include "vx_binary_data.h"
+
+#define T          int16_t
+#define NAME       min
+#define FUNC       MIN_FUNC_0_WARP(T)
+#define TEST_DATA  TEST_BINARY_DATA_WRAP(T, NAME)
+
+DEF_VX_BINARY_CASE_2_WRAP(T, FUNC, NAME)
+
+#define TEST_RUN(T, NAME, out, in, x, n) \
+  RUN_VX_BINARY_CASE_2_WRAP(T, NAME, FUNC, out, in, x, n)
+
+#include "vx_binary_run.h"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i32.c
new file mode 100644 (file)
index 0000000..980b63c
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do run { target { riscv_v } } } */
+/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */
+
+#include "vx_binary.h"
+#include "vx_binary_data.h"
+
+#define T          int32_t
+#define NAME       min
+#define FUNC       MIN_FUNC_0_WARP(T)
+#define TEST_DATA  TEST_BINARY_DATA_WRAP(T, NAME)
+
+DEF_VX_BINARY_CASE_2_WRAP(T, FUNC, NAME)
+
+#define TEST_RUN(T, NAME, out, in, x, n) \
+  RUN_VX_BINARY_CASE_2_WRAP(T, NAME, FUNC, out, in, x, n)
+
+#include "vx_binary_run.h"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i64.c
new file mode 100644 (file)
index 0000000..26fae23
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do run { target { riscv_v } } } */
+/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */
+
+#include "vx_binary.h"
+#include "vx_binary_data.h"
+
+#define T          int64_t
+#define NAME       min
+#define FUNC       MIN_FUNC_0_WARP(T)
+#define TEST_DATA  TEST_BINARY_DATA_WRAP(T, NAME)
+
+DEF_VX_BINARY_CASE_2_WRAP(T, FUNC, NAME)
+
+#define TEST_RUN(T, NAME, out, in, x, n) \
+  RUN_VX_BINARY_CASE_2_WRAP(T, NAME, FUNC, out, in, x, n)
+
+#include "vx_binary_run.h"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-1-i8.c
new file mode 100644 (file)
index 0000000..c5c14a4
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do run { target { riscv_v } } } */
+/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */
+
+#include "vx_binary.h"
+#include "vx_binary_data.h"
+
+#define T          int8_t
+#define NAME       min
+#define FUNC       MIN_FUNC_0_WARP(T)
+#define TEST_DATA  TEST_BINARY_DATA_WRAP(T, NAME)
+
+DEF_VX_BINARY_CASE_2_WRAP(T, FUNC, NAME)
+
+#define TEST_RUN(T, NAME, out, in, x, n) \
+  RUN_VX_BINARY_CASE_2_WRAP(T, NAME, FUNC, out, in, x, n)
+
+#include "vx_binary_run.h"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i16.c
new file mode 100644 (file)
index 0000000..bfdabeb
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do run { target { riscv_v } } } */
+/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */
+
+#include "vx_binary.h"
+#include "vx_binary_data.h"
+
+#define T          int16_t
+#define NAME       min
+#define FUNC       MIN_FUNC_1_WARP(T)
+#define TEST_DATA  TEST_BINARY_DATA_WRAP(T, NAME)
+
+DEF_VX_BINARY_CASE_2_WRAP(T, FUNC, NAME)
+
+#define TEST_RUN(T, NAME, out, in, x, n) \
+  RUN_VX_BINARY_CASE_2_WRAP(T, NAME, FUNC, out, in, x, n)
+
+#include "vx_binary_run.h"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i32.c
new file mode 100644 (file)
index 0000000..af34049
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do run { target { riscv_v } } } */
+/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */
+
+#include "vx_binary.h"
+#include "vx_binary_data.h"
+
+#define T          int32_t
+#define NAME       min
+#define FUNC       MIN_FUNC_1_WARP(T)
+#define TEST_DATA  TEST_BINARY_DATA_WRAP(T, NAME)
+
+DEF_VX_BINARY_CASE_2_WRAP(T, FUNC, NAME)
+
+#define TEST_RUN(T, NAME, out, in, x, n) \
+  RUN_VX_BINARY_CASE_2_WRAP(T, NAME, FUNC, out, in, x, n)
+
+#include "vx_binary_run.h"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i64.c
new file mode 100644 (file)
index 0000000..013bd83
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do run { target { riscv_v } } } */
+/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */
+
+#include "vx_binary.h"
+#include "vx_binary_data.h"
+
+#define T          int64_t
+#define NAME       min
+#define FUNC       MIN_FUNC_1_WARP(T)
+#define TEST_DATA  TEST_BINARY_DATA_WRAP(T, NAME)
+
+DEF_VX_BINARY_CASE_2_WRAP(T, FUNC, NAME)
+
+#define TEST_RUN(T, NAME, out, in, x, n) \
+  RUN_VX_BINARY_CASE_2_WRAP(T, NAME, FUNC, out, in, x, n)
+
+#include "vx_binary_run.h"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmin-run-2-i8.c
new file mode 100644 (file)
index 0000000..0f4fd2d
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do run { target { riscv_v } } } */
+/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */
+
+#include "vx_binary.h"
+#include "vx_binary_data.h"
+
+#define T          int8_t
+#define NAME       min
+#define FUNC       MIN_FUNC_1_WARP(T)
+#define TEST_DATA  TEST_BINARY_DATA_WRAP(T, NAME)
+
+DEF_VX_BINARY_CASE_2_WRAP(T, FUNC, NAME)
+
+#define TEST_RUN(T, NAME, out, in, x, n) \
+  RUN_VX_BINARY_CASE_2_WRAP(T, NAME, FUNC, out, in, x, n)
+
+#include "vx_binary_run.h"