Re: Re: [PATCH] RISC-V: Enable vectorization for vect-early-break_124-pr114403.c

2024-05-21 Thread Li Xu
Committed, thanks. xu...@eswincomputing.com From: Robin Dapp Date: 2024-05-21 22:58 To: juzhe.zh...@rivai.ai; Li Xu; gcc-patches CC: rdapp.gcc; kito.cheng; palmer; tamar.christina; Richard Biener; richard.sandiford; zhengyu; pan2.li Subject: Re: [PATCH] RISC-V: Enable vectorization for vect

[gcc r15-763] RISC-V: Enable vectorization for vect-early-break_124-pr114403.c

2024-05-21 Thread Li Xu via Gcc-cvs
https://gcc.gnu.org/g:ffab721f3c9ecbb9831844d844ad257b69a77993 commit r15-763-gffab721f3c9ecbb9831844d844ad257b69a77993 Author: xuli Date: Mon May 20 01:56:47 2024 + RISC-V: Enable vectorization for vect-early-break_124-pr114403.c Because "targetm.slow_unaligned_access" is

[PATCH] RISC-V: Enable vectorization for vect-early-break_124-pr114403.c

2024-05-20 Thread Li Xu
From: xuli Because "targetm.slow_unaligned_access" is set to true by default (aka -mtune=rocket) for RISC-V, it causes the __builtin_memcpy with 8 bytes failed to folded into int64 assignment during ccp1. So adding "-mtune=generic-ooo" to the RISC-V target can vectorize

[PATCH v2] RISC-V: Add riscv_vector_cc function attribute

2024-03-01 Thread Li Xu
From: xuli Standard vector calling convention variant will only enabled when function has vector argument or returning value by default, however user may also want to invoke function without that during a vectorized loop at some situation, but it will cause a huge performance penalty due to

Re: [PATCH] RISC-V: Add riscv_vector_cc function attribute

2024-02-29 Thread Li Xu
Ping. xu...@eswincomputing.com From: Li Xu Date: 2024-02-27 09:17 To: gcc-patches CC: kito.cheng; palmer; juzhe.zhong; zhengyu; xuli Subject: [PATCH] RISC-V: Add riscv_vector_cc function attribute From: xuli Standard vector calling convention variant will only enabled when function has

[PATCH] RISC-V: Add riscv_vector_cc function attribute

2024-02-26 Thread Li Xu
From: xuli Standard vector calling convention variant will only enabled when function has vector argument or returning value by default, however user may also want to invoke function without that during a vectorized loop at some situation, but it will cause a huge performance penalty due to

Re: Re: [PATCH v2] RISC-V: Bugfix for resolve_overloaded_builtin[PR113420]

2024-01-21 Thread Li Xu
Committed, thanks xu...@eswincomputing.com From: juzhe.zh...@rivai.ai Date: 2024-01-22 14:40 To: Li Xu; gcc-patches CC: kito.cheng; palmer; Li Xu Subject: Re: [PATCH v2] RISC-V: Bugfix for resolve_overloaded_builtin[PR113420] LGTM. juzhe.zh...@rivai.ai From: Li Xu Date: 2024-01-22 12:11

[PATCH v2] RISC-V: Bugfix for resolve_overloaded_builtin[PR113420]

2024-01-21 Thread Li Xu
From: xuli v2: Avoid internal ICE for the case below. vint8mf8_t test_vle8_v_i8mf8_m(vbool64_t vm, const int32_t *rs1, size_t vl) { return __riscv_vle8(vm, rs1, vl); } v1: Change the hash value of overloaded intrinsic from considering all parameter types to: 1. Encoding vector data type 2. In

Re: Re: [PATCH] RISC-V: Bugfix for resolve_overloaded_builtin[PR113420]

2024-01-19 Thread Li Xu
you are right. vint8mf8_t test_vle8_v_i8mf8_m(vbool64_t vm, const int32_t *rs1, size_t vl) { return __riscv_vle8(vm, rs1, vl); } This will cause ICE. I tried clang and it will also cause ICE. xu...@eswincomputing.com From: juzhe.zh...@rivai.ai Date: 2024-01-19 15:53 To: Li Xu; gcc-patches

[PATCH] RISC-V: Bugfix for resolve_overloaded_builtin[PR113420]

2024-01-18 Thread Li Xu
From: xuli Change the hash value of overloaded intrinsic from considering all parameter types to: 1. Encoding vector data type 2. In order to distinguish vle8_v_i8mf8_m(vbool64_t vm, const int8_t *rs1, size_t vl) and vle8_v_u8mf8_m(vbool64_t vm, const uint8_t *rs1, size_t vl), encode the

Re: Re: [PATCH] testsuite: Fix dump checks under different riscv-sim for RVV.

2023-12-18 Thread Li Xu
Committed, thanks juzhe. xu...@eswincomputing.com From: juzhe.zhong Date: 2023-12-19 14:01 To: Li Xu CC: gcc-patches@gcc.gnu.org; kito.ch...@gmail.com; pal...@dabbelt.com; xuli Subject: Re: [PATCH] testsuite: Fix dump checks under different riscv-sim for RVV. ok Replied Message

[PATCH] testsuite: Fix dump checks under different riscv-sim for RVV.

2023-12-18 Thread Li Xu
From: xuli gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/cpymem-1.c: Fix checks under medany. * gcc.target/riscv/rvv/base/cpymem-strategy-3.c: Fix checks. * gcc.target/riscv/rvv/base/cpymem-strategy-4.c: Ditto. --- .../gcc.target/riscv/rvv/base/cpymem-1.c |

[PATCH] testsuite: Fix cpymem-2.c dump checks under different riscv-sim for RVV.

2023-12-18 Thread Li Xu
From: xuli gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/cpymem-2.c: Fix checks. --- .../gcc.target/riscv/rvv/base/cpymem-2.c | 44 ++- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-2.c

[PATCH v2] testsuite: Fix cpymem-1.c dump checks under different riscv-sim for RVV.

2023-12-17 Thread Li Xu
From: xuli gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/cpymem-1.c: Fix checks. --- .../gcc.target/riscv/rvv/base/cpymem-1.c | 29 +-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c

[PATCH] testsuite: Fix cpymem-1.c dump checks under different riscv-sim for RVV.

2023-12-17 Thread Li Xu
From: xuli gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/cpymem-1.c: Fix checks. --- .../gcc.target/riscv/rvv/base/cpymem-1.c | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c

Re: Re: [PATCH] RISC-V: Add viota missed avl_type attribute

2023-12-17 Thread Li Xu
Committed, thanks juzhe. xu...@eswincomputing.com From: juzhe.zhong Date: 2023-12-18 09:08 To: Li Xu CC: gcc-patches@gcc.gnu.org; kito.ch...@gmail.com; pal...@dabbelt.com Subject: Re: [PATCH] RISC-V: Add viota missed avl_type attribute lgtm Replied Message FromLi Xu Date12/18/2023

[PATCH] RISC-V: Add viota missed avl_type attribute

2023-12-17 Thread Li Xu
From: Juzhe-Zhong This patch fixes the following FAIL when LMUL = 8: riscv-sim/-march=rv64gcv/-mabi=lp64d/-mcmodel=medany/--param=riscv-autovec-lmul=m8/--param=riscv-autovec-preference=scalable FAIL: gcc.dg/vect/slp-multitypes-2.c execution test The rootcause is we missed viota avl_type, so we

Re: Re: [PATCH] RISC-V: Remove useless modes

2023-12-05 Thread Li Xu
Got it. Committed, thanks juzhe and kito. xu...@eswincomputing.com From: Kito Cheng Date: 2023-12-06 14:45 To: Li Xu CC: gcc-patches; palmer; juzhe.zhong Subject: Re: [PATCH] RISC-V: Remove useless modes You could add [NFC] to the title for this kind of patch to declare its clean up

[PATCH] RISC-V: Remove useless modes

2023-12-05 Thread Li Xu
From: xuli gcc/ChangeLog: * config/riscv/riscv.md: Remove. --- gcc/config/riscv/riscv.md | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md index a98918dfd43..0db659acfbe 100644 --- a/gcc/config/riscv/riscv.md +++

Re: Re: [PATCH v2] RISC-V: FAIL:g++.dg/torture/vshuf-v[2|4]di.C -Os (execution test) on RV32

2023-12-05 Thread Li Xu
Committed, thanks juzhe. xu...@eswincomputing.com From: juzhe.zh...@rivai.ai Date: 2023-12-05 16:41 To: Li Xu; gcc-patches CC: kito.cheng; palmer; Li Xu Subject: Re: [PATCH v2] RISC-V: FAIL:g++.dg/torture/vshuf-v[2|4]di.C -Os (execution test) on RV32 LGTM. Thanks. juzhe.zh...@rivai.ai

[PATCH v2] RISC-V: FAIL:g++.dg/torture/vshuf-v[2|4]di.C -Os (execution test) on RV32

2023-12-05 Thread Li Xu
From: xuli This patch fixs the issue of g++.dg/torture/vshuf-v2di.C and g++.dg/torture/vshuf-v4di.C -Os execution failure with -march=rv32gcv -mabi=ilp32d. Consider the following code: typedef unsigned long long V __attribute__((vector_size(16))); .LC0: 0xc1c2c3c4c5c6c7c8 before this patch:

[PATCH] RISC-V: FAIL:g++.dg/torture/vshuf-v[2|4]di.C -Os (execution test) on RV32

2023-12-05 Thread Li Xu
From: xuli This patch fixs the issue of g++.dg/torture/vshuf-v2di.C and g++.dg/torture/vshuf-v4di.C -Os execution failure with -march=rv32gcv -mabi=ilp32d. Consider the following code: typedef unsigned long long V __attribute__((vector_size(16))); .LC0: 0xc1c2c3c4c5c6c7c8 before this patch:

[PATCH] RISC-V: Add explicit braces to eliminate warning.

2023-11-29 Thread Li Xu
From: xuli ../.././gcc/gcc/config/riscv/riscv.cc: In function ‘void riscv_option_override()’: ../.././gcc/gcc/config/riscv/riscv.cc:8673:6: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] if (TARGET_RVE) ^ gcc/ChangeLog: * config/riscv/riscv.cc

Re: Re: [PATCH] RISC-V: Implement -mmemcpy-strategy= options[PR112537]

2023-11-19 Thread Li Xu
Committed, thanks jeff and juzhe. Thanks, Li Xu xu...@eswincomputing.com From: juzhe.zh...@rivai.ai Date: 2023-11-20 09:55 To: Li Xu; jeffreyalaw; gcc-patches CC: kito.cheng; palmer; Robin Dapp Subject: Re: Re: [PATCH] RISC-V: Implement -mmemcpy-strategy= options[PR112537] Jeff has approved

Re: Re: [PATCH] RISC-V: Implement -mmemcpy-strategy= options[PR112537]

2023-11-19 Thread Li Xu
I've tested it and there are no issues with regression testing. Thanks, Li Xu xu...@eswincomputing.com From: Jeff Law Date: 2023-11-20 05:42 To: Li Xu; gcc-patches CC: kito.cheng; palmer; juzhe.zhong Subject: Re: [PATCH] RISC-V: Implement -mmemcpy-strategy= options[PR112537] On 11/16/23

[PATCH] RISC-V: Implement -mmemcpy-strategy= options[PR112537]

2023-11-16 Thread Li Xu
From: xuli https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112537 -mmemcpy-strategy=[auto|libcall|scalar|vector] auto: Current status, use scalar or vector instructions. libcall: Always use a library call. scalar: Only use scalar instructions. vector: Only use vector instructions. PR

[PATCH] RISC-V: Eliminate unused parameter warning.

2023-11-08 Thread Li Xu
From: xuli The parameter orig_fndecl is not used, use anonymous parameters instead. ../.././gcc/gcc/config/riscv/riscv-c.cc: In function ‘bool riscv_check_builtin_call(location_t, vec, tree, tree, unsigned int, tree_node**)’: ../.././gcc/gcc/config/riscv/riscv-c.cc:207:11: warning: unused

Re: Re: [PATCH] RISC-V: Support vcreate intrinsics for non-tuple types

2023-11-01 Thread Li Xu
Committed, thanks juzhe. xu...@eswincomputing.com From: juzhe.zh...@rivai.ai Date: 2023-11-02 09:00 To: Li Xu; gcc-patches CC: kito.cheng; palmer; Li Xu Subject: Re: [PATCH] RISC-V: Support vcreate intrinsics for non-tuple types LGTM. Thanks. juzhe.zh...@rivai.ai From: Li Xu Date: 2023

[PATCH] RISC-V: Support vcreate intrinsics for non-tuple types

2023-11-01 Thread Li Xu
From: xuli https://github.com/riscv-non-isa/rvv-intrinsic-doc/pull/288 gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc: Expand non-tuple intrinsics. * config/riscv/riscv-vector-builtins-functions.def (vcreate): Define non-tuple intrinsics. *

[PATCH] RISC-V: Support vundefine intrinsics for tuple types

2023-11-01 Thread Li Xu
From: xuli https://github.com/riscv-non-isa/rvv-intrinsic-doc/pull/288 gcc/ChangeLog: * config/riscv/riscv-vector-builtins-functions.def (vundefined): Add vundefine intrinsics for tuple types. * config/riscv/riscv-vector-builtins.cc: Ditto. * config/riscv/vector.md

Re: Re: [PATCH v6] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-10-31 Thread Li Xu
All overload and non-overload intrinsics have been tested successfully on gcc and g++. Thanks. > -原始邮件-发件人:"juzhe.zh...@rivai.ai" > 发送时间:2023-10-31 17:07:11 (星期二)收件人:"Li Xu" > , gcc-patches > 抄送:"kito.cheng" , palmer > , &

[PATCH v6] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-10-31 Thread Li Xu
. * gcc.target/riscv/rvv/base/overloaded_vget_vset.h: New test. * gcc.target/riscv/rvv/base/overloaded_vloxseg2ei16.h: New test. * gcc.target/riscv/rvv/base/overloaded_vmv.h: New test. * gcc.target/riscv/rvv/base/overloaded_vreinterpret.h: New test. Signed-off-by: Li Xu Co

Re: Re: [PATCH V5] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-10-30 Thread Li Xu
const binop vfadd_frm_obj; template class binop : public function_base { public: bool maybe_require_frm_p () const override { return true; }//vadd is true ... } -- Li Xu >+static bool >+maybe_require_frm_p (function_instance ) >+{ >+  return instance.b

Re: Re: [PATCH v2] RISC-V: Fix ICE of RVV vget/vset intrinsic[PR111935]

2023-10-30 Thread Li Xu
Already backported to releases/gcc-13. -- Li Xu >Ok for gcc 13 but just wait one more week to make sure everything is fine >as gcc convention :) > >Li Xu 於 2023年10月24日 週二,15:49寫道: > >> Committed t

[PATCH V5] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-10-30 Thread Li Xu
/rvv/base/overloaded_vreinterpret.h: New test. Signed-off-by: Li Xu Co-Authored-By: Pan Li --- gcc/config/riscv/riscv-c.cc | 36 ++- gcc/config/riscv/riscv-protos.h | 1 + .../riscv/riscv-vector-builtins-shapes.cc | 1 + gcc/config/riscv/riscv-vector

Re: Re: [PATCH V4] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-10-30 Thread Li Xu
OK, I will send patch v5. -- Li Xu >Ok. Understand. > >Could you add wrapper "maybe_require_vxrm_p" and "maybe_require_frm_p"  ? > >static bool >maybe_require_frm_p >return instance.base == bases::vfwredu

Re: Re: [PATCH V4] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-10-30 Thread Li Xu
-- Li Xu >Thanks. > >I like this 'HASH' solution which is much more reasonable to me. > >Some comments here: > >+bool >+has_vxrm_or_frm_p (function_instance , const vec >) >+{ >+  /* Vector fixed-point arithmetic ins

[PATCH V4] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-10-30 Thread Li Xu
. * gcc.target/riscv/rvv/base/overloaded_vget_vset.h: New test. * gcc.target/riscv/rvv/base/overloaded_vloxseg2ei16.h: New test. * gcc.target/riscv/rvv/base/overloaded_vmv.h: New test. * gcc.target/riscv/rvv/base/overloaded_vreinterpret.h: New test. Signed-off-by: Li Xu Co

Re: Re: [PATCH v2] RISC-V: Fix ICE of RVV vget/vset intrinsic[PR111935]

2023-10-24 Thread Li Xu
Committed to trunk. Thanks juzhe. -- Li Xu >Ok for trunk (You can commit it to the trunk now). > >For GCC-13,  I'd like to wait for kito's comment. > >Thanks. > > >juzhe.zh...@rivai.ai > >From: Li Xu >Date: 202

[PATCH v2] RISC-V: Fix ICE of RVV vget/vset intrinsic[PR111935]

2023-10-24 Thread Li Xu
Calling vget/vset intrinsic without receiving a return value will cause a crash. Because in this case e.target is null. This patch should be backported to releases/gcc-13. PR/target 111935 gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc: fix bug.

RISC-V: Fix ICE of RVV vget/vset intrinsic[PR111935]

2023-10-24 Thread Li Xu
Calling vget/vset intrinsic without receiving a return value will cause a crash. Because in this case e.target is null. This patch should be backported to releases/gcc-13. PR target/111935 gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc: Don't use the e.target directly.

Re: Re: [PATCH] RISC-V: Fix scan-assembler-times of RVV test case

2023-10-06 Thread Li Xu
Commited, thanks juzhe. -- Li Xu >OK. > > > >juzhe.zh...@rivai.ai > >From: Li Xu >Date: 2023-10-07 11:18 >To: gcc-patches >CC: kito.cheng; palmer; juzhe.zhong; xuli >Subject: [PATCH] RISC-V: Fix scan-assembler-times of RVV test case >Fr

[PATCH] RISC-V: Fix scan-assembler-times of RVV test case

2023-10-06 Thread Li Xu
From: xuli gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-25.c: Adjust assembler times. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-26.c: Ditto. --- .../gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-25.c | 10 +-

Re: Re: [PATCH v2] RISC-V: Bugfix for RTL check[PR111533]

2023-09-27 Thread Li Xu
Committed, thanks juzhe. -- Li Xu >LGTM. Thanks for fixing it. > > > >juzhe.zh...@rivai.ai > >From: Li Xu >Date: 2023-09-28 09:33 >To: gcc-patches >CC: kito.cheng; palmer; juzhe.zhong; xuli >Subject: [PATCH v2] RISC-V: Bugfix for RTL check[PR111533] >

[PATCH v2] RISC-V: Bugfix for RTL check[PR111533]

2023-09-27 Thread Li Xu
From: xuli Consider the flowing situation: BB5: local_dem(RVV Insn 1, AVL(reg zero)) RVV Insn 1: vmv.s.x, AVL (const_int 1) RVV Insn 2: vredsum.vs, AVL(reg zero) vmv.s.x has vl operand, the following code will get avl (cosnt_int) from RVV Insn 1. rtx avl = has_vl_op (insn->rtl ()) ? get_vl

[PATCH] RISC-V: Bugfix for RTL check[PR111533]

2023-09-26 Thread Li Xu
From: xuli Consider the flowing situation: BB5: local_dem(RVV Insn 1, AVL(reg zero)) RVV Insn 1: vmv.s.x, AVL (const_int 1) RVV Insn 2: vredsum.vs, AVL(reg zero) vmv.s.x has vl operand, the following code will get avl (cosnt_int) from RVV Insn 1. rtx avl = has_vl_op (insn->rtl ()) ? get_vl

Re: Re: [PATCH V2] RISC-V: Optimization of vrgather.vv into vrgatherei16.vv[PR111451]

2023-09-21 Thread Li Xu
Committed, thanks Juzhe. -- Li Xu >LGTM. You can commit it after you pass the regression. > > > >juzhe.zh...@rivai.ai > >From: Li Xu >Date: 2023-09-22 10:37 >To: gcc-patches >CC: kito.cheng; palmer; juzhe.zhong; xuli >Subject: [PATCH V2] RI

[PATCH V2] RISC-V: Optimization of vrgather.vv into vrgatherei16.vv[PR111451]

2023-09-21 Thread Li Xu
From: xuli Consider this following case: typedef int32_t vnx32si __attribute__ ((vector_size (128))); __attribute__ ((noipa)) void permute_##TYPE (TYPE values1, TYPE values2, \ TYPE *out) \ {

[PATCH] RISC-V: Optimization of vrgather.vv into vrgatherei16.vv[PR111451]

2023-09-21 Thread Li Xu
From: xuli Consider this following case: typedef int32_t vnx32si __attribute__ ((vector_size (128))); __attribute__ ((noipa)) void permute_##TYPE (TYPE values1, TYPE values2, \ TYPE *out) \ {

Re: Re: [PATCH] RISC-V: Optimized for strided load/store with stride == element width[PR111450]

2023-09-20 Thread Li Xu
Committed, thanks Juzhe. -- Li Xu >Thanks a lot. LGTM. > > > >juzhe.zh...@rivai.ai > >From: Li Xu >Date: 2023-09-21 11:12 >To: gcc-patches >CC: kito.cheng; palmer; juzhe.zhong; xuli >Subject: [PATCH] RISC-V: Optimized for strided load/store with s

[PATCH] RISC-V: Optimized for strided load/store with stride == element width[PR111450]

2023-09-20 Thread Li Xu
From: xuli When stride == element width, vlsse should be optimized into vle.v. vsse should be optimized into vse.v. PR target/111450 gcc/ChangeLog: *config/riscv/constraints.md (c01): const_int 1. (c02): const_int 2. (c04): const_int 4. (c08): const_int

Re: Re: [PATCH] RISC-V: Remove phase 6 of vsetvl pass in GCC13[PR111412]

2023-09-18 Thread Li Xu
commited, thanks kito and juzhe. -- Li Xu >I think it's not make too much sense to back port GCC14's change to >GCC 13, removing phase 6 optimization is reasonable to me, so  LGTM :) > >On Mon, Sep 18, 2023 at 2:44 PM juzhe.zh...@rivai.ai > wrote: >> >> Th

[PATCH] RISC-V: Remove phase 6 of vsetvl pass in GCC13[PR111412]

2023-09-17 Thread Li Xu
From: xuli vsetvl pass has been refactored in gcc14, and the optimization is more reasonable than releases/gcc-13. This problem does not exist in gcc14. Phase 6 of gcc13 is an optimization patch. Due to lack of consideration, there will be some hidden bugs, so we decided to remove phase 6.

Re: Re: [PATCH v3] RISC-V: Elimilate warning in class vcreate

2023-09-12 Thread Li Xu
Committed, thanks juzhe. -- Li Xu >lgtm > Replied Message >FromLi Xu >Date09/12/2023 14:20 >togcc-patc...@gcc.gnu.org >cckito.ch...@gmail.com, >pal...@dabbelt.com, >juzhe.zh...@rivai.ai, >xuli >Subject[PATCH v3] RISC-V: Elimilate warning in class vcreate

[PATCH v3] RISC-V: Elimilate warning in class vcreate

2023-09-12 Thread Li Xu
From: xuli The following is the content of class vcreate: class vcreate : public function_base { public: gimple *fold (gimple_folder ) const override { } rtx expand (function_expander ) const override { return NULL_RTX; } }; The warning caused is:

[PATCH v2] RISC-V: Elimilate warning in class vcreate

2023-09-12 Thread Li Xu
From: xuli The following is the content of class vcreate: class vcreate : public function_base { public: gimple *fold (gimple_folder ) const override { } rtx expand (function_expander ) const override { return NULL_RTX; } }; The warning caused is:

[PATCH] RISC-V: Elimilate warning

2023-09-11 Thread Li Xu
From: xuli ./riscv-gcc/gcc/config/riscv/riscv-vector-builtins-bases.cc:1719:34: warning: unused parameter 'e' [-Wunused-parameter] rtx expand (function_expander ) const override ^ gcc/ChangeLog: *

Re: Re: [PATCH] RISC-V: Add vcreate intrinsics for RVV tuple types

2023-09-11 Thread Li Xu
Committed, thanks juzhe and kito. -- Li Xu >LGTM, thanks for implement this :) > >On Tue, Sep 12, 2023 at 10:16 AM juzhe.zh...@rivai.ai > wrote: >> >> Thanks for support it. >> LGTM from my side. >> Wait for kito's more comments. >> >&

[PATCH] RISC-V: Add vcreate intrinsics for RVV tuple types

2023-09-11 Thread Li Xu
From: xuli gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc (class vcreate): (BASE): New class. * config/riscv/riscv-vector-builtins-bases.h: Ditto. * config/riscv/riscv-vector-builtins-functions.def (vcreate): Add vcreate support. *

Re: [PATCH V2] RISC-V: Insert vsetivli zero, 0 for vmv.x.s/vfmv.f.s instructions satisfying REG_P(operand[1]) in -O0.

2023-08-27 Thread Li Xu
This patch should be backported to releases/gcc-13 to address  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111076 -- Li Xu >This issue happens is because the operand1 of scalar move can be >REG_P (operand[1]) in the O0 case, which causes the VSETVL PASS to >not insert t

Re: Re: [PATCH] RISCV: Fix PR111074 [GCC13 BUG]

2023-08-22 Thread Li Xu
Committed, thanks all. -- Li Xu >The test case is too complicated and I can't simplify it, so no test case is >added. > >------ >Li Xu >>From: xuli >> >>This patch fixes this issue happens on GCC-13. >>https://gcc.gnu.org/bugzilla

Re: [PATCH] RISCV: Fix PR111074 [GCC13 BUG]

2023-08-21 Thread Li Xu
The test case is too complicated and I can't simplify it, so no test case is added. -- Li Xu >From: xuli > >This patch fixes this issue happens on GCC-13. >https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111074 > >This patch should be backported to GCC-13. >

[PATCH] RISCV: Fix PR111074 [GCC13 BUG]

2023-08-21 Thread Li Xu
From: xuli This patch fixes this issue happens on GCC-13. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111074 This patch should be backported to GCC-13. GCC-14 has rewritten propagate_avl function, so there is no issue. PR target/111074 gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc

[committed] MAINTAINERS: Add myself to write after approval

2023-07-30 Thread Li Xu
From: xuli Signed-off-by: Li Xu ChangeLog: * MAINTAINERS: Add myself. --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index e9b11b43a0f..49aa6bae73b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -712,6 +712,7 @@ Jonathan Wright

[PATCH] RISC-V: Remove vxrm parameter for vsadd[u] and vssub[u]

2023-07-27 Thread Li Xu
From: xuli Computation of `vsadd`, `vsaddu`, `vssub`, and `vssubu` do not need the rounding mode, therefore the intrinsics of these instructions do not have the parameter for rounding mode control. gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc: remove rounding mode of

[PATCH] RISC-V: Fix vector tuple intrinsic

2023-07-26 Thread Li Xu
Consider this following case: void test_vsoxseg3ei32_v_i32mf2x3(int32_t *base, vuint32mf2_t bindex, vint32mf2x3_t v_tuple, size_t vl) { return __riscv_vsoxseg3ei32_v_i32mf2x3(base, bindex, v_tuple, vl); } Compiler failed with: test.c:19:1: internal compiler error: in vl_vtype_info, at

[PATCH v2] RISC-V: Fix vector tuple intrinsic

2023-07-26 Thread Li Xu
Consider this following case: void test_vsoxseg3ei32_v_i32mf2x3(int32_t *base, vuint32mf2_t bindex, vint32mf2x3_t v_tuple, size_t vl) { return __riscv_vsoxseg3ei32_v_i32mf2x3(base, bindex, v_tuple, vl); } Compiler failed with: test.c:19:1: internal compiler error: in vl_vtype_info, at

[PATCH] RISC-V: Fix vector tuple intrinsic

2023-07-25 Thread Li Xu
Consider this following case: void test_vsoxseg3ei32_v_i32mf2x3(int32_t *base, vuint32mf2_t bindex, vint32mf2x3_t v_tuple, size_t vl) { return __riscv_vsoxseg3ei32_v_i32mf2x3(base, bindex, v_tuple, vl); } Compiler failed with: test.c:19:1: internal compiler error: in vl_vtype_info, at

[PATCH] RISCV: Fix local_eliminate_vsetvl_insn bug in VSETVL PASS[PR110560]

2023-07-07 Thread Li Xu
This patch fixes this issue happens on GCC-13. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110560 This patch should be backported to GCC-13. GCC-14 has rewritten this function, so there is no issue. PR target/110560 gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc

[PATCH] Extend streamer_mode_table size to MACHINE_MODE_BITSIZE.

2023-06-27 Thread Li Xu
If MAX_MACHINE_MODE exceeds 8bits, a warning will appear in the following code. waring: writing 293 bytes into a region of size 256 overflows the destination gcc/lto-streamer-out.cc void lto_output_init_mode_table (void) { memset (streamer_mode_table, '\0', MAX_MACHINE_MODE); } gcc/ChangeLog:

Re: [PATCH v2] RISC-V: fix expand function of vlmul_ext RVV intrinsic

2023-06-26 Thread Li Xu
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.zh...@rivai.ai wrote: >> LGTM. >> Thanks for fixing it. >Agreed.  I didn't see the V2

[PATCH v2] RISC-V: fix expand function of vlmul_ext RVV intrinsic

2023-06-25 Thread 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

[PATCH] RISC-V: force arg and target to reg rtx under -O0

2023-06-24 Thread Li Xu
arg and target should be expanded to reg rtx during expand pass. 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:

[PATCH v2] RISC-V: Set the natural size of constant vector mask modes to one RVV data vector.

2023-06-20 Thread Li Xu
If reinterpret vnx2bi as vnx16qi, vnx16qi must occupy no more of the underlying registers than vnx2bi. Consider this following case: void test_vreinterpret_v_b64_i8m1 (uint8_t *in, int8_t *out) { vbool64_t vmask = __riscv_vlm_v_b64 (in, 2); vint8m1_t vout = __riscv_vreinterpret_v_b64_i8m1

[PATCH] RISC-V: Set the natural size of constant vector mask modes to one RVV data vector.

2023-06-20 Thread Li Xu
If reinterpret vnx2bi as vnx16bi, vnx16bi must occupy no more of the underlying registers than vnx2bi. Consider this following case: void test_vreinterpret_v_b64_i8m1 (uint8_t *in, int8_t *out) { vbool64_t vmask = __riscv_vlm_v_b64 (in, 2); vint8m1_t vout = __riscv_vreinterpret_v_b64_i8m1

[PATCH v2] RISC-V: Fix VWEXTF iterator requirement

2023-06-18 Thread Li Xu
gcc/ChangeLog: * config/riscv/vector-iterators.md: zvfh/zvfhmin depends on the Zve32f extension. --- gcc/config/riscv/vector-iterators.md | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/config/riscv/vector-iterators.md

[PATCH] RISC-V: Fix iterator requirement

2023-06-18 Thread Li Xu
VWF is defined under TARGET_MIN_VLEN >= 128. VWEXTF: zvfh/zvfhmin depends on the Zve32f extension. gcc/ChangeLog: * config/riscv/vector-iterators.md: Fix requirement --- gcc/config/riscv/vector-iterators.md | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-)

[PATCH] RISC-V: Fix 'REQUIREMENT' for machine_mode 'MODE' in vector-iterators.md.

2023-06-05 Thread Li Xu
gcc/ChangeLog: * config/riscv/vector-iterators.md: Fix 'REQUIREMENT' for machine_mode 'MODE'. * config/riscv/vector.md (@pred_indexed_store): change VNX16_QHSI to VNX16_QHSDI. (@pred_indexed_store): Ditto. --- gcc/config/riscv/vector-iterators.md | 26

[PATCH V2] RISC-V: Insert vsetivli zero, 0 for vmv.x.s/vfmv.f.s instructions satisfying REG_P(operand[1]) in -O0.

2023-05-09 Thread Li Xu
This issue happens is because the operand1 of scalar move can be REG_P (operand[1]) in the O0 case, which causes the VSETVL PASS to not insert the vsetvl instruction correctly, and the compiler crashes. Consider this following case: int16_t foo1 (void *base, size_t vl) { int16_t maxVal =

[PATCH] RISC-V: Insert vsetivli zero, 0 for vmv.x.s/vfmv.f.s instructions satisfying REG_P(operand[1]) in -O0.

2023-05-09 Thread Li Xu
This issue happens is because the operand1 of scalar move can be REG_P (operand[1]) in the O0 case, which causes the VSETVL PASS to not insert the vsetvl instruction correctly, and the compiler crashes. Consider this following case: int16_t foo1 (void *base, size_t vl) { int16_t maxVal =

[PATCH] RISC-V: Fix typo

2023-04-04 Thread Li Xu
gcc/ChangeLog: * config/riscv/riscv-vector-builtins.def: Fix typo. * config/riscv/riscv.cc (riscv_dwarf_poly_indeterminate_value): Ditto. * config/riscv/vector-iterators.md: Ditto. --- gcc/config/riscv/riscv-vector-builtins.def | 3 +-- gcc/config/riscv/riscv.cc

[PATCH] RISC-V: Fix typo

2023-04-02 Thread Li Xu
gcc/ChangeLog: * config/riscv/riscv-vector-builtins.def (vuint32m8_t): Fix typo (vfloat32m8_t): Likewise --- gcc/config/riscv/riscv-vector-builtins.def | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/riscv/riscv-vector-builtins.def