]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Upgrade RVV intrinsic version to 0.12
authorPan Li <pan2.li@intel.com>
Wed, 21 Feb 2024 04:06:22 +0000 (12:06 +0800)
committerPan Li <pan2.li@intel.com>
Thu, 22 Feb 2024 01:22:45 +0000 (09:22 +0800)
Upgrade the version of RVV intrinsic from 0.11 to 0.12.

PR target/114017

gcc/ChangeLog:

* config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins): Upgrade
the version to 0.12.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/predef-__riscv_v_intrinsic.c: Update the
version to 0.12.
* gcc.target/riscv/rvv/base/pr114017-1.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/config/riscv/riscv-c.cc
gcc/testsuite/gcc.target/riscv/predef-__riscv_v_intrinsic.c
gcc/testsuite/gcc.target/riscv/rvv/base/pr114017-1.c [new file with mode: 0644]

index 3ef06dcfd2d2f5ffd8744cfe95bfa517fca1d797..3755ec0b8ef3f6299d80fbe672068910252d4f17 100644 (file)
@@ -139,7 +139,7 @@ riscv_cpu_cpp_builtins (cpp_reader *pfile)
     {
       builtin_define ("__riscv_vector");
       builtin_define_with_int_value ("__riscv_v_intrinsic",
-                                    riscv_ext_version_value (0, 11));
+                                    riscv_ext_version_value (0, 12));
     }
 
    if (TARGET_XTHEADVECTOR)
index dbbedf54f8780699db63b77e7033b54946a9f767..07f1f159a8ff189f726a3a5cea10bb49180e78d3 100644 (file)
@@ -3,7 +3,7 @@
 
 int main () {
 
-#if __riscv_v_intrinsic != 11000
+#if __riscv_v_intrinsic != 12000
 #error "__riscv_v_intrinsic"
 #endif
 
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr114017-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr114017-1.c
new file mode 100644 (file)
index 0000000..8eee7c6
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
+
+#include "riscv_vector.h"
+
+vuint8mf2_t
+test (vuint16m1_t val, size_t shift, size_t vl)
+{
+#if __riscv_v_intrinsic == 11000
+  #warning "RVV Intrinsics v0.11"
+  return __riscv_vnclipu (val, shift, vl);
+#endif
+
+#if __riscv_v_intrinsic == 12000
+  #warning "RVV Intrinsics v0.12" /* { dg-warning "RVV Intrinsics v0.12" } */
+  return __riscv_vnclipu (val, shift, 0, vl);
+#endif
+}
+