public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v2] RISC-V: fix expand function of vlmul_ext RVV intrinsic
@ 2023-06-25  9:09 Li Xu
  2023-06-25  9:13 ` juzhe.zhong
  0 siblings, 1 reply; 5+ messages in thread
From: Li Xu @ 2023-06-25  9:09 UTC (permalink / raw)
  To: gcc-patches; +Cc: kito.cheng, palmer, juzhe.zhong, zhengyu, Li Xu

Consider this following case:
void test_vlmul_ext_v_i8mf8_i8mf4(vint8mf8_t op1) {
  vint8mf4_t res = __riscv_vlmul_ext_v_i8mf8_i8mf4(op1);
}

Compilation fails with:
test.c: In function 'test_vlmul_ext_v_i8mf8_i8mf4':
test.c:5:1: error: unrecognizable insn:
    5 | }
      | ^
(insn 30 29 0 2 (set (mem/c:VNx2QI (reg/f:DI 143) [0 x+0 S[2, 2] A32])
        (mem/c:VNx2QI (reg/f:DI 148) [0 op1+0 S[2, 2] A16])) "test.c":4:18 -1
     (nil))
during RTL pass: vregs
test.c:5:1: internal compiler error: in extract_insn, at recog.cc:2791
0x7c61b8 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        ../.././riscv-gcc/gcc/rtl-error.cc:108
0x7c61d7 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../.././riscv-gcc/gcc/rtl-error.cc:116
0xed58a7 extract_insn(rtx_insn*)
        ../.././riscv-gcc/gcc/recog.cc:2791
0xb7f789 instantiate_virtual_regs_in_insn
        ../.././riscv-gcc/gcc/function.cc:1611
0xb7f789 instantiate_virtual_regs
        ../.././riscv-gcc/gcc/function.cc:1984

gcc/ChangeLog:

        * config/riscv/riscv-vector-builtins-bases.cc: change emit_insn to emit_move_insn

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/rvv/base/vlmul_ext-2.c: New test.
---
 gcc/config/riscv/riscv-vector-builtins-bases.cc       | 2 +-
 gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-2.c | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-2.c

diff --git a/gcc/config/riscv/riscv-vector-builtins-bases.cc b/gcc/config/riscv/riscv-vector-builtins-bases.cc
index c6c53dc13a5..5c8deda900d 100644
--- a/gcc/config/riscv/riscv-vector-builtins-bases.cc
+++ b/gcc/config/riscv/riscv-vector-builtins-bases.cc
@@ -1567,7 +1567,7 @@ public:
   {
     tree arg = CALL_EXPR_ARG (e.exp, 0);
     rtx src = expand_normal (arg);
-    emit_insn (gen_rtx_SET (gen_lowpart (e.vector_mode (), e.target), src));
+    emit_move_insn (gen_lowpart (e.vector_mode (), e.target), src);
     return e.target;
   }
 };
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-2.c
new file mode 100644
index 00000000000..2b088b53546
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O0" } */
+
+#include "riscv_vector.h"
+
+void test_vlmul_ext_v_i8mf8_i8mf4(vint8mf8_t op1) {
+  vint8mf4_t res = __riscv_vlmul_ext_v_i8mf8_i8mf4(op1);
+}
-- 
2.17.1


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

* Re: [PATCH v2] RISC-V: fix expand function of vlmul_ext RVV intrinsic
  2023-06-25  9:09 [PATCH v2] RISC-V: fix expand function of vlmul_ext RVV intrinsic Li Xu
@ 2023-06-25  9:13 ` juzhe.zhong
  2023-06-25 12:54   ` Jeff Law
  0 siblings, 1 reply; 5+ messages in thread
From: juzhe.zhong @ 2023-06-25  9:13 UTC (permalink / raw)
  To: Li Xu, gcc-patches; +Cc: kito.cheng, palmer, zhengyu, Li Xu, jeffreyalaw

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

LGTM.
Thanks for fixing it.

Hi, Jeff:
I saw Li Xu is frequently helping RVV support in GCC. Is it possible to give him the write access?

Thanks.


juzhe.zhong@rivai.ai
 
From: Li Xu
Date: 2023-06-25 17:09
To: gcc-patches
CC: kito.cheng; palmer; juzhe.zhong; zhengyu; Li Xu
Subject: [PATCH v2] RISC-V: fix expand function of vlmul_ext RVV intrinsic
Consider this following case:
void test_vlmul_ext_v_i8mf8_i8mf4(vint8mf8_t op1) {
  vint8mf4_t res = __riscv_vlmul_ext_v_i8mf8_i8mf4(op1);
}
 
Compilation fails with:
test.c: In function 'test_vlmul_ext_v_i8mf8_i8mf4':
test.c:5:1: error: unrecognizable insn:
    5 | }
      | ^
(insn 30 29 0 2 (set (mem/c:VNx2QI (reg/f:DI 143) [0 x+0 S[2, 2] A32])
        (mem/c:VNx2QI (reg/f:DI 148) [0 op1+0 S[2, 2] A16])) "test.c":4:18 -1
     (nil))
during RTL pass: vregs
test.c:5:1: internal compiler error: in extract_insn, at recog.cc:2791
0x7c61b8 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        ../.././riscv-gcc/gcc/rtl-error.cc:108
0x7c61d7 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../.././riscv-gcc/gcc/rtl-error.cc:116
0xed58a7 extract_insn(rtx_insn*)
        ../.././riscv-gcc/gcc/recog.cc:2791
0xb7f789 instantiate_virtual_regs_in_insn
        ../.././riscv-gcc/gcc/function.cc:1611
0xb7f789 instantiate_virtual_regs
        ../.././riscv-gcc/gcc/function.cc:1984
 
gcc/ChangeLog:
 
        * config/riscv/riscv-vector-builtins-bases.cc: change emit_insn to emit_move_insn
 
gcc/testsuite/ChangeLog:
 
        * gcc.target/riscv/rvv/base/vlmul_ext-2.c: New test.
---
gcc/config/riscv/riscv-vector-builtins-bases.cc       | 2 +-
gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-2.c | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-2.c
 
diff --git a/gcc/config/riscv/riscv-vector-builtins-bases.cc b/gcc/config/riscv/riscv-vector-builtins-bases.cc
index c6c53dc13a5..5c8deda900d 100644
--- a/gcc/config/riscv/riscv-vector-builtins-bases.cc
+++ b/gcc/config/riscv/riscv-vector-builtins-bases.cc
@@ -1567,7 +1567,7 @@ public:
   {
     tree arg = CALL_EXPR_ARG (e.exp, 0);
     rtx src = expand_normal (arg);
-    emit_insn (gen_rtx_SET (gen_lowpart (e.vector_mode (), e.target), src));
+    emit_move_insn (gen_lowpart (e.vector_mode (), e.target), src);
     return e.target;
   }
};
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-2.c
new file mode 100644
index 00000000000..2b088b53546
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O0" } */
+
+#include "riscv_vector.h"
+
+void test_vlmul_ext_v_i8mf8_i8mf4(vint8mf8_t op1) {
+  vint8mf4_t res = __riscv_vlmul_ext_v_i8mf8_i8mf4(op1);
+}
-- 
2.17.1
 
 

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

* Re: [PATCH v2] RISC-V: fix expand function of vlmul_ext RVV intrinsic
  2023-06-25  9:13 ` juzhe.zhong
@ 2023-06-25 12:54   ` Jeff Law
  2023-06-25 14:06     ` Li, Pan2
  2023-06-26  9:16     ` Li Xu
  0 siblings, 2 replies; 5+ messages in thread
From: Jeff Law @ 2023-06-25 12:54 UTC (permalink / raw)
  To: juzhe.zhong, Li Xu, gcc-patches; +Cc: kito.cheng, palmer, zhengyu



On 6/25/23 03:13, juzhe.zhong@rivai.ai wrote:
> LGTM.
> Thanks for fixing it.
Agreed.  I didn't see the V2 had already been posted.

> 
> Hi, Jeff:
> I saw Li Xu is frequently helping RVV support in GCC. Is it possible to 
> give him the write access?
Yes, we can do that with the normal process.

Li Xu, fill out this form:

https://sourceware.org/cgi-bin/pdw/ps_form.cgi

List me as approving the request.
Jeff

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

* RE: [PATCH v2] RISC-V: fix expand function of vlmul_ext RVV intrinsic
  2023-06-25 12:54   ` Jeff Law
@ 2023-06-25 14:06     ` Li, Pan2
  2023-06-26  9:16     ` Li Xu
  1 sibling, 0 replies; 5+ messages in thread
From: Li, Pan2 @ 2023-06-25 14:06 UTC (permalink / raw)
  To: Jeff Law, juzhe.zhong, Li Xu, gcc-patches; +Cc: kito.cheng, palmer, zhengyu

Committed, thanks Jeff.

Pan

-----Original Message-----
From: Gcc-patches <gcc-patches-bounces+pan2.li=intel.com@gcc.gnu.org> On Behalf Of Jeff Law via Gcc-patches
Sent: Sunday, June 25, 2023 8:55 PM
To: juzhe.zhong@rivai.ai; Li Xu <xuli1@eswincomputing.com>; gcc-patches <gcc-patches@gcc.gnu.org>
Cc: kito.cheng <kito.cheng@gmail.com>; palmer <palmer@dabbelt.com>; zhengyu <zhengyu@eswincomputing.com>
Subject: Re: [PATCH v2] RISC-V: fix expand function of vlmul_ext RVV intrinsic



On 6/25/23 03:13, juzhe.zhong@rivai.ai wrote:
> LGTM.
> Thanks for fixing it.
Agreed.  I didn't see the V2 had already been posted.

> 
> Hi, Jeff:
> I saw Li Xu is frequently helping RVV support in GCC. Is it possible to 
> give him the write access?
Yes, we can do that with the normal process.

Li Xu, fill out this form:

https://sourceware.org/cgi-bin/pdw/ps_form.cgi

List me as approving the request.
Jeff

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

* Re: [PATCH v2] RISC-V: fix expand function of vlmul_ext RVV intrinsic
  2023-06-25 12:54   ` Jeff Law
  2023-06-25 14:06     ` Li, Pan2
@ 2023-06-26  9:16     ` Li Xu
  1 sibling, 0 replies; 5+ messages in thread
From: Li Xu @ 2023-06-26  9:16 UTC (permalink / raw)
  To: Jeff Law; +Cc: juzhe.zhong, gcc-patches, kito.cheng, palmer, zhengyu

Hi, Jeff:

I have filled out the form. May I ask if you have received my application? Is there anything else I need to do?

Thanks.
--------------
Li Xu
>
>
>On 6/25/23 03:13, juzhe.zhong@rivai.ai wrote:
>> LGTM.
>> Thanks for fixing it.
>Agreed.  I didn't see the V2 had already been posted.
>
>>
>> Hi, Jeff:
>> I saw Li Xu is frequently helping RVV support in GCC. Is it possible to
>> give him the write access?
>Yes, we can do that with the normal process.
>
>Li Xu, fill out this form:
>
>https://sourceware.org/cgi-bin/pdw/ps_form.cgi
>
>List me as approving the request.
>Jeff

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

end of thread, other threads:[~2023-06-26  9:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-25  9:09 [PATCH v2] RISC-V: fix expand function of vlmul_ext RVV intrinsic Li Xu
2023-06-25  9:13 ` juzhe.zhong
2023-06-25 12:54   ` Jeff Law
2023-06-25 14:06     ` Li, Pan2
2023-06-26  9:16     ` Li Xu

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