Re: [PATCH v6] RISC-V:Optimize the MASK opt generation

2023-09-29 Thread Kito Cheng
Hi Jeff: Could you take a look for this? RISC-V part is ok to me. Thanks :) Feng Wang 於 2023年9月12日 週二 17:18 寫道: > New patch add some comments and update docs for this new usage. > --- > Accoring to Kito's advice, using "MASK(name) Var(other_flag_name)" > to generate MASK and TARGET MACRO autom

Re: [PATCH v6] RISC-V:Optimize the MASK opt generation

2023-10-01 Thread Kito Cheng
Committed to trunk, thanks Feng :) On Sat, Sep 30, 2023 at 3:34 AM Jeff Law wrote: > > > > On 9/12/23 03:18, Feng Wang wrote: > > New patch add some comments and update docs for this new usage. > > --- > > Accoring to Kito's advice, using "MASK(name) Var(other_flag_name)" > > to generate MASK and

Re: [PATCH v6] RISC-V:Optimize the MASK opt generation

2023-10-01 Thread Kito Cheng
Hi Gerald: Thanks for reporting this issue, I just realized multidimensional arrays are gawk extensions, could you try the attached patch to see if it can resolve the issue? On Mon, Oct 2, 2023 at 4:56 AM Gerald Pfeifer wrote: > > On Sun, 1 Oct 2023, Kito Cheng wrote: > > Commit

[PATCH] options: Prevent multidimensional arrays

2023-10-02 Thread Kito Cheng
Multidimensional arrary is gawk extension, and we accidentally introduced that in recent commit[1]. [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e4a4b8e983bac865eb435b11798e38d633b98942 gcc/ChangeLog: * opt-read.awk: Drop multidimensional arrays. * opth-gen.awk: Ditto. ---

Re: [PATCH] RISC-V: Use stdint-gcc.h in rvv testsuite

2023-10-02 Thread Kito Cheng
> > On Tue, Sep 26, 2023 at 10:59 AM Patrick O'Neill > > wrote: > >> stdint.h can be replaced with stdint-gcc.h to resolve some missing > >> system headers in non-multilib installations. > >> > >> Tested using glibc rv32gcv and rv64gcv on r14-4258-gc9837443075. > >> > >> gcc/ChangeLog: > >> > >>

Re: [PATCH v2] RISC-V: Implement TLS Descriptors.

2023-10-02 Thread Kito Cheng
Just one nit and one more comment for doc: Could you add some doc something like that? mostly I grab from other target, so you can just included in the patch. diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 31f2234640f..39396668da2 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/in

[PATCH] RISC-V: Fix the riscv_legitimize_poly_move issue on targets where the minimal VLEN exceeds 512.

2023-10-02 Thread Kito Cheng
riscv_legitimize_poly_move was expected to ensure the poly value is at most 32 times smaller than the minimal VLEN (32 being derived from '4096 / 128'). This assumption held when our mode modeling was not so precisely defined. However, now that we have modeled the mode size according to the correct

Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-10-02 Thread Kito Cheng
Proposed fix, and verified with "mawk" and "gawk -P" (gawk with posix mode) on my linux also some other report it work on freebsd, just wait review :) https://gcc.gnu.org/pipermail/gcc-patches/2023-October/631785.html On Tue, Oct 3, 2023 at 2:07 AM Jeff Law wrote: > > > > On 10/2/23 12:03, David

[PATCH v1 1/4] options: Define TARGET__P and TARGET__OPTS_P macro for Mask and InverseMask

2023-10-03 Thread Kito Cheng
We TARGET__P marcro to test a Mask and InverseMask with user specified target_variable, however we may want to test with specific gcc_options variable rather than target_variable. Like RISC-V has defined lots of Mask with TargetVariable, which is not easy to use, because that means we need to know

[no subject]

2023-10-03 Thread Kito Cheng
From: Kito Cheng Reply-To: Subject: [PATCH v1 0/4] RISC-V target attribute In-Reply-To: This patch set implement target attribute for RISC-V target, which is similar to other target like x86 or ARM, let user able to set some local setting per function without changing global settings. We

[PATCH v1 2/4] RISC-V: Refactor riscv_option_override and riscv_convert_vector_bits. [NFC]

2023-10-03 Thread Kito Cheng
Allow those funciton apply from a local gcc_options rather than the global options. Preparatory for target attribute, sperate this change for eaiser reivew since it's a NFC. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_convert_vector_bits): Get setting from argument rather than

[PATCH v1 4/4] RISC-V: Implement target attribute

2023-10-03 Thread Kito Cheng
The target attribute which proposed in [1], target attribute allow user to specify a local setting per-function basis. The syntax of target attribute is `__attribute__((target("")))`. and the syntax of `` describes below: ``` ATTR-STRING := ATTR-STRING ';' ATTR | ATTR ATTR:=

[PATCH v1 3/4] RISC-V: Extend riscv_subset_list, preparatory for target attribute support

2023-10-03 Thread Kito Cheng
riscv_subset_list only accept a full arch string before, but we need to parse single extension when supporting target attribute, also we may set a riscv_subset_list directly rather than re-parsing the ISA string again. gcc/ChangeLog: * config/riscv/riscv-subset.h (riscv_subset_list::parse

Re:

2023-10-03 Thread Kito Cheng
Ooop, I screwed up when writing my cover letter of the target attribute patch set... On Tue, Oct 3, 2023 at 5:10 PM Kito Cheng wrote: > > From: Kito Cheng > > Reply-To: > > Subject: [PATCH v1 0/4] RISC-V target attribute > > In-Reply-To: > > This patch set impleme

Re: [PATCH] RISC-V: Fix the riscv_legitimize_poly_move issue on targets where the minimal VLEN exceeds 512.

2023-10-04 Thread Kito Cheng
钟居哲 於 2023年10月4日 週三,20:20寫道: > > I think the "max poly value" is the LMUL 1 mode coeffs[1] > > See int vlenb = BYTES_PER_RISCV_VECTOR.coeffs[1]; > > So I think bump max_power to exact_log2 (64); is not enough. > since we adjust the LMUL 1 mode size according to TARGET_MIN_VLEN. > > I suspect the te

Re: [PATCH] options: Prevent multidimensional arrays

2023-10-04 Thread Kito Cheng
committed to trunk, got approval from Jeff in another mail thread: https://gcc.gnu.org/pipermail/gcc-patches/2023-October/631873.html :) On Mon, Oct 2, 2023 at 4:03 PM Kito Cheng wrote: > > Multidimensional arrary is gawk extension, and we accidentally > introduced that in recent

Re: [PATCH] RISC-V: THead: Fix missing CFI directives for th.sdd in prologue.

2023-10-04 Thread Kito Cheng
LGTM, will commit if nobody commit that tomorrow :p Christoph Müllner 於 2023年10月4日 週三,23:04寫道: > On Wed, Oct 4, 2023 at 9:49 AM Xianmiao Qu > wrote: > > > > From: quxm > > > > When generating CFI directives for the store-pair instruction, > > if we add two parallel REG_FRAME_RELATED_EXPR expr_l

Re: [PATCH] RISC-V: Fix the riscv_legitimize_poly_move issue on targets where the minimal VLEN exceeds 512.

2023-10-05 Thread Kito Cheng
Hi Robin: Your suggested code seems work fine, let me run more test and send v2, I guess I just don’t know how to explain why it work in comment :p Robin Dapp 於 2023年10月5日 週四,03:57寫道: > >> I think the "max poly value" is the LMUL 1 mode coeffs[1] > >> > >> See int vlenb = BYTES_PER_RISCV_VECTOR.

Re: [PATCH v2] RISC-V: Use stdint-gcc.h in rvv testsuite

2023-10-05 Thread Kito Cheng
LGTM Patrick O'Neill 於 2023年10月6日 週五 07:46 寫道: > stdint.h can be replaced with stdint-gcc.h to resolve some missing > system headers in non-multilib installations. > > Tested using glibc rv32gcv and rv64gcv on r14-4381-g7eb5ce7f58e. > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/rvv

Re: [PATCH v1] RISC-V: Update comments for FP rounding related autovec

2023-10-05 Thread Kito Cheng
LGTM 於 2023年10月6日 週五 10:39 寫道: > From: Pan Li > > Some comment is out of date, this patch would like to fix it. > > gcc/ChangeLog: > > * config/riscv/autovec.md: Update comments. > > Signed-off-by: Pan Li > --- > gcc/config/riscv/autovec.md | 6 +- > 1 file changed, 5 insertions(+

Re: [PATCH v1 1/4] options: Define TARGET__P and TARGET__OPTS_P macro for Mask and InverseMask

2023-10-09 Thread Kito Cheng
> Doesn't this need to be updated to avoid multi-dimensional arrays in awk > and rebased? Oh, yeah, I should update that, it's post before that issue reported, let me send v2 sn :P

Re: [PATCH] RISC-V: Make xtheadcondmov-indirect tests robust against instruction reordering

2023-10-09 Thread Kito Cheng
I guess you may also want to clean up those bodies for "check-function-bodies"? On Mon, Oct 9, 2023 at 3:47 PM Christoph Muellner wrote: > > From: Christoph Müllner > > Fixes: c1bc7513b1d7 ("RISC-V: const: hide mvconst splitter from IRA") > > A recent change broke the xtheadcondmov-indirect test

Re: [PATCH] RISC-V: Add available vector size for RVV

2023-10-09 Thread Kito Cheng
LGTM On Mon, Oct 9, 2023 at 4:23 PM Juzhe-Zhong wrote: > > For RVV, we have VLS modes enable according to TARGET_MIN_VLEN > from M1 to M8. > > For example, when TARGET_MIN_VLEN = 128 bits, we enable > 128/256/512/1024 bits VLS modes. > > This patch fixes following FAIL: > FAIL: gcc.dg/vect/bb-slp

[PATCH v2 0/4] RISC-V target attribute

2023-10-09 Thread Kito Cheng
This patch set implement target attribute for RISC-V target, which is similar to other target like x86 or ARM, let user able to set some local setting per function without changing global settings. We support arch, tune and cpu first, and we will support other target attribute later, this versi

[PATCH v2 1/4] options: Define TARGET__P and TARGET__OPTS_P macro for Mask and InverseMask

2023-10-09 Thread Kito Cheng
We TARGET__P marcro to test a Mask and InverseMask with user specified target_variable, however we may want to test with specific gcc_options variable rather than target_variable. Like RISC-V has defined lots of Mask with TargetVariable, which is not easy to use, because that means we need to know

[PATCH v2 2/4] RISC-V: Refactor riscv_option_override and riscv_convert_vector_bits. [NFC]

2023-10-09 Thread Kito Cheng
Allow those funciton apply from a local gcc_options rather than the global options. Preparatory for target attribute, sperate this change for eaiser reivew since it's a NFC. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_convert_vector_bits): Get setting from argument rather than

[PATCH v2 4/4] RISC-V: Implement target attribute

2023-10-09 Thread Kito Cheng
The target attribute which proposed in [1], target attribute allow user to specify a local setting per-function basis. The syntax of target attribute is `__attribute__((target("")))`. and the syntax of `` describes below: ``` ATTR-STRING := ATTR-STRING ';' ATTR | ATTR ATTR:=

[PATCH v2 3/4] RISC-V: Extend riscv_subset_list, preparatory for target attribute support

2023-10-09 Thread Kito Cheng
riscv_subset_list only accept a full arch string before, but we need to parse single extension when supporting target attribute, also we may set a riscv_subset_list directly rather than re-parsing the ISA string again. gcc/ChangeLog: * config/riscv/riscv-subset.h (riscv_subset_list::parse

Re: [PATCH v3 0/2] RISC-V: Support CORE-V XCVMAC and XCVALU extensions

2023-10-10 Thread Kito Cheng
Just repeat what I said on the mailing list again :P it's LGTM, just need to rebase to deal with riscv.opt related changes :) On Sat, Sep 30, 2023 at 8:02 PM Mary Bennett wrote: > > Thank you for reviewing this patch. > > v1->v2: > * Add XCValu RTL. > * Change assembly mnemonics from mixed c

Re: [PATCH v2 3/4] RISC-V: Extend riscv_subset_list, preparatory for target attribute support

2023-10-11 Thread Kito Cheng
Thanks, committed with fixup for those two comments :) On Tue, Oct 10, 2023 at 7:01 AM Jeff Law wrote: > > > > On 10/9/23 22:13, Kito Cheng wrote: > > riscv_subset_list only accept a full arch string before, but we need to > > parse single extension when supporting targe

Re: [PATCH v2 1/4] options: Define TARGET__P and TARGET__OPTS_P macro for Mask and InverseMask

2023-10-11 Thread Kito Cheng
Thanks, committed, and just did one more check with x86 again, it works as well, hope no more awk portable issue this time :P On Tue, Oct 10, 2023 at 6:51 AM Jeff Law wrote: > > > > On 10/9/23 22:13, Kito Cheng wrote: > > We TARGET__P marcro to test a Mask and InverseMask with

Re: [PATCH v2 2/4] RISC-V: Refactor riscv_option_override and riscv_convert_vector_bits. [NFC]

2023-10-11 Thread Kito Cheng
Thanks, committed :) On Tue, Oct 10, 2023 at 6:51 AM Jeff Law wrote: > > > > On 10/9/23 22:13, Kito Cheng wrote: > > Allow those funciton apply from a local gcc_options rather than the > > global options. > > > > Preparatory for target attribute, sperate thi

Re: [PATCH v2 4/4] RISC-V: Implement target attribute

2023-10-11 Thread Kito Cheng
> Assuming you're agreeable to adjusting the code to avoid alloca, we'll > do a quick turnaround on the v3 -- I'll just audit the return paths to > make sure we don't leak and we'll be good to go. Thanks for point out that, let me figure out which is the best way to fix that, using xstrdup + free

Re: Re: [PATCH v2 1/4] options: Define TARGET__P and TARGET__OPTS_P macro for Mask and InverseMask

2023-10-11 Thread Kito Cheng
PTS (opts); > > > > -- > juzhe.zh...@rivai.ai > > > *From:* Kito Cheng > *Date:* 2023-10-12 05:20 > *To:* Jeff Law > *CC:* Kito Cheng ; gcc-patches > ; palmer ; rdapp > ; juzhe.zhong > *Subject:* Re: [PATCH v2 1/4] options: Define TARGET__P and > TARGET__OPTS_P m

Re: Re: [PATCH] RISC-V: Fix the riscv_legitimize_poly_move issue on targets where the minimal VLEN exceeds 512.

2023-10-11 Thread Kito Cheng
riscv-autovec-lmul=m8 > -march=rv64gcv_zvl4096b --param=riscv-autovec-lmul=dynamic > > I will do that in stage 3. I hope this patch can be landed before I do that. > > juzhe.zh...@rivai.ai > > > From: Kito Cheng > Date: 2023-10-05 22:00

[committed] RISC-V: Add TARGET_MIN_VLEN_OPTS to fix the build

2023-10-11 Thread Kito Cheng
gcc/ChangeLog: * config/riscv/riscv-opts.h (TARGET_MIN_VLEN_OPTS): New. --- gcc/config/riscv/riscv-opts.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/gcc/config/riscv/riscv-opts.h b/gcc/config/riscv/riscv-opts.h index e7c6b75c5ea..31ee42dea6b 100644 --- a/gcc/config/riscv/ri

Re: Re: [PATCH v2 1/4] options: Define TARGET__P and TARGET__OPTS_P macro for Mask and InverseMask

2023-10-11 Thread Kito Cheng
Fixed, sorry for disturbing trunk On Wed, Oct 11, 2023 at 3:50 PM Kito Cheng wrote: > > Oh, my bad seem like that was in later patch, let me fix now > > 钟居哲 於 2023年10月11日 週三 15:49 寫道: >> >> ../../../../gcc/gcc/config/riscv/riscv.cc:8142:18: error: >> ‘TARGET_MIN_

Re: RISC-V: Support CORE-V XCVMAC and XCVALU extensions

2023-10-11 Thread Kito Cheng
Take a quick look and maybe fix it like that, but I am not sure the layout is what they want. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index eb665188caf..1692e43de10 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -21714,7 +21714,7 @@ vector intrinsic specification, whi

Re: [PATCH v1] RISC-V: Support FP llrint auto vectorization

2023-10-11 Thread Kito Cheng
Did I miss something? the title says support but it seems only testcase?? On Wed, Oct 11, 2023 at 8:38 PM Li, Pan2 wrote: > > Committed, thanks Juzhe. > > > > Pan > > > > From: juzhe.zh...@rivai.ai > Sent: Thursday, October 12, 2023 11:34 AM > To: Li, Pan2 ; gcc-patches > Cc: Li, Pan2 ; Wang, Y

Re: [PATCH v1] RISC-V: Support FP llrint auto vectorization

2023-10-12 Thread Kito Cheng
ion from the situation like search from the git logs, > I choose option 2 here and add some description in > as well. > > Finally, is there any best practices for this case? Thank again for > comments. > > Pan > > -Original Message- > From: Kito Cheng >

Re: [PATCH] RISC-V: Fix the riscv_legitimize_poly_move issue on targets where the minimal VLEN exceeds 512.

2023-10-12 Thread Kito Cheng
Yeah, will send v2 today Jeff Law 於 2023年10月12日 週四 09:15 寫道: > > > On 10/11/23 17:17, Kito Cheng wrote: > > Yeah, I'll take you suggestion and go ahead, Robin's suggestion is > > great but it's just a little too magic :P > So there'll be a V2 of this

Re: [PATCH v2] RISC-V: Make xtheadcondmov-indirect tests robust against instruction reordering

2023-10-12 Thread Kito Cheng
Sorry for the late comment after Jeff say ok, but I guess we may consider add "-fno-schedule-insns -fno-schedule-insns2" to avoid disturbing from schedule like some of our test case in gcc/testsuite/gcc.target/riscv/rvv? On Thu, Oct 12, 2023 at 9:12 AM Jeff Law wrote: > > > > On 10/12/23 07:06, C

Re: [PATCH v2] RISC-V: Make xtheadcondmov-indirect tests robust against instruction reordering

2023-10-12 Thread Kito Cheng
but anyway, I don't have a strong opinion for either way, just go ahead no matter which one you choose. On Thu, Oct 12, 2023 at 11:28 AM Kito Cheng wrote: > > Sorry for the late comment after Jeff say ok, but I guess we may > consider add "-fno-schedule-insns -fno-schedu

[PATCH v2] RISC-V: Fix the riscv_legitimize_poly_move issue on targets where the minimal VLEN exceeds 512.

2023-10-12 Thread Kito Cheng
riscv_legitimize_poly_move was expected to ensure the poly value is at most 32 times smaller than the minimal VLEN (32 being derived from '4096 / 128'). This assumption held when our mode modeling was not so precisely defined. However, now that we have modeled the mode size according to the correct

Re: [PATCH v2] RISC-V: Fix the riscv_legitimize_poly_move issue on targets where the minimal VLEN exceeds 512.

2023-10-12 Thread Kito Cheng
Committed with few changelog tweak :P On Thu, Oct 12, 2023 at 3:37 PM 钟居哲 wrote: > > LGTM > > > juzhe.zh...@rivai.ai > > > From: Kito Cheng > Date: 2023-10-13 02:40 > To: gcc-patches; kito.cheng; palmer; jeffreyalaw; rdapp; juzhe.zh

Re: [PATCH] RISC-V Regression: Fix FAIL of bb-slp-pr69907.c for RVV

2023-10-12 Thread Kito Cheng
LGTM Juzhe-Zhong 於 2023年10月12日 週四 22:45 寫道: > Like ARM SVE and GCN, add RVV. > > gcc/testsuite/ChangeLog: > > * gcc.dg/vect/bb-slp-pr69907.c: Add RVV. > > --- > gcc/testsuite/gcc.dg/vect/bb-slp-pr69907.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gcc/te

Re: Continued (Non)mutlib and stub header issue (was Re: [PATCH v2] RISC-V: Use stdint-gcc.h in rvv testsuite)

2023-10-13 Thread Kito Cheng
> When looking around, I stumbled upon commit > d0bbecb1c41 "RISC-V: Add riscv_vector.h wrapper in testsuite to > prevent pull in stdint.h from C library" >work > Which seems like a step in a right direction, but how does one ensure > that the wrapper riscv_vector.h (containing stdint-gcc.h) i

Re: [PATCH] RISC-V: Fix interrupt support for -g.

2018-07-02 Thread Kito Cheng
Hi Jim: Does it possible just combine those pattern into simple_return pattern, and then check the function type and output correct return instruction in riscv_output_return? On Tue, Jul 3, 2018 at 8:22 AM Jim Wilson wrote: > > This fixes a problem found by someone trying to use the new RISC-V in

Re: [PATCH] RISC-V: Fix interrupt support for -g.

2018-07-02 Thread Kito Cheng
Hi Jim: It's no problem with current approach, I just think it can simplify the .md file. Thanks :) On Tue, Jul 3, 2018 at 11:22 AM Jim Wilson wrote: > > On Mon, Jul 2, 2018 at 8:04 PM, Kito Cheng wrote: > > Does it possible just combine those pattern into simple_return >

[PATCH] RISC-V: Report error if function declare with different

2018-07-06 Thread Kito Cheng
Hi all: This patch implemented TARGET_MERGE_DECL_ATTRIBUTES hook to check the interrupter is all compatible, tested with rv32ima and rv64ima elf toolchain. gcc/ChangeLog 2018-07-06 Kito Cheng * config/riscv/riscv.c (enum riscv_privilege_levels): Add UNKNOWN_MODE

Re: [PATCH] RISC-V: Report error if function declare with different

2018-07-12 Thread Kito Cheng
ping. On Fri, Jul 6, 2018 at 4:38 PM Kito Cheng wrote: > > Hi all: > > This patch implemented TARGET_MERGE_DECL_ATTRIBUTES hook to check the > interrupter is all compatible, tested with rv32ima and rv64ima elf > toolchain. > > gcc/ChangeLog > 2018-07-06 Kito Cheng

[PATCH 0/0] RISC-V: Support IEEE half precision operation

2022-07-07 Thread Kito Cheng
This patch set implement _Float16 both for softfloat and hardfloat (zfh/zfhmin), _Float16 has introduced into RISC-V psABI[1] since Jul 2021 and zfh/zfhmin extension has ratified since 2022[2]. [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/172 [2] https://github.com/riscv/riscv-is

[PATCH 1/2] RISC-V: Support _Float16 type.

2022-07-07 Thread Kito Cheng
RISC-V decide use _Float16 as primary IEEE half precision type, and this already become part of psABI, this patch has added folloing support for _Float16: - Soft-float support for _Float16. - Make sure _Float16 available on C++ mode. - Name mangling for _Float16 on C++ mode. gcc/ChangeLog

[PATCH 2/2] RISC-V: Support zfh and zfhmin extension

2022-07-07 Thread Kito Cheng
Zfh and Zfhmin are extensions for IEEE half precision, both are ratified in Jan. 2022[1]: - Zfh has full set of operation like F or D for single or double precision. - Zfhmin has only provide minimal support for half precision operation, like conversion, load, store and move instructions. [1]

Re: [PATCH 1/2] RISC-V: Support _Float16 type.

2022-07-27 Thread Kito Cheng
Hi Joseph: On Wed, Jul 27, 2022 at 5:42 AM Joseph Myers wrote: > > On Thu, 7 Jul 2022, Kito Cheng wrote: > > > +/* Implement TARGET_MANGLE_TYPE. */ > > + > > +static const char * > > +riscv_mangle_type (const_tree type) > > +{ > > + /* Half-pr

[PATCH] soft-fp: Update soft-fp from glibc

2022-08-10 Thread Kito Cheng
This patch is updating all soft-fp from glibc, most changes are copyright years update, removing "Contributed by" lines and update URL for license, and changes other than those update are adding conversion function between IEEE half and 32-bit/64-bit integer, those functions are required by RISC-V

[PATCH 0/2] RISC-V: Support _Float16 type and implement zfh and zfhmin extension

2022-08-10 Thread Kito Cheng
This patch set implements Zfh and Zfhmin, adds soft-float for _Float16, and enables _Float16 type in C++ mode. Zfh and Zfhmin are extensions for IEEE half precision, both are ratified in Jan. 2022[1] v2 Changes: Fix mangling for C++ mode to fit the RISC-V psABI spec. [1] https://github.com/r

[PATCH v2 1/2] RISC-V: Support _Float16 type.

2022-08-10 Thread Kito Cheng
RISC-V decide use _Float16 as primary IEEE half precision type, and this already become part of psABI, this patch has added folloing support for _Float16: - Soft-float support for _Float16. - Make sure _Float16 available on C++ mode. - Name mangling for _Float16 on C++ mode. gcc/ChangeLog

[PATCH v2 2/2] RISC-V: Support zfh and zfhmin extension

2022-08-10 Thread Kito Cheng
Zfh and Zfhmin are extensions for IEEE half precision, both are ratified in Jan. 2022[1]: - Zfh has full set of operation like F or D for single or double precision. - Zfhmin has only provide minimal support for half precision operation, like conversion, load, store and move instructions. [1]

Re: [PATCH] RISC-V: Rename some variables of vector_block_info[NFC]

2023-10-20 Thread Kito Cheng
> 1. Remove "m_" prefix as they are not private members. Actually it's not only for private members[1], but I think it's not mandatory, anyway it's not objection, and I am OK with that, just share the doc [1] "When structs and/or classes have member functions, prefer to name data members with a l

Re: [PATCH] RISC-V: Fix ICE for the fusion case from vsetvl to scalar move[PR111927]

2023-10-23 Thread Kito Cheng
Few minor comments: On Mon, Oct 23, 2023 at 5:04 PM Juzhe-Zhong wrote: > > ICE: > > during RTL pass: vsetvl > : In function 'riscv_lms_f32': > :240:1: internal compiler error: in merge, at > config/riscv/riscv-vsetvl.cc:1997 > 240 | } > > In general compatible_p (avl_equal_p) has: > > if (

Re: [PATCH V2] RISC-V: Fix ICE for the fusion case from vsetvl to scalar move[PR111927]

2023-10-23 Thread Kito Cheng
LGTM Juzhe-Zhong 於 2023年10月23日 週一 17:41 寫道: > ICE: > > during RTL pass: vsetvl > : In function 'riscv_lms_f32': > :240:1: internal compiler error: in merge, at > config/riscv/riscv-vsetvl.cc:1997 > 240 | } > > In general compatible_p (avl_equal_p) has: > > if (next.has_vl () && next.vl_use

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

2023-10-24 Thread Kito Cheng
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 to trunk. Thanks juzhe. > > > -- > > > > Li Xu > > > > >Ok for trunk (You can commit it to the trunk now). > > > > > > > > > >For GCC-13, I'd lik

Re: [PATCH] RISC-V: Add AVL propagation PASS for RVV auto-vectorization

2023-10-24 Thread Kito Cheng
> +using namespace rtl_ssa; > +using namespace riscv_vector; > + > +/* The AVL propagation instructions and corresponding preferred AVL. > + It will be updated during the analysis. */ > +static hash_map *avlprops; Maybe put into member data of pass_avlprop? > + > +const pass_data pass_data_avl

Re: [PATCH] RISC-V: Export some functions from riscv-vsetvl to riscv-v

2023-10-25 Thread Kito Cheng
LGTM, but plz mention it's NFC in the title, no v2 needed :) On Wed, Oct 25, 2023 at 5:03 PM Juzhe-Zhong wrote: > > Address kito's comments of AVL propagation patch. > > Export the functions that are not only used by VSETVL PASS but also AVL > propagation PASS. > > No functionality change. > gcc

Re: [PATCH V2] RISC-V: Add AVL propagation PASS for RVV auto-vectorization

2023-10-26 Thread Kito Cheng
LGTM, Thanks, it's really awesome - the implementation is simpler than I expected, it's another great improvement for RISC-V GCC! Just make sure Patrick gives a green light on the testing before committing the patch :) On Wed, Oct 25, 2023 at 8:05 PM Juzhe-Zhong wrote: > > This patch addresse

Re: Re: [PATCH] RISC-V: Add rawmemchr expander.

2023-10-27 Thread Kito Cheng
Could you put it into riscv-string.cc rather than riscv-v.cc? I would like to put those builtin function expander together if possible, riscv-string.cc might little bit confuse, but it's all included in string.h On Fri, Oct 27, 2023 at 3:40 PM juzhe.zh...@rivai.ai wrote: > > LGTM. Thanks. > > ___

Re: [PATCH 1/4] RISC-V: Recategorize "prefetch" availabilities

2023-10-30 Thread Kito Cheng
> Unless Kito feels otherwise I would suggest keeping a distinct API > interface for each case. Yeah, I think they should have a distinct API.

Re: [RFC] RISC-V: Support -mcmodel=large.

2023-10-30 Thread Kito Cheng
> Overall it looks pretty good. Does Andestech have a copyright > assignment in place? Or are you contributing under the DCO rule? Kuan-Lin Chen is Andestech folk, and Andestech have signed copyright assignment for most GNU toolchain components I believe :) > https://gcc.gnu.org/dco.html > > J

Re: [PATCH] RISC-V: Early expand DImode vec_duplicate in RV32 system

2023-11-06 Thread Kito Cheng
Could you add a testcase? other than that LGTM. On Mon, Nov 6, 2023 at 8:27 PM Juzhe-Zhong wrote: > > An ICE was discovered in recent rounding autovec support: > > config/riscv/riscv-v.cc:4314 >65 | } > | ^ > 0x1fa5223 riscv_vector::validate_change_or_fail(rtx_def*, rtx_def**, > rtx_def

Re: Re: [PATCH] RISC-V: Early expand DImode vec_duplicate in RV32 system

2023-11-06 Thread Kito Cheng
___ > juzhe.zh...@rivai.ai > > > From: Kito Cheng > Date: 2023-11-06 20:38 > To: Juzhe-Zhong > CC: gcc-patches; kito.cheng; jeffreyalaw; rdapp.gcc > Subject: Re: [PATCH] RISC-V: Early expand DImode vec_duplicate in RV32 system > Could you add a t

Re: [PATCH] RISC-V: VECT: Remember to assert any_known_not_updated_vssa

2023-11-06 Thread Kito Cheng
> Oh, you're right! I should have checked the master branch first... and > I was even wondering why it wasn't marked as such. Should perhaps > cherry pick this for gcc-13-with-riscv-opts? gcc-13-with-riscv-opts mostly maintained by Ventana folks, so maybe ask Jeff if you want to cherry pick into

Re: [PATCH] RISC-V: Fix -march option parsing when `p` extension exists.

2021-01-21 Thread Kito Cheng
> ([gnu.org #1673033] Xing GUO), but I haven’t got response so far. Not sure if > this patch can be accepted as a small bugfix patch. If not, I’m happy to > wait until FSF prove it. > > Best Regards, > Xing > > On Jan 22, 2021, at 2:26 PM, Kito Cheng wrote: > >

[PATCH] PR target/98743: Fix ICE in convert_move for RISC-V

2021-02-01 Thread Kito Cheng
- Check `TO` mode is not BLMmode before call store_expr, calling store_expr with BLKmode will cause ICE. - Verified with riscv64, x86_64 and aarch64, no introduce new regression. Note: Those logic was introduced by 3e60ddeb8220ed388819bb3f14e8caa9309fd3c2, so I cc Jakub for reivew. gc

Re: [PATCH] PR target/98743: Fix ICE in convert_move for RISC-V

2021-02-01 Thread Kito Cheng
> > - Check `TO` mode is not BLMmode before call store_expr, calling store_expr > >with BLKmode will cause ICE. > > How do you end up with a SUBREG_PROMOTED* of something that has bitsize of 0 > (GET_MODE_BITSIZE of BLKmode is 0, right)? to_rtx is already having a mode other than BLKmode in t

[PATCH v2] PR target/98743: Fix ICE in convert_move for RISC-V

2021-02-01 Thread Kito Cheng
- Check `from` mode is not BLMmode before call store_expr, calling store_expr with BLKmode will cause ICE. - Verified with riscv64, x86_64 and aarch64, no introduce new regression. Note: Those logic was introduced by 3e60ddeb8220ed388819bb3f14e8caa9309fd3c2, so I cc Jakub for reivew.

Re: [PATCH v2] PR target/98743: Fix ICE in convert_move for RISC-V

2021-02-02 Thread Kito Cheng
Hi Jakub: Thanks for your review, committed with testcase movement. On Tue, Feb 2, 2021 at 4:41 PM Jakub Jelinek wrote: > > On Tue, Feb 02, 2021 at 03:21:24PM +0800, Kito Cheng wrote: > > - Check `from` mode is not BLMmode before call store_expr, calling > > store_expr &

[PATCH] PR target/98878 - Incorrect multilib list for riscv*-rtems

2021-02-04 Thread Kito Cheng
- Multi-lib only check the default argument is appeared in the multilib flag list, but we didn't check the case that the flag is required but default argument didn't provide. - For example riscv*-rtems has a multilib set: rv32imafd/ilp32d;@march=rv32imafd@mabi=ilp32d And when we

[PATCH] config.sub, config.guess : Import upstream 2021-01-25.

2021-02-23 Thread Kito Cheng
Hi Does it update config.sub and config.guess, I know it's already stage 4, but the config.* stuff update should be harmless things, and we need this for RISC-V big-endian support, which is already supported in binutils 2.36. This imports from: sha1 6faca61810d335c7837f320733fe8e15a1431fc2 Chan

[PATCH] PR target/99314: Fix integer signedness issue for cpymem pattern expansion.

2021-03-04 Thread Kito Cheng
. 2021-03-05 Sinan Lin Kito Cheng gcc/ChangeLog: * config/riscv/riscv.c (riscv_block_move_straight): Change type to unsigned HOST_WIDE_INT for parameter and local variable with HOST_WIDE_INT type. (riscv_adjust_block_mem): Ditto

Re: [PATCH] RISC-V: Allow multi-lib build with different code model

2021-08-15 Thread Kito Cheng
Committed to trunk. On Wed, Jul 21, 2021 at 4:45 PM Kito Cheng wrote: > > --with-multilib-generator was only support for different ISA/ABI > combination, however code model is effect the code gen a lots it > should able to handled in multilib mechanism. > > Adding `--cmodel=`

[PATCH v2] PR target/96759 - Handle global variable assignment from misaligned structure/PARALLEL return values.

2020-09-24 Thread Kito Cheng
In g:70cdb21e579191fe9f0f1d45e328908e59c0179e, DECL/global variable has handled misaligned stores, but it didn't handle PARALLEL values, and I refer the other part of this function, I found the PARALLEL need handled by emit_group_* functions, so I add a check, and using emit_group_store if storing

[PATCH] RISC-V: Define __riscv_cmodel_medany for PIC mode.

2020-09-24 Thread Kito Cheng
- According the conclusion in RISC-V C API document, we decide to deprecat the __riscv_cmodel_pic marco - __riscv_cmodel_pic is deprecated and will removed in next GCC release. [1] https://github.com/riscv/riscv-c-api-doc/pull/11 --- gcc/config/riscv/riscv-c.c| 7 ---

Re: [PATCH v2] PR target/96759 - Handle global variable assignment from misaligned structure/PARALLEL return values.

2020-10-05 Thread Kito Cheng
ping. On Fri, Sep 25, 2020 at 2:33 PM Richard Biener wrote: > On Fri, 25 Sep 2020, Kito Cheng wrote: > > > In g:70cdb21e579191fe9f0f1d45e328908e59c0179e, DECL/global variable has > handled > > misaligned stores, but it didn't handle PARALLEL values, and I refer

[PATCH] PR target/96307: Fix KASAN option checking.

2020-10-05 Thread Kito Cheng
- Disable kasan if target is unsupported and -fasan-shadow-offset= is not given, no matter `--param asan-stack=1` is given or not. - Moving KASAN option checking testcase to gcc.dg, those testcase could be useful for all other target which not support asan. - Verifed on riscv and x86. g

[PATCH] RISC-V: Derive ABI from -march if -mabi is not present.

2020-10-05 Thread Kito Cheng
Hi Jim, Palmer and Andrew: I think this patch is kind of major change for GCC RISC-V port, so I cc all RISC-V gcc maintainer to make sure this change is fine with you guys. - Motivation of this patch: 1. Sync behavior between clang/llvm. 2. Preparation for -mcpu option support, -mcpu will

[PATCH] RISC-V: Support --target-help for -mcpu/-mtune

2022-09-29 Thread Kito Cheng
gcc/ChangeLog: * common/config/riscv/riscv-common.cc (riscv_tunes): New. (riscv_get_valid_option_values): New. (TARGET_GET_VALID_OPTION_VALUES): New. * config/riscv/riscv-cores.def (RISCV_TUNE): New, define options for tune here. (RISCV_CORE): Fix co

[PATCH] PR middle-end/88345: Honor -falign-functions=N even optimized for size.

2022-10-06 Thread Kito Cheng
From: Monk Chiang Currnetly setting of -falign-functions=N will be ignored if the function is optimized for size or marked as cold function. However function alignment requirement is needed even optimized for size in some situations, RISC-V target is an example, RISC-V kernel implement patchable

[committed] RISC-V: Add newline to the end of file [NFC]

2022-10-10 Thread Kito Cheng
gcc/ChangeLog: * config/riscv/riscv-c.cc: Add newline to the end of file. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/pragma-1.c: Add newline to the end of file. * gcc.target/riscv/rvv/base/pragma-2.c: Ditto. * gcc.target/riscv/rvv/base/pragma-3.c: Ditto.

[committed] RISC-V: Adjust testcase for rvv/base/user-1.c

2022-10-10 Thread Kito Cheng
The -march option check isn't precise enough, -march=rv*v* also mach any zve extensions. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/user-1.c: Add dg-options and drop dg-skip-if. Reported-by: Christoph Müllner Tested-by: Christoph Müllner Reviewed-by: Ju-Zhe Zhong ---

[committed] RISC-V: Add riscv_vector.h wrapper in testsuite to prevent pull in stdint.h from C library

2022-10-10 Thread Kito Cheng
For RISC-V linux/glibc toolchain will got header file not found when including stdint.h if multilib is not enabled, it because some header file will try to include gnu/stubs-.h from the system, however it only generated when multilib enabled. In order to prevent that, we introduce a wrapper for ri

[committed] RISC-V: Implement misc macro for vector extensions.

2022-03-21 Thread Kito Cheng
See also: https://github.com/riscv-non-isa/riscv-c-api-doc/pull/21 gcc/ChangeLog: * common/config/riscv/riscv-common.cc (riscv_ext_flag_table): Update flag name and mask name. * config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins): Define misc macro for vector extensio

Re: [PATCH] RISC-V: Implement ZTSO extension.

2022-03-21 Thread Kito Cheng
Hi Palmer: I guess the problem is binutils isn't included and it's too close to the GCC release, and binutils will report errors if it has any unsupported extensions. Most distro will use GCC 12 + binutils 2.38 or GCC 11 + binutils 2.38, so either combination doesn't work for march string with zt

[committed] RISC-V: Sync arch-canonicalize and riscv-common.cc

2022-04-11 Thread Kito Cheng
Currently we are sync that manually, but I guess we should re-implement arch-canonicalize in C++, so that we could reuse the stuffs from riscv-common.cc. gcc/ChangeLog: * config/riscv/arch-canonicalize: Add TODO item. (IMPLIED_EXT): Sync. (arch_canonicalize): Checking unti

[committed] RISC-V: Support -misa-spec for arch-canonicalize and multilib-generator. [PR104853]

2022-04-11 Thread Kito Cheng
We migrate the default ISA spec version from 2.2 to 20191213, but those scripts aren't updated at the same time, this patch is making both scripts support different ISA spec versions. gcc/ChangeLog: PR target/104853 * config.gcc: Pass -misa-spec to arch-canonicalize and mu

[PATCH] RISC-V: Handle different sigcontext struct layout.

2022-01-18 Thread Kito Cheng
RISC-V glibc intend to removed its own `sigcontext.h`[1] and use the linux kernel's one, however the struct layout is slightly different between those two version, fortunately they have identical layout, so we just need a magical way to detect which one we are used. libgcc/ChangeLog: * co

[committed] RISC-V: Fix testcase after bump isa spec version

2022-01-24 Thread Kito Cheng
Extension version might be different among different ISA spec version, add explicitly isa-spec version to prevent that might fail when build GCC with different default ISA version. gcc/testsuite/ChangeLog * gcc.target/riscv/attribute-19.c: Add -misa-spec=2.2 --- gcc/testsuite/gcc.target/

[committed] RISC-V: Do not emit zcisr and zifencei if i-ext is 2.0

2022-01-24 Thread Kito Cheng
I-ext 2.0 already included zicsr and zifencei, skip that prevent confusing binutils. gcc/ChangeLog * common/config/riscv/riscv-common.cc (riscv_subset_list::to_string): Skip zicsr and zifencei if I-ext is 2.0. --- gcc/common/config/riscv/riscv-common.cc | 14 -- 1 fil

[PATCH] RISC-V: Always pass -misa-spec to assembler [PR104219]

2022-01-25 Thread Kito Cheng
Add -misa-spec to OPTION_DEFAULT_SPECS to make sure -misa-spec will always pass that into assembler, that prevent GCC and binutils using different way to interpret the ISA string. gcc/ChangeLog: PR target/104219 * config.gcc (riscv*-*-*): Normalize the with_isa_spec value.

[committed] RISC-V: Fix detection of zifencei support for binutils

2022-02-05 Thread Kito Cheng
- binutils will complain version info is not found if default ISA spec is 2.2 for binutils. Error: cannot find default versions of the ISA extension `zifencei' gcc/ChangeLog: * configure.ac: Fix detection for zifencei support. * configure: Regenerate. --- gcc/configure| 2

  1   2   3   4   5   6   7   8   9   10   >