Skip to content

Commit 3aba045

Browse files
author
Victor Do Nascimento
committed
aarch64: Add support for GCS system registers with the +gcs modifier
Given the introduction of system registers associated with the Guarded Control Stack extension to Armv9.4-a in Binutils and their reliance on the `+gcs' modifier, we implement the necessary changes in GCC to allow for them to be recognized by the compiler. gcc/ChangeLog: * config/aarch64/aarch64-option-extensions.def (gcs): New. * config/aarch64/aarch64.h (AARCH64_ISA_GCS): New. (TARGET_THE): Likewise. * doc/invoke.texi (AArch64 Options): Describe GCS.
1 parent 16a05fa commit 3aba045

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

gcc/config/aarch64/aarch64-option-extensions.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,6 @@ AARCH64_OPT_EXTENSION("d128", D128, (), (), (), "d128")
163163

164164
AARCH64_OPT_EXTENSION("the", THE, (), (), (), "the")
165165

166+
AARCH64_OPT_EXTENSION("gcs", GCS, (), (), (), "gcs")
167+
166168
#undef AARCH64_OPT_EXTENSION

gcc/config/aarch64/aarch64.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ constexpr auto AARCH64_FL_DEFAULT_ISA_MODE = AARCH64_FL_SM_OFF;
265265
#define AARCH64_ISA_CSSC (aarch64_isa_flags & AARCH64_FL_CSSC)
266266
#define AARCH64_ISA_D128 (aarch64_isa_flags & AARCH64_FL_D128)
267267
#define AARCH64_ISA_THE (aarch64_isa_flags & AARCH64_FL_THE)
268+
#define AARCH64_ISA_GCS (aarch64_isa_flags & AARCH64_FL_GCS)
268269

269270
/* The current function is a normal non-streaming function. */
270271
#define TARGET_NON_STREAMING (AARCH64_ISA_SM_OFF)
@@ -465,6 +466,11 @@ constexpr auto AARCH64_FL_DEFAULT_ISA_MODE = AARCH64_FL_SM_OFF;
465466
enabled through +the. */
466467
#define TARGET_THE (AARCH64_ISA_THE)
467468

469+
/* Armv9.4-A Guarded Control Stack extension system registers are
470+
enabled through +gcs. */
471+
#define TARGET_GCS (AARCH64_ISA_GCS)
472+
473+
468474
/* Standard register usage. */
469475

470476
/* 31 64-bit general purpose registers R0-R30:

gcc/doc/invoke.texi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21363,6 +21363,8 @@ Enable the FEAT_SME_F64F64 extension to SME.
2136321363
Enable the Scalable Matrix Extension 2. This also enables SME instructions.
2136421364
@item d128
2136521365
Enable support for 128-bit system register read/write instructions.
21366+
@item gcs
21367+
Enable support for Armv9.4-a Guarded Control Stack extension.
2136621368
@item the
2136721369
Enable support for Armv8.9-a/9.4-a translation hardening extension.
2136821370

0 commit comments

Comments
 (0)