public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH V2 0/7] aarch64: Add support for __arm_rsr and __arm_wsr ACLE function family
@ 2023-10-18 15:02 Victor Do Nascimento
  2023-10-18 15:02 ` [PATCH V2 1/7] aarch64: Sync system register information with Binutils Victor Do Nascimento
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Victor Do Nascimento @ 2023-10-18 15:02 UTC (permalink / raw)
  To: gcc-patches
  Cc: kyrylo.tkachov, richard.sandiford, Richard.Earnshaw,
	Victor Do Nascimento

This revision of the patch series addresses the following key pieces
of upstream feedback:

  * `aarch64-sys-regs.def', being identical in content to the file with
  the same name in Binutils, now retains the copyright header from
  Binutils.
  * We migrate away from the binary search handling of system-register
  lookups in favour of a hashmap approach, relaxing the requirement
  that all entries in `aarch64-sys-reg.def' be kept in alphabetical
  order.
  * A static selftest is added for sanity-checking of the contents of
  `aarch64-sys-regs.def'.  Given the move to a hashmap lookup mechanism,
  no testing is needed for the preservation of alphabetical order, but
  a test is added to detect spurious duplicate register definitions.

---

This patch series adds support for reading and writing to and from
system registers via the relevant ACLE-defined builtins [1].

The patch series makes 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 (7):
  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
  aarch64: Add system register duplication check selftest

 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       | 1064 +++++++++++++++++
 gcc/config/aarch64/aarch64.cc                 |  243 ++++
 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, 1813 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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2023-10-27 13:51 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-18 15:02 [PATCH V2 0/7] aarch64: Add support for __arm_rsr and __arm_wsr ACLE function family Victor Do Nascimento
2023-10-18 15:02 ` [PATCH V2 1/7] aarch64: Sync system register information with Binutils Victor Do Nascimento
2023-10-18 15:02 ` [PATCH V2 2/7] aarch64: Add support for aarch64-sys-regs.def Victor Do Nascimento
2023-10-18 21:07   ` Richard Sandiford
2023-10-26 14:48     ` Victor Do Nascimento
2023-10-26 15:14       ` Richard Sandiford
2023-10-18 15:02 ` [PATCH V2 3/7] aarch64: Implement system register validation tools Victor Do Nascimento
2023-10-18 19:07   ` Richard Sandiford
2023-10-18 15:02 ` [PATCH V2 4/7] aarch64: Add basic target_print_operand support for CONST_STRING Victor Do Nascimento
2023-10-18 21:09   ` Richard Sandiford
2023-10-18 15:02 ` [PATCH V2 5/7] aarch64: Implement system register r/w arm ACLE intrinsic functions Victor Do Nascimento
2023-10-18 20:39   ` Richard Sandiford
2023-10-26 15:06     ` Victor Do Nascimento
2023-10-26 15:23       ` Richard Sandiford
2023-10-26 15:56         ` Victor Do Nascimento
2023-10-27 13:18         ` Alex Coplan
2023-10-27 13:51           ` Victor Do Nascimento
2023-10-18 15:02 ` [PATCH V2 6/7] aarch64: Add front-end argument type checking for target builtins Victor Do Nascimento
2023-10-18 21:20   ` Richard Sandiford
2023-10-18 15:02 ` [PATCH V2 7/7] aarch64: Add system register duplication check selftest Victor Do Nascimento
2023-10-18 21:30   ` Richard Sandiford
2023-10-26 15:13     ` Victor Do Nascimento
2023-10-26 15:31       ` Richard Sandiford

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).