public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Lehua Ding <lhtin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-4094] RISC-V: Add fixed PR111255 testcase by other patch
Date: Mon, 18 Sep 2023 12:15:52 +0000 (GMT)	[thread overview]
Message-ID: <20230918121552.0D6F73858C60@sourceware.org> (raw)

https://gcc.gnu.org/g:4ab744ace2478c4b986ec4ac27c0e3467b7a6419

commit r14-4094-g4ab744ace2478c4b986ec4ac27c0e3467b7a6419
Author: Lehua Ding <lehua.ding@rivai.ai>
Date:   Mon Sep 18 20:04:07 2023 +0800

    RISC-V: Add fixed PR111255 testcase by other patch
    
    This patch add the missed PR111255 testcase which is fixed by this
    committed patch (https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628922.html).
    
            PR target/111255
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/riscv/rvv/vsetvl/pr111255.c: New test.

Diff:
---
 .../gcc.target/riscv/rvv/vsetvl/pr111255.c         | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111255.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111255.c
new file mode 100644
index 00000000000..736f6838a50
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111255.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 --param riscv-autovec-lmul=m2 -fno-vect-cost-model" } */
+
+#include <stdint.h>
+
+#define DEF_LOOP(OLD_TYPE, NEW_TYPE)                                           \
+  void __attribute__ ((noipa))                                                 \
+  test_##OLD_TYPE##_2_##NEW_TYPE (NEW_TYPE *__restrict r,                      \
+				  OLD_TYPE *__restrict a, NEW_TYPE b,          \
+				  OLD_TYPE *__restrict pred, int n)            \
+  {                                                                            \
+    for (int i = 0; i < n; ++i)                                                \
+      {                                                                        \
+	r[i] = pred[i] ? (NEW_TYPE) a[i] : b;                                  \
+      }                                                                        \
+  }
+
+/* INT -> narrower-INT */
+#define TEST_ALL_X2X_NARROWER(T)                                               \
+  T (int16_t, int8_t)
+
+TEST_ALL_X2X_NARROWER (DEF_LOOP)
+
+/* { dg-final { scan-assembler-not {\tvsetvli\t[a-x0-9]+,[a-x0-9]+,e[0-9]+,m[f0-9]+,t[au],m[au]\n\tvsetvli\t} } } */

                 reply	other threads:[~2023-09-18 12:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230918121552.0D6F73858C60@sourceware.org \
    --to=lhtin@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).