]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/config/aarch64/aarch64.opt
aarch64: Extend -mtp= arguments
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Tue, 13 Jun 2023 09:13:55 +0000 (10:13 +0100)
committerKyrylo Tkachov <kyrylo.tkachov@arm.com>
Tue, 13 Jun 2023 09:16:40 +0000 (10:16 +0100)
commit4389a2d2d0cc639cbeeb8453dc20bf315316d4e3
tree3723c4fd11de38041b243af5771b9594b0d2c5b2
parentd438b67e005bf8fc9e4af26410bf69816c30e969
aarch64: Extend -mtp= arguments

After discussing the -mtp= option with Arm's LLVM developers we'd like to extend
the functionality of the option somewhat.
First of all, there is another TPIDR register that can be used to read the thread pointer:
TPIDRRO_EL0 (which can also be accessed by AArch32 under another name) so it makes sense
to add -mtp=tpidrr0_el0. This makes the existing arguments el0, el1, el2, el3 somewhat
inconsistent in their naming so this patch introduces the more "full" names
tpidr_el0, tpidr_el1, tpidr_el2, tpidr_el3 and makes the above short names alias of these new ones.
Long story short, we preserve backwards compatibility and add a new TPIDR register to access through
-mtp that wasn't available previously.
There is more relevant discussion of the options at https://reviews.llvm.org/D152433 if you're interested.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/ChangeLog:

PR target/108779
* config/aarch64/aarch64-opts.h (enum aarch64_tp_reg): Add
AARCH64_TPIDRRO_EL0 value.
* config/aarch64/aarch64.cc (aarch64_output_load_tp): Define.
* config/aarch64/aarch64.opt (tpidr_el0, tpidr_el1, tpidr_el2,
tpidr_el3, tpidrro_el3): New accepted values to -mtp=.
* doc/invoke.texi (AArch64 Options): Document new -mtp= options.

gcc/testsuite/ChangeLog:

PR target/108779
* gcc.target/aarch64/mtp_5.c: New test.
* gcc.target/aarch64/mtp_6.c: New test.
* gcc.target/aarch64/mtp_7.c: New test.
* gcc.target/aarch64/mtp_8.c: New test.
* gcc.target/aarch64/mtp_9.c: New test.
gcc/config/aarch64/aarch64-opts.h
gcc/config/aarch64/aarch64.cc
gcc/config/aarch64/aarch64.opt
gcc/doc/invoke.texi
gcc/testsuite/gcc.target/aarch64/mtp_5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/mtp_6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/mtp_7.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/mtp_8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/mtp_9.c [new file with mode: 0644]