]> gcc.gnu.org Git - gcc.git/commitdiff
RISC-V: Support TU for integer ternary OP[PR110964]
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Thu, 10 Aug 2023 09:21:46 +0000 (17:21 +0800)
committerPan Li <pan2.li@intel.com>
Thu, 10 Aug 2023 12:29:47 +0000 (20:29 +0800)
PR target/110964

gcc/ChangeLog:
PR target/110964
* config/riscv/riscv-v.cc (expand_cond_len_ternop): Add integer ternary.

gcc/testsuite/ChangeLog:
PR target/110964
* gcc.target/riscv/rvv/autovec/pr110964.c: New test.

gcc/config/riscv/riscv-v.cc
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr110964.c [new file with mode: 0644]

index c9f0a4a9e7b0b1008c185b0881b15fbe4a63d4b0..a3062c906182cb5cc059d77d0a7d6213ddb2fe62 100644 (file)
@@ -3604,8 +3604,7 @@ expand_cond_len_ternop (unsigned icode, rtx *ops)
       if (FLOAT_MODE_P (mode))
        emit_nonvlmax_fp_ternary_tu_insn (icode, RVV_TERNOP_TU, ops, len);
       else
-       /* FIXME: Enable this case when we support it in the middle-end.  */
-       gcc_unreachable ();
+       emit_nonvlmax_tu_insn (icode, RVV_TERNOP_TU, ops, len);
     }
   else
     {
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr110964.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr110964.c
new file mode 100644 (file)
index 0000000..cf2d1fb
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d --param=riscv-autovec-preference=scalable -Ofast" } */
+
+int *a;
+long b, c;
+
+int d ()
+{
+  const int e;
+  for (; a < e; a++) /* { dg-warning "comparison between pointer and integer" } */
+    c += *a * b;
+}
+
This page took 0.102489 seconds and 5 git commands to generate.