Re: [PATCH] RISC-V: Implement vec_set and vec_extract.

2023-06-12 Thread Robin Dapp via Gcc-patches
> I suggest we implement vector calling convention even though it is not > ratified yet. > We can allow calling convention to be enabled only when > --param=riscv-autovec-preference=fixed-vlmax. > We have such issue: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110119 >

Re: Re: [PATCH] RISC-V: Implement vec_set and vec_extract.

2023-06-12 Thread juzhe.zh...@rivai.ai
I suggest we implement vector calling convention even though it is not ratified yet. We can allow calling convention to be enabled only when --param=riscv-autovec-preference=fixed-vlmax. We have such issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110119 if we don't have calling convention f

[PATCH] RISC-V: Save and restore FCSR in interrupt functions to avoid program errors.

2023-06-12 Thread Jin Ma via Gcc-patches
gcc/ChangeLog: * config/riscv/riscv.cc (riscv_compute_frame_info): Allocate frame for FCSR. (riscv_for_each_saved_reg): Save and restore FCSR in interrupt functions. * config/riscv/riscv.md (riscv_frcsr): New patterns. (riscv_fscsr): Likewise. gcc/testsuite/Chang

Re: [PATCH] Add MinGW option -mcrtdll= for choosing C RunTime DLL library

2023-06-12 Thread Pali Rohár via Gcc-patches
On Monday 12 June 2023 23:13:00 Jonathan Yong wrote: > On 6/12/23 01:26, LIU Hao wrote: > > 在 2023/6/12 07:08, Jonathan Yong 写道: > > > +preprocessor is done. MinGW import library @code{msvcrt} is just a > > > +symlink (or file copy) to the other MinGW CRT import library > > > > I suggest a change

Re: [RFC] Add stdckdint.h header for C23

2023-06-12 Thread Jakub Jelinek via Gcc-patches
On Mon, Jun 12, 2023 at 09:51:02PM +, Joseph Myers wrote: > On Sat, 10 Jun 2023, Jakub Jelinek via Gcc-patches wrote: > > > I have looked at gnulib stdckdint.h and they are full of workarounds > > for various compilers, EDG doesn't do this, clang <= 14 can't multiply > > __int128, ..., so I th

Re: [PATCH v3] i386: Allow -mlarge-data-threshold with -mcmodel=large

2023-06-12 Thread Jan Beulich via Gcc-patches
On 13.06.2023 05:28, Fangrui Song wrote: > --- /dev/null > +++ b/gcc/testsuite/gcc.target/i386/large-data.c > @@ -0,0 +1,13 @@ > +/* { dg-do compile } */ > +/* { dg-require-effective-target lp64 } */ > +/* { dg-options "-O2 -mcmodel=large -mlarge-data-threshold=4" } */ > +/* { dg-final { scan-assem

Re: [PATCH 3/4] rs6000: build constant via li/lis;rldicl/rldicr

2023-06-12 Thread Jiufu Guo via Gcc-patches
Hi, David Edelsohn writes: > > On Wed, Jun 7, 2023 at 9:56 PM Jiufu Guo wrote: > > Hi, > > This patch checks if a constant is possible left/right cleaned on a rotated > value from a negative value of "li/lis". If so, we can build the constant > through "li/lis ; rldicl/rldicr". > > Boo

Re: [PATCH 1/4] rs6000: build constant via li;rotldi

2023-06-12 Thread Jiufu Guo via Gcc-patches
Hi David, David Edelsohn writes: > On Wed, Jun 7, 2023 at 9:55 PM Jiufu Guo wrote: > > Hi, > > This patch checks if a constant is possible to be rotated to/from a positive > or negative value from "li". If so, we could use "li;rotldi" to build it. > > Bootstrap and regtest pass on ppc64{,l

[PATCH v3] i386: Allow -mlarge-data-threshold with -mcmodel=large

2023-06-12 Thread Fangrui Song via Gcc-patches
When using -mcmodel=medium, large data objects larger than the -mlarge-data-threshold threshold are placed into large data sections (.lrodata, .ldata, .lbss and some variants). GNU ld and ld.lld 17 place .l* sections into separate output sections. If small and medium code model object files are m

Re: [PATCH] rs6000, fix vec_replace_unaligned builtin arguments

2023-06-12 Thread Kewen.Lin via Gcc-patches
Hi Carl, on 2023/5/31 04:41, Carl Love wrote: > GCC maintainers: > > The following patch fixes the first argument in the builtin definition > and the corresponding test cases. Initially, the builtin specification > was wrong due to a cut and past error. The documentation was fixed in: > > >

[PATCH] Fix note_defect3 function

2023-06-12 Thread Akari Takahashi via Gcc-patches
Hello, I've noticed an issue with the note_defect3 function and have prepared a patch to fix it. The function is missing a return statement, which is causing undefined behavior. This patch adds the missing return statement, ensuring that the function returns the correct value. Please consider app

Re: [PATCH ver 3] rs6000: Add builtins for IEEE 128-bit floating point values

2023-06-12 Thread Kewen.Lin via Gcc-patches
Hi Carl, on 2023/6/8 23:21, Carl Love wrote: > Kewen, GCC maintainers: > > Version 3, was able to get the overloaded version of scalar_insert_exp > to work and the change to xsxexpqp_f128_ define instruction to > work with the suggestions from Kewen. > > Version 2, I have addressed the various

Re: Ping^^: [PATCH V2] extract DF/SF/SI/HI/QI subreg from parameter word on stack

2023-06-12 Thread Jiufu Guo via Gcc-patches
Hi, Jeff Law writes: > On 5/10/23 19:20, Jiufu Guo wrote: >> >> Hi, >> >> I would like to ping: >> https://gcc.gnu.org/pipermail/gcc-patches/2023-January/609396.html >> >> We know there are a few issues related to aggregate parameter and >> returns. I'm thinking if it is ok for trunk to use t

[PATCH v6] RISC-V: Add vector psabi checking.

2023-06-12 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch adds support to check function's argument or return is vector type and throw warning if yes. There're two exceptions, - The vector_size attribute. - The intrinsic functions. Some cases that need to add -Wno-psabi to ignore the warning. gcc/ChangeLog:

Re: Re: [PATCH 3/4] [RISC-V] resolve confilct between zcmp multi push/pop and shrink-wrap-separate

2023-06-12 Thread Fei Gao
On 2023-06-13 03:26  Jeff Law wrote: > > > >On 6/6/23 23:52, Fei Gao wrote: >> Disable zcmp multi push/pop if shrink-wrap-separate is active. >> >> So in -Os that prefers smaller code size, by default shrink-wrap-separate >> is disabled while zcmp multi push/pop is enabled. >> >> And in -O2 and ot

Re: [PATCH] Make sure SCALAR_INT_MODE_P before invoke try_const_anchors

2023-06-12 Thread Jiufu Guo via Gcc-patches
Hi, Jeff Law writes: > On 6/11/23 23:44, Jiufu Guo wrote: >> Richard Biener writes: >> >>> On Fri, 9 Jun 2023, Jiufu Guo wrote: >>> Hi, Richard Biener writes: > On Fri, 9 Jun 2023, Jiufu Guo wrote: > >> >> Hi, >> >> Richard Biener writes: >>>

RE: [PATCH v5] RISC-V: Add vector psabi checking.

2023-06-12 Thread Wang, Yanzhang via Gcc-patches
I think it's ok to add it to specific cases and will not affect other cases. There's not so many cases. And we can revert it after the finalization. > -Original Message- > From: Kito Cheng > Sent: Monday, June 12, 2023 10:53 PM > To: Jeff Law > Cc: Wang, Yanzhang ; gcc-patches@gcc.gnu.or

Re: Re: [PATCH V2] RISC-V: Support RVV VLA SLP auto-vectorization

2023-06-12 Thread juzhe.zh...@rivai.ai
Ok. https://gcc.gnu.org/pipermail/gcc-patches/2023-June/thread.html I have add comments as you suggested. juzhe.zh...@rivai.ai From: Jeff Law Date: 2023-06-13 07:21 To: juzhe.zhong; gcc-patches CC: kito.cheng; kito.cheng; palmer; palmer; rdapp.gcc; pan2.li Subject: Re: [PATCH V2] RISC-V: Supp

[PATCH] RISC-V: Add comments of some functions

2023-06-12 Thread juzhe . zhong
From: Juzhe-Zhong gcc/ChangeLog: * config/riscv/riscv-v.cc (rvv_builder::single_step_npatterns_p): Add comment. (shuffle_generic_patterns): Ditto. (expand_vec_perm_const_1): Ditto. --- gcc/config/riscv/riscv-v.cc | 7 +++ 1 file changed, 7 insertions(+) diff --git

Re: [PATCH] LoongArch: Set 4 * (issue rate) as the default for -falign-functions and -falign-loops

2023-06-12 Thread Lulu Cheng
在 2023/6/12 下午5:19, Xi Ruoyao 写道: On Tue, 2023-05-30 at 09:30 +0800, Lulu Cheng wrote: 在 2023/5/29 下午2:09, Xi Ruoyao 写道: On Tue, 2023-04-18 at 21:06 +0800, Lulu Cheng wrote: Hi, ruoyao: Thank you so much for making this submission. But we are testing the impact of these two alignment parame

Re: [PATCHv2, rs6000] Add two peephole2 patterns for mr. insn

2023-06-12 Thread Kewen.Lin via Gcc-patches
Hi Haochen, on 2023/6/12 10:34, HAO CHEN GUI wrote: > Hi, > This patch adds two peephole2 patterns which help convert certain insn > sequences to "mr." instruction. These insn sequences can't be combined in > combine pass. > > Compared to last version, it adds a new mode iterator "Q" which sh

Re: [PATCH] rs6000: replace '(const_int 0)' to 'unspec:BLK [(const_int 0)]' for stack_tie

2023-06-12 Thread Jiufu Guo via Gcc-patches
Hi David, David Edelsohn writes: > Hi, Jiufu > > This definitely seems to be a better solution. > > The TARGET_CONST_ANCHOR change should not be part of this patch. Also > there is no ChangeLog for the patch. Thanks a lot for your quick review!! And sorry for the sending this patch in a hurr

[PATCH 0/9] vect: Move costing next to the transform for vect load

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch series follows Richi's suggestion at the link [1], which suggest structuring vectorizable_load to make costing next to the transform, in order to make it easier to keep costing and the transform in sync. For now, it's a known issue that what we cost can be inconsistent with what we tran

[PATCH 7/9] vect: Adjust vectorizable_load costing on VMAT_CONTIGUOUS_REVERSE

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_CONTIGUOUS_REVERSE in function vectorizable_load. We don't call function vect_model_load_cost for it any more. This change makes us not miscount some required vector permutation as the associated test case shows. gcc/ChangeLog: * tree-vect-st

[PATCH 5/9] vect: Adjust vectorizable_load costing on VMAT_GATHER_SCATTER

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_GATHER_SCATTER in function vectorizable_load. We don't call function vect_model_load_cost for it any more. It's mainly for gather loads with IFN or emulated gather loads, it follows the handlings in function vect_model_load_cost. This patch shouldn't

[PATCH 4/9] vect: Adjust vectorizable_load costing on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP in function vectorizable_load. We don't call function vect_model_load_cost for them any more. As PR82255 shows, we don't always need a vector construction there, moving costing next to the transform can make us only cos

[PATCH 8/9] vect: Adjust vectorizable_load costing on VMAT_CONTIGUOUS_PERMUTE

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_CONTIGUOUS_PERMUTE in function vectorizable_load. We don't call function vect_model_load_cost for it any more. As the affected test case gcc.target/i386/pr70021.c shows, the previous costing can under-cost the total generated vector loads as for VMAT_C

[PATCH 9/9] vect: Adjust vectorizable_load costing on VMAT_CONTIGUOUS

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_CONTIGUOUS in function vectorizable_load. We don't call function vect_model_load_cost for it any more. It removes function vect_model_load_cost which becomes useless and unreachable now. gcc/ChangeLog: * tree-vect-stmts.cc (vect_model_load_co

[PATCH 2/9] vect: Adjust vectorizable_load costing on VMAT_GATHER_SCATTER && gs_info.decl

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adds one extra argument cost_vec to function vect_build_gather_load_calls, so that we can do costing next to the tranform in vect_build_gather_load_calls. For now, the implementation just follows the handlings in vect_model_load_cost, it isn't so good, so placing one FIXME for any furthe

[PATCH 3/9] vect: Adjust vectorizable_load costing on VMAT_INVARIANT

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_INVARIANT in function vectorizable_load. We don't call function vect_model_load_cost for it any more. To make the costing on VMAT_INVARIANT better, this patch is to query hoist_defs_of_uses for hoisting decision, and add costs for different "where" bas

[PATCH 6/9] vect: Adjust vectorizable_load costing on VMAT_LOAD_STORE_LANES

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_LOAD_STORE_LANES in function vectorizable_load. We don't call function vect_model_load_cost for it any more. It follows what we do in the function vect_model_load_cost, and shouldn't have any functional changes. gcc/ChangeLog: * tree-vect-stm

[PATCH 1/9] vect: Move vect_model_load_cost next to the transform in vectorizable_load

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch is an initial patch to move costing next to the transform, it still adopts vect_model_load_cost for costing but moves and duplicates it down according to the handlings of different vect_memory_access_types, hope it can make the subsequent patches easy to review. This patch should not ha

RE: [PATCH V2] RISC-V: Enhance RVV VLA SLP auto-vectorization with decompress operation

2023-06-12 Thread Li, Pan2 via Gcc-patches
Committed, thanks Jeff. Pan -Original Message- From: Gcc-patches On Behalf Of Jeff Law via Gcc-patches Sent: Tuesday, June 13, 2023 3:43 AM To: juzhe.zh...@rivai.ai; gcc-patches@gcc.gnu.org Cc: kito.ch...@sifive.com; pal...@rivosinc.com; rdapp@gmail.com Subject: Re: [PATCH V2] RISC-

RE: [PATCH] RISC-V: Fix V_WHOLE && V_FRACT iterator requirement

2023-06-12 Thread Li, Pan2 via Gcc-patches
Committed, thanks Jeff. Pan -Original Message- From: Gcc-patches On Behalf Of Jeff Law via Gcc-patches Sent: Tuesday, June 13, 2023 3:54 AM To: juzhe.zh...@rivai.ai; Robin Dapp ; gcc-patches Cc: Kito.cheng ; palmer Subject: Re: [PATCH] RISC-V: Fix V_WHOLE && V_FRACT iterator requirem

[PATCH v4] Add condition coverage profiling

2023-06-12 Thread Jørgen Kvalsvik via Gcc-patches
This patch adds support in gcc+gcov for modified condition/decision coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of test/code coverage and it is particularly important in the avation and automotive industries for safety-critical applications. MC/DC it is required for or reco

Re: [PATCH] rs6000: replace '(const_int 0)' to 'unspec:BLK [(const_int 0)]' for stack_tie

2023-06-12 Thread David Edelsohn via Gcc-patches
Hi, Jiufu This definitely seems to be a better solution. The TARGET_CONST_ANCHOR change should not be part of this patch. Also there is no ChangeLog for the patch. This generally looks correct and consistent with other ports. I want to give Segher a chance to double check it, if he wishes. Tha

[wwwdocs] cxx-dr-status: Update from C++ Core Language Issue TOC, Revision 111

2023-06-12 Thread Marek Polacek via Gcc-patches
A biiig update with 100 new DRs. Also updated to reflect that DR 976 has been implemented. W3C validated. Pushed. commit d558d0a4f3407696d3f2ed868926a09a289e032e Author: Marek Polacek Date: Mon Jun 12 20:06:34 2023 -0400 cxx-dr-status: Update from C++ Core Language Issue TOC, Revision 1

Re: [PATCH] RISC-V: Basic VLS code gen for RISC-V

2023-06-12 Thread Jeff Law via Gcc-patches
On 5/30/23 17:37, juzhe.zhong wrote: Oh. I forgot we need vl/vtype regnum dependency. It seems extending vla pattern with vls mode is unavoidable. So I think we can define_insn_and _spit and split intructions after RA so that we can get benefits from general rtl code patterns. So you're

Re: [PATCH V2] RISC-V: Support RVV VLA SLP auto-vectorization

2023-06-12 Thread Jeff Law via Gcc-patches
On 6/6/23 21:19, juzhe.zh...@rivai.ai wrote: From: Juzhe-Zhong This patch enables basic VLA SLP auto-vectorization. Consider this following case: void f (uint8_t *restrict a, uint8_t *restrict b) { for (int i = 0; i < 100; ++i) { a[i * 8 + 0] = b[i * 8 + 7] + 1; a[i * 8

Re: [PATCH] Add MinGW option -mcrtdll= for choosing C RunTime DLL library

2023-06-12 Thread Jonathan Yong via Gcc-patches
On 6/12/23 01:26, LIU Hao wrote: 在 2023/6/12 07:08, Jonathan Yong 写道: +preprocessor is done. MinGW import library @code{msvcrt} is just a +symlink (or file copy) to the other MinGW CRT import library I suggest a change to this line:    symlink to (or a copy of) another MinGW CRT import libr

PING: Re: [PATCH 1/3] testsuite: move handle-multiline-outputs to before check for blank lines

2023-06-12 Thread David Malcolm via Gcc-patches
Please can someone review this testsuite patch: https://gcc.gnu.org/pipermail/gcc-patches/2023-May/620275.html Thanks Dave On Wed, 2023-05-31 at 14:06 -0400, David Malcolm wrote: > I have followup patches that require checking for multiline patterns > that have blank lines within them, so this

[PATCH v7 6/6] libstdc++: make std::is_object dispatch to new built-in traits

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_object to dispatch to new built-in traits, __is_function, __is_reference, and __is_void. libstdc++-v3/ChangeLog: * include/std/type_traits (is_object): Use new built-in traits, __is_function, __is_reference, and __is_void. (is_object_v): Likewise. S

[PATCH v7 5/6] c++, libstdc++: implement __is_void built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_void. Since the new built-in name is __is_void, to avoid unintentional macro replacement, this patch also involves the removal of the existing __is_void in helper_functions.h and cpp_type_traits.h and renaming __is_void to is_void in the test fil

[PATCH v7 4/6] libstdc++: use new built-in trait __is_function for std::is_function

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_function to dispatch to new built-in trait __is_function. libstdc++-v3/ChangeLog: * include/std/type_traits (is_function): Use __is_function built-in trait. (is_function_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_tr

[PATCH v7 3/6] c++: implement __is_function built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_function. gcc/cp/ChangeLog: * cp-trait.def: Define __is_function. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_FUNCTION. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

[PATCH v7 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_reference to dispatch to new built-in trait __is_reference. libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __is_reference built-in trait. (is_reference_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/ty

[PATCH v7 1/6] c++: implement __is_reference built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __is_reference. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_REFERENCE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/te

[PATCH v7 0/6] c++, libstdc++: get std::is_object to dispatch to new built-in traits

2023-06-12 Thread Ken Matsui via Gcc-patches
Hi, This patch series gets std::is_object to dispatch to built-in traits and implements the following built-in traits, on which std::object depends. * __is_reference * __is_function * __is_void std::is_object was depending on them with disjunction and negation. __not_<__

[PATCH v6 5/6] c++, libstdc++: implement __is_void built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_void. Since the new built-in name is __is_void, to avoid unintentional macro replacement, this patch also involves the removal of the existing __is_void in helper_functions.h and cpp_type_traits.h and renaming __is_void to is_void in the test fil

[PATCH v6 6/6] libstdc++: make std::is_object dispatch to new built-in traits

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_object to dispatch to new built-in traits, __is_function, __is_reference, and __is_void. libstdc++-v3/ChangeLog: * include/std/type_traits (is_object): Use new built-in traits, __is_function, __is_reference, and __is_void. (is_object_v): Likewise. S

[PATCH v6 3/6] c++: implement __is_function built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_function. gcc/cp/ChangeLog: * cp-trait.def: Define __is_function. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_FUNCTION. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

[PATCH v6 4/6] libstdc++: use new built-in trait __is_function for std::is_function

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_function to dispatch to new built-in trait __is_function. libstdc++-v3/ChangeLog: * include/std/type_traits (is_function): Use __is_function built-in trait. (is_function_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_tr

[PATCH v6 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_reference to dispatch to new built-in trait __is_reference. libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __is_reference built-in trait. (is_reference_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/ty

[PATCH v6 1/6] c++: implement __is_reference built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __is_reference. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_REFERENCE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/te

[PATCH v6 0/6] c++, libstdc++: get std::is_object to dispatch to new built-in traits

2023-06-12 Thread Ken Matsui via Gcc-patches
Hi, This patch series gets std::is_object to dispatch to built-in traits and implements the following built-in traits, on which std::object depends. * __is_reference * __is_function * __is_void std::is_object was depending on them with disjunction and negation. __not_<__

Re: [PATCH] Avoid duplicate vector initializations during RTL expansion.

2023-06-12 Thread Jeff Law via Gcc-patches
On 6/11/23 10:15, Roger Sayle wrote: This middle-end patch avoids some redundant RTL for vector initialization during RTL expansion. For the simple test case: typedef __int128 v1ti __attribute__ ((__vector_size__ (16))); __int128 key; v1ti foo() { return (v1ti){key}; } the middle-end

[PATCH v5 6/6] libstdc++: make std::is_object dispatch to new built-in traits

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_object to dispatch to new built-in traits, __is_function, __is_reference, and __is_void. libstdc++-v3/ChangeLog: * include/std/type_traits (is_object): Use new built-in traits, __is_function, __is_reference, and __is_void. (__is_object): Define this

[PATCH v5 5/6] c++, libstdc++: implement __is_void built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_void. Since the new built-in name is __is_void, to avoid unintentional macro replacement, this patch also involves the removal of the existing __is_void in helper_functions.h and cpp_type_traits.h and renaming __is_void to is_void in the test fil

[PATCH v5 4/6] libstdc++: use new built-in trait __is_function for std::is_function

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_function to dispatch to new built-in trait __is_function. libstdc++-v3/ChangeLog: * include/std/type_traits (is_function): Use __is_function built-in trait. (is_function_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_tr

Re: Splitting up 27_io/basic_istream/ignore/wchar_t/94749.cc (takes too long)

2023-06-12 Thread Mike Stump via Gcc-patches
On Jun 12, 2023, at 1:35 AM, Bernhard Reutner-Fischer wrote: > > On Sat, 10 Jun 2023 11:29:36 -0700 > Mike Stump wrote: > >> On Jun 9, 2023, at 2:47 PM, Bernhard Reutner-Fischer >> wrote: > >>>But well. Either way, what >>> should we do about remote env, i

[PATCH v5 3/6] c++: implement __is_function built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_function. gcc/cp/ChangeLog: * cp-trait.def: Define __is_function. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_FUNCTION. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

[PATCH v5 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_reference to dispatch to new built-in trait __is_reference. libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __is_reference built-in trait. (is_reference_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/ty

[PATCH v5 1/6] c++: implement __is_reference built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __is_reference. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_REFERENCE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/te

[PATCH v5 0/6] c++, libstdc++: get std::is_object to dispatch to new built-in traits

2023-06-12 Thread Ken Matsui via Gcc-patches
Hi, This patch series gets std::is_object to dispatch to built-in traits and implements the following built-in traits, on which std::object depends. * __is_reference * __is_function * __is_void std::is_object was depending on them with disjunction and negation. __not_<__

Re: [PATCH 1/2] Implementation of new RISCV optimizations pass: fold-mem-offsets.

2023-06-12 Thread Jeff Law via Gcc-patches
On 6/12/23 01:32, Manolis Tsamis wrote: + for (ref_link = ref_chain; ref_link; ref_link = ref_link->next) +{ + /* Problem getting some definition for this instruction. */ + if (ref_link->ref == NULL) + return NULL; + if (DF_REF_INSN_INFO (ref_link->ref) == NULL) +

Re: [RFC] Add stdckdint.h header for C23

2023-06-12 Thread Joseph Myers
On Sat, 10 Jun 2023, Jakub Jelinek via Gcc-patches wrote: > I have looked at gnulib stdckdint.h and they are full of workarounds > for various compilers, EDG doesn't do this, clang <= 14 can't multiply > __int128, ..., so I think the header belongs into the compiler rather > than C library, becaus

Re: [PATCH 1/2] Implementation of new RISCV optimizations pass: fold-mem-offsets.

2023-06-12 Thread Jeff Law via Gcc-patches
On 6/12/23 01:41, Manolis Tsamis wrote: I also think that's where this should end up since most of the pass is target independent anyway. I just couldn't figure out what would be a proper way to model the propagation rules for each target. Is a target hook necessary for that? No hook should

Re: [PATCH] combine: Narrow comparison of memory and constant

2023-06-12 Thread Jeff Law via Gcc-patches
On 6/12/23 01:57, Stefan Schulze Frielinghaus via Gcc-patches wrote: Comparisons between memory and constants might be done in a smaller mode resulting in smaller constants which might finally end up as immediates instead of in the literal pool. For example, on s390x a non-symmetric compariso

[PATCH] Fortran: fix passing of zero-sized array arguments to procedures [PR86277]

2023-06-12 Thread Harald Anlauf via Gcc-patches
Dear all, the attached - actually rather small - patch is the result of a rather intensive session with Mikael in an attempt to fix the situation that we did not create proper temporaries when passing zero-sized array arguments to procedures. When the dummy argument was declared as OPTIONAL, in m

Re: [PATCH] Make sure SCALAR_INT_MODE_P before invoke try_const_anchors

2023-06-12 Thread Jeff Law via Gcc-patches
On 6/11/23 23:44, Jiufu Guo wrote: Richard Biener writes: On Fri, 9 Jun 2023, Jiufu Guo wrote: Hi, Richard Biener writes: On Fri, 9 Jun 2023, Jiufu Guo wrote: Hi, Richard Biener writes: On Fri, 9 Jun 2023, Richard Sandiford wrote: guojiufu writes: Hi, On 2023-06-09 16:00,

[PATCH] c: Add stdckdint.h header for C23

2023-06-12 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch is an updated version of the patch I've posted on Saturday, on top of the 2 patches I've posted a few minutes ago. Bootstrapped/regtested on x86_64-linux and i686-linux. 2023-06-12 Jakub Jelinek * Makefile.in (USER_H): Add stdckdint.h. * ginclude/stdck

[PATCH] c, c++: Accept __builtin_classify_type (typename)

2023-06-12 Thread Jakub Jelinek via Gcc-patches
Hi! As mentioned in my stdckdint.h mail, __builtin_classify_type has a problem that argument promotion (the argument is passed to ... prototyped builtin function) means that certain type classes will simply never appear. I think it is too late to change how it behaves, lots of code in the wild mig

Re: [PATCH] RISC-V: Fix V_WHOLE && V_FRACT iterator requirement

2023-06-12 Thread Jeff Law via Gcc-patches
On 6/12/23 03:58, juzhe.zh...@rivai.ai wrote: I'd like you to defer to you commit my patch with your test (Jeff has approved my patch, just feel free to commit). Then let's go with that. Juzhe's patch + Robin's test. jeff

[PATCH] c: Add __typeof_unqual__ and __typeof_unqual support

2023-06-12 Thread Jakub Jelinek via Gcc-patches
Hi! As I mentioned in my stdckdint.h mail, I think having __ prefixed keywords for the typeof_unqual keyword which can be used in earlier language modes can be useful, not all code can be switched to C23 right away. The following patch implements that. It keeps the non-C23 behavior for it for th

Re: [PATCH V2] RISC-V: Enhance RVV VLA SLP auto-vectorization with decompress operation

2023-06-12 Thread Jeff Law via Gcc-patches
On 6/12/23 09:11, juzhe.zh...@rivai.ai wrote: From: Juzhe-Zhong According to RVV ISA: https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc We can enhance VLA SLP auto-vectorization with (16.5.1. Synthesizing vdecompress) Decompress operation. Case 1 (nunits = POLY_INT_CST [16, 16

Re: Followup on PR/109279: large constants on RISCV

2023-06-12 Thread Vineet Gupta
Hi Jeff, Thx for the detailed explanation and insight. On 6/7/23 16:44, Jeff Law wrote: With 2e886eef7f2b, define_insn_and_split "*mvconst_internal" recog() kicks in during cse1, eliding insns for a const_int.     (insn 7 6 8 2 (set (reg:DI 137) (const_int [0x1010101])) {*mvconst_int

Re: [PATCH 3/4] [RISC-V] resolve confilct between zcmp multi push/pop and shrink-wrap-separate

2023-06-12 Thread Jeff Law via Gcc-patches
On 6/6/23 23:52, Fei Gao wrote: Disable zcmp multi push/pop if shrink-wrap-separate is active. So in -Os that prefers smaller code size, by default shrink-wrap-separate is disabled while zcmp multi push/pop is enabled. And in -O2 and others that prefers speed, by default shrink-wrap-separate

Re: [PATCH] RISC-V: Add sign-extending variants for vmv.x.s.

2023-06-12 Thread Jeff Law via Gcc-patches
On 6/12/23 09:15, 钟居哲 wrote: Change +(define_insn "@pred_extract_first_sextdi" into (define_insn "*pred_extract_first_sextdi" Change +(define_insn "@pred_extract_first_sextsi" into (define_insn "*pred_extract_first_sextsi" I don't think we will call combine pattern in vector-opt.md in th

Re: [PATCH] RISC-V: Implement vec_set and vec_extract.

2023-06-12 Thread Jeff Law via Gcc-patches
On 6/12/23 08:55, Robin Dapp wrote: Hi, this implements the vec_set and vec_extract patterns for integer and floating-point data types. For vec_set we broadcast the insert value to a vector register and then perform a vslideup with effective length 1 to the requested index. vec_extract is d

Re: [PATCH V2] RISC-V: Rework Phase 5 && Phase 6 of VSETVL PASS

2023-06-12 Thread Richard Sandiford via Gcc-patches
Jeff Law via Gcc-patches writes: > On 6/9/23 04:41, juzhe.zh...@rivai.ai wrote: >> @@ -4342,135 +4510,81 @@ pass_vsetvl::cleanup_insns (void) const >> } >> } >> >> +/* Return true if the SET result is not used by any instructions. */ >> +static bool >> +has_no_uses (basic_block cfg_bb,

[committed] [PR rtl-optimization/101188] Fix reload_cse_move2add ignoring clobbers

2023-06-12 Thread Jeff Law via Gcc-patches
So as Georg-Johann discusses in the BZ, reload_cse_move2add can generate incorrect code when optimizing code with clobbers. Specifically in the case where we try to optimize a sequence of 4 operations down to 3 operations we can reset INSN to the next instruction and continue the loop. That s

Re: [PATCH] New finish_compare_by_pieces target hook (for x86).

2023-06-12 Thread Uros Bizjak via Gcc-patches
On Mon, Jun 12, 2023 at 4:03 PM Roger Sayle wrote: > > > The following simple test case, from PR 104610, shows that memcmp () == 0 > can result in some bizarre code sequences on x86. > > int foo(char *a) > { > static const char t[] = "0123456789012345678901234567890"; > return __builtin_me

Re: [PATCH v4 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference

2023-06-12 Thread Ken Matsui via Gcc-patches
Yes, I have fixed them on my side and am waiting for the test results! Thank you! On Mon, Jun 12, 2023 at 11:09 AM François Dumont wrote: > Same remark for all your alike patches. > > On 11/06/2023 04:43, Ken Matsui via Libstdc++ wrote: > > This patch gets std::is_reference to dispatch to new bu

Re: [PATCH v4 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference

2023-06-12 Thread François Dumont via Gcc-patches
Same remark for all your alike patches. On 11/06/2023 04:43, Ken Matsui via Libstdc++ wrote: This patch gets std::is_reference to dispatch to new built-in trait __is_reference. libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __is_reference built-in trait.

Re: [aarch64] Code-gen for vector initialization involving constants

2023-06-12 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 31 May 2023 at 00:23, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi Richard, > > The s32 case for single constant patch doesn't regress now after the > > above commit. > > Bootstrapped+tested on aarch64-linux-gnu, and verified that the new > > tests pass for aarch64_be-l

[committed] OpenMP: Cleanups related to the 'present' modifier

2023-06-12 Thread Tobias Burnus
Cleanup follow up to r14-1579-g4ede915d5dde93 "openmp: Add support for the 'present' modifier" committed 6 days ago. Namely: * Replace for the program → libgomp ABI GOMP_MAP_PRESENT_[ALLOC,TO,FROM,TOFROM] by the preexisting GOMP_MAP_FORCE_PRESENT but keep the other enum values (and use them

[COMMITTED 12/17] - Add a hybrid MAX_EXPR operator for integer and pointer.

2023-06-12 Thread Andrew MacLeod via Gcc-patches
Add a hybrid operator to choose between integer and pointer versions at runtime. This is the last use of the pointer table, so it is also removed. Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From cd194f582c5be3cc91e025e304e2769f61ceb6b6 Mon Sep 17 00:00:00 2001 From:

[COMMITTED 17/17] PR tree-optimization/110205 - Add some overrides.

2023-06-12 Thread Andrew MacLeod via Gcc-patches
Add some missing overrides, and add the diaptch pattern for FII which will be used for integer to float conversion. Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From 1bed4b49302e2fd7bf89426117331ae89ebdc90b Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 12 J

[COMMITTED 10/17] - Add a hybrid BIT_IOR_EXPR operator for integer and pointer.

2023-06-12 Thread Andrew MacLeod via Gcc-patches
Add a hybrid operator to choose between integer and pointer versions at runtime. Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From 80f402e832a2ce402ee1562030d5c67ebc276f7c Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Sat, 10 Jun 2023 16:33:17 -0400 Subject: [PA

[COMMITTED 15/17] - Provide a default range_operator via range_op_handler.

2023-06-12 Thread Andrew MacLeod via Gcc-patches
This provides range_op_handler with a default range_operator, so you no longer need to check if it has a valid handler or not. The valid check now turns into a "is this something other than a default operator" check.   IT means you can now simply invoke fold without checking.. ie instead of

[COMMITTED 9/17] - Add a hybrid BIT_AND_EXPR operator for integer and pointer.

2023-06-12 Thread Andrew MacLeod via Gcc-patches
Add a hybrid operator to choose between integer and pointer versions at runtime. Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From 8adb8b2fd5797706e9fbb353d52fda123545431d Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Sat, 10 Jun 2023 16:28:40 -0400 Subject: [PA

[COMMITTED 16/17] - Provide interface for non-standard operators.

2023-06-12 Thread Andrew MacLeod via Gcc-patches
This patch removes the hack introduced late last year for the non-standard range-op support. Instead of adding a a pointer to a range_operator in the header file, and then setting the operator from another file via that pointer, the table itself is extended and  we provide new #defines to decl

[COMMITTED 14/17] - Switch from unified table to range_op_table. There can be only one.

2023-06-12 Thread Andrew MacLeod via Gcc-patches
Now that the unified table is the only one,  remove it and simply use range_op_table as the class instead of inheriting from it. Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From 5bb9d2acd1987f788a52a2be9bca10c47033020a Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Da

[COMMITTED 6/17] - Move operator_min to the unified range-op table.

2023-06-12 Thread Andrew MacLeod via Gcc-patches
Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From 508645fd461ceb8b743837e24411df2e17bd3950 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Sat, 10 Jun 2023 16:09:58 -0400 Subject: [PATCH 06/17] Move operator_min to the unified range-op table. * range-op-mixed.h (c

[COMMITTED 13/17] - Remove type from range_op_handler table selection

2023-06-12 Thread Andrew MacLeod via Gcc-patches
Lucky 13.  WIth the unified table complete, it is no longer necessary to specify a type when constructing a range_op_handler. This patch removes that requirement. Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From 8934830333933349d41e62f9fd6a3d21ab71150c Mon Sep 17 00:

[COMMITTED 8/17] - Split pointer based range operators to range-op-ptr.cc

2023-06-12 Thread Andrew MacLeod via Gcc-patches
This patch moves all the pointer specific code into a new file range-op-ptr.cc Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From cb511d2209fa3a05801983a6965656734c1592c6 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Sat, 10 Jun 2023 16:17:51 -0400 Subject: [PATC

[COMMITTED 5/17] - Move operator_bitwise_or to the unified range-op table.

2023-06-12 Thread Andrew MacLeod via Gcc-patches
Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From a71ee5c2d48691280f76a90e2838d968f45de0c8 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Sat, 10 Jun 2023 16:05:33 -0400 Subject: [PATCH 05/17] Move operator_bitwise_or to the unified range-op table. * range-op-mix

[COMMITTED 4/17] - Move operator_bitwise_and to the unified range-op table.

2023-06-12 Thread Andrew MacLeod via Gcc-patches
Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From f2166fc81194a3e4e9ef185a7404551b410bb752 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Sat, 10 Jun 2023 16:02:09 -0400 Subject: [PATCH 04/17] Move operator_bitwise_and to the unified range-op table. At this point

[COMMITTED 11/17] - Add a hybrid MIN_EXPR operator for integer and pointer.

2023-06-12 Thread Andrew MacLeod via Gcc-patches
Add a hybrid operator to choose between integer and pointer versions at runtime. Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From 08f2e419b1e29f114857b3d817904abf3b4891be Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Sat, 10 Jun 2023 16:34:26 -0400 Subject: [PA

[COMMITTED 7/17] - Move operator_max to the unified range-op table.

2023-06-12 Thread Andrew MacLeod via Gcc-patches
This is the last of the integral operators, so also remove the integral table. Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From 6585fa54e0f2a54f1a398b49b5b4b6a9cd6da4ea Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Sat, 10 Jun 2023 16:10:54 -0400 Subject: [PATC

  1   2   >