public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Victor Do Nascimento <victor.donascimento@arm.com>
To: <gcc-patches@gcc.gnu.org>
Cc: <kyrylo.tkachov@arm.com>, <richard.sandiford@arm.com>,
	<Richard.Earnshaw@arm.com>,
	Victor Do Nascimento <victor.donascimento@arm.com>
Subject: [PATCH 0/6] aarch64: Add support for __arm_rsr and __arm_wsr ACLE function family
Date: Tue, 3 Oct 2023 16:18:31 +0100	[thread overview]
Message-ID: <20231003151920.1853404-1-victor.donascimento@arm.com> (raw)

This patch series adds support for reading and writing to and from
system registers via the relevant ACLE-defined builtins [1], making a
series of additions to the aarch64-specific areas of the compiler to
make this possible. 

Firstly, a mechanism for defining system registers is established via a
new .def file and the new SYSREG macro.  This macro is the same as is
used in Binutils and system register entries are compatible with
either code-base.

Given the information contained in this system register definition
file, a compile-time validation mechanism is implemented, such that any
system register name passed as a string literal argument to these
builtins can be checked against known system registers and its use
for a given target architecture validated.

Finally, patterns for each of these builtins are added to the back-end
such that, if all validation criteria are met, the correct assembly is
emitted.

Thus, the following example of system register access is now valid for
GCC:

	long long old = __arm_rsr("trcseqstr");
	__arm_wsr("trcseqstr", new);

Testing:
 - Bootstrap/regtest on aarch64-linux-gnu done.

[1] https://arm-software.github.io/acle/main/acle.html

Victor Do Nascimento (6):
  aarch64: Sync system register information with Binutils
  aarch64: Add support for aarch64-sys-regs.def
  aarch64: Implement system register validation tools
  aarch64: Add basic target_print_operand support for CONST_STRING
  aarch64: Implement system register r/w arm ACLE intrinsic functions
  aarch64: Add front-end argument type checking for target builtins

 gcc/config/aarch64/aarch64-builtins.cc        |  233 ++++
 gcc/config/aarch64/aarch64-c.cc               |    4 +-
 gcc/config/aarch64/aarch64-protos.h           |    5 +
 gcc/config/aarch64/aarch64-sys-regs.def       | 1059 +++++++++++++++++
 gcc/config/aarch64/aarch64.cc                 |  182 +++
 gcc/config/aarch64/aarch64.h                  |   36 +
 gcc/config/aarch64/aarch64.md                 |   17 +
 gcc/config/aarch64/arm_acle.h                 |   30 +
 gcc/config/aarch64/predicates.md              |    4 +
 .../gcc.target/aarch64/acle/rwsr-1.c          |   20 +
 .../gcc.target/aarch64/acle/rwsr-2.c          |   15 +
 gcc/testsuite/gcc.target/aarch64/acle/rwsr.c  |  144 +++
 12 files changed, 1747 insertions(+), 2 deletions(-)
 create mode 100644 gcc/config/aarch64/aarch64-sys-regs.def
 create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/rwsr-1.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/rwsr-2.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/rwsr.c

-- 
2.41.0


             reply	other threads:[~2023-10-03 15:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03 15:18 Victor Do Nascimento [this message]
2023-10-03 15:18 ` [PATCH 1/6] aarch64: Sync system register information with Binutils Victor Do Nascimento
2023-10-05 11:42   ` Richard Earnshaw
2023-10-05 13:04     ` Victor Do Nascimento
2023-10-09  0:02       ` Ramana Radhakrishnan
2023-10-09 12:52         ` Victor Do Nascimento
2023-10-03 15:18 ` [PATCH 2/6] aarch64: Add support for aarch64-sys-regs.def Victor Do Nascimento
2023-10-05 12:03   ` Richard Earnshaw
2023-10-03 15:18 ` [PATCH 3/6] aarch64: Implement system register validation tools Victor Do Nascimento
2023-10-05 12:24   ` Richard Earnshaw
2023-10-03 15:18 ` [PATCH 4/6] aarch64: Add basic target_print_operand support for CONST_STRING Victor Do Nascimento
2023-10-05 12:26   ` Richard Earnshaw
2023-10-05 12:33     ` Richard Earnshaw
2023-10-05 12:47     ` Victor Do Nascimento
2023-10-03 15:18 ` [PATCH 5/6] aarch64: Implement system register r/w arm ACLE intrinsic functions Victor Do Nascimento
2023-10-05 12:40   ` Richard Earnshaw
2023-10-03 15:18 ` [PATCH 6/6] aarch64: Add front-end argument type checking for target builtins Victor Do Nascimento
2023-10-05 12:48   ` Richard Earnshaw
2023-10-07 11:53     ` Richard Sandiford
2023-10-09 13:12       ` Victor Do Nascimento
2023-10-10 11:20         ` Richard Earnshaw (lists)
2023-10-12 10:37           ` Richard Sandiford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231003151920.1853404-1-victor.donascimento@arm.com \
    --to=victor.donascimento@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@arm.com \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).