[PATCH][GCC][Arm] Missing optimization pattern for rev16 on architectures with thumb1

2024-02-12 Thread Matthieu Longo
information at https://linaro.atlassian.net/browse/GNU-1141 gcc/testsuite/ChangeLog: * gcc.target/arm/rev16_2.c: XFAIL when compiled with Thumb1.From 11be6a0feb1cbc0bca6e23dacf98c5817b71ba3d Mon Sep 17 00:00:00 2001 From: Matthieu Longo Date: Thu, 8 Feb 2024 18:13:49 + Subject: [PATCH

RE: [PATCH][GCC][Arm] Define __ARM_FEATURE_BF16 when +bf16 feature is enabled

2024-01-22 Thread Matthieu Longo
RD_FLOAT\ && bitmap_bit_p (arm_active_target.isa, isa_bit_neon)) Please let me know if you agree on the simplification. Regards, Matthieu -Original Message- From: Richard Earnshaw Sent: Wednesday, January 10, 2024 3:26 PM To: Matthieu Longo ; gcc-patches@gcc.

[PATCH][GCC][Arm] Add pattern for bswap + rotate -> rev16 [Bug 108933]

2024-01-22 Thread Matthieu Longo
rev16 pattern was not recognised anymore as a change in the bswap tree pass was introducing a new GIMPLE form, not recognized by the assembly final transformation pass. More details in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108933 gcc/ChangeLog: PR target/108933 * config/a

Re: [PATCH][GCC][Arm] Add pattern for bswap + rotate -> rev16 [Bug 108933]

2024-01-29 Thread Matthieu Longo
, Matthieu Longo wrote: rev16 pattern was not recognised anymore as a change in the bswap tree pass was introducing a new GIMPLE form, not recognized by the assembly final transformation pass. More details in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108933 gcc/ChangeLog:     PR target

[PATCH][GCC][Arm] Define __ARM_FEATURE_BF16 when +bf16 feature is enabled

2024-01-08 Thread Matthieu Longo
Hi, Arm GCC backend does not define __ARM_FEATURE_BF16 when +bf16 is specified (via -march option, or target pragma) whereas it is supposed to be tested before including arm_bf16.h (as specified in ACLE document: https://arm-software.github.io/acle/main/acle.html#arm_bf16h). gcc/ChangeLog:

[PATCH v1 0/3][libgcc] store signing key and signing method in DWARF _Unwind_FrameState

2024-07-19 Thread Matthieu Longo
ipermail/gcc-patches/2022-May/594414.html Ok for master? I don't have commit access so I need someone to commit on my behalf. Regards, Matthieu. Matthieu Longo (3): aarch64: store signing key and signing method in DWARF _Unwind_FrameState libgcc: hide CIE and FDE data for DWARF archi

[PATCH v1 1/3] aarch64: store signing key and signing method in DWARF _Unwind_FrameState

2024-07-19 Thread Matthieu Longo
This patch is only a refactoring of the existing implementation of PAuth and returned-address signing. The existing behavior is preserved. _Unwind_FrameState already contains several CIE and FDE information (see the attributes below the comment "The information we care about from the CIE/FDE" in l

[PATCH v1 2/3] libgcc: hide CIE and FDE data for DWARF architecture extensions behind a handler.

2024-07-19 Thread Matthieu Longo
This patch provides a new handler MD_ARCH_FRAME_STATE_T to hide an architecture-specific structure containing CIE and FDE data related to DWARF architecture extensions. Hiding the architecture-specific attributes behind a handler has the following benefits: 1. isolating those data from the generic

[PATCH v1 3/3] libgcc: update configure (regenerated by autoreconf)

2024-07-19 Thread Matthieu Longo
libgcc/ChangeLog: * configure: Regenerate. --- libgcc/configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libgcc/configure b/libgcc/configure index a69d314374a..15a0be23644 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -587,6 +587,7 @@ ac_includes_default='/* none */

Re: [PATCH v1 1/3] aarch64: store signing key and signing method in DWARF _Unwind_FrameState

2024-07-29 Thread Matthieu Longo
On 2024-07-19 15:54, Matthieu Longo wrote: This patch is only a refactoring of the existing implementation of PAuth and returned-address signing. The existing behavior is preserved. _Unwind_FrameState already contains several CIE and FDE information (see the attributes below the comment &quo

Re: [PATCH v1 0/3][libgcc] store signing key and signing method in DWARF _Unwind_FrameState

2024-07-29 Thread Matthieu Longo
On 2024-07-19 15:54, Matthieu Longo wrote: This patch series is only a refactoring of the existing implementation of PAuth and returned-address signing. The existing behavior is preserved. 1. aarch64: store signing key and signing method in DWARF _Unwind_FrameState _Unwind_FrameState already

[PATCH v1 0/4] dwarf2: add hooks for architecture-specific CFIs

2024-08-06 Thread Matthieu Longo
rc64-unknown-linux-gnu. Ok for master? I don't have commit access so I need someone to commit on my behalf. Regards, Matthieu. Matthieu Longo (4): Rename REG_CFA_TOGGLE_RA_MANGLE to REG_CFA_NEGATE_RA_STATE dwarf2: add hooks for architecture-specific CFIs aarch64 testsuite: explain expec

[PATCH v1 1/4] Rename REG_CFA_TOGGLE_RA_MANGLE to REG_CFA_NEGATE_RA_STATE

2024-08-06 Thread Matthieu Longo
The current name REG_CFA_TOGGLE_RA_MANGLE is not representative of what it really is, i.e. a register to represent several states, not only a binary one. Same for dwarf2out_frame_debug_cfa_toggle_ra_mangle. gcc/ChangeLog: * combine-stack-adj.cc (no_unhandled_cfa): Rename.

[PATCH v1 3/4] aarch64 testsuite: explain expectections for pr94515* tests

2024-08-06 Thread Matthieu Longo
gcc/testsuite/ChangeLog: * g++.target/aarch64/pr94515-1.C: Improve test documentation. * g++.target/aarch64/pr94515-2.C: Same. --- gcc/testsuite/g++.target/aarch64/pr94515-1.C | 8 ++ gcc/testsuite/g++.target/aarch64/pr94515-2.C | 28 +++- 2 files changed, 30

[PATCH v1 2/4] dwarf2: add hooks for architecture-specific CFIs

2024-08-06 Thread Matthieu Longo
Architecture-specific CFI directives are currently declared an processed among others architecture-independent CFI directives in gcc/dwarf2* files. This approach creates confusion, specifically in the case of DWARF instructions in the vendor space and using the same instruction code. Such a clash

[PATCH v1 4/4] dwarf2: store the RA state in CFI row

2024-08-06 Thread Matthieu Longo
On AArch64, the RA state informs the unwinder whether the return address is mangled and how, or not. This information is encoded in a boolean in the CFI row. This binary approach prevents from expressing more complex configuration, as it is the case with PAuth_LR introduced in Armv9.5-A. This patc

Re: [PATCH v1 3/4] aarch64: improve assembly debug comments for build attributes

2024-10-16 Thread Matthieu Longo
On 2024-10-08 18:45, Richard Sandiford wrote: Matthieu Longo writes: The previous implementation to emit build attributes did not support string values (asciz) in aeabi_subsection, and was not emitting values associated to tags in the assembly comments. This new approach provides a more user

Re: [PATCH v1 4/4] aarch64: encapsulate note.gnu.property emission into a class

2024-10-16 Thread Matthieu Longo
On 2024-10-08 18:51, Richard Sandiford wrote: Matthieu Longo writes: gcc/ChangeLog: * config.gcc: Add aarch64-dwarf-metadata.o to extra_objs. * config/aarch64/aarch64-dwarf-metadata.h (class section_note_gnu_property): Encapsulate GNU properties code into a class

Re: [PATCH v1 1/4] aarch64: add debug comments to feature properties in .note.gnu.property

2024-10-16 Thread Matthieu Longo
On 2024-10-08 18:39, Richard Sandiford wrote: Sorry for the slow review. Matthieu Longo writes: GNU properties are emitted to provide some information about the features used in the generated code like PAC, BTI, or GCS. However, no debug comment are emitted in the generated assembly even if

Re: [PATCH v1 2/4] aarch64: add minimal support for GCS build attributes

2024-10-16 Thread Matthieu Longo
On 2024-10-08 18:42, Richard Sandiford wrote: Since this is an RFC, it would probably be more helpful to get review comments about the design or the adherence to the spec. I'll need to look into things a bit more for that, though, so I'm afraid the below is more implementation trivia.

[PATCH v2 0/4] aarch64: add minimal support of AEABI build attributes for GCS

2024-10-23 Thread Matthieu Longo
, Matthieu Diff with revision 1 [2]: - update the description of (2) - address the comments related to the tests in (2) - add new commits (1), (3) and (4) Diff with revision 2 [3]: - address comments of Richard Sandiford in revision 2. - fix several formatting mistakes. - remove RFC tag. Matthieu Longo

[PATCH v2 2/4] aarch64: add minimal support of AEABI build attributes for GCS.

2024-10-23 Thread Matthieu Longo
ibutes/no-build-attribute-gcs.c: New test. * gcc.target/aarch64/build-attributes/no-build-attribute-pac.c: New test. * gcc.target/aarch64/build-attributes/no-build-attribute-standard.c: New test. Co-Authored-By: Matthieu Longo --- gcc/config.in | 6

[PATCH v2 4/4] aarch64: encapsulate note.gnu.property emission into a class

2024-10-23 Thread Matthieu Longo
gcc/ChangeLog: * config.gcc: Add aarch64-dwarf-metadata.o to extra_objs. * config/aarch64/aarch64-dwarf-metadata.h (class section_note_gnu_property): Encapsulate GNU properties code into a class. * config/aarch64/aarch64.cc (GNU_PROPERTY_AARCH64_FEAT

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

2024-10-23 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

[PATCH v2 3/4] aarch64: improve assembly debug comments for AEABI build attributes

2024-10-23 Thread Matthieu Longo
The previous implementation to emit AEABI build attributes did not support string values (asciz) in aeabi_subsection, and was not emitting values associated to tags in the assembly comments. This new approach provides a more user-friendly interface relying on typing, and improves the emitted assem

Re: [PATCH v2 0/4] aarch64: add minimal support of AEABI build attributes for GCS

2024-11-11 Thread Matthieu Longo
On 2024-10-23 17:43, Richard Sandiford wrote: Matthieu Longo writes: The primary focus of this patch series is to add support for build attributes in the context of GCS (Guarded Control Stack, an Armv9.4-a extension) to the AArch64 backend. It addresses comments from revision 1 [2] and 2 [3

Re: [PATCH v1 1/3] aarch64: store signing key and signing method in DWARF _Unwind_FrameState

2024-09-17 Thread Matthieu Longo
On 2024-08-06 11:06, Richard Sandiford wrote: Sorry for the slow review. Matthieu Longo writes: This patch is only a refactoring of the existing implementation of PAuth and returned-address signing. The existing behavior is preserved. _Unwind_FrameState already contains several CIE and FDE

Re: [PATCH v1 2/3] libgcc: hide CIE and FDE data for DWARF architecture extensions behind a handler.

2024-09-17 Thread Matthieu Longo
On 2024-08-06 11:21, Richard Sandiford wrote: Matthieu Longo writes: This patch provides a new handler MD_ARCH_FRAME_STATE_T to hide an architecture-specific structure containing CIE and FDE data related to DWARF architecture extensions. Hiding the architecture-specific attributes behind a

Re: [PATCH v1 2/4] dwarf2: add hooks for architecture-specific CFIs

2024-09-17 Thread Matthieu Longo
On 2024-08-13 16:31, Richard Sandiford wrote: Matthieu Longo writes: Architecture-specific CFI directives are currently declared an processed among others architecture-independent CFI directives in gcc/dwarf2* files. This approach creates confusion, specifically in the case of DWARF

Re: [PATCH v1 3/4] aarch64 testsuite: explain expectections for pr94515* tests

2024-09-17 Thread Matthieu Longo
On 2024-08-13 16:53, Richard Sandiford wrote: Matthieu Longo writes: gcc/testsuite/ChangeLog: * g++.target/aarch64/pr94515-1.C: Improve test documentation. * g++.target/aarch64/pr94515-2.C: Same. The patch is OK as-is, since it's clearly a strict improvement ove

Re: [PATCH v1 4/4] dwarf2: store the RA state in CFI row

2024-09-17 Thread Matthieu Longo
On 2024-08-06 15:28, Jakub Jelinek wrote: On Tue, Aug 06, 2024 at 03:07:44PM +0100, Matthieu Longo wrote: On AArch64, the RA state informs the unwinder whether the return address is mangled and how, or not. This information is encoded in a boolean in the CFI row. This binary approach prevents

[PATCH] aarch64: fix build failure on aarch64-none-elf

2024-09-26 Thread Matthieu Longo
A previous patch ([1]) introduced a build regression on aarch64-none-elf target. The changes were primarilly tested on aarch64-unknown-linux-gnu, so the issue was missed during development. The includes are slighly different between the two targets, and due to some include rules ([2]), "aarch64-unw

Re: [PATCH] aarch64: fix build failure on aarch64-none-elf

2024-09-27 Thread Matthieu Longo
On 2024-09-26 18:41, Andrew Pinski wrote: On Thu, Sep 26, 2024 at 10:28 AM Andrew Pinski wrote: On Thu, Sep 26, 2024 at 10:15 AM Matthieu Longo wrote: A previous patch ([1]) introduced a build regression on aarch64-none-elf target. The changes were primarilly tested on aarch64-unknown

[PATCH v1 2/4] aarch64: add minimal support for GCS build attributes

2024-09-27 Thread Matthieu Longo
From: Srinath Parvathaneni 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, GNU properties are

[PATCH v1 0/4][RFC] aarch64: add minimal support for GCS build attributes

2024-09-27 Thread Matthieu Longo
/662825.html [2]: https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/vendors/ARM/heads/gcs Regards, Matthieu Matthieu Longo (3): aarch64: add debug comments to feature properties in .note.gnu.property aarch64: improve assembly debug comments for build attributes aarch64: encapsulate

[PATCH v1 4/4] aarch64: encapsulate note.gnu.property emission into a class

2024-09-27 Thread Matthieu Longo
gcc/ChangeLog: * config.gcc: Add aarch64-dwarf-metadata.o to extra_objs. * config/aarch64/aarch64-dwarf-metadata.h (class section_note_gnu_property): Encapsulate GNU properties code into a class. * config/aarch64/aarch64.cc (GNU_PROPERTY_AARCH64_FEATURE_1_AND): Define. (GNU

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

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

[PATCH v1 3/4] aarch64: improve assembly debug comments for build attributes

2024-09-27 Thread Matthieu Longo
The previous implementation to emit build attributes did not support string values (asciz) in aeabi_subsection, and was not emitting values associated to tags in the assembly comments. This new approach provides a more user-friendly interface relying on typing, and improves the emitted assembly co

[PATCH v2 1/4] aarch64: store signing key and signing method in DWARF _Unwind_FrameState

2024-09-18 Thread Matthieu Longo
This patch is only a refactoring of the existing implementation of PAuth and returned-address signing. The existing behavior is preserved. _Unwind_FrameState already contains several CIE and FDE information (see the attributes below the comment "The information we care about from the CIE/FDE" in l

[PATCH v2 0/4][libgcc] store signing key and signing method in DWARF _Unwind_FrameState

2024-09-18 Thread Matthieu Longo
et with unusual DWARF [1] Regression tested on aarch64-unknown-linux-gnu, and no regression found. [1]: https://gcc.gnu.org/pipermail/gcc-patches/2022-May/594414.html Ok for master? I don't have commit access so I need someone to commit on my behalf. Regards, Matthieu. Matthieu Longo (4): a

[PATCH v2 2/4] aarch64: skip copy of RA state register into target context

2024-09-18 Thread Matthieu Longo
The RA state register is local to a frame, so it should not be copied to the target frame during the context installation. This patch adds a new backend handler that check whether a register needs to be skipped or not before its installation. libgcc/ChangeLog: * config/aarch64/aarch64-unwind.

[PATCH v2 4/4] libgcc: update configure (regenerated by autoreconf)

2024-09-18 Thread Matthieu Longo
libgcc/ChangeLog: * configure: Regenerate. --- libgcc/configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libgcc/configure b/libgcc/configure index a69d314374a..15a0be23644 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -587,6 +587,7 @@ ac_includes_default='/* none */

[PATCH v2 1/4] Rename REG_CFA_TOGGLE_RA_MANGLE to REG_CFA_NEGATE_RA_STATE

2024-09-18 Thread Matthieu Longo
The current name REG_CFA_TOGGLE_RA_MANGLE is not representative of what it really is, i.e. a register to represent several states, not only a binary one. Same for dwarf2out_frame_debug_cfa_toggle_ra_mangle. gcc/ChangeLog: * combine-stack-adj.cc (no_unhandled_cfa): Rename.

[PATCH v2 3/4] libgcc: hide CIE and FDE data for DWARF architecture extensions behind a handler.

2024-09-18 Thread Matthieu Longo
This patch provides a new handler MD_ARCH_FRAME_STATE_T to hide an architecture-specific structure containing CIE and FDE data related to DWARF architecture extensions. Hiding the architecture-specific attributes behind a handler has the following benefits: 1. isolating those data from the generic

[PATCH v2 2/4] dwarf2: add hooks for architecture-specific CFIs

2024-09-18 Thread Matthieu Longo
Architecture-specific CFI directives are currently declared an processed among others architecture-independent CFI directives in gcc/dwarf2* files. This approach creates confusion, specifically in the case of DWARF instructions in the vendor space and using the same instruction code. Such a clash

[PATCH v2 0/4] dwarf2: add hooks for architecture-specific CFIs

2024-09-18 Thread Matthieu Longo
-linux-gnu and ran GCC's & G++'s testsuites for AArch64. Built GCC stage 1 for target sparc64-unknown-linux-gnu. Ok for master? I don't have commit access so I need someone to commit on my behalf. Regards, Matthieu. Matthieu Longo (4): Rename REG_CFA_TOGGLE_RA_MANGLE to REG_CFA_N

[PATCH v2 3/4] aarch64 testsuite: explain expectections for pr94515* tests

2024-09-18 Thread Matthieu Longo
gcc/testsuite/ChangeLog: * g++.target/aarch64/pr94515-1.C: Improve test documentation. * g++.target/aarch64/pr94515-2.C: Same. --- gcc/testsuite/g++.target/aarch64/pr94515-1.C | 8 gcc/testsuite/g++.target/aarch64/pr94515-2.C | 39 +--- 2 files changed, 41 in

[PATCH v2 4/4] dwarf2: store the RA state in CFI row

2024-09-18 Thread Matthieu Longo
On AArch64, the RA state informs the unwinder whether the return address is mangled and how, or not. This information is encoded in a boolean in the CFI row. This binary approach prevents from expressing more complex configuration, as it is the case with PAuth_LR introduced in Armv9.5-A. This patc

[PATCH v1] autoupdate: replace obsolete macros in libiberty

2024-11-18 Thread Matthieu Longo
Autoreconf-2.72 warns about obsolete macros. This patch aims at removing the noise from a future upgrade to autoreconf-2.72 or later. This is in no a way a complete patch allowing the upgrade to autoreconf-2.72. - AC_GNU_SOURCE by AC_USE_SYSTEM_EXTENSIONS https://www.gnu.org/savannah-checkouts/g

[PATCH] MAINTAINERS: add myself to write after approval

2024-12-11 Thread Matthieu Longo
Ralph Loaderralph Sheldon Lobosmlobo Gabor Loki loki +Matthieu Longo mlongo Sandra Loosemoresandra Manuel López-Ibáñez manu