[committed] Re: [PATCH] libstdc++: Add missing constexpr to simd

2023-05-23 Thread Matthias Kretz via Gcc-patches
I pushed the attached patch. I kept the operator names... too late, there were already operator names in the stdx::simd implemenation anyway. ;) - Matthias On Monday, 22 May 2023 22:51:49 CEST Jonathan Wakely wrote: > On Mon, 22 May 2023 at 21:27, Matthias Kretz wrote: > > On Monday, 22 May 20

Re: [PATCH] RISC-V: Refactor the framework of RVV auto-vectorization

2023-05-23 Thread Robin Dapp via Gcc-patches
Hi Juzhe, in general I find the revised structure quite logical and it is definitely an improvement. Some abstraction are still a bit leaky but we can always refactor "on the fly". Some comments on the general parts, skipping over the later details. > bool m_has_dest_p; Why does a store not

[COMMITTED] ada: Crash on dispatching primitive referencing limited-with type

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda The compiler crashes processing a compilation unit has limited-with context clauses, and the profile of some dispatching primitive references a type visible through a limited-with clause, and the dispatching primitive has class-wide preconditions. gcc/ada/ * sem_ch1

[COMMITTED] ada: Minor fix typo in comment

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Spotted while reviewing a patch with a similar typo. gcc/ada/ * libgnat/s-mmap.adb (Mapped_Region_Record): Fix typo in comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-mmap.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

[COMMITTED] ada: Small code cleanup

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This just merges two conditional blocks depending on the same condition. gcc/ada/ * frontend.adb (Frontend): Merge two conditional blocks and adjust. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/frontend.adb | 21 - 1 file ch

[COMMITTED] ada: Fix address arithmetic issues in the runtime

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This is most notably the addition of addresses in Interfaces.C.Pointers and System.Bitfield_Utils. There is also a change to System.Stream_Attributes, which was representing a thin pointer as a record, which is not problematic per se, but is in the end, because the expanded c

[COMMITTED] ada: Remove duplicate comment

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques gcc/ada/ * sem_ch7.adb: Remove duplicate comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch7.adb | 4 1 file changed, 4 deletions(-) diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 5021d0ee04f..2610a7bba4d 100644

[COMMITTED] ada: Transfer fix for pretty-printed parentheses from GNATprove to GNAT

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Expressions with parentheses are notoriously problematic to pretty-print. In GNATprove we had a post-processing fix for them, but it is better to have this fix in the GNAT frontend repository and apply it for CodePeer as well. gcc/ada/ * pprint.adb (Expression_Image

[COMMITTED] ada: Sync different variants of interrupt handler registration

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek This patch propagates the apparently cleanest solutions between various variants of the runtime units for interrupt handler registration. In particular, the unnecessary default expressions for list cells with interrupt handler addresses are removed, the list is changed from

[COMMITTED] ada: Add new switch -gnatyz

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Arnaud Charlet Improve -gnatyx to check additional complete conditions, and introduce a new switch -gnatyz to check for unnecessary parentheses according to operator precedence rules. Enable -gnatyz as part of -gnatyg. gcc/ada/ * par-ch5.adb, style.ads, styleg.adb, styleg.ads

[COMMITTED] ada: Fix expression pretty-printer for SPARK counterexamples

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek The expression pretty-printer that is used for SPARK counterexamples was essentially duplicating the logic of First_Node/Last_Node and First_Sloc/Last_Sloc routines. Now it simply reuses those routines. gcc/ada/ * errout.adb (Paren_Required): New subsidiary

[COMMITTED] ada: Revert to old pretty-printing of internal entities for CodePeer

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Add some defensive code to get pretty-printed CodePeer outputs for ACATS back to shape. At least some of this code appears to be redundant and perhaps unnecessary, but we can this up later. Expression pretty-printer should not be called with N_Defining_Identifier nodes at al

[COMMITTED] ada: Fix endings of pretty-printed numeric literals

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When looking for the end of an numeric literal we consumed '+' and '-' characters, because they might appear in the exponent part. This was too aggressive when they separated the number from the subsequent operand, like in "123+456". Now we skip past numeric literals by stric

[COMMITTED] ada: Fix address manipulation issue in the tasking runtime

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The implementation of task attributes in the runtime defines an atomic clone of System.Address, which is awkward for targets where addresses and pointers have a specific representation, so this change replaces that with a pragma Atomic_Components on the Attribute_Array type.

[COMMITTED] ada: Add mention of what LSP stands for

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques There are multiple possible interpretations of "LSP". For example, "Language Server Protocol". This patch clarifies that the occurrences of "LSP" in GNAT's source code refer to the Liskov Substitution Principle. gcc/ada/ * einfo.ads: Mention full name of LSP. Te

[COMMITTED] ada: Suppress warning about Subprogram_Variant failing at run time

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Warning about check failing at run time is likely spurious for mutually recursive subprograms with multiple variant clauses. These will be non-trivial to detect, so we simply suppress the warning altogether for all subprogram variants. gcc/ada/ * exp_prag.adb (Expan

[COMMITTED] ada: Spurious errors on class-wide preconditions of private types

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda The compiler reports spurious errors processing the class-wide preconditions of a dispatching primitive of a private type T, when the class-wide precondition invokes another dispatching primitive of T that has the same name as a record component of T. gcc/ada/ * sem

[COMMITTED] ada: Make string interpolation part of the core extensions

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Raphael Amiard gcc/ada/ * scng.adb (Scan): Replace occurrences of All_Extensions_Allowed by Core_Extensions_Allowed. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/scng.adb | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/

[COMMITTED] ada: Fix internal error on quantified expression with predicated type

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The problem is that the special function created by the compiler to check the predicate does not inherit the public status of the type, because it is generated as part of the freezing of the quantified expression, which occurs from within a couple of intermediate internal scop

[COMMITTED] ada: Remove special-case for parentheses in expansion for GNATprove

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When expanding of inequality operators for GNAT we were adding extra parens, supposedly to "fix Sprint output" (source print); for GNATprove we didn't, as these extra parens were leading to wrong columns for check messages. Adding these extra parens couldn't be a right, beca

[COMMITTED] ada: Add default value at initialization for CodePeer

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Yannick Moy Avoid spurious alarm by CodePeer analysis by adding default value for a variable initialization. gcc/ada/ * sem_util.adb (Check_Node): Add default init on local Id. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 3 ++- 1 file changed,

[COMMITTED] ada: Add tags to warnings controlled by Warn_On_Redundant_Constructs

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Some of the calls to Error_Msg_N controlled by the flag Warn_On_Redundant_Constructs missed the "?r?" tag in their message string. This caused a misleading "[enabled by default]" label to appear next to the error message. Spotted while adding a warning about duplicated choic

[COMMITTED] ada: Cleanup inconsistent iteration over exception handlers

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When detecting duplicate choices in exception handlers we had inconsistent pairs of First/Next_Non_Pragma and First_Non_Pragma/Next. This was harmless, because exception choices don't allow pragmas at all, e.g.: when Program_Error | Constraint_Error | ...; -- pragma not

[COMMITTED] ada: Ignore accessibility actuals in expression pretty-printer

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Extra actual parameters for accessibility checks are confusing for the expression pretty-printer that is used by CodePeer. It seems that nodes created for the accessibility checks should use the Sloc of the source expression of accessibility checks, not the target. However, t

[COMMITTED] ada: Facilitate proof of Interfaces.C.To_Ada

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Yannick Moy Nightly runs of GNATprove fail on proof of the assertion following the loop. Add a loop invariant to facilitate that proof. gcc/ada/ * libgnat/i-c.adb (To_Ada): Add loop invariant. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/i-c.adb | 1 +

[COMMITTED] ada: ICE on BIP call in class-wide function return within instance

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Gary Dismukes The compiler blows up (such as with a Storage_Error or Assert_Failure) on a call to a limited build-in-place function occurring in the return for a function with a limited class-wide result. Such a function should include extra formals for a task master and activation chain (b

[COMMITTED] ada: Rework fix for internal error on quantified expression with predicated type

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou It turns out that skipping compiler-generated block scopes is problematic when computing the public status of a subprogram, because this subprogram may end up being nested in the elaboration procedure of a package spec or body, in which case it may not be public. This replace

[COMMITTED] ada: Remove unnecessary call to Detach.

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Vadim Godunko Holder object is constant and protected from modification by tampering rules. gcc/ada/ * libgnat/a-coinho__shared.adb (Constant_Reference): Remove call of Detach (Query_Element): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc

[COMMITTED] ada: Fix bogus error on predicated limited record declared in protected type

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This happens when the limited record is initialized with a function call because of a couple of issues: incorrect tree sharing when building the predicate check and too late freezing for a compiler-generated subtype. It turns out that building the predicate check manually is

[COMMITTED] ada: Accept and analyze new aspect Exceptional_Cases

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Add new aspect Exceptional_Cases, which is intended for SPARK and describes in which cases an exception will be raised, and optionally supply a postcondition that shall be verified in this case. The implementation is heavily modeled after Subprogram_Variant, which in turn wa

[COMMITTED] ada: Fix oversight in latest change

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The resolution must be identical inside and outside the System hierarchy. gcc/ada/ * sem_res.adb (Resolve_Intrinsic_Operator): Always perform the same resolution for the special mod operator of System.Storage_Elements. Tested on x86_64-pc-linux-gnu, committe

[COMMITTED] ada: Turn assertions into defensive code in error locations

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek We pretty-print numeric literals that do not come from source by relying on their Sloc. This generally works well, but sporadically the Sloc is set wrongly. We might want to trace and fix such occurrences, but for now it is simpler to replace an otherwise reasonable assertion

[COMMITTED] ada: Fix minor address arithmetic issues in System.Dwarf_Lines

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou Offset calculations should use the operator of System.Storage_Elements. gcc/ada/ * libgnat/s-dwalin.adb (Enable_Cache): Use the subtract operator of System.Storage_Elements to compute the offset. (Symbolic_Address): Likewise. Tested on x86_64-pc-linu

Re: [PATCH] Fix handling of non-integral bit-fields in native_encode_initializer

2023-05-23 Thread Eric Botcazou via Gcc-patches
> OK. Thanks! > Can we handle non-integer bitfields by recursing with a temporary buffer to > encode it byte-aligned and then apply shifting and masking to get it in > place? Or is that not worth it? Certainly doable, something along these lines is implemented in varasm.c to output these non-in

[COMMITTED] ada: Remove the body of System.Storage_Elements

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou All the subprograms declared in the unit have convention Intrinsic and their current implementation makes some implicit assumptions that are not valid universally, so it is replaced by a direct expansion. This is mostly straightforward because Resolve_Intrinsic_Operator alrea

[COMMITTED] ada: Update ghost code for proof of integer input functions

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Claire Dross Introduce new ghost helper functions to facilitate proof. gcc/ada/ * libgnat/s-valueu.adb (Scan_Raw_Unsigned): Use new helpers. * libgnat/s-vauspe.ads (Raw_Unsigned_Starts_As_Based_Ghost, Raw_Unsigned_Is_Based_Ghost): New ghost helper functions.

[COMMITTED] ada: Fix reference to Ada issue in comment

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques gcc/ada/ * sem_disp.adb: Fix reference to Ada issue in comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_disp.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index b0

[COMMITTED] ada: Fix latent issue in support for protected entries

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The problem is that, unlike for protected subprograms, the expansion of cleanups for protected entries is not delayed when they contain package instances with a body, so the cleanups are generated twice and this may yield two finalizers if the secondary stack is used in the en

[COMMITTED] ada: A discriminant of a variable is not a variable

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird gcc/ada/ * sem_util.adb (Is_Variable): Correctly return False for a selected component name of the form Some_Object.Some_Discriminant, even if Some_Object is a variable. We don't want to allow such a name as an actual parameter in a call

[COMMITTED] ada: Remove redundant parentheses from System.Stack_Checking.Operations

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Patrick Bernardi gcc/ada/ * libgnat/s-stchop.adb (Stack_Check): Remove redundant parentheses. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-stchop.adb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/ada/libgnat/s-stchop.ad

[COMMITTED] ada: Fix address arithmetic issues in the expanded code

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This is most notably the addition of addresses in Expand_Interface_Thunk. There is also a small change to Expand_Dispatching_Call, which was directly accessing a class-wide interface object as a tag, thus giving rise later to unchecked conversions between either the root or th

Re: [PATCH] libiberty: On Windows pass a >32k cmdline through a response file.

2023-05-23 Thread Jonathan Yong via Gcc-patches
On 5/22/23 13:25, Costas Argyris wrote: Currently on Windows, when CreateProcess is called with a command-line that exceeds the 32k Windows limit, we get a very bad error: "CreateProcess: No such file or directory" This patch detects the case where this would happen and writes the long command-

[COMMITTED] ada: Fix resolution of mod operator of System.Storage_Elements

2023-05-23 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This operator is special because the left operand is of Address type while the right operand and the result are of Storage_Offset type (but we raise Constraint_Error if the right operand is not positive) and it needs to be resolved to the type of the left operand to implement

Re: [C PATCH v3] Fix ICEs related to VM types in C 2/2

2023-05-23 Thread Richard Biener via Gcc-patches
On Tue, May 23, 2023 at 8:24 AM Martin Uecker wrote: > > Am Dienstag, dem 23.05.2023 um 08:13 +0200 schrieb Richard Biener: > > On Mon, May 22, 2023 at 7:24 PM Martin Uecker via Gcc-patches > > wrote: > > > > > > > > > > > > This version contains the middle-end changes for PR109450 > > > and test

Re: Re: [PATCH] RISC-V: Refactor the framework of RVV auto-vectorization

2023-05-23 Thread juzhe.zh...@rivai.ai
Hi, Robin. >> Why does a store not have a destination (as commented below)? OK, V2 patch will have more comments. >> m_all_unmasked_p or m_fully_unmasked_p? OK. >> Apart from the insn-centric name, couldn't we also decide this >> based on the context later? In the vector-builtins.cc we have >>

Re: Re: [PATCH] RISC-V: Refactor the framework of RVV auto-vectorization

2023-05-23 Thread Kito Cheng via Gcc-patches
> ARM uses rtx operands[] in many places and I personally prefer this way since > it will make codes much cleaner. > I dislike the way making the function argument with multiple operand ,like > this: > void func(rtx dest, rtx src1, rtx src2, ) > If we are doing this, we will need to add helper

[PATCH V2] RISC-V: Refactor the framework of RVV auto-vectorization

2023-05-23 Thread juzhe . zhong
From: Juzhe-Zhong This patch is to refactor the framework of RVV auto-vectorization. Since we find out are keep adding helpers && wrappers when implementing auto-vectorization. It will make the RVV auto-vectorizaiton very messy. After double check my downstream RVV GCC, assemble all auto-vector

Re: Re: [PATCH] RISC-V: Refactor the framework of RVV auto-vectorization

2023-05-23 Thread juzhe.zh...@rivai.ai
Yeah. I know. Like ARM does everywhere: (define_expand "vcond" [(set (match_operand:SVE_ALL 0 "register_operand") (if_then_else:SVE_ALL (match_operator 3 "comparison_operator" [(match_operand:SVE_I 4 "register_operand") (match_operand:SVE_I 5 "nonmemory_operand")]) (match_

Re: [C PATCH v3] Fix ICEs related to VM types in C 2/2

2023-05-23 Thread Martin Uecker via Gcc-patches
Am Dienstag, dem 23.05.2023 um 10:18 +0200 schrieb Richard Biener: > On Tue, May 23, 2023 at 8:24 AM Martin Uecker > wrote: > > > > Am Dienstag, dem 23.05.2023 um 08:13 +0200 schrieb Richard Biener: > > > On Mon, May 22, 2023 at 7:24 PM Martin Uecker via Gcc-patches > > > wrote: > > > > > > > >

Re: [PATCH] libatomic: Provide gthr.h default implementation

2023-05-23 Thread Sebastian Huber
On 10.01.23 16:38, Sebastian Huber wrote: On 19/12/2022 17:02, Sebastian Huber wrote: Build libatomic for all targets.  Use gthr.h to provide a default implementation.  If the thread model is "single", then this implementation will not work if for example atomic operations are used for thread/

[PATCH] testsuite, analyzer: Fix testcases with fclose

2023-05-23 Thread Christophe Lyon via Gcc-patches
The gcc.dg/analyzer/data-model-4.c and gcc.dg/analyzer/torture/conftest-1.c fail with recent glibc headers and succeed with older headers. The new error message is: warning: use of possibly-NULL 'f' where non-null expected [CWE-690] [-Wanalyzer-possible-null-argument] Like similar previous fixes

Re: [PATCH V2] RISC-V: Refactor the framework of RVV auto-vectorization

2023-05-23 Thread Robin Dapp via Gcc-patches
Hi Juzhe, thanks, IMHO it's clearer with the changes now. There are still things that could be improved but it is surely an improvement over what we currently have. Therefore I'd vote to go ahead so we can continue with more expanders and changes. Still, we should be prepared for more refactori

Re: Re: [PATCH V2] RISC-V: Refactor the framework of RVV auto-vectorization

2023-05-23 Thread juzhe.zh...@rivai.ai
Oh, Thanks. Let's wait for Kito's final approved. juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-05-23 17:44 To: juzhe.zhong; gcc-patches CC: rdapp.gcc; kito.cheng; kito.cheng; palmer; palmer; jeffreyalaw Subject: Re: [PATCH V2] RISC-V: Refactor the framework of RVV auto-vectorization Hi Juz

[PATCH] tree-optimization/109849 - missed code hoisting

2023-05-23 Thread Richard Biener via Gcc-patches
The following fixes code hoisting to properly consider ANTIC_OUT instead of ANTIC_IN. That's a bit expensive to re-compute but since we no longer iterate we're doing this only once per BB which should be acceptable. This avoids missing hoistings to the end of blocks where something in the block c

Re: Re: [PATCH V2] RISC-V: Refactor the framework of RVV auto-vectorization

2023-05-23 Thread Kito Cheng via Gcc-patches
Lgtm, we can always improve later, I am not intend to block things too :) juzhe.zh...@rivai.ai 於 2023年5月23日 週二 17:46 寫道: > Oh, Thanks. > Let's wait for Kito's final approved. > > > > juzhe.zh...@rivai.ai > > From: Robin Dapp > Date: 2023-05-23 17:44 > To: juzhe.zhong; gcc-patches > CC: rdapp.gcc

[PATCH][committed] aarch64: PR target/109855 Add predicate and constraints to define_subst in aarch64-simd.md

2023-05-23 Thread Kyrylo Tkachov via Gcc-patches
Hi all, In this PR we ICE because the substituted pattern for mla "lost" its predicate and constraint for operand 0 because the define_subst template: [(set (match_operand: 0) (vec_concat: (match_dup 1) (match_operand:VDZ 2 "aarch64_simd_or_scalar_imm_zero")))]) Uses

[PATCH] RISC-V: Fix warning of vxrm pattern

2023-05-23 Thread juzhe . zhong
From: Juzhe-Zhong I just notice the warning: ../../../riscv-gcc/gcc/config/riscv/vector.md:618:1: warning: source missing a mode? gcc/ChangeLog: * config/riscv/vector.md: Add mode. --- gcc/config/riscv/vector.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/

RE: Re: [PATCH V2] RISC-V: Refactor the framework of RVV auto-vectorization

2023-05-23 Thread Li, Pan2 via Gcc-patches
Committed, thanks Kito. Pan -Original Message- From: Gcc-patches On Behalf Of Kito Cheng via Gcc-patches Sent: Tuesday, May 23, 2023 5:57 PM To: 钟居哲 Cc: Robin Dapp ; gcc-patches ; Kito.cheng ; palmer ; palmer ; jeffreyalaw Subject: Re: Re: [PATCH V2] RISC-V: Refactor the framework o

[PATCH 2/2] aarch64: Provide FPR alternatives for some bit insertions [PR109632]

2023-05-23 Thread Richard Sandiford via Gcc-patches
At -O2, and so with SLP vectorisation enabled: struct complx_t { float re, im; }; complx_t add(complx_t a, complx_t b) { return {a.re + b.re, a.im + b.im}; } generates: fmovw3, s1 fmovx0, d0 fmovx1, d2 fmovw2, s3 bfi x

[PATCH 1/2] md: Allow to refer to the value of int iterator FOO

2023-05-23 Thread Richard Sandiford via Gcc-patches
In a follow-up patch, I wanted to use an int iterator to iterate over various possible values of a const_int. But one problem with int iterators was that there was no way of referring to the current value of the iterator. This is unlike modes and codes, which provide automatic "mode", "MODE", "co

Re: [PATCH 2/2] aarch64: Provide FPR alternatives for some bit insertions [PR109632]

2023-05-23 Thread Richard Biener via Gcc-patches
On Tue, May 23, 2023 at 12:38 PM Richard Sandiford via Gcc-patches wrote: > > At -O2, and so with SLP vectorisation enabled: > > struct complx_t { float re, im; }; > complx_t add(complx_t a, complx_t b) { > return {a.re + b.re, a.im + b.im}; > } > > generates: > > fmov

[PATCH] Dump ANTIC_OUT before pruning it

2023-05-23 Thread Richard Biener via Gcc-patches
This dumps ANTIC_OUT before pruning clobbered mems from it as part of the ANTIC_IN compute. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-ssa-pre.cc (compute_antic_aux): Dump the correct ANTIC_OUT. --- gcc/tree-ssa-pre.cc | 7 --- 1 file changed, 4 inser

Re: [PATCH 2/2] aarch64: Provide FPR alternatives for some bit insertions [PR109632]

2023-05-23 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Tue, May 23, 2023 at 12:38 PM Richard Sandiford via Gcc-patches > wrote: >> >> At -O2, and so with SLP vectorisation enabled: >> >> struct complx_t { float re, im; }; >> complx_t add(complx_t a, complx_t b) { >> return {a.re + b.re, a.im + b.im}; >> }

RE: [PATCH] arm: Fix ICE due to infinite splitting [PR109800]

2023-05-23 Thread Kyrylo Tkachov via Gcc-patches
Hi Alex, > -Original Message- > From: Alex Coplan > Sent: Thursday, May 11, 2023 12:15 PM > To: gcc-patches@gcc.gnu.org > Cc: ni...@redhat.com; Richard Earnshaw ; > Ramana Radhakrishnan ; Kyrylo Tkachov > > Subject: [PATCH] arm: Fix ICE due to infinite splitting [PR109800] > > Hi, > >

Re: [PATCH] c-family: implement -ffp-contract=on

2023-05-23 Thread Alexander Monakov via Gcc-patches
On Tue, 23 May 2023, Richard Biener wrote: > > Ah, no, I deliberately decided against that, because that way we would go > > via gimplify_arg, which would emit all side effects in *pre_p. That seems > > wrong if arguments had side-effects that should go in *post_p. > > Ah, true - that warrants a

Re: [PATCH] RISC-V: Refactor the framework of RVV auto-vectorization

2023-05-23 Thread Richard Sandiford via Gcc-patches
"juzhe.zh...@rivai.ai" writes: > Yeah. I know. > Like ARM does everywhere: > (define_expand "vcond" > [(set (match_operand:SVE_ALL 0 "register_operand") > (if_then_else:SVE_ALL > (match_operator 3 "comparison_operator" > [(match_operand:SVE_I 4 "register_operand") >(match_op

Re: [PATCH] Fix type error of 'switch (SUBREG_BYTE (op)).'

2023-05-23 Thread Richard Sandiford via Gcc-patches
Jeff Law via Gcc-patches writes: > On 5/17/23 03:03, Jin Ma wrote: >> For example: >> (define_insn "mov_lowpart_sidi2" >>[(set (match_operand:SI0 "register_operand" "=r") >> (subreg:SI (match_operand:DI 1 "register_operand" " r") 0))] >>"TARGET_64BIT" >>"mov\t%0,%1

Re: [PATCH V12] VECT: Add decrement IV iteration loop control by variable amount support

2023-05-23 Thread juzhe.zh...@rivai.ai
Bootstrap on X86 passed. Ok for trunk? Thanks. juzhe.zh...@rivai.ai From: juzhe.zhong Date: 2023-05-22 16:38 To: gcc-patches CC: richard.sandiford; rguenther; Ju-Zhe Zhong Subject: [PATCH V12] VECT: Add decrement IV iteration loop control by variable amount support From: Ju-Zhe Zhong gcc/C

[patch]: Implement PR104327 for avr

2023-05-23 Thread Georg-Johann Lay
PR target/104327 not only affects s390 but also avr: The avr backend pre-sets some options depending on optimization level. The inliner then thinks that always_inline functions are not eligible for inlining and terminates with an error. Proposing the following patch that implements TARGET_CAN_INL

[COMMITTED] Remove buggy special case in irange::invert [PR109934].

2023-05-23 Thread Aldy Hernandez via Gcc-patches
[Andrew, do you remotely remember what if anything this did? It came from a wholesale merge from our long forgotten branch, so there's no history on the specifics of it. Not important, I'm just curious. It was probably me high on something.] This patch removes a buggy special case in irange::in

Re: [COMMITTED] Remove buggy special case in irange::invert [PR109934].

2023-05-23 Thread Aldy Hernandez via Gcc-patches
BTW, we should probably backport this to god knows how many branches. Aldy On Tue, May 23, 2023 at 2:58 PM Aldy Hernandez wrote: > > [Andrew, do you remotely remember what if anything this did? It came > from a wholesale merge from our long forgotten branch, so there's no > history on the speci

Re: [PATCH] RISC-V: Fix warning of vxrm pattern

2023-05-23 Thread Jeff Law via Gcc-patches
On 5/23/23 04:09, juzhe.zh...@rivai.ai wrote: From: Juzhe-Zhong I just notice the warning: ../../../riscv-gcc/gcc/config/riscv/vector.md:618:1: warning: source missing a mode? gcc/ChangeLog: * config/riscv/vector.md: Add mode. While I'm a big fan of the gen* warnings, I do wish t

[PATCH V2] RISC-V: Add RVV comparison autovectorization

2023-05-23 Thread juzhe . zhong
From: Juzhe-Zhong This patch enable RVV auto-vectorization including floating-point unorder and order comparison. The testcases are leveraged from Richard. So include Richard as co-author. Co-Authored-By: Richard Sandiford gcc/ChangeLog: * config/riscv/autovec.md (@vcond_mask_): New

Re: [PATCH V2] RISC-V: Add RVV comparison autovectorization

2023-05-23 Thread Robin Dapp via Gcc-patches
> +(define_expand "vec_cmp" > + [(set (match_operand: 0 "register_operand") > + (match_operator: 1 "comparison_operator" > + [(match_operand:VI 2 "register_operand") > +(match_operand:VI 3 "register_operand")]))] > + "TARGET_VECTOR" > + { > +riscv_vector::expand_vec_cmp (op

RE: [PATCH] RISC-V: Fix warning of vxrm pattern

2023-05-23 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, May 23, 2023 9:43 PM To: juzhe.zh...@rivai.ai; gcc-patches@gcc.gnu.org Cc: kito.ch...@gmail.com; kito.ch...@sifive.com; pal...@dabbelt.com; pal...@rivosinc.com; rdapp..

Re: [PATCH] vect: Missed opportunity to use [SU]ABD

2023-05-23 Thread Oluwatamilore Adebayo via Gcc-patches
> > + if (reject_unsigned && TYPE_UNSIGNED (abs_type)) > > +return false; > > + if (!ANY_INTEGRAL_TYPE_P (abs_type) || TYPE_OVERFLOW_WRAPS (abs_type)) > > +return false; > > Could you explain the reject_unsigned behaviour? I'd have expected > TYPE_OVERFLOW_WRAPS (abs_type) to reject the

[PATCH] [arm] testsuite: make mve_intrinsic_type_overloads-int.c libc-agnostic

2023-05-23 Thread Christophe Lyon via Gcc-patches
Glibc defines int32_t as 'int' while newlib defines it as 'long int'. Although these correspond to the same size, g++ complains when using the

Re: [PATCH] [arm] testsuite: make mve_intrinsic_type_overloads-int.c libc-agnostic

2023-05-23 Thread Stamatis Markianos-Wright via Gcc-patches
On 23/05/2023 15:41, Christophe Lyon wrote: Glibc defines int32_t as 'int' while newlib defines it as 'long int'. Although these correspond to the same size, g++ complains when using the

[PATCH 1/2] Missed opportunity to use [SU]ABD

2023-05-23 Thread Oluwatamilore Adebayo via Gcc-patches
From: oluade01 This adds a recognition pattern for the non-widening absolute difference (ABD). gcc/ChangeLog: * doc/md.texi (sabd, uabd): Document them. * internal-fn.def (ABD): Use new optab. * optabs.def (sabd_optab, uabd_optab): New optabs, * tree-vect-pattern

[PATCH V3] RISC-V: Add RVV comparison autovectorization

2023-05-23 Thread juzhe . zhong
From: Juzhe-Zhong This patch enable RVV auto-vectorization including floating-point unorder and order comparison. The testcases are leveraged from Richard. So include Richard as co-author. Co-Authored-By: Richard Sandiford gcc/ChangeLog: * config/riscv/autovec.md (@vcond_mask_): New

Re: Re: [PATCH V2] RISC-V: Add RVV comparison autovectorization

2023-05-23 Thread 钟居哲
Hi, Robin. >> Don't you want to use your shiny new operand passing style here as >> with the other expanders? H, I do this just following ARM code style. You can see I do pass rtx[] for expand_vcond and pass rtx,rtx,rtx for expand_vec_cmp. Well, I just follow ARM SVE implementation (You can c

[PATCH] Generic vector op costing adjustment

2023-05-23 Thread Richard Biener via Gcc-patches
This is a small adjustment to the work done for PR108752 and better reflects the cost of the generated sequence. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/108752 * tree-vect-stmts.cc (vectorizable_operation): For bit operations with

[PATCH] tree-optimization/109747 - SLP cost of CTORs

2023-05-23 Thread Richard Biener via Gcc-patches
The x86 backend looks at the SLP node passed to the add_stmt_cost hook when costing vec_construct, looking for elements that require a move from a GPR to a vector register and cost that. But since vect_prologue_cost_for_slp decomposes the cost for an external SLP node into individual pieces this c

[PATCH] Account for vector splat GPR->XMM move cost

2023-05-23 Thread Richard Biener via Gcc-patches
The following also accounts for a GPR->XMM move cost for splat operations and properly guards eliding the cost when moving from memory only for SSE4.1 or HImode or larger operands. This doesn't fix the PR fully yet. Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? Thanks, Richard.

Re: [PATCH] Account for vector splat GPR->XMM move cost

2023-05-23 Thread Uros Bizjak via Gcc-patches
On Tue, May 23, 2023 at 5:18 PM Richard Biener wrote: > > The following also accounts for a GPR->XMM move cost for splat > operations and properly guards eliding the cost when moving from > memory only for SSE4.1 or HImode or larger operands. This > doesn't fix the PR fully yet. > > Bootstrapped

[COMMITTED] i386: Add V8QI and V4QImode partial vector shift operations

2023-05-23 Thread Uros Bizjak via Gcc-patches
Add V8QImode and V4QImode vector shift patterns that call into ix86_expand_vecop_qihi_partial. Generate special sequences for constant count operands. The patch regresses g++.dg/pr91838.C - as explained in PR91838, the test returns different results, depending on whether V8QImode shift pattern is

Re: [PATCH] tree-optimization/109747 - SLP cost of CTORs

2023-05-23 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > The x86 backend looks at the SLP node passed to the add_stmt_cost > hook when costing vec_construct, looking for elements that require > a move from a GPR to a vector register and cost that. But since > vect_prologue_cost_for_slp decomposes the cost for an external > SLP

[avr,committed] Fix cost computation for bit insertions.

2023-05-23 Thread Georg-Johann Lay
Applied this patchlet that implements proper cost computation of (set (zero_extract (...) ...)) kind patterns that do single-bit (inverted) bit insertions. Johann -- Improve cost computation for single-bit bit insertions. Some miscomputation of rtx_costs lead to sub-optimal code for single-

Re: [patch] mcore: Fix sprintf length warning

2023-05-23 Thread Jeff Law via Gcc-patches
On 5/22/23 17:58, Jan-Benedict Glaw wrote: Hi! One of the supplied argument strings is unneccesarily long (c-sky, using basically the same code, fixed it to a shorter length) and this fixes overflow warnings, as GCC fails to deduce that the full 256 bytes for load_op[] are not used at all.

[PATCH] PR middle-end/109840: Preserve popcount/parity type in match.pd.

2023-05-23 Thread Roger Sayle
PR middle-end/109840 is a regression introduced by my recent patch to fold popcount(bswap(x)) as popcount(x). When the bswap and the popcount have the same precision, everything works fine, but this optimization also allowed a zero-extension between the two. The oversight is that we need to be s

[PATCH] libstdc++: use using instead of typedef for type_traits

2023-05-23 Thread Ken Matsui via Gcc-patches
Since the type_traits header is a C++11 header file, using can be used instead of typedef. This patch provides more readability, especially for long type names. libstdc++-v3/ChangeLog: * include/std/type_traits: Use using instead of typedef --- libstdc++-v3/include/std/type_traits | 158

RISC-V: Use extension instructions instead of bitwise "and"

2023-05-23 Thread Jivan Hakobyan via Gcc-patches
In the case where the target supports extension instructions, it is preferable to use that instead of doing the same in other ways. For the following case void foo (unsigned long a, unsigned long* ptr) { ptr[0] = a & 0xUL; ptr[1] &= 0xUL; } GCC generates foo: li

Re: [PATCH v2] xtensa: Optimize '(x & CST1_POW2) != 0 ? CST2_POW2 : 0'

2023-05-23 Thread Max Filippov via Gcc-patches
On Mon, May 22, 2023 at 10:48 PM Takayuki 'January June' Suwa wrote: > > On 2023/05/23 11:27, Max Filippov wrote: > > Hi Suwa-san, > > Hi! > > > This change introduces a bunch of test failures on big endian configuration. > > I believe that's because the starting bit position for zero_extract is

Re: [PATCH 2/2] xtensa: Merge '*addx' and '*subx' insn patterns into one

2023-05-23 Thread Max Filippov via Gcc-patches
On Mon, May 22, 2023 at 12:06 AM Takayuki 'January June' Suwa wrote: > > By making use of the 'addsub_operator' added in the last patch. > > gcc/ChangeLog: > > * config/xtensa/xtensa.md (*addsubx): Rename from '*addx', > and change to also accept '*subx' pattern. > (*subx):

Re: [PATCH V2] RISC-V: Add RVV comparison autovectorization

2023-05-23 Thread Robin Dapp via Gcc-patches
>>> Don't you want to use your shiny new operand passing style here as >>> with the other expanders? > H, I do this just following ARM code style. > You can see I do pass rtx[] for expand_vcond and pass rtx,rtx,rtx for > expand_vec_cmp. > Well, I just follow ARM SVE implementation (You can che

[PATCH] libstdc++: Add missing constexpr to simd_neon

2023-05-23 Thread Matthias Kretz via Gcc-patches
Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/109261 * include/experimental/bits/simd_neon.h (_S_reduce): Add constexpr and make NEON implementation conditional on not __builtin_is_constant_evaluated. --- .../include/experimental/bits/simd_n

Re: [PATCH v2] rs6000: Add buildin for mffscrn instructions

2023-05-23 Thread Peter Bergner via Gcc-patches
On 5/23/23 12:24 AM, Kewen.Lin wrote: > on 2023/5/23 01:31, Carl Love wrote: >> The builtins were requested for use in GLibC. As of version 2.31 they >> were added as inline asm. They requested a builtin so the asm could be >> removed. > > So IMHO we also want the similar support for mffscrn, tha

[PATCH] Dump if a pattern fails after having printed applying it

2023-05-23 Thread Andrew Pinski via Gcc-patches
While trying to understand how to use the ! operand for match patterns, I noticed that the debug dumps would print out applying a pattern but nothing when it was rejected in the end. This was confusing me. This adds that by emitting a dump for the failed case. Note the patch is little more complex

[PATCH] RISC-V: Fix magic number of RVV auto-vectorization expander

2023-05-23 Thread juzhe . zhong
From: Juzhe-Zhong This simple patch fixes the magic number, replaced by enum to make code more reasonable. Ok for trunk ? gcc/ChangeLog: * config/riscv/riscv-v.cc (expand_vec_series): Fix magic number. (expand_const_vector): Ditto. (legitimize_move): Ditto. (exp

Re: Re: [PATCH V2] RISC-V: Add RVV comparison autovectorization

2023-05-23 Thread juzhe.zh...@rivai.ai
Ok. Let's wait for Kito's more comments. Thanks. juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-05-24 05:07 To: 钟居哲; gcc-patches CC: rdapp.gcc; kito.cheng; kito.cheng; palmer; palmer; Jeff Law; richard.sandiford Subject: Re: [PATCH V2] RISC-V: Add RVV comparison autovectorization >>> Don't y

  1   2   >