Re: [PATCH 0/7] Support privileged RISC-V extensions

2025-06-04 Thread Kito Cheng
LGTM :) On Thu, Jun 5, 2025 at 2:21 PM Jiawei wrote: > > These patches add support for several privileged RISC-V extensions, including > Sm/scsrind, Smrnmi, Ssccptr, Sscounterenw, Sstvala, Sstvecd, and Ssu64xl. > > The CSRs definition in Binutils part, and gcc part just let the compiler and > use

Re: [PATCH] widening_mul: Make better use of overflowing operations in codegen of min/max(a, add/sub(a, b))

2025-06-04 Thread Richard Biener
On Wed, Jun 4, 2025 at 7:44 PM Andrew Pinski wrote: > > On Wed, Jun 4, 2025 at 6:27 AM Richard Biener > wrote: > > > > On Thu, May 29, 2025 at 10:04 AM wrote: > > > > > > From: Dhruv Chawla > > > > > > This patch folds the following patterns: > > > - max (a, add (a, b)) -> [sum, ovf] = addo (a,

Re: [PATCH] i386: Fix vmovvdup's mem attribute

2025-06-04 Thread Uros Bizjak
On Thu, Jun 5, 2025 at 3:29 AM Hu, Lin1 wrote: > > Hi, > > Some vmovvdup pattern's type attribute is sselog1 and then mem attribute is > both. Modify type attribute according to other patterns about vmovvdup. > > Bootstrapped and regtested on x86_64-linux-pc-gnu, OK for trunk? OK. Thanks, Uros.

[PATCH 6/7] RISC-V: Support Sstvecd extension.

2025-06-04 Thread Jiawei
Support the Sstvecd extension, which allows Supervisor Trap Vector Base Address register (stvec) to support Direct mode. gcc/ChangeLog: * config/riscv/riscv-ext.def: New extension definition. * config/riscv/riscv-ext.opt: New extension mask. * doc/riscv-ext.texi: Document

[PATCH 3/7] RISC-V: Support Ssccptr extension.

2025-06-04 Thread Jiawei
Support the Ssccptr extension, which allows the main memory to support page table reads. gcc/ChangeLog: * config/riscv/riscv-ext.def: New extension definition. * config/riscv/riscv-ext.opt: New extension mask. * doc/riscv-ext.texi: Document the new extension. gcc/testsuit

[PATCH 5/7] RISC-V: Support Sstvala extension.

2025-06-04 Thread Jiawei
Support the Sstvala extension, which provides all needed values in Supervisor Trap Value register (stval). gcc/ChangeLog: * config/riscv/riscv-ext.def: New extension definition. * config/riscv/riscv-ext.opt: New extension mask. * doc/riscv-ext.texi: Document the new extens

[PATCH 1/7] RISC-V: Support Sm/scsrind extensions.

2025-06-04 Thread Jiawei
Support the Sm/scsrind extensions, which provide indirect access to machine-level CSRs. gcc/ChangeLog: * config/riscv/riscv-ext.def: New extension definition. * config/riscv/riscv-ext.opt: New extension mask. * doc/riscv-ext.texi: Document the new extension. gcc/testsuite

[PATCH 7/7] RISC-V: Support Ssu64xl extension.

2025-06-04 Thread Jiawei
Support the Ssu64xl extension, which requires UXLEN to be 64. gcc/ChangeLog: * config/riscv/riscv-ext.def: New extension definition. * config/riscv/riscv-ext.opt: New extension mask. * doc/riscv-ext.texi: Document the new extension. gcc/testsuite/ChangeLog: * gcc

[PATCH 4/7] RISC-V: Support Sscounterenw extension.

2025-06-04 Thread Jiawei
Support the Sscounterenw extension, which allows writeable enables for any supported counter. gcc/ChangeLog: * config/riscv/riscv-ext.def: New extension definition. * config/riscv/riscv-ext.opt: New extension mask. * doc/riscv-ext.texi: Document the new extension.

[PATCH 0/7] Support privileged RISC-V extensions

2025-06-04 Thread Jiawei
These patches add support for several privileged RISC-V extensions, including Sm/scsrind, Smrnmi, Ssccptr, Sscounterenw, Sstvala, Sstvecd, and Ssu64xl. The CSRs definition in Binutils part, and gcc part just let the compiler and user know these extensions are supported. Jiawei (7): RISC-V: Supp

[PATCH 2/7] RISC-V: Support Smrnmi extension.

2025-06-04 Thread Jiawei
Support the Smrnmi extension, which provides new CSRs for Machine mode Non-Maskable Interrupts. gcc/ChangeLog: * config/riscv/riscv-ext.def: New extension definition. * config/riscv/riscv-ext.opt: New extension mask. * doc/riscv-ext.texi: Document the new extension. gcc/t

Re: [PATCH] ranger: Add support for float <-> float casts [PR120231]

2025-06-04 Thread Aldy Hernandez
Andrew MacLeod writes: > Fine with me.  I don't think Aldy got to many of the cast conversions. None is the right answer :). Thanks Jakub. Aldy

Re: [PATCH v6 6/8] libstdc++: Implement layout_stride from mdspan.

2025-06-04 Thread Daniel Krügler
Am Mi., 4. Juni 2025 um 17:18 Uhr schrieb Luc Grosheintz < luc.groshei...@gmail.com>: > Implements the remaining parts of layout_left and layout_right; and all > of layout_stride. > > The implementation of layout_stride::mapping::is_exhaustive applies > the following change to the standard: > >

Re: [PATCH v1] RISC-V: Fix ICE for gcc.dg/graphite/pr33576.c with rv32gcv

2025-06-04 Thread 钟居哲
LGTM juzhe.zh...@rivai.ai From: pan2.li Date: 2025-06-05 13:01 To: gcc-patches CC: juzhe.zhong; kito.cheng; jeffreyalaw; rdapp.gcc; ken.chen; hongtao.liu; Pan Li Subject: [PATCH v1] RISC-V: Fix ICE for gcc.dg/graphite/pr33576.c with rv32gcv From: Pan Li The div of rvv has not such insn v2

Ping: PR 99293: Optimize splat of a V2DF/V2DI extract with constant element

2025-06-04 Thread Michael Meissner
Ping patch for PR target/99293 https://gcc.gnu.org/pipermail/gcc-patches/2025-May/683038.html -- Michael Meissner, IBM PO Box 98, Ayer, Massachusetts, USA, 01432 email: meiss...@linux.ibm.com

[PATCH] PR target/120528 -- Simplify zero extend from memory to VSX register on power10

2025-06-04 Thread Michael Meissner
Previously GCC would zero extend a DImode value in memory to a TImode target in a vector register by firt zero extending the DImode value into a GPR TImode register pair, and then do a MTVSRDD to move this value to a VSX register. For example, consider the following code: #ifndef TYPE

Re: [PATCH] widening_mul: Make better use of overflowing operations in codegen of min/max(a, add/sub(a, b))

2025-06-04 Thread Dhruv Chawla
On 30/05/25 13:35, Andrew Pinski wrote: External email: Use caution opening links or attachments On Thu, May 29, 2025 at 1:05 AM wrote: From: Dhruv Chawla This patch folds the following patterns: - max (a, add (a, b)) -> [sum, ovf] = addo (a, b); !ovf ? sum : a - max (a, sub (a, b)) -> [su

[PATCH, V3] PR target/108958 -- simplify mtvsrdd to zero extend GPR DImode to VSX TImode

2025-06-04 Thread Michael Meissner
Before this patch GCC would zero extend a DImode GPR value to TImode by first zero extending the DImode value into a GPR TImode register pair, and then do a MTVSRDD to move this value to a VSX register. For example, consider the following code: #ifndef TYPE #define TYPE unsigned l

Re: [PATCH] widening_mul: Make better use of overflowing operations in codegen of min/max(a, add/sub(a, b))

2025-06-04 Thread Dhruv Chawla
On 04/06/25 23:14, Andrew Pinski wrote: External email: Use caution opening links or attachments On Wed, Jun 4, 2025 at 6:27 AM Richard Biener wrote: On Thu, May 29, 2025 at 10:04 AM wrote: From: Dhruv Chawla This patch folds the following patterns: - max (a, add (a, b)) -> [sum, ovf] =

[PATCH] [x86] [PR103750] Also handle avx512 kmask & immediate 15 or 3 when VF is 4/2.

2025-06-04 Thread liuhongt
like r16-105-g599bca27dc37b3, the patch handles redunduant clean up of upper-bits for maskload. .i.e Successfully matched this instruction: (set (reg:V4DF 175) (vec_merge:V4DF (unspec:V4DF [ (mem:V4DF (plus:DI (reg/v/f:DI 155 [ b ]) (reg:DI 143 [ ivtmp.56

Re: [PATCH] real: Fix up real_from_integer [PR120547]

2025-06-04 Thread Richard Biener
> Am 04.06.2025 um 23:04 schrieb Jakub Jelinek : > > Hi! > > The function has 2 problems, one is _BitInt specific and the other is > most likely also reproduceable only with it. > > The first issue is that I've missed updating the function for _BitInt, > maxbitlen as MAX_BITSIZE_MODE_ANY_INT

[PATCH v1] RISC-V: Fix ICE for gcc.dg/graphite/pr33576.c with rv32gcv

2025-06-04 Thread pan2 . li
From: Pan Li The div of rvv has not such insn v2 = div (vec_dup (x), v1), thus the generated rtl like that hit the unreachable assert when expand insn. This patch would like to remove op div from the binary op form (vec_dup (x), v) to avoid pattern matching by mistake. No new test introduced as

Reverted. (was Re: [PATCH v4] libstdc++: stringstream ctors from string_view [PR119741])

2025-06-04 Thread Nathan Myers
On 6/4/25 20:30, H.J. Lu wrote: On Wed, Jun 4, 2025 at 8:02 PM Jonathan Wakely wrote: On Thu, 29 May 2025 at 20:30, Nathan Myers wrote: Change in V4: * Rename tests to string_view.cc * Adapt tests to cons/wchar_t directories * Define symbol __cpp_lib_sstream_from_string_view as 202406

Re: [PATCH] RISC-V: Update extension defination.

2025-06-04 Thread Jiawei
Committed since it is a simply typo fix. Thanks 在 2025/6/5 9:38, Jiawei 写道: Update the defination of RISC-V extensions in riscv-ext.def. gcc/ChangeLog: * config/riscv/riscv-ext.def: Update declaration. Signed-off-by: Jiawei --- gcc/config/riscv/riscv-ext.def | 282

Re: [Patch][RFC?] OpenMP: Add omp_get_initial_device/omp_get_num_devices builtins

2025-06-04 Thread Sandra Loosemore
On 6/4/25 08:15, Tobias Burnus wrote: This came up when looking at some context selectors that use 'target_device', but is largely unrelated to it. (target_device has its own special casing). Namely, it makes omp_get_initial_device and omp_get_num_devices PURE, which attributes don't permit for

[PATCH] RISC-V: Update extension defination.

2025-06-04 Thread Jiawei
Update the defination of RISC-V extensions in riscv-ext.def. gcc/ChangeLog: * config/riscv/riscv-ext.def: Update declaration. Signed-off-by: Jiawei --- gcc/config/riscv/riscv-ext.def | 282 - 1 file changed, 141 insertions(+), 141 deletions(-) diff --gi

[PATCH] i386: Fix vmovvdup's mem attribute

2025-06-04 Thread Hu, Lin1
Hi, Some vmovvdup pattern's type attribute is sselog1 and then mem attribute is both. Modify type attribute according to other patterns about vmovvdup. Bootstrapped and regtested on x86_64-linux-pc-gnu, OK for trunk? BRs, Lin gcc/ChangeLog: * config/i386/sse.md (avx512f_movddup

Re: [to-be-committed][RISC-V] Improve sequences to generate -1, 1 in some cases.

2025-06-04 Thread Jeff Law
On 6/4/25 6:37 PM, Palmer Dabbelt wrote: On Wed, 04 Jun 2025 17:25:20 PDT (-0700), Jeff Law wrote: This patch has a minor improvement to if-converted sequences based on observations I found while evaluating another patch from Shreya to handle more cases with zicond insns. Specifically there is

Re: [to-be-committed][RISC-V] Improve sequences to generate -1, 1 in some cases.

2025-06-04 Thread Palmer Dabbelt
On Wed, 04 Jun 2025 17:25:20 PDT (-0700), Jeff Law wrote: This patch has a minor improvement to if-converted sequences based on observations I found while evaluating another patch from Shreya to handle more cases with zicond insns. Specifically there is a smaller/faster way than zicond to genera

Re: [PATCH v4] libstdc++: stringstream ctors from string_view [PR119741]

2025-06-04 Thread H.J. Lu
On Wed, Jun 4, 2025 at 8:02 PM Jonathan Wakely wrote: > > On Thu, 29 May 2025 at 20:30, Nathan Myers wrote: > > > > Change in V4: > > * Rename tests to string_view.cc > > * Adapt tests to cons/wchar_t directories > > * Define symbol __cpp_lib_sstream_from_string_view as 202406 > > * Define sy

[to-be-committed][RISC-V] Improve sequences to generate -1, 1 in some cases.

2025-06-04 Thread Jeff Law
This patch has a minor improvement to if-converted sequences based on observations I found while evaluating another patch from Shreya to handle more cases with zicond insns. Specifically there is a smaller/faster way than zicond to generate a -1,1 result when the condition is testing the sign

Re: simple frm save/restore strategy (was Re: [PATCH 3/6] RISC-V: frm/mode-switch: remove dubious frm edge insertion before call_insn)

2025-06-04 Thread Vineet Gupta
On 6/4/25 15:06, Jeff Law wrote: >> static int >> get_frm () >> { >>   int frm = -1; >>   __asm__ volatile ( "frrm %0" :"=r"(frm) : :); >>   return frm; >> } >> >> int >> test_float_point_frm_static (float *out, vfloat32m1_t op1, vfloat32m1_t >> op2, >>

Re: simple frm save/restore strategy (was Re: [PATCH 3/6] RISC-V: frm/mode-switch: remove dubious frm edge insertion before call_insn)

2025-06-04 Thread Jeff Law
On 6/4/25 3:23 PM, Vineet Gupta wrote: On 6/4/25 10:40, Jeff Law wrote: On 5/23/25 12:22 PM, Vineet Gupta wrote: 3. NOK: We loose the ability to instrument local RM writes - especially in the testsuite.   e.g.      a.  instrinsic setting a static RM b. get_frm() to ensure that h

[PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-04 Thread Jonathan Wakely
Rename __semaphore_base to __semaphore_impl, because it's not used as a base class. Replace the three identical lambda expressions with a named class, __semaphore_impl::_Can_acquire, which stores the most recent value of the counter as a data member. Add a new __platform_semaphore_impl class templ

[PATCH 2/2] libstdc++: Add assertions to atomic waiting functions that need platform wait

2025-06-04 Thread Jonathan Wakely
These overloads should never be used for proxy waits, so add assertions to ensure that they aren't used accidentally. The reason they can't be used is that they don't call __args._M_setup_wait to obtain a __wait_state pointer. Even if that was changed, they would wait on a proxy wait which is pote

Re: SPEC2017 526 blender regression (was Re: [PATCH v2 1/2] RISC-V: Add pattern for vector-scalar multiply-add/sub [PR119100])

2025-06-04 Thread Vineet Gupta
On 6/4/25 11:43, Vineet Gupta wrote: > On 6/4/25 11:34, Paul-Antoine Arras wrote: >> Hi Vineet, >> >> On 04/06/2025 20:29, Vineet Gupta wrote: >>> Hi Paul, >>> >>> On 5/30/25 03:04, Paul-Antoine Arras wrote: This pattern enables the combine pass (or late-combine, depending on the case

[PATCH] aarch64: Add testcase for vld2 which was fixed by r16-1113 [PR89606]

2025-06-04 Thread Andrew Pinski
This aarch64 specific vld2 intrinsics testcase was fixed by r16-1113-g069caa5cea91f (simple copy propagation for aggregates). I didn't include it in the original patch as I was testing on x86_64 but I got around to testing this and now we don't have any more extra movs so let's add a testcase. Te

[PATCH] More use MEM_EXPR only if MEM_P is true

2025-06-04 Thread H.J. Lu
On Wed, Jun 4, 2025 at 4:13 PM Richard Sandiford wrote: > > Richard Biener writes: > > On Wed, Jun 4, 2025 at 7:28 AM H.J. Lu wrote: > >> > >> On s390x, for input: > >> > >> (call_insn/u 7 6 11 2 (parallel [ > >> (set (reg:SI 2 %r2) > >> (call (subreg:QI (symbol_ref:S

Re: simple frm save/restore strategy (was Re: [PATCH 3/6] RISC-V: frm/mode-switch: remove dubious frm edge insertion before call_insn)

2025-06-04 Thread Vineet Gupta
On 6/4/25 10:40, Jeff Law wrote: > > On 5/23/25 12:22 PM, Vineet Gupta wrote: > >> 3. NOK: We loose the ability to instrument local RM writes - especially in >> the >> testsuite. >>   e.g. >>      a.  instrinsic setting a static RM >> b. get_frm() to ensure that happened (inline asm to rea

[committed] libstdc++: Skip time zone format testing for COW std::string

2025-06-04 Thread Jonathan Wakely
This is needed when testing with -D_GLIBCXX_USE_CXX11_ABI=0 to fix: FAIL: std/time/format/empty_spec.cc -std=gnu++20 (test for excess errors) libstdc++-v3/ChangeLog: * testsuite/std/time/format/empty_spec.cc: Only test time zones for cxx11 string ABI. --- Pushed to trunk. libs

[PATCH] real: Fix up real_from_integer [PR120547]

2025-06-04 Thread Jakub Jelinek
Hi! The function has 2 problems, one is _BitInt specific and the other is most likely also reproduceable only with it. The first issue is that I've missed updating the function for _BitInt, maxbitlen as MAX_BITSIZE_MODE_ANY_INT + HOST_BITS_PER_WIDE_INT obviously isn't guaranteed to be larger than

Re: [PATCH] libstdc++: Fix formatting of 3-digits months, day, weekday and hour [PR120481]

2025-06-04 Thread Jonathan Wakely
On 02/06/25 13:19 +0200, Tomasz Kamiński wrote: This patch fixes the handle multiple digits values for the month, day, weekday and hour, when used with the %m, %d, %e, %m, %u, %w, %H, and %D, %F specifiers. The values are now printed unmodified. This patch also fixes printing negative year with

Re: [PATCH] xtensa: Implement l(ceil|floor|round|)sfsi2 insn patterns and their scaled variants

2025-06-04 Thread Max Filippov
Hi Suwa-san, On Tue, Jun 3, 2025 at 7:44 AM Takayuki 'January June' Suwa wrote: > > By using the previously unused CEIL|FLOOR|ROUND.S floating-point coprocessor > instructions. In addition, two instruction operand format codes are added > to output the scale value as assembler source. > > /

Re: [PATCH 2/4] c++/modules: Implement streaming of uncontexted TYPE_DECLs [PR98735]

2025-06-04 Thread Jason Merrill
On 5/26/25 8:55 AM, Nathaniel Shead wrote: On Fri, May 23, 2025 at 11:31:26AM -0400, Jason Merrill wrote: On 5/21/25 10:15 PM, Nathaniel Shead wrote: Another approach would be to fix 'write_class_def' to handle these declarations better, but that ended up being more work and felt fragile. It al

Re: [PATCH] OpenMP: Fix regressions in metadirective-target-device-2.c [PR120518]

2025-06-04 Thread Tobias Burnus
Sandra Loosemore wrote: gcc/ChangeLog PR c++/120518 * omp-general.cc (omp_device_num_check): Look inside a CLEANUP_POINT_EXPR when trying to optimize special cases. LGTM. Thanks, Tobias […] + tree t = *device_num; + if (TREE_CODE (t) == CLEANUP_POINT_EXPR) +t =

[PATCH] OpenMP: Fix regressions in metadirective-target-device-2.c [PR120518]

2025-06-04 Thread Sandra Loosemore
My previous patch that added a CLEANUP_POINT_EXPR around the device_num selector expression in the C++ front end broke the testcase c-c++-common/gomp/metadirective-target-device-2.c on offload targets. It confused the code in omp_device_num_check that tries to bypass error checking and do early res

[committed v2] libstdc++: Make system_clock::to_time_t always_inline [PR99832]

2025-06-04 Thread Jonathan Wakely
For some 32-bit targets Glibc supports changing the size of time_t to be 64 bits by defining _TIME_BITS=64. That causes an ABI change which would affect std::chrono::system_clock::to_time_t. Because to_time_t is not a function template, its mangled name does not depend on the return type, so it has

Re: [PATCH] libstdc++: Implement P0849R8 auto(x) library changes

2025-06-04 Thread Patrick Palka
On Wed, 5 Mar 2025, Patrick Palka wrote: > On Wed, 5 Mar 2025, Patrick Palka wrote: > > > On Thu, 24 Oct 2024, Jonathan Wakely wrote: > > > > > On Wed, 9 Oct 2024 at 14:02, Patrick Palka wrote: > > > > > > > > On Mon, 7 Oct 2024, Patrick Palka wrote: > > > > > > > > > Tested on x86_64-pc-linux-

Re: SPEC2017 526 blender regression (was Re: [PATCH v2 1/2] RISC-V: Add pattern for vector-scalar multiply-add/sub [PR119100])

2025-06-04 Thread Vineet Gupta
On 6/4/25 11:34, Paul-Antoine Arras wrote: > Hi Vineet, > > On 04/06/2025 20:29, Vineet Gupta wrote: >> Hi Paul, >> >> On 5/30/25 03:04, Paul-Antoine Arras wrote: >>> This pattern enables the combine pass (or late-combine, depending on the >>> case) >>> to merge a vec_duplicate into a plus-mult or

Re: SPEC2017 526 blender regression (was Re: [PATCH v2 1/2] RISC-V: Add pattern for vector-scalar multiply-add/sub [PR119100])

2025-06-04 Thread Paul-Antoine Arras
On 04/06/2025 20:43, Vineet Gupta wrote: On 6/4/25 11:34, Paul-Antoine Arras wrote: Hi Vineet, On 04/06/2025 20:29, Vineet Gupta wrote: Hi Paul, On 5/30/25 03:04, Paul-Antoine Arras wrote: This pattern enables the combine pass (or late-combine, depending on the case) to merge a vec_duplicate

[PATCH] libstdc++: Fix std::format thousands separators when sign present [PR120548]

2025-06-04 Thread Jonathan Wakely
The leading sign character should be skipped when deciding whether to insert thousands separators into a floating-point format. libstdc++-v3/ChangeLog: PR libstdc++/120548 * include/std/format (__formatter_fp::_M_localize): Do not * include a leading sign character in the

Re: SPEC2017 526 blender regression (was Re: [PATCH v2 1/2] RISC-V: Add pattern for vector-scalar multiply-add/sub [PR119100])

2025-06-04 Thread Paul-Antoine Arras
Hi Vineet, On 04/06/2025 20:29, Vineet Gupta wrote: Hi Paul, On 5/30/25 03:04, Paul-Antoine Arras wrote: This pattern enables the combine pass (or late-combine, depending on the case) to merge a vec_duplicate into a plus-mult or minus-mult RTL instruction. Before this patch, we have two instr

SPEC2017 526 blender regression (was Re: [PATCH v2 1/2] RISC-V: Add pattern for vector-scalar multiply-add/sub [PR119100])

2025-06-04 Thread Vineet Gupta
Hi Paul, On 5/30/25 03:04, Paul-Antoine Arras wrote: > This pattern enables the combine pass (or late-combine, depending on the case) > to merge a vec_duplicate into a plus-mult or minus-mult RTL instruction. > > Before this patch, we have two instructions, e.g.: > vfmv.v.fv6,fa0 > vfm

Re: RISC-V frm mode switching and late_combine2

2025-06-04 Thread Jeff Law
On 6/3/25 11:11 AM, Richard Sandiford wrote: Vineet Gupta writes: On 6/3/25 08:24, Richard Sandiford wrote: I think the issue is that: (insn 9 8 27 2 (parallel [ (asm_operands/v ("fsrm %0") ("") 0 [ (reg:SI 15 a5 [139]) ]

Re: [PATCH] ext-dce: Only transform extend to subreg if TRULY_NOOP_TRUNCATION [PR 120050]

2025-06-04 Thread Jeff Law
On 5/12/25 5:59 AM, Richard Sandiford wrote: Xi Ruoyao writes: The tranform would be unsafe if !TRULY_NOOP_TRUNCATION because on these machines the hardware may look at bits outside of the given mode. gcc/ChangeLog: PR rtl-optimization/120050 * ext-dce.cc (ext_dce_try_optim

Re: [PATCH v2] ext-dce: Don't refine live width with SUBREG mode if !TRULY_NOOP_TRUNCATION_MODES_P [PR 120050]

2025-06-04 Thread Jeff Law
On 6/4/25 9:40 AM, Xi Ruoyao wrote: On Wed, 2025-05-28 at 18:17 +0100, Richard Sandiford wrote: Sorry for the slow reply, had a few days off. Xi Ruoyao writes: If we see a promoted subreg and TRULY_NOOP_TRUNCATION says the truncation is not a noop, then all bits of the inner reg are live. 

Re: [PATCH 5/6] RISC-V: frm/mode-switch: Reduce FRM restores on DYN transition

2025-06-04 Thread Vineet Gupta
On 6/4/25 10:36, Jeff Law wrote: > On 5/9/25 2:27 PM, Vineet Gupta wrote: >> FRM mode switching state machine has DYN as default state which it also >> fallsback to after transitioning to other states such as DYN_CALL. >> Currently TARGET_MODE_EMIT generates a FRM restore on any transition to >> DY

[pushed] c++: constexpr prvalues vs genericize [PR120502]

2025-06-04 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Here constexpr evaluation was getting confused by the result of split_nonconstant_init, which leaves an INIT_EXPR from an empty CONSTRUCTOR to be followed by member initialization. As a result CONSTRUCTOR_NO_CLEARING was set for the time_zo

Re: RISC-V frm mode switching and late_combine2

2025-06-04 Thread Vineet Gupta
On 6/4/25 04:45, Richard Sandiford wrote: > I think the issue is that: > > (insn 9 8 27 2 (parallel [ > (asm_operands/v ("fsrm %0") ("") 0 [ > (reg:SI 15 a5 [139]) > ] > [ > (asm_inp

Re: [PATCH] widening_mul: Make better use of overflowing operations in codegen of min/max(a, add/sub(a, b))

2025-06-04 Thread Andrew Pinski
On Wed, Jun 4, 2025 at 6:27 AM Richard Biener wrote: > > On Thu, May 29, 2025 at 10:04 AM wrote: > > > > From: Dhruv Chawla > > > > This patch folds the following patterns: > > - max (a, add (a, b)) -> [sum, ovf] = addo (a, b); !ovf ? sum : a > > - max (a, sub (a, b)) -> [sum, ovf] = subo (a, b)

Re: simple frm save/restore strategy (was Re: [PATCH 3/6] RISC-V: frm/mode-switch: remove dubious frm edge insertion before call_insn)

2025-06-04 Thread Jeff Law
On 5/23/25 12:22 PM, Vineet Gupta wrote: 3. NOK: We loose the ability to instrument local RM writes - especially in the testsuite.   e.g.      a.  instrinsic setting a static RM b. get_frm() to ensure that happened (inline asm to read out frm) The tightly coupled restore kicks in be

Re: [PATCH 5/6] RISC-V: frm/mode-switch: Reduce FRM restores on DYN transition

2025-06-04 Thread Jeff Law
On 5/9/25 2:27 PM, Vineet Gupta wrote: FRM mode switching state machine has DYN as default state which it also fallsback to after transitioning to other states such as DYN_CALL. Currently TARGET_MODE_EMIT generates a FRM restore on any transition to DYN leading to spurious/extraneous FRM resto

[PUSHED] Avoid SIGSEGV in nvptx 'mkoffload' for voluminous PTX code

2025-06-04 Thread Thomas Schwinge
In commit 50be486dff4ea2676ed022e9524ef190b92ae2b1 "nvptx: libgomp+mkoffload.cc: Prepare for reverse offload fn lookup", some additional tracking of the PTX code was added, and this assumes that potentially every single character of PTX code needs to be tracked as a new chunk of PTX code. That's p

Re: [PATCH v2] libstdc++: Export std::indirect and std::polymorphic from std module [PR119152]

2025-06-04 Thread Jonathan Wakely
On Wed, 4 Jun 2025 at 17:04, Tomasz Kamiński wrote: > > PR libstdc++/119152 > > libstdc++-v3/ChangeLog: > > * src/c++23/std.cc.in (std::indirect, pmr::indirect) > [__cpp_lib_indirect] > (std::polymorphic, pmr::polymorphic) [__cpp_lib_polymorphic]: Export. > --- > v2

Re: [PATCH] Use MEM_EXPR only if MEM_P is true

2025-06-04 Thread Stefan Schulze Frielinghaus
On Wed, Jun 04, 2025 at 09:12:58AM +0100, Richard Sandiford wrote: > Richard Biener writes: > > On Wed, Jun 4, 2025 at 7:28 AM H.J. Lu wrote: > >> > >> On s390x, for input: > >> > >> (call_insn/u 7 6 11 2 (parallel [ > >> (set (reg:SI 2 %r2) > >> (call (subreg:QI (symb

Re: [PATCH v2] ext-dce: Don't refine live width with SUBREG mode if !TRULY_NOOP_TRUNCATION_MODES_P [PR 120050]

2025-06-04 Thread Xi Ruoyao
On Wed, 2025-05-28 at 18:17 +0100, Richard Sandiford wrote: > Sorry for the slow reply, had a few days off. > > Xi Ruoyao writes: > > If we see a promoted subreg and TRULY_NOOP_TRUNCATION says the > > truncation is not a noop, then all bits of the inner reg are live.  We > > cannot reduce the liv

Re: [PATCH v5 7/8] libstdc++: Add tests for layout_stride.

2025-06-04 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 5:45 PM Luc Grosheintz wrote: > > > On 6/4/25 15:38, Tomasz Kaminski wrote: > > On Wed, Jun 4, 2025 at 2:19 PM Tomasz Kaminski > wrote: > > > >> > >> > >> On Wed, Jun 4, 2025 at 2:05 PM Luc Grosheintz > > >> wrote: > >> > >>> > >>> > >>> On 6/4/25 13:19, Tomasz Kaminski w

[PATCH v2] libstdc++: Export std::indirect and std::polymorphic from std module [PR119152]

2025-06-04 Thread Tomasz Kamiński
PR libstdc++/119152 libstdc++-v3/ChangeLog: * src/c++23/std.cc.in (std::indirect, pmr::indirect) [__cpp_lib_indirect] (std::polymorphic, pmr::polymorphic) [__cpp_lib_polymorphic]: Export. --- v2 adds missing pmr versions. Thanks to Patrick, for noticing that. OK fo

[PATCH v6 3/8] libstdc++: Add tests for layout_left.

2025-06-04 Thread Luc Grosheintz
Implements a suite of tests for the currently implemented parts of layout_left. The individual tests are templated over the layout type, to allow reuse as more layouts are added. libstdc++-v3/ChangeLog: * testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc: New test. * tes

[PATCH] powerpc: testsuite: Fix powerpc FMV symbol tests [PR 120519]

2025-06-04 Thread Alfie Richards
Hi, This fixes the FMV powerpc tests I recently committed, and hopefully makes them work on a wider range of target configurations. I plan to commit this on Monday if no one has any objections. Thanks, Alfie --- >8 --- As discussed on the BZ page, this removes the tests on the symbols in the r

Re: [PATCH v5 7/8] libstdc++: Add tests for layout_stride.

2025-06-04 Thread Luc Grosheintz
On 6/4/25 15:38, Tomasz Kaminski wrote: On Wed, Jun 4, 2025 at 2:19 PM Tomasz Kaminski wrote: On Wed, Jun 4, 2025 at 2:05 PM Luc Grosheintz wrote: On 6/4/25 13:19, Tomasz Kaminski wrote: Ah, sorry I got confused in the review suggestions, and latter when checking the code. What I me

[PATCH v4 2/3] aarch64: encapsulate note.gnu.property emission into a class

2025-06-04 Thread Matthieu Longo
The code emitting the GNU properties was moved to a separate file to improve modularity and "releave" the 31000-lines long aarch64.cc file from a few lines. It introduces a new namespace "aarch64::" for AArch64 backend which reduce the length of function names by not prepending 'aarch64_' to each

[PATCH v4 1/3] aarch64: add debug comments to feature properties in .note.gnu.property

2025-06-04 Thread Matthieu Longo
GNU properties are emitted to provide some information about the features used in the generated code like BTI, GCS, or PAC. However, no debug comment are emitted in the generated assembly even if -dA is provided. It makes understanding the information stored in the .note.gnu.property section more d

Re: [PATCH] Use MEM_EXPR only if MEM_P is true

2025-06-04 Thread Stefan Schulze Frielinghaus
On Wed, Jun 04, 2025 at 05:07:13PM +0200, Jakub Jelinek wrote: > On Wed, Jun 04, 2025 at 05:02:45PM +0200, Stefan Schulze Frielinghaus wrote: > > Building a subreg in case of > > > > else if (GET_CODE (x) == CONST) > > { > > /* Extract the symbol ref from: > > (mem:QI (const:DI

Re: [PATCH v5 10/24] Add dispatcher_resolver_function and is_target_clone flags to cgraph_node.

2025-06-04 Thread Jeff Law
On 5/29/25 6:46 AM, Alfie Richards wrote: These are needed to correctly mangle FMV declarations. gcc/ChangeLog: * cgraph.h (struct cgraph_node): Add dispatcher_resolver_function and is_target_clone. OK jeff

[PATCH v6 1/8] libstdc++: Improve naming, whitespace and silence warnings for extents.

2025-06-04 Thread Luc Grosheintz
libstdc++-v3/ChangeLog: * include/std/mdspan(__mdspan::_ExtentsStorage): Change name of private member _M_dynamic_extens to _M_dyn_exts. * include/std/mdspan(extents): Change name of private member from _M_dynamic_extents to _M_exts. * include/std/mdspan: Fi

Re: [PATCH] c++: substituting fn parm redeclared with dep alias tmpl [PR120224]

2025-06-04 Thread Patrick Palka
On Wed, 21 May 2025, Jason Merrill wrote: > On 5/20/25 11:28 AM, Patrick Palka wrote: > > On Mon, 19 May 2025, Patrick Palka wrote: > > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look > > > OK for trunk/15/14? > > > > Whoops, CI reports I missed a testsuite adjustment exp

[PATCH v4 0/3] aarch64: add support of AEABI Build Attributes

2025-06-04 Thread Matthieu Longo
GCS (Guarded Control Stack, an Armv9.4-a extension) requires some caution at runtime. The runtime linker needs to reason about the compatibility of a set of relocable object files that might not have been compiled with the same compiler. Up until now, those metadata, used for the previously ment

[PATCH v4 3/3] aarch64: add support for AEABI Build Attributes

2025-06-04 Thread Matthieu Longo
GCS (Guarded Control Stack, an Armv9.4-a extension) requires some caution at runtime. The runtime linker needs to reason about the compatibility of a set of relocable object files that might not have been compiled with the same compiler. Up until now, those metadata, used for the previously mention

[PATCH v6 8/8] libstdc++: Make layout_left(layout_stride) noexcept.

2025-06-04 Thread Luc Grosheintz
[mdspan.layout.left.cons] of N4950 states that this ctor is not noexcept. Since, all other ctors of layout_left, layout_right or layout_stride are noexcept, the choice was made, based on [res.on.exception.handling], to make this ctor noexcept. Two other major standard library implementations make

[PATCH v6 7/8] libstdc++: Add tests for layout_stride.

2025-06-04 Thread Luc Grosheintz
Implements the tests for layout_stride and for the features of the other two layouts that depend on layout_stride. libstdc++-v3/ChangeLog: * testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc: Add tests for layout_stride. * testsuite/23_containers/mdspan/layouts/c

Re: [PATCH] Use MEM_EXPR only if MEM_P is true

2025-06-04 Thread Jakub Jelinek
On Wed, Jun 04, 2025 at 05:02:45PM +0200, Stefan Schulze Frielinghaus wrote: > Building a subreg in case of > > else if (GET_CODE (x) == CONST) > { > /* Extract the symbol ref from: > (mem:QI (const:DI (unspec:DI [(symbol_ref:DI ("foo"))] >

Re: [PATCH v5 09/24] Add assembler_name to cgraph_function_version_info.

2025-06-04 Thread Jeff Law
On 5/29/25 6:46 AM, Alfie Richards wrote: Add the assembler_name member to cgraph_function_version_info to store the base assembler name of the funciton set, before FMV mangling. This is Just a typo in the patch description. Should be "function". used in later patches for refactoring FMV ma

Re: [PATCH] libstdc++: Export std::indirect and std::polymorphic from std module [PR119152]

2025-06-04 Thread Patrick Palka
I think we also need to export the ::pmr version? On Wed, Jun 4, 2025 at 10:44 AM Tomasz Kamiński wrote: > > PR libstdc++/119152 > > libstdc++-v3/ChangeLog: > > * src/c++23/std.cc.in (std::indirect) [__cpp_lib_indirect] > (std::polymorphic) [__cpp_lib_polymorphic]: Export.

[PATCH v6 6/8] libstdc++: Implement layout_stride from mdspan.

2025-06-04 Thread Luc Grosheintz
Implements the remaining parts of layout_left and layout_right; and all of layout_stride. The implementation of layout_stride::mapping::is_exhaustive applies the following change to the standard: 4266. layout_stride::mapping should treat empty mappings as exhaustive https://cplusplus.github.io

[PATCH v6 0/8] Implement layouts from mdspan.

2025-06-04 Thread Luc Grosheintz
The previous iteration can be found here: https://gcc.gnu.org/pipermail/libstdc++/2025-May/061781.html Changes since v5: * Fixed tests on 32-bit systems. * Expand tests to check absense of UB while multiplying dynamic extents. * Formatting (several places). * static_assert for size of

[PATCH v6 2/8] libstdc++: Implement layout_left from mdspan.

2025-06-04 Thread Luc Grosheintz
Implements the parts of layout_left that don't depend on any of the other layouts. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_left): New class. * src/c++23/std.cc.in: Add layout_left. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 303 +++

[PATCH v6 4/8] libstdc++: Implement layout_right from mdspan.

2025-06-04 Thread Luc Grosheintz
Implement the parts of layout_left that depend on layout_right; and the parts of layout_right that don't depend on layout_stride. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_right): New class. * src/c++23/std.cc.in: Add layout_right. Signed-off-by: Luc Grosheintz --- l

[PATCH v6 5/8] libstdc++: Add tests for layout_right.

2025-06-04 Thread Luc Grosheintz
Adds tests for layout_right and for the parts of layout_left that depend on layout_right. libstdc++-v3/ChangeLog: * testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc: Add tests for layout_right. * testsuite/23_containers/mdspan/layouts/ctors.cc: Add tests for

Re: [PATCH v2] libstdc++: Test for formatting with empty spec for time points.

2025-06-04 Thread Jonathan Wakely
On Wed, 4 Jun 2025 at 15:35, Tomasz Kaminski wrote: > > > > On Wed, Jun 4, 2025 at 4:04 PM Jonathan Wakely wrote: >> >> On 04/06/25 13:06 +0200, Tomasz Kamiński wrote: >> >Adding a tests for behavior of the ostream operator and the formatting >> >with empty chronio-spec for the chrono types. Curr

Re: [PATCH v5 08/24] Add get_clone_versions and get_target_version functions.

2025-06-04 Thread Jeff Law
On 5/29/25 6:46 AM, Alfie Richards wrote: This is a reimplementation of get_target_clone_attr_len, get_attr_str, and separate_attrs using string_slice and auto_vec to make memory management and use simpler. Adds get_target_version helper function to get the target_version string from a decl.

Re: [PATCH] libstdc++: Export std::indirect and std::polymorphic from std module [PR119152]

2025-06-04 Thread Jonathan Wakely
On Wed, 4 Jun 2025 at 15:44, Tomasz Kamiński wrote: > > PR libstdc++/119152 > > libstdc++-v3/ChangeLog: > > * src/c++23/std.cc.in (std::indirect) [__cpp_lib_indirect] > (std::polymorphic) [__cpp_lib_polymorphic]: Export. > --- > OK for trunk? OK thanks > > libstdc++-v3/

Re: [PATCH] RISC-V:Add the MIPS P8700 conditional move extension instruction support.

2025-06-04 Thread Jeff Law
On 5/27/25 5:06 AM, Umesh Kalappa wrote: The P8700 is a high-performance processor from MIPS by extending RISCV with the MIPS custom instruction and the following changes are added to enable the conditional move support from mips No regressions are found for "runtest --tool gcc --target_boa

[PATCH] libstdc++: Export std::indirect and std::polymorphic from std module [PR119152]

2025-06-04 Thread Tomasz Kamiński
PR libstdc++/119152 libstdc++-v3/ChangeLog: * src/c++23/std.cc.in (std::indirect) [__cpp_lib_indirect] (std::polymorphic) [__cpp_lib_polymorphic]: Export. --- OK for trunk? libstdc++-v3/src/c++23/std.cc.in | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libstdc

Re: [PATCH v2] libstdc++: Test for formatting with empty spec for time points.

2025-06-04 Thread Tomasz Kaminski
On Wed, Jun 4, 2025 at 4:04 PM Jonathan Wakely wrote: > On 04/06/25 13:06 +0200, Tomasz Kamiński wrote: > >Adding a tests for behavior of the ostream operator and the formatting > >with empty chronio-spec for the chrono types. Current coverage is: > > * time point, zoned_time and local_time_forma

[PATCH] RISC-V: Add patterns for vector-scalar negate-(multiply-add/sub) [PR119100]

2025-06-04 Thread Paul-Antoine Arras
This pattern enables the combine pass (or late-combine, depending on the case) to merge a vec_duplicate into a (possibly negated) minus-mult RTL instruction. Before this patch, we have two instructions, e.g.: vfmv.v.fv6,fa0 vfnmadd.vv v2,v6,v4 After, we get only one: vfnmadd.vf

Re: [PATCH] libstdc++: Implement C++26 std::polymorphic [PR119152]

2025-06-04 Thread Patrick Palka
On Tue, May 27, 2025 at 8:37 AM Tomasz Kamiński wrote: > > From: Jonathan Wakely > > This patch implements C++26 std::polymorphic as specified in P3019 with > amendment to move assignment from LWG 4251. > > The implementation always allocate stored object on the heap. The manager > function (_M_m

[Patch][RFC?] OpenMP: Add omp_get_initial_device/omp_get_num_devices builtins

2025-06-04 Thread Tobias Burnus
This came up when looking at some context selectors that use 'target_device', but is largely unrelated to it. (target_device has its own special casing). Namely, it makes omp_get_initial_device and omp_get_num_devices PURE, which attributes don't permit for Fortran - based on the state that the n

Re: [PATCH v2] libstdc++: Test for formatting with empty spec for time points.

2025-06-04 Thread Jonathan Wakely
On 04/06/25 13:06 +0200, Tomasz Kamiński wrote: Adding a tests for behavior of the ostream operator and the formatting with empty chronio-spec for the chrono types. Current coverage is: * time point, zoned_time and local_time_format in this commit, * duration and hh_mm_ss in r16-1099-gac0a04b7a25

Re: [PATCH] ranger: Add support for float <-> float casts [PR120231]

2025-06-04 Thread Andrew MacLeod
Fine with me.  I don't think Aldy got to many of the cast conversions. Andrew On 6/3/25 03:31, Jakub Jelinek wrote: Hi! I've noticed we don't even support say float -> double and other scalar floating point to scalar floating point conversions in the ranger, we just end up with VARYING for tho

  1   2   >