Hi all,

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.
Pushing to trunk.
Thanks,
Kyrill

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

Attachment: mtp-a64.patch
Description: mtp-a64.patch

Reply via email to