Re: [PATCH v2][GCC] aarch64: Add support for ACLE hint intrinsics

Srinath Parvathaneni <[email protected]>
Newsgroups gmane.comp.gcc.patches
Message-ID <AS8PR08MB100991C277A1E50EFBDB61DE39BA42@AS8PR08MB10099.eurprd08.prod.outlook.com>
Ping!!
________________________________
From: Srinath Parvathaneni <[email protected]>
Sent: 11 August 2026 17:13
To: [email protected] <[email protected]>
Cc: Alice Carlotti <[email protected]>; Alex Coplan <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH v2][GCC] aarch64: Add support for ACLE hint intrinsics

Hi,

Changes v1 -> v2:

* Rebase the old v1 patch:
  https://gcc.gnu.org/legacy-ml/gcc-patches/2019-05/msg01925.html
* Add memory clobbers to the hint instruction patterns so that the
  builtins are treated as affecting memory.
* Update the tests to reflect the addition of the memory clobbers.
* Change the hint intrinsic definitions in arm_acle.h from inline
  functions to macro expansions.
-------------------------------------------------------------------

This patch adds support for ACLE system hint intrinsics
__yield(), __wfe(), __wfi(), __sev() and __sevl() and their
corresponding AArch64 builtins. The ACLE specification is
available at [1].

Regression tested on aarch64-none-linux-gnu with no regressions.

Ok for trunk?

Thanks,
Srinath

gcc/ChangeLog:

        * config/aarch64/aarch64-builtins.cc (enum aarch64_builtins): Add
        AARCH64_BUILTIN_YIELD, AARCH64_BUILTIN_WFE, AARCH64_BUILTIN_WFI,
        AARCH64_BUILTIN_SEV and AARCH64_BUILTIN_SEVL.
        (aarch64_init_syshintop_builtins): New function.
        (aarch64_general_init_builtins): Call aarch64_init_syshintop_builtins.
        (aarch64_general_expand_builtin): Expand the system hint builtins.
        * config/aarch64/aarch64.md (unspecv): Add UNSPECV_YIELD, UNSPECV_WFE,
        UNSPECV_WFI, UNSPECV_SEV and UNSPECV_SEVL.
        (yield): New insn pattern.
        (wfe): Likewise.
        (wfi): Likewise.
        (sev): Likewise.
        (sevl): Likewise.
        * config/aarch64/arm_acle.h (__yield): Define hint intrinsics.
        (__wfe): Likewise.
        (__wfi): Likewise.
        (__sev): Likewise.
        (__sevl): Likewise.

gcc/testsuite/ChangeLog:

        * gcc.target/aarch64/acle/hint-1.c: New test.
        * gcc.target/aarch64/acle/hint-2.c: Likewise.

[1] https://github.com/ARM-software/acle/blob/main/main/acle.md#hints
---
 gcc/config/aarch64/aarch64-builtins.cc        | 51 ++++++++++++
 gcc/config/aarch64/aarch64.md                 | 45 +++++++++++
 gcc/config/aarch64/arm_acle.h                 | 16 ++++
 .../gcc.target/aarch64/acle/hint-1.c          | 26 +++++++
 .../gcc.target/aarch64/acle/hint-2.c          | 77 +++++++++++++++++++
 5 files changed, 215 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/hint-1.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/hint-2.c
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.