Re: [RFC] GNU Vector Extension -- Packed Boolean Vectors

2023-07-02 Thread Tejas Belagod via Gcc-patches
On 6/29/23 6:55 PM, Richard Biener wrote: On Wed, Jun 28, 2023 at 1:26 PM Tejas Belagod wrote: From: Richard Biener Date: Tuesday, June 27, 2023 at 12:58 PM To: Tejas Belagod Cc: gcc-patches@gcc.gnu.org Subject: Re: [RFC] GNU Vector Extension -- Packed Boolean Vectors On Tue, Jun 27, 2

[PATCH, rs6000] Extract the element in dword0 by mfvsrd and shift/mask [PR110331]

2023-07-02 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch implements the vector element extraction by mfvsrd and shift/mask when the element is in dword0 of the vector. Originally, it generates vsplat/mfvsrd on P8 and li/vextract on P9. Since mfvsrd has lower latency than vextract and rldicl has lower latency than vsplat, the new sequence

[PATCH] Middle-end: Change order of LEN_MASK_LOAD/LEN_MASK_STORE arguments

2023-07-02 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, Richard and Richi. According to Richard's review comments: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/623405.html current len, bias and mask order is not reasonable. Change {len,mask,bias} into {len,bias,mask}. This patch is a simple fix patch, ok for trunk ?

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

2023-07-02 Thread Kewen.Lin via Gcc-patches
Hi Richi, Thanks for your review comments on this and some others! on 2023/6/30 19:37, Richard Biener wrote: > On Tue, Jun 13, 2023 at 4:07 AM Kewen Lin wrote: >> >> This patch series follows Richi's suggestion at the link [1], >> which suggest structuring vectorizable_load to make costing >> ne

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

2023-07-02 Thread Kewen.Lin via Gcc-patches
Hi Richard, on 2023/7/2 16:58, Richard Sandiford wrote: > Kewen Lin writes: >> @@ -9743,11 +9739,23 @@ vectorizable_load (vec_info *vinfo, >>unsigned int n_groups = 0; >>for (j = 0; j < ncopies; j++) >> { >> - if (nloads > 1) >> + if (nloads > 1 && !costing_p) >>

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

2023-07-02 Thread Kewen.Lin via Gcc-patches
This is version v2 rebasing from latest trunk. = 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/Chang

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

2023-07-02 Thread Kewen.Lin via Gcc-patches
This is version v2 rebasing from latest trunk. = 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 i

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

2023-07-02 Thread Kewen.Lin via Gcc-patches
Hi Richi, on 2023/6/30 19:18, Richard Biener wrote: > On Tue, Jun 13, 2023 at 4:03 AM Kewen Lin wrote: >> >> 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_

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

2023-07-02 Thread Kewen.Lin via Gcc-patches
Hi Richi, on 2023/6/30 19:11, Richard Biener wrote: > On Tue, Jun 13, 2023 at 4:03 AM Kewen Lin wrote: >> >> 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

Re: [PATCH V6] Machine Description: Add LEN_MASK_{GATHER_LOAD, SCATTER_STORE} pattern

2023-07-02 Thread juzhe.zh...@rivai.ai
Oh. Sorry. I forget update the changeLog. We hope RVV can vectorize such case into following IR: loop_len = SELECT_VL control_mask = comparison v = LEN_MASK_GATHER_LOAD (.., loop_len, control_mask, bias) LEN_SCATTER_STORE (... v, ..., loop_len, control_mask, bias) This change log is incorrect and

[PATCH V6] Machine Description: Add LEN_MASK_{GATHER_LOAD, SCATTER_STORE} pattern

2023-07-02 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, Richi and Richard. Base one the review comments from Richard: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/623405.html I add the helper function: /* Add len, bias and mask arguments according to the STMT. */ static unsigned int add_len_bias_and_mask_args (expand_

[PATCH] libstdc++: use __is_enum built-in trait

2023-07-02 Thread Ken Matsui via Gcc-patches
This patch replaces is_enum::value with __is_enum built-in trait in the type_traits header. libstdc++-v3/ChangeLog: * include/std/type_traits (__make_unsigned_selector): Use __is_enum built-in trait. (__make_signed_selector): Likewise. (__underlying_type_impl): Lik

[committed] d: Fix testcase failure of gdc.dg/Wbuiltin_declaration_mismatch2.d.

2023-07-02 Thread Iain Buclaw via Gcc-patches
Hi, Seen at least on aarch64-*-darwin, the parameters used to instantiate the shufflevector intrinsic meant the return type was __vector(int[1]), which resulted in the error: vector type '__vector(int[1])' is not supported on this platform. All instantiations have now been fixed so the expec

[PATCH] Fortran: fixes for procedures with ALLOCATABLE,INTENT(OUT) arguments [PR92178]

2023-07-02 Thread Harald Anlauf via Gcc-patches
Dear all, the attached patch fixes a long-standing issue with the order of evaluation of procedure argument expressions and deallocation of allocatable actual arguments passed to allocatable dummies with intent(out) attribute. It is based on an initial patch by Steve, handles issues pointed out b

[PATCH v7 2/4] p1689r5: initial support

2023-07-02 Thread Ben Boeckel via Gcc-patches
This patch implements support for [P1689R5][] to communicate to a build system the C++20 module dependencies to build systems so that they may build `.gcm` files in the proper order. Support is communicated through the following three new flags: - `-fdeps-format=` specifies the format for the out

[PATCH v7 4/4] c++modules: report module mapper files as a dependency

2023-07-02 Thread Ben Boeckel via Gcc-patches
It affects the build, and if used as a static file, can reliably be tracked using the `-MF` mechanism. gcc/cp/: * mapper-client.cc, mapper-client.h (open_module_client): Accept dependency tracking and track module mapper files as dependencies. * module.cc (make_map

[PATCH v7 1/4] spec: add a spec function to join arguments

2023-07-02 Thread Ben Boeckel via Gcc-patches
When passing `-o` flags to other options, the typical `-o foo` spelling leaves a leading whitespace when replacing elsewhere. This ends up creating flags spelled as `-some-option-with-arg= foo.ext` which doesn't parse properly. When attempting to make a spec function to just remove the leading whit

[PATCH v7 0/4] P1689R5 support

2023-07-02 Thread Ben Boeckel via Gcc-patches
Hi, This patch series adds initial support for ISO C++'s [P1689R5][], a format for describing C++ module requirements and provisions based on the source code. This is required because compiling C++ with modules is not embarrassingly parallel and need to be ordered to ensure that `import some_modul

[PATCH v7 3/4] c++modules: report imported CMI files as dependencies

2023-07-02 Thread Ben Boeckel via Gcc-patches
They affect the build, so report them via `-MF` mechanisms. gcc/cp/ * module.cc (do_import): Report imported CMI files as dependencies. gcc/testsuite/ * g++.dg/modules/depreport-1_a.C: New test. * g++.dg/modules/depreport-1_b.C: New test. * g++.dg/modules

Re: [PATCH] tree-ssa-math-opts: Fix up ICE in match_uaddc_usubc [PR110508]

2023-07-02 Thread Richard Biener via Gcc-patches
> Am 02.07.2023 um 16:54 schrieb Jakub Jelinek via Gcc-patches > : > > Hi! > > The match_uaddc_usubc matching doesn't require that the second > .{ADD,SUB}_OVERFLOW has REALPART_EXPR of its lhs used, only that there is > at most one. So, in the weird case where the REALPART_EXPR of it isn't

[PATCH] tree-ssa-math-opts: Fix up ICE in match_uaddc_usubc [PR110508]

2023-07-02 Thread Jakub Jelinek via Gcc-patches
Hi! The match_uaddc_usubc matching doesn't require that the second .{ADD,SUB}_OVERFLOW has REALPART_EXPR of its lhs used, only that there is at most one. So, in the weird case where the REALPART_EXPR of it isn't present, we shouldn't ICE trying to replace that REALPART_EXPR with REALPART_EXPR of

Re: [PATCH 1/2] xtensa: Fix missing mode warning in "*eqne_INT_MIN"

2023-07-02 Thread Max Filippov via Gcc-patches
On Sat, Jul 1, 2023 at 10:21 AM Takayuki 'January June' Suwa wrote: > > gcc/ChangeLog: > > * config/xtensa/xtensa.md (*eqne_INT_MIN): > Add missing ":SI" to the match_operator. > --- > gcc/config/xtensa/xtensa.md | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Regtested f

Re: [PATCH 2/2] xtensa: The use of CLAMPS instruction also requires TARGET_MINMAX, as well as TARGET_CLAMPS

2023-07-02 Thread Max Filippov via Gcc-patches
On Sat, Jul 1, 2023 at 10:21 AM Takayuki 'January June' Suwa wrote: > > Because both smin and smax requiring TARGET_MINMAX are essential to the > RTL representation. > > gcc/ChangeLog: > > * config/xtensa/xtensa.cc (xtensa_match_CLAMPS_imms_p): > Simplify. > * config/xtensa

[pushed] Darwin, Objective-C: Support -fconstant-cfstrings [PR108743].

2023-07-02 Thread Iain Sandoe via Gcc-patches
Tested on x86_64-darwin and with make pdf and an examination of the revised output. Pushed to trunk, thanks Iain --- 8< --- This support the -fconstant-cfstrings option as used by clang (and expect by some build scripts) as an alias to the target-specific -mconstant-cfstrings. The documentation

[committed] d: Add testcase from PR108962

2023-07-02 Thread Iain Buclaw via Gcc-patches
Hi, This adds testcase from PR108962 into the gdc testsuite. The issue was fixed in r14-2232 and backported to gcc-13. Regtested, committed to mainline and gcc-13 branches. Regards, Iain. --- PR d/108962 gcc/testsuite/ChangeLog: * gdc.dg/pr108962.d: New test. --- gcc/testsui

Re: [PATCH] libphobos: Handle Darwin Arm and AArch64 in fibre context asm.

2023-07-02 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Sandoe's message of Juli 2, 2023 12:22 pm: > Tested on AArch64 (Arm64) Darwin on 11.x, 13.x and master, > OK for trunk? > and backports? > thanks > Iain > > --- 8< --- > > This code currently fails to build because it contains ELF- > specific directives. This patch excludes th

[PATCH] libphobos: Handle Darwin Arm and AArch64 in fibre context asm.

2023-07-02 Thread Iain Sandoe via Gcc-patches
Tested on AArch64 (Arm64) Darwin on 11.x, 13.x and master, OK for trunk? and backports? thanks Iain --- 8< --- This code currently fails to build because it contains ELF- specific directives. This patch excludes those directives when the platform is Darwin. We do not expect switching fibres bet

Re: [PATCH V5] Machine Description: Add LEN_MASK_{GATHER_LOAD, SCATTER_STORE} pattern

2023-07-02 Thread Richard Sandiford via Gcc-patches
juzhe.zh...@rivai.ai writes: > From: Ju-Zhe Zhong > > Hi, Richi and Richard. > > This patch is adding LEN_MASK_{GATHER_LOAD,SCATTER_STORE} to allow targets > handle flow control by mask and loop control by length on gather/scatter > memory > operations. Consider this following case: > > #include

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

2023-07-02 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Tue, Jun 13, 2023 at 4:07 AM Kewen Lin wrote: >> >> 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

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

2023-07-02 Thread Richard Sandiford via Gcc-patches
Kewen Lin writes: > @@ -9743,11 +9739,23 @@ vectorizable_load (vec_info *vinfo, >unsigned int n_groups = 0; >for (j = 0; j < ncopies; j++) > { > - if (nloads > 1) > + if (nloads > 1 && !costing_p) > vec_alloc (v, nloads); > gimple *new_stmt = NUL