Hi all, After discussing the -mtp= option with Arm's LLVM developers we'd like to extend the functionality of the option somewhat. There are actually 3 system registers that can be accessed for the thread pointer in aarch32: tpidrurw, tpidruro, tpidrprw. They are all read through the CP15 co-processor mechanism. The current -mtp=cp15 option reads the tpidruro register. This patch extends -mtp to allow for the above three explicit tpidr names and keeps -mtp=cp15 as an alias of -mtp=tpidruro for backwards compatibility.
There is more relevant discussion of the options at https://reviews.llvm.org/D152433 if you're interested. Bootstrapped and tested on arm-none-linux-gnueabihf. Pushing to trunk. Thanks, Kyrill gcc/ChangeLog: * config/arm/arm-opts.h (enum arm_tp_type): Remove TP_CP15. Add TP_TPIDRURW, TP_TPIDRURO, TP_TPIDRPRW values. * config/arm/arm-protos.h (arm_output_load_tpidr): Declare prototype. * config/arm/arm.cc (arm_option_reconfigure_globals): Replace TP_CP15 with TP_TPIDRURO. (arm_output_load_tpidr): Define. * config/arm/arm.h (TARGET_HARD_TP): Define in terms of TARGET_SOFT_TP. * config/arm/arm.md (load_tp_hard): Call arm_output_load_tpidr to output assembly. (reload_tp_hard): Likewise. * config/arm/arm.opt (tpidrurw, tpidruro, tpidrprw): New values for arm_tp_type. * doc/invoke.texi (Arm Options, mtp): Document new values. gcc/testsuite/ChangeLog: * gcc.target/arm/mtp.c: New test. * gcc.target/arm/mtp_1.c: New test. * gcc.target/arm/mtp_2.c: New test. * gcc.target/arm/mtp_3.c: New test. * gcc.target/arm/mtp_4.c: New test.
mtp-arm.patch
Description: mtp-arm.patch