public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Add fixed PR111255 testcase by other patch
@ 2023-09-18 12:13 Lehua Ding
  2023-09-18 12:13 ` juzhe.zhong
  0 siblings, 1 reply; 3+ messages in thread
From: Lehua Ding @ 2023-09-18 12:13 UTC (permalink / raw)
  To: gcc-patches
  Cc: juzhe.zhong, kito.cheng, rdapp.gcc, palmer, jeffreyalaw, lehua.ding

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.

---
 .../gcc.target/riscv/rvv/vsetvl/pr111255.c    | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111255.c

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} } } */
--
2.36.3


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

* Re: [PATCH] RISC-V: Add fixed PR111255 testcase by other patch
  2023-09-18 12:13 [PATCH] RISC-V: Add fixed PR111255 testcase by other patch Lehua Ding
@ 2023-09-18 12:13 ` juzhe.zhong
  2023-09-18 12:16   ` Lehua Ding
  0 siblings, 1 reply; 3+ messages in thread
From: juzhe.zhong @ 2023-09-18 12:13 UTC (permalink / raw)
  To: 丁乐华, gcc-patches
  Cc: kito.cheng, Robin Dapp, palmer, jeffreyalaw, 丁乐华

[-- Attachment #1: Type: text/plain, Size: 2200 bytes --]

LGTM。



juzhe.zhong@rivai.ai
 
From: Lehua Ding
Date: 2023-09-18 20:13
To: gcc-patches
CC: juzhe.zhong; kito.cheng; rdapp.gcc; palmer; jeffreyalaw; lehua.ding
Subject: [PATCH] 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.
 
---
.../gcc.target/riscv/rvv/vsetvl/pr111255.c    | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111255.c
 
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} } } */
--
2.36.3
 

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

* Re: [PATCH] RISC-V: Add fixed PR111255 testcase by other patch
  2023-09-18 12:13 ` juzhe.zhong
@ 2023-09-18 12:16   ` Lehua Ding
  0 siblings, 0 replies; 3+ messages in thread
From: Lehua Ding @ 2023-09-18 12:16 UTC (permalink / raw)
  To: juzhe.zhong, gcc-patches; +Cc: kito.cheng, Robin Dapp, palmer, jeffreyalaw

Committed, thanks Juzhe.

On 2023/9/18 20:13, juzhe.zhong@rivai.ai wrote:
> LGTM。
> 
> ------------------------------------------------------------------------
> juzhe.zhong@rivai.ai
> 
>     *From:* Lehua Ding <mailto:lehua.ding@rivai.ai>
>     *Date:* 2023-09-18 20:13
>     *To:* gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>     *CC:* juzhe.zhong <mailto:juzhe.zhong@rivai.ai>; kito.cheng
>     <mailto:kito.cheng@gmail.com>; rdapp.gcc
>     <mailto:rdapp.gcc@gmail.com>; palmer <mailto:palmer@rivosinc.com>;
>     jeffreyalaw <mailto:jeffreyalaw@gmail.com>; lehua.ding
>     <mailto:lehua.ding@rivai.ai>
>     *Subject:* [PATCH] 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.
>     ---
>     .../gcc.target/riscv/rvv/vsetvl/pr111255.c    | 24 +++++++++++++++++++
>     1 file changed, 24 insertions(+)
>     create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111255.c
>     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} } } */
>     --
>     2.36.3
> 

-- 
Best,
Lehua


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

end of thread, other threads:[~2023-09-18 12:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-18 12:13 [PATCH] RISC-V: Add fixed PR111255 testcase by other patch Lehua Ding
2023-09-18 12:13 ` juzhe.zhong
2023-09-18 12:16   ` Lehua Ding

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).