Skip to content
Snippets Groups Projects
Commit cca8d9e5 authored by Kyrylo Tkachov's avatar Kyrylo Tkachov
Browse files

arm: Extend -mtp= arguments

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.

Bootstrapped and tested on arm-none-linux-gnueabihf.

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.
parent 4389a2d2
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment