RE: [PATCH v1 2/4] RISC-V: Add test for vec_duplicate + vssubu.vv combine case 0 with GR2VR cost 0, 2 and 15

2025-06-27 Thread Li, Pan2
> > + DEF_VX_BINARY_CASE_2_WRAP(T, SAT_U_SUB_FUNC(T), sat_add) \ > Shouldn't that be sat_sub here? Oh, Yes, should be sat_sub, but happen to work for test, let me update it in v2. Pan -Original Message- From: Robin Dapp Sent: Friday, June 27, 2025 2:37 PM To: Li, Pan2 ; gcc-patches

Re: [PATCH][RFC] c/96570 - diagnostics for conversions to/from time_t

2025-06-27 Thread Richard Biener
On Thu, 26 Jun 2025, Joseph Myers wrote: > On Thu, 26 Jun 2025, Richard Biener wrote: > > > The following prototypes diagnostics for conversions to/from time_t > > where the source/destination does not have sufficient precision for it. > > I've lumped this into -Wconversion for the moment and did

Re: [PATCH] gcc: middle-end opt for trigonometric pi-based functions builtins

2025-06-27 Thread Jakub Jelinek
On Fri, Jun 27, 2025 at 08:17:46AM +0200, Tobias Burnus wrote: > Hi Yuao, > > > Yuao Ma wrote: > > >//but the testcases don't seem to be conditionalized on this. Would the > > >//new tests fail if gcc is built against an insufficiently recent version > > >//of mpfr, > … > > The test case is indee

[PATCH][committed][docs]: fix a typo in used attribute documentation

2025-06-27 Thread Tamar Christina
This fixes a small typo in the Label attributes docs. Committed as obvious. Thanks, Tamar gcc/ChangeLog: * doc/extend.texi: Fix typo in unsed attribute docs. --- diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 69c6512074642ece47f1f9a3d7bdde20ec800d40..6e80ef8a2055c2015973

Re: [PATCH] vect: Misalign checks for gather/scatter.

2025-06-27 Thread Richard Biener
On Thu, 26 Jun 2025, Robin Dapp wrote: > > + bool is_misaligned = scalar_align < inner_vectype_sz; > > + bool is_packed = scalar_align > 1 && is_misaligned; > > + > > + *misalignment = !is_misaligned ? 0 : inner_vectype_sz - scalar_align; > > + > > + if (targetm.vectorize.suppo

Re: [PATCH] c++/modules: Ensure type of partial spec VAR_DECL is consistent with its template [PR120644]

2025-06-27 Thread Nathaniel Shead
On Wed, Jun 25, 2025 at 11:52:14AM -0400, Jason Merrill wrote: > On 6/25/25 9:02 AM, Nathaniel Shead wrote: > > On Tue, Jun 24, 2025 at 12:10:09PM -0400, Patrick Palka wrote: > > > On Tue, 24 Jun 2025, Jason Merrill wrote: > > > > > > > On 6/23/25 5:41 PM, Nathaniel Shead wrote: > > > > > Bootstra

[PATCH v3 3/6] bitint: Allow unused bits when testing extended _BitInt ABIs

2025-06-27 Thread Yang Yujie
In LoongArch psABI, large _BitInt(N) (N > 64) objects are only extended to fill the highest 8-byte chunk that contains any used bit, but the size of such a large _BitInt type is a multiple of their 16-byte alignment. So there may be an entire unused 8-byte chunk that is not filled by extension, an

[PATCH v3 5/6] LoongArch: Prioritize target-specific makefile fragments

2025-06-27 Thread Yang Yujie
libgcc/ChangeLog: * config.host: Remove unused code. Include LoongArch-specific tmake_files after the OS-specific ones. --- libgcc/config.host | 31 --- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/libgcc/config.host b/libgcc/config.h

[PATCH v3 1/6] bitint: Allow mode promotion of _BitInt types

2025-06-27 Thread Yang Yujie
For targets that treat small _BitInts like the fundamental integral types, we should allow their machine modes to be promoted in the same way. gcc/ChangeLog: * explow.cc (promote_function_mode): Add a case for small/medium _BitInts. (promote_mode): Same. --- gcc/explow.cc

[PATCH v3 4/6] bitint: Do not optimize away conversion to _BitInt before a VCE

2025-06-27 Thread Yang Yujie
A _BitInt value may rely on a conversion to become properly extended. So a conversion to _BitInt is not trivially removable even if the types of the result and the operand have the same precision and size. This patches fixes gcc.dg/torture/bitint-64.c at -O2 on LoongArch, which fails because exten

[PATCH v3 6/6] LoongArch: Add support for _BitInt [PR117599]

2025-06-27 Thread Yang Yujie
This patch adds support for C23's _BitInt for LoongArch. >From the LoongArch psABI[1]: > _BitInt(N) objects are stored in little-endian order in memory > and are signed by default. > > For N ≤ 64, a _BitInt(N) object have the same size and alignment > of the smallest fundamental integral type tha

[Patch] Fortran/OpenACC: Permit PARAMETER as 'var' in clauses (+ ignore)

2025-06-27 Thread Tobias Burnus
Background: In real-world code, one can find: !$ACC DECLARE COPYIN(c1es, c2es, ...) as here for the ICON weather model. This clearly implies that other compilers accept and, potentially, require those. For better compatibility with real-world use, the just released OpenACC 3.4 now permits PARAME

Re: [PATCH] Fix misoptimization of CONSTRUCTOR with reverse SSO

2025-06-27 Thread Richard Biener
On Thu, Jun 26, 2025 at 12:34 PM Eric Botcazou wrote: > > Hi, > > fold_ctor_reference already punts on a CONSTRUCTOR whose type has reverse > storage order, but it can be invoked in a couple of places on a CONSTRUCTOR > with native storage order that has been wrapped in a VIEW_CONVERT_EXPR to a >

[PATCH v3 2/6] expand: Reduce unneeded _BitInt extensions

2025-06-27 Thread Yang Yujie
For targets that set the "extended" flag in TARGET_C_BITINT_TYPE_INFO, we assume small _BitInts to be internally extended after arithmetic operations. In this case, an extra extension during RTL expansion can be avoided. gcc/ChangeLog: * expr.cc (expand_expr_real_1): Do not call r

[PATCH v3 0/1] Implement default_accessor.

2025-06-27 Thread Luc Grosheintz
Changes since v2: * Check requirement that ElementType is neither an array type nor an abstract class type. Luc Grosheintz (1): libstdc++: Implement default_accessor from mdspan. libstdc++-v3/include/std/mdspan | 31 ++ libstdc++-v3/src/c++23/std.cc.in

[PATCH v3 1/1] libstdc++: Implement default_accessor from mdspan.

2025-06-27 Thread Luc Grosheintz
libstdc++-v3/ChangeLog: * include/std/mdspan (default_accessor): New class. * src/c++23/std.cc.in: Register default_accessor. * testsuite/23_containers/mdspan/accessors/default.cc: New test. * testsuite/23_containers/mdspan/accessors/default_neg.cc: New test. Signe

[PATCH v3 0/6] LoongArch: Add support for _BitInt [PR117599]

2025-06-27 Thread Yang Yujie
Main changes from v2: 1. Cache the result of info.extended during expansion of every function. 2. Do not insert extra conversion for _BitInt extension before __atomic_compare_exchange. Instead, prevent the conversion generated with the compare-and-swap loop from being optimized away. (Not

Re: [PATCH v2 1/1] libstdc++: Implement default_accessor from mdspan.

2025-06-27 Thread Luc Grosheintz
On 6/27/25 08:53, Tomasz Kaminski wrote: On Thu, Jun 26, 2025 at 3:40 PM Luc Grosheintz wrote: On 6/13/25 12:40, Luc Grosheintz wrote: libstdc++-v3/ChangeLog: * include/std/mdspan (default_accessor): New class. * src/c++23/std.cc.in: Register default_accessor. * tes

Re: [PATCH v3 1/6] bitint: Allow mode promotion of _BitInt types

2025-06-27 Thread Jakub Jelinek
On Fri, Jun 27, 2025 at 03:33:34PM +0800, Yang Yujie wrote: > For targets that treat small _BitInts like the fundamental > integral types, we should allow their machine modes to be promoted > in the same way. > > gcc/ChangeLog: > > * explow.cc (promote_function_mode): Add a case for >

Re: [PATCH] vect: Misalign checks for gather/scatter.

2025-06-27 Thread Robin Dapp
Maybe we can pass a scalar mode to the hook when we ask for SCATTER/GATHER? That might need fixups in other targets of course, but it would make it clear what we're asking for? How about an additional argument bool gather_scatter to make it more explicit? Then we could just if (gather_scatt

Re: [PATCH v3 2/6] expand: Reduce unneeded _BitInt extensions

2025-06-27 Thread Jakub Jelinek
On Fri, Jun 27, 2025 at 03:33:35PM +0800, Yang Yujie wrote: > @@ -11291,6 +11296,13 @@ expand_expr_real_1 (tree exp, rtx target, > machine_mode tmode, >type = TREE_TYPE (exp); >mode = TYPE_MODE (type); >unsignedp = TYPE_UNSIGNED (type); > + if (bitint_extended == -1 && TREE_CODE (type

[pushed] libstdc++: Fix Darwin bootstrap by simplifying ver file syntax.

2025-06-27 Thread Iain Sandoe
Tested on x86_64-darwin, powerpc64le-linux, pushed to trunk to fix bootstrap on Darwin, thanks, Iain --- 8< --- The symbol parsing script does not handle the closing brace of a new symbol group and the identifier for the inherited group to be on different lines, which r16-1708-gaf5b72cf9f564 intr

Re: [PATCH v3 4/6] bitint: Do not optimize away conversion to _BitInt before a VCE

2025-06-27 Thread Jakub Jelinek
On Fri, Jun 27, 2025 at 03:33:37PM +0800, Yang Yujie wrote: > A _BitInt value may rely on a conversion to become properly extended. > So a conversion to _BitInt is not trivially removable even if the > types of the result and the operand have the same precision and size. > > This patches fixes gcc

Re: [PATCH v3 5/6] LoongArch: Prioritize target-specific makefile fragments

2025-06-27 Thread Jakub Jelinek
On Fri, Jun 27, 2025 at 03:33:38PM +0800, Yang Yujie wrote: > libgcc/ChangeLog: > > * config.host: Remove unused code. Include LoongArch-specific > tmake_files after the OS-specific ones. This should be reviewed by LoongArch maintainers. Jakub

Re: [PATCH V3] x86: Enable separate shrink wrapping

2025-06-27 Thread H.J. Lu
On Tue, Jun 17, 2025 at 10:04 PM Cui, Lili wrote: > > From: Lili Cui > > Hi Uros, > > This is patch v3, the main changes are as follows. > > 1. Added a pro_epilogue_adjust_stack_add_nocc in i386.md to add memory > clobber for lea/mov. > 2. Adjusted some formatting issues. > 3. Added scan-rtl-dum

[PATCH v2 2/5] libstdc++: Check prerequite of extents::extents.

2025-06-27 Thread Luc Grosheintz
Previously the prerequite of the extents ctors that static_extent(i) == dynamic_extent || extent(i) == other.extent(i). was not checked. This commit add the __glibcxx_assert and test it. libstdc++-v3/ChangeLog: * include/std/mdspan (extents): Check prerequite of the ctor that

[PATCH v2 1/4] RISC-V: Combine vec_duplicate + vssubu.vv to vssubu.vx on GR2VR cost

2025-06-27 Thread pan2 . li
From: Pan Li This patch would like to combine the vec_duplicate + vssubu.vv to the vssubu.vx. From example as below code. The related pattern will depend on the cost of vec_duplicate from GR2VR. Then the late-combine will take action if the cost of GR2VR is zero, and reject the combination if

Re: [PATCH v4 1/1] libstdc++: Implement default_accessor from mdspan.

2025-06-27 Thread Tomasz Kaminski
Also, for single patch (not-patch series), you do not need to have [PATCH 0/N], simple [PATCH] and then [PATCH v2] also works. On Fri, Jun 27, 2025 at 11:11 AM Tomasz Kaminski wrote: > > > On Fri, Jun 27, 2025 at 11:06 AM Luc Grosheintz > wrote: > >> libstdc++-v3/ChangeLog: >> >> * incl

[PATCH] libstdc++: Use runtime format for internal format calls in chrono [PR110739]

2025-06-27 Thread Tomasz Kamiński
This patch adjust all internal std::format call inside of __formatter_chrono, to use runtime format stirng and thus avoid compile time checking of validity of the format string. Majority of cases are covered by calling newly introduced _S_empty_fs() function that returns __Runtime_format_string con

Re: [PATCH] vect: Misalign checks for gather/scatter.

2025-06-27 Thread Richard Biener
On Fri, 27 Jun 2025, Robin Dapp wrote: > > Maybe we can pass a scalar mode to the hook when we ask for > > SCATTER/GATHER? That might need fixups in other targets of course, > > but it would make it clear what we're asking for? > > How about an additional argument bool gather_scatter to make it

[PATCH v2 3/4] RISC-V: Add test for vec_duplicate + vssubu.vv combine case 1 with GR2VR cost 0, 1 and 2

2025-06-27 Thread pan2 . li
From: Pan Li Add asm dump check test for vec_duplicate + vssubu.vv combine to vssubu.vx, with the GR2VR cost is 0, 1 and 2. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vx_vf/vx-4-u16.c: Add asm check for vssubu.vx combine. * gcc.target/riscv/rvv/autovec/vx_vf

Re: [PATCH v2 0/4] RISC-V: Combine vec_duplicate + vssubu.vv to vssubu.vx on GR2VR cost

2025-06-27 Thread Robin Dapp
This patch would like to introduce the combine of vec_dup + vssubu.vv into vssubu.vx on the cost value of GR2VR. The late-combine will take place if the cost of GR2VR is zero, or reject the combine if non-zero like 1, 2, 15 in test. There will be two cases for the combine: OK. -- Regards Robi

Re: [PATCH v2 0/5] Implement mdspan.

2025-06-27 Thread Luc Grosheintz
After this series I think we should have completed the C++23 part of mdspan. I'm not sure about the last few steps: 1. Can I create a commit that sets the official FTM to 202207L? 2. Who and when creates the commit that updates the page with the supported features [1]? [1]: https://gcc.gn

Re: [PATCH] libstdc++: Use runtime format for internal format calls in chrono [PR110739]

2025-06-27 Thread Jonathan Wakely
On Fri, 27 Jun 2025 at 10:10, Tomasz Kaminski wrote: > > > > On Fri, Jun 27, 2025 at 10:31 AM Tomasz Kamiński wrote: >> >> This patch adjust all internal std::format call inside of __formatter_chrono, >> to use runtime format stirng and thus avoid compile time checking of validity >> of the forma

Re: [patch,avr] Turn on LRA per default

2025-06-27 Thread Jeff Law
On 6/27/25 7:08 AM, Georg-Johann Lay wrote: This turns on -mlra per default on avr. Ok for trunk? Yes, definitely. The more soak time it gets the better IMHO. jeff

RE: [PATCH v2 0/4] RISC-V: Combine vec_duplicate + vssubu.vv to vssubu.vx on GR2VR cost

2025-06-27 Thread Li, Pan2
Seem the CI only pick up the last commit to run, from the Apply Status of https://github.com/ewlu/gcc-precommit-ci/issues/3576#issuecomment-3012381157. Is there anyway we can retrigger the test somewhere ? If no I can send a v3 series with the commit reordered and see. Pan -Original Messag

Re: [PATCH 4/8] libstdc++: Directly implement ranges::stable_sort [PR100795]

2025-06-27 Thread Jonathan Wakely
On 26/06/25 22:25 -0400, Patrick Palka wrote: PR libstdc++/100795 libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (__detail::__move_merge): New, based on the stl_algo.h implementation. (__detail::__merge_sort_loop): Likewise. (__detail::__chunk_inser

Re: [PATCH 5/8] libstdc++: Directly implement ranges::stable_partition [PR100795]

2025-06-27 Thread Jonathan Wakely
On 26/06/25 22:25 -0400, Patrick Palka wrote: PR libstdc++/100795 libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (__detail::__find_if_not_n): New, based on the stl_algo.h implementation. (__detail::__stable_partition_adaptive): Likewise. (__stable_p

Re: [PATCH 5/8] libstdc++: Directly implement ranges::stable_partition [PR100795]

2025-06-27 Thread Jonathan Wakely
On 26/06/25 22:25 -0400, Patrick Palka wrote: PR libstdc++/100795 libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (__detail::__find_if_not_n): New, based on the stl_algo.h implementation. (__detail::__stable_partition_adaptive): Likewise. (__stable_p

Re: [PATCH 6/8] libstdc++: Directly implement ranges::nth_element [PR100795]

2025-06-27 Thread Jonathan Wakely
On 26/06/25 22:25 -0400, Patrick Palka wrote: PR libstdc++/100795 libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (__detail::__introselect): New, based on the stl_algo.h implementation. (nth_element_fn::operator()): Reimplement in terms of the above.

Re: Remove early inlining from afdo pass

2025-06-27 Thread Jan Hubicka
Hi, > > We can look into this. We do compare manually the IR dumps from both and it > is not ideal. > What we should do is an additional (optional) pass that runs after > auto-profile to compare the annotations > using the profile-use. We will have to filter out any functions/path that > runs

Re: [PATCH 1/2] Fixup partial_vectors_supported_p use

2025-06-27 Thread Richard Sandiford
Richard Biener writes: > On Fri, 27 Jun 2025, Richard Biener wrote: > >> On Thu, 26 Jun 2025, Richard Sandiford wrote: >> >> > Richard Biener writes: >> > > The following fixes the computation of supports_partial_vectors which >> > > is used to prune the set of modes to iterate over for epilog >

Re: [PATCH 1/2] Fixup partial_vectors_supported_p use

2025-06-27 Thread Richard Biener
On Fri, 27 Jun 2025, Richard Sandiford wrote: > Richard Biener writes: > > On Fri, 27 Jun 2025, Richard Biener wrote: > > > >> On Thu, 26 Jun 2025, Richard Sandiford wrote: > >> > >> > Richard Biener writes: > >> > > The following fixes the computation of supports_partial_vectors which > >> > >

Re: [PATCH] RISC-V: Refactor the function bitmap_union_of_preds_with_entry

2025-06-27 Thread Jin Ma
On Tue, 24 Jun 2025 14:05:54 +0200, "Robin Dapp" wrote: > Hi Ma Jin, > > thanks for looking into this, it has been on my todo list with very low > priority since the vsetvl rewrite. Yes, I've noticed this for quite some time. While the logic itself is sound, it strikes me as quite odd every time

Re: [PATCH v3 6/6] LoongArch: Add support for _BitInt [PR117599]

2025-06-27 Thread Yang Yujie
On Fri, Jun 27, 2025 at 10:00:00AM GMT, Jakub Jelinek wrote: > On Fri, Jun 27, 2025 at 03:33:35PM +0800, Yang Yujie wrote: > > @@ -11291,6 +11296,13 @@ expand_expr_real_1 (tree exp, rtx target, > > machine_mode tmode, > >type = TREE_TYPE (exp); > >mode = TYPE_MODE (type); > >unsignedp

Re: [PATCH v4 1/1] libstdc++: Implement default_accessor from mdspan.

2025-06-27 Thread Tomasz Kaminski
On Fri, Jun 27, 2025 at 11:06 AM Luc Grosheintz wrote: > libstdc++-v3/ChangeLog: > > * include/std/mdspan (default_accessor): New class. > * src/c++23/std.cc.in: Register default_accessor. > * testsuite/23_containers/mdspan/accessors/default.cc: New test. > * tests

[PATCH v2 0/4] RISC-V: Combine vec_duplicate + vssubu.vv to vssubu.vx on GR2VR cost

2025-06-27 Thread pan2 . li
From: Pan Li This patch would like to introduce the combine of vec_dup + vssubu.vv into vssubu.vx on the cost value of GR2VR. The late-combine will take place if the cost of GR2VR is zero, or reject the combine if non-zero like 1, 2, 15 in test. There will be two cases for the combine: Case 0:

[PATCH v2 1/7] RISC-V: Add basic XAndes vendor extension support.

2025-06-27 Thread KuanLin Chen
Hi Jeff, > Just a nit. In several places you need to replace > "UPPERCAE_NAME" with "UPPERCASE_NAME". Fixed. Thanks for your review. This is a patch series for Andes vender extension of RISC-V. These patches are tested by riscv-gnu-toolchain gcc/g++ testsuite. And the report is the same as with

[PATCH 4/7 v2] RISC-V: Add support for the XAndesvbfhcvt ISA extension.

2025-06-27 Thread KuanLin Chen
Hi, This patch add support for XAndesvbfhcvt ISA extension. This extension defines instructions to perform vector floating-point conversion between the BFLOAT16 floating-point data and the IEEE-754 32-bit single-precision floating-point (SP) data in a vector register. gcc/ChangeLog: * co

[PATCH v2 2/4] RISC-V: Add test for vec_duplicate + vssubu.vv combine case 0 with GR2VR cost 0, 2 and 15

2025-06-27 Thread pan2 . li
From: Pan Li Add asm dump check and run test for vec_duplicate + vssubu.vv combine to vssubu.vx, with the GR2VR cost is 0, 2 and 15. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u16.c: Add asm check. * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u32.c: Ditto.

[PATCH v2 5/5] libstdc++: Make mdspan nothrow movable.

2025-06-27 Thread Luc Grosheintz
If all members of mdspan are nothrow movable, then mdspan can also be nothrow movable. The standard doesn't specify that mdspan must be nothrow movable (when possible). Nothrow movable enables containers to use move operations even if they have a strong exception guarantee. This commit strenghtens

Re: [PATCH v4 1/1] libstdc++: Implement default_accessor from mdspan.

2025-06-27 Thread Jonathan Wakely
On Fri, 27 Jun 2025 at 10:39, Tomasz Kaminski wrote: > > Also, for single patch (not-patch series), you do not need to have [PATCH > 0/N], simple [PATCH] and then [PATCH v2] also works. Yeah, sending a 0/N cover letter is only useful to describe what a multi-part patch series does. For a single

[PATCH v2 4/5] libstdc++: Implement mdspan and tests.

2025-06-27 Thread Luc Grosheintz
Implements the class mdspan as described in N4950, i.e. without P3029. It also adds tests for mdspan. libstdc++-v3/ChangeLog: * include/std/mdspan (mdspan): New class. * src/c++23/std.cc.in: Add std::mdspan. * testsuite/23_containers/mdspan/class_mandate_neg.cc: New test.

Re: [to-be-committed][RISC-V][PR target/119971] Avoid losing shift count masking

2025-06-27 Thread Jeff Law
On 5/5/25 11:56 PM, Bernhard Reutner-Fischer wrote: On 5 May 2025 20:42:34 CEST, Jeff Law wrote: diff --git a/gcc/testsuite/gcc.target/riscv/pr119971.c b/gcc/testsuite/gcc.target/riscv/pr119971.c new file mode 100644 index 000..c3f23b05ec3 --- /dev/null +++ b/gcc/testsuite/gcc.targe

[PATCH v2] vect: Misalign checks for gather/scatter.

2025-06-27 Thread Robin Dapp
Hi, Changes from v1: - Add gather_scatter argument to support_vector_misalignment. - Don't rely on DR_BASE_ALIGNMENT. - Add IFN helpers and use them. - Add gather/scatter helper macros. - Clarify is_packed handling in docs. This patch adds simple misalignment checks for gather/scatter operations

[patch,avr] Turn on LRA per default

2025-06-27 Thread Georg-Johann Lay
This turns on -mlra per default on avr. Ok for trunk? Johann -- AVR: target/113934 - Use LRA per default. Now that the patches for PR120424 are upstream, the last known bug associated with avr+lra has been fixed: PR118591. So we can pull the switch that turns on LRA per default. This patch

[RFC] libstdc++: Provide meaning to precision for duration in chrono-spec.

2025-06-27 Thread Tomasz Kamiński
The standard does not currently specify how the precision value is interpreted if specify, only prohibit it from being used for formatting any other object than durations with floating point types. This patch interprets user-specified duration value as follows: * if spec is empty for floating-poi

[commmited v2] libstdc++: Fix warnings introduced by type-erasing for chrono commits [PR110739]

2025-06-27 Thread Tomasz Kamiński
The r16-1709-g4b3cefed1a08344495fedec4982d85168bd8173f caused `-Woverflow` in empty_spec.cc file. This warning is not cause by any issue in shipping code, and results in taking to much shortcut when implementing a test-only custom representation type Rep, where long was always used to store a value

Re: [PATCH 5/8] libstdc++: Directly implement ranges::stable_partition [PR100795]

2025-06-27 Thread Jonathan Wakely
On Fri, 27 Jun 2025 at 15:26, Patrick Palka wrote: > > On Fri, 27 Jun 2025, Jonathan Wakely wrote: > > > On 26/06/25 22:25 -0400, Patrick Palka wrote: > > > PR libstdc++/100795 > > > > > > libstdc++-v3/ChangeLog: > > > > > > * include/bits/ranges_algo.h (__detail::__find_if_not_n): New, >

[PATCH] gcc: middle-end opt for trigonometric pi-based functions builtins

2025-06-27 Thread Yuao Ma
Hi Jakub, > I think the __builtin_constant_p(acospi(0.5)) approach is usable, but would > be much better done on the lib/target-supports.exp side. > So, have foldable_pi_based_trigonometry effective target, which would test > if __builtin_constant_p(acospi(0.5)) is 1. Thanks again for your helpfu

[PATCH] libstdc++: Lift locale initialization in main chrono format loop [PR110739]

2025-06-27 Thread Tomasz Kamiński
This patch lifts locale initialization from locale-specific handling methods into _M_format_to function, and pass the locale by const reference. To avoid uncessary computation of locale::classic(), we use _Optional_locale, and emplace __fc.locale() into it only for localized formatting (_M_spec._M

Re: [PATCH] gcc: middle-end opt for trigonometric pi-based functions builtins

2025-06-27 Thread Jakub Jelinek
On Fri, Jun 27, 2025 at 03:04:35PM +, Yuao Ma wrote: > > I think the __builtin_constant_p(acospi(0.5)) approach is usable, but would > > be much better done on the lib/target-supports.exp side. > > So, have foldable_pi_based_trigonometry effective target, which would test > > if __builtin_const

Re: [PATCH 7/8] libstdc++: Directly implement ranges::sample [PR100795]

2025-06-27 Thread Jonathan Wakely
On Fri, 27 Jun 2025 at 15:37, Patrick Palka wrote: > > On Fri, 27 Jun 2025, Jonathan Wakely wrote: > > > On 27/06/25 14:53 +0100, Jonathan Wakely wrote: > > > On 26/06/25 23:12 -0400, Patrick Palka wrote: > > > > On Thu, 26 Jun 2025, Patrick Palka wrote: > > > > > > > > > PR libstdc++/1007

[committed v2] libstdc++: Use runtime format for internal format calls in chrono [PR110739]

2025-06-27 Thread Tomasz Kamiński
This patch adjust all internal std::format call inside of __formatter_chrono, to use runtime format string and thus avoid compile time checking of validity of the format string. Majority of cases are covered by calling newly introduced _S_empty_fs() function that returns __Runtime_format_string con

[PATCH] gcc: middle-end opt for trigonometric pi-based functions builtins

2025-06-27 Thread Yuao Ma
Hi Jakub, > Please don't include math.h here. Done. > And instead of this line use __builtin_acospi (0.5). > and, in dejagnu for runtime tests we prefer __builtin_abort on failure, so Done. Yuao 0001-gcc-middle-end-opt-for-trigonometric-pi-based-functi.patch Description: 0001-gcc-middle-en

Re: [PATCH] gcc: middle-end opt for trigonometric pi-based functions builtins

2025-06-27 Thread Jakub Jelinek
On Fri, Jun 27, 2025 at 03:38:32PM +, Yuao Ma wrote: > Hi Jakub, > > > Please don't include math.h here. > > Done. > > > And instead of this line use __builtin_acospi (0.5). > > and, in dejagnu for runtime tests we prefer __builtin_abort on failure, so > > Done. Oh, one more thing. signbit

Re: [PATCH 1/2] allow contraction to synthetic single-element vector FMA

2025-06-27 Thread Richard Biener
On Wed, Jun 25, 2025 at 11:39 AM Richard Biener wrote: > > On Tue, Jun 24, 2025 at 5:25 PM Alexander Monakov wrote: > > > > > I'd say we want to fix these kind of things before switching the default. > > > Can > > > you file bugreports for the distinct issues you noticed when adjusting the > >

[PATCH] libstdc++: Fix warnings introduced by type-erasing for chrono commits [PR110739]

2025-06-27 Thread Tomasz Kamiński
The r16-1709-g4b3cefed1a08344495fedec4982d85168bd8173f caused `-Woverflow` in empty_spec.cc file. This warning is not cause by any issue in shipping code, and results in taking to much shorcut when implementing a test-only custom representation type Rep, where long was always used to store a value.

Re: [PATCH] libstdc++: Fix warnings introduced by type-erasing for chrono commits [PR110739]

2025-06-27 Thread Tomasz Kaminski
On Fri, Jun 27, 2025 at 1:03 PM Tomasz Kamiński wrote: > The r16-1709-g4b3cefed1a08344495fedec4982d85168bd8173f caused `-Woverflow` > in empty_spec.cc file. This warning is not cause by any issue in shipping > code, and results in taking to much shorcut when implementing a test-only > custom repr

Re: [PATCH v3 6/6] LoongArch: Add support for _BitInt [PR117599]

2025-06-27 Thread Jakub Jelinek
On Fri, Jun 27, 2025 at 03:33:39PM +0800, Yang Yujie wrote: > [1] https://github.com/loongson/la-abi-specs > > PR target/117599 > > gcc/ChangeLog: > > * config/loongarch/loongarch.h: Define a PROMOTE_MODE case for > small _BitInts. > * config/loongarch/loongarch.cc (loong

Re: [PATCH v3 3/6] bitint: Allow unused bits when testing extended _BitInt ABIs

2025-06-27 Thread Jakub Jelinek
On Fri, Jun 27, 2025 at 03:33:36PM +0800, Yang Yujie wrote: > In LoongArch psABI, large _BitInt(N) (N > 64) objects are only > extended to fill the highest 8-byte chunk that contains any used bit, > but the size of such a large _BitInt type is a multiple of their > 16-byte alignment. So there may

Re: [PATCH] libstdc++: Use runtime format for internal format calls in chrono [PR110739]

2025-06-27 Thread Tomasz Kaminski
On Fri, Jun 27, 2025 at 10:31 AM Tomasz Kamiński wrote: > This patch adjust all internal std::format call inside of > __formatter_chrono, > to use runtime format stirng and thus avoid compile time checking of > validity > of the format string. Majority of cases are covered by calling newly > intr

[PATCH 2/7 v2] RISC-V: Add support for the XAndesperf ISA extension.

2025-06-27 Thread KuanLin Chen
Hi Kito, >>* +(define_predicate "extract_loc_imm_si"* > Rename it to unsigned_5_bit_integer_operand >>* + (and (match_code "const_int") *>>* +(match_test "IN_RANGE (INTVAL (op), 0, 31)"))) *>>* +* >>* +(define_predicate "extract_loc_imm_di"* > Rename it to unsigned_6_bit_integer_operand

[PATCH 3/7 v2] RISC-V: Add support for the XAndesbfhcvt ISA extension.

2025-06-27 Thread KuanLin Chen
Hi, This extension defines instructions to perform scalar floating-point conversion between the BFLOAT16 floating-point data and the IEEE-754 32-bit single-precision floating-point (SP) data in a scalar floating point register. gcc/ChangeLog: * config/riscv/andes.def: Add nds_fcvt_s_bf16

RE: [PATCH V3] x86: Enable separate shrink wrapping

2025-06-27 Thread Cui, Lili
> -Original Message- > From: H.J. Lu > Sent: Friday, June 27, 2025 4:48 PM > To: Cui, Lili > Cc: ubiz...@gmail.com; gcc-patches@gcc.gnu.org; Liu, Hongtao > ; richard.guent...@gmail.com; Michael Matz > ; Sam James ; kenjin4...@gmail.com > Subject: Re: [PATCH V3] x86: Enable separate shrink

Re: [PATCH 4/8] libstdc++: Directly implement ranges::stable_sort [PR100795]

2025-06-27 Thread Jonathan Wakely
On Fri, 27 Jun 2025 at 15:16, Jonathan Wakely wrote: > > On Fri, 27 Jun 2025 at 15:15, Patrick Palka wrote: > > > > On Fri, 27 Jun 2025, Jonathan Wakely wrote: > > > > > On 26/06/25 22:25 -0400, Patrick Palka wrote: > > > > PR libstdc++/100795 > > > > > > > > libstdc++-v3/ChangeLog: > > > > >

Re: [PATCH] sh: Recognize >> 31 in treg_set_expr_not_const01

2025-06-27 Thread Jeff Law
On 6/27/25 7:59 AM, Oleg Endo wrote: On Fri, 2025-06-27 at 10:51 -0300, Raphael Moreira Zinsly wrote: A right shift of 31 will become 0 or 1, this can be checked for treg_set_expr_not_const01 to avoid matching addc_t_r as this can expand to a 3 insn sequence instead. This improves tests 023

Re: [PATCH 5/8] libstdc++: Directly implement ranges::stable_partition [PR100795]

2025-06-27 Thread Patrick Palka
On Fri, 27 Jun 2025, Jonathan Wakely wrote: > On 26/06/25 22:25 -0400, Patrick Palka wrote: > > PR libstdc++/100795 > > > > libstdc++-v3/ChangeLog: > > > > * include/bits/ranges_algo.h (__detail::__find_if_not_n): New, > > based on the stl_algo.h implementation. > > (__detail::__

[patch,wwwdocs,applied] AVR uses LRA per default

2025-06-27 Thread Georg-Johann Lay
Adjusted backends.html for avr. Applied as obvious. Johann -- commit 3ba9c3647d9dee45c5afe90ccc21c3b5753ca8aa backends.html (avr): Uses LRA per default. https:/gcc.gnu.org/r16-1733 enabled LRA per default on AVR. diff --git a/htdocs/backends.html b/htdocs/backends.html index 2a63f91b..52f897

Re: [PATCH 7/8] libstdc++: Directly implement ranges::sample [PR100795]

2025-06-27 Thread Jonathan Wakely
On 26/06/25 22:25 -0400, Patrick Palka wrote: PR libstdc++/100795 OK for trunk (the FIXME can stay for now and be dealt with later). libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (__sample_fn::operator()): Reimplement the forward_iterator branch directly.

[PATCH v3 1/4] RISC-V: Combine vec_duplicate + vssubu.vv to vssubu.vx on GR2VR cost

2025-06-27 Thread pan2 . li
From: Pan Li This patch would like to combine the vec_duplicate + vssubu.vv to the vssubu.vx. From example as below code. The related pattern will depend on the cost of vec_duplicate from GR2VR. Then the late-combine will take action if the cost of GR2VR is zero, and reject the combination if

Re: [PATCH 4/8] libstdc++: Directly implement ranges::stable_sort [PR100795]

2025-06-27 Thread Patrick Palka
On Fri, 27 Jun 2025, Jonathan Wakely wrote: > On 26/06/25 22:25 -0400, Patrick Palka wrote: > > PR libstdc++/100795 > > > > libstdc++-v3/ChangeLog: > > > > * include/bits/ranges_algo.h (__detail::__move_merge): New, > > based on the stl_algo.h implementation. > > (__detail::__mer

Re: [PATCH 4/8] libstdc++: Directly implement ranges::stable_sort [PR100795]

2025-06-27 Thread Jonathan Wakely
On Fri, 27 Jun 2025 at 15:15, Patrick Palka wrote: > > On Fri, 27 Jun 2025, Jonathan Wakely wrote: > > > On 26/06/25 22:25 -0400, Patrick Palka wrote: > > > PR libstdc++/100795 > > > > > > libstdc++-v3/ChangeLog: > > > > > > * include/bits/ranges_algo.h (__detail::__move_merge): New, > > >

[PATCH v3 3/4] RISC-V: Add test for vec_duplicate + vssubu.vv combine case 0 with GR2VR cost 0, 2 and 15

2025-06-27 Thread pan2 . li
From: Pan Li Add asm dump check and run test for vec_duplicate + vssubu.vv combine to vssubu.vx, with the GR2VR cost is 0, 2 and 15. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u16.c: Add asm check. * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u32.c: Ditto.

Re: [PATCH 7/8] libstdc++: Directly implement ranges::sample [PR100795]

2025-06-27 Thread Jonathan Wakely
On 27/06/25 14:53 +0100, Jonathan Wakely wrote: On 26/06/25 23:12 -0400, Patrick Palka wrote: On Thu, 26 Jun 2025, Patrick Palka wrote: PR libstdc++/100795 libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (__sample_fn::operator()): Reimplement the forward_iterator

RE: [PATCH v2 0/4] RISC-V: Combine vec_duplicate + vssubu.vv to vssubu.vx on GR2VR cost

2025-06-27 Thread Li, Pan2
It is better to leave a record in CI system, I will send v3 to trigger another CI and see, will commit it if CI is OK. Pan -Original Message- From: Robin Dapp Sent: Friday, June 27, 2025 9:53 PM To: Li, Pan2 ; Robin Dapp ; gcc-patches@gcc.gnu.org Cc: juzhe.zh...@rivai.ai; kito.ch...@g

[PATCH v3 2/4] RISC-V: Reconcile the existing test due to cost model change

2025-06-27 Thread pan2 . li
From: Pan Li The cost model change will make the default cost of vx to 2, thus reconcile the asm check for this change. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/sat/vec_sat_u_sub_trunc-1-u16.c: Update the asm check due to cost model change. * gcc.target/ri

Re: [PATCH 7/8] libstdc++: Directly implement ranges::sample [PR100795]

2025-06-27 Thread Patrick Palka
On Fri, 27 Jun 2025, Jonathan Wakely wrote: > On 27/06/25 14:53 +0100, Jonathan Wakely wrote: > > On 26/06/25 23:12 -0400, Patrick Palka wrote: > > > On Thu, 26 Jun 2025, Patrick Palka wrote: > > > > > > > PR libstdc++/100795 > > > > > > > > libstdc++-v3/ChangeLog: > > > > > > > >

[PATCH v3 4/4] RISC-V: Add test for vec_duplicate + vssubu.vv combine case 1 with GR2VR cost 0, 1 and 2

2025-06-27 Thread pan2 . li
From: Pan Li Add asm dump check test for vec_duplicate + vssubu.vv combine to vssubu.vx, with the GR2VR cost is 0, 1 and 2. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vx_vf/vx-4-u16.c: Add asm check for vssubu.vx combine. * gcc.target/riscv/rvv/autovec/vx_vf

Re: [PATCH v3 1/1] libstdc++: Implement default_accessor from mdspan.

2025-06-27 Thread Tomasz Kaminski
On Fri, Jun 27, 2025 at 9:52 AM Luc Grosheintz wrote: > libstdc++-v3/ChangeLog: > > * include/std/mdspan (default_accessor): New class. > * src/c++23/std.cc.in: Register default_accessor. > * testsuite/23_containers/mdspan/accessors/default.cc: New test. > * testsu

[PATCH 7/7 v2] RISC-V: Add support for the XAndesvdot ISA extension.

2025-06-27 Thread KuanLin Chen
Hi, This extension defines vector instructions to calculae of the signed/unsigned dot product of four SEW/4-bit data and accumulate the result into a SEWbit element for all elements in a vector register. gcc/ChangeLog: * config/riscv/andes-vector-builtins-bases.cc (nds_vd4dot): New class

[PATCH v2 4/4] RISC-V: Reconcile the existing test due to cost model change

2025-06-27 Thread pan2 . li
From: Pan Li The cost model change will make the default cost of vx to 2, thus reconcile the asm check for this change. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/sat/vec_sat_u_sub_trunc-1-u16.c: Update the asm check due to cost model change. * gcc.target/ri

Re: [PATCH v4 1/1] libstdc++: Implement default_accessor from mdspan.

2025-06-27 Thread Luc Grosheintz
On 6/27/25 11:44, Jonathan Wakely wrote: On Fri, 27 Jun 2025 at 10:39, Tomasz Kaminski wrote: Also, for single patch (not-patch series), you do not need to have [PATCH 0/N], simple [PATCH] and then [PATCH v2] also works. Yeah, sending a 0/N cover letter is only useful to describe what a

Re: [PATCH v5] libstdc++: Implement default_accessor from mdspan.

2025-06-27 Thread Luc Grosheintz
Sorry, I'll continue working another day. This commit is broken; please ignore. On 6/27/25 13:15, Luc Grosheintz wrote: libstdc++-v3/ChangeLog: * include/std/mdspan (default_accessor): New class. * src/c++23/std.cc.in: Register default_accessor. * testsuite/23_containers

[PATCH v5] libstdc++: Implement default_accessor from mdspan.

2025-06-27 Thread Luc Grosheintz
libstdc++-v3/ChangeLog: * include/std/mdspan (default_accessor): New class. * src/c++23/std.cc.in: Register default_accessor. * testsuite/23_containers/mdspan/accessors/default.cc: New test. * testsuite/23_containers/mdspan/accessors/default_neg.cc: New test. Signe

[PATCH] tree-optimization/120780: Support object size for containing objects

2025-06-27 Thread Siddhesh Poyarekar
MEM_REF cast of a subobject to its containing object has negative offsets, which objsz sees as an invalid access. Support this use case by peeking into the structure to validate that the containing object indeed contains a type of the subobject at that offset and if present, adjust the wholesize f

Re: [PATCH v3 1/1] libstdc++: Implement default_accessor from mdspan.

2025-06-27 Thread Luc Grosheintz
On 6/27/25 10:28, Tomasz Kaminski wrote: On Fri, Jun 27, 2025 at 9:52 AM Luc Grosheintz wrote: libstdc++-v3/ChangeLog: * include/std/mdspan (default_accessor): New class. * src/c++23/std.cc.in: Register default_accessor. * testsuite/23_containers/mdspan/accessors

Re: [PATCH][RFC] c/96570 - diagnostics for conversions to/from time_t

2025-06-27 Thread Florian Weimer
* Joseph Myers: > On Thu, 26 Jun 2025, Richard Biener wrote: > >> The following prototypes diagnostics for conversions to/from time_t >> where the source/destination does not have sufficient precision for it. >> I've lumped this into -Wconversion for the moment and didn't bother >> fixing up the t

Re: [PATCH 1/4] c++: Add flag to detect underlying representative of bitfield decls

2025-06-27 Thread Nathaniel Shead
On Wed, Jun 25, 2025 at 01:05:39PM -0400, Jason Merrill wrote: > On 5/21/25 10:14 PM, Nathaniel Shead wrote: > > This patch isn't currently necessary with how I've currently done the > > follow-up patches, but is needed for avoiding any potential issues in > > the future with DECL_CONTEXT'ful types

Re: [PATCH][RFC] c/96570 - diagnostics for conversions to/from time_t

2025-06-27 Thread Richard Biener
On Fri, 27 Jun 2025, Florian Weimer wrote: > * Joseph Myers: > > > On Thu, 26 Jun 2025, Richard Biener wrote: > > > >> The following prototypes diagnostics for conversions to/from time_t > >> where the source/destination does not have sufficient precision for it. > >> I've lumped this into -Wconv

  1   2   >