public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Support TU for integer ternary OP[PR110964]
@ 2023-08-10  9:21 Juzhe-Zhong
  2023-08-10 12:09 ` Robin Dapp
  0 siblings, 1 reply; 3+ messages in thread
From: Juzhe-Zhong @ 2023-08-10  9:21 UTC (permalink / raw)
  To: gcc-patches; +Cc: kito.cheng, kito.cheng, jeffreyalaw, rdapp.gcc, Juzhe-Zhong

        PR target/110964

gcc/ChangeLog:

        * config/riscv/riscv-v.cc (expand_cond_len_ternop): Add integer ternary.

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/rvv/autovec/pr110964.c: New test.

---
 gcc/config/riscv/riscv-v.cc                         |  3 +--
 .../gcc.target/riscv/rvv/autovec/pr110964.c         | 13 +++++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/pr110964.c

diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
index c9f0a4a9e7b..a3062c90618 100644
--- a/gcc/config/riscv/riscv-v.cc
+++ b/gcc/config/riscv/riscv-v.cc
@@ -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
index 00000000000..cf2d1fb5f1d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr110964.c
@@ -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;
+}
+
-- 
2.36.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] RISC-V: Support TU for integer ternary OP[PR110964]
  2023-08-10  9:21 [PATCH] RISC-V: Support TU for integer ternary OP[PR110964] Juzhe-Zhong
@ 2023-08-10 12:09 ` Robin Dapp
  2023-08-10 12:23   ` Li, Pan2
  0 siblings, 1 reply; 3+ messages in thread
From: Robin Dapp @ 2023-08-10 12:09 UTC (permalink / raw)
  To: Juzhe-Zhong, gcc-patches; +Cc: rdapp.gcc, kito.cheng, kito.cheng, jeffreyalaw

OK.

Regards
 Robin


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] RISC-V: Support TU for integer ternary OP[PR110964]
  2023-08-10 12:09 ` Robin Dapp
@ 2023-08-10 12:23   ` Li, Pan2
  0 siblings, 0 replies; 3+ messages in thread
From: Li, Pan2 @ 2023-08-10 12:23 UTC (permalink / raw)
  To: Robin Dapp, Juzhe-Zhong, gcc-patches; +Cc: kito.cheng, kito.cheng, jeffreyalaw

Committed, thanks Robin.

Pan

-----Original Message-----
From: Gcc-patches <gcc-patches-bounces+pan2.li=intel.com@gcc.gnu.org> On Behalf Of Robin Dapp via Gcc-patches
Sent: Thursday, August 10, 2023 8:09 PM
To: Juzhe-Zhong <juzhe.zhong@rivai.ai>; gcc-patches@gcc.gnu.org
Cc: rdapp.gcc@gmail.com; kito.cheng@gmail.com; kito.cheng@sifive.com; jeffreyalaw@gmail.com
Subject: Re: [PATCH] RISC-V: Support TU for integer ternary OP[PR110964]

OK.

Regards
 Robin


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-10 12:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-10  9:21 [PATCH] RISC-V: Support TU for integer ternary OP[PR110964] Juzhe-Zhong
2023-08-10 12:09 ` Robin Dapp
2023-08-10 12:23   ` Li, Pan2

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).