[arm] Add support for aliases of CPU names

Richard Earnshaw (lists) Richard.Earnshaw@arm.com
Thu Nov 8 17:50:00 GMT 2018


This patch adds support for defining an alias for a CPU name that can
then be used in conjunction with the -mcpu option in the same way that
the primary name can be used.  Aliases do not lead to a short-cut of
the feature options; they are literally an alternative name for the
core CPU.

The new entry in arm-cpus.in allows a cpu definition to contain an
alias statement, for example

begin cpu strongarm
 alias strongarm110 !strongarm1100 !strongarm1110
 ...
end cpu strongarm

each entry in the list represents another alias for the CPU.  If the
alias name starts with an exclamation mark, then it will match as for
any other alias (sans the ! itself), but it will not be listed in any
of the CPU hinting options (the intent is to make the alias
essentially undocumented).  In the above example, hints would be
provided for strongarm and strongarm110, but not for strongarm1100 or
strongarm1110.

The advantage of using aliases in this way is that it allows us to
reduce the number of duplicate table entries and identifier tags used
inside the compiler itself.

	* config/arm/parsecpu.awk (/alias/): New parsing rule.
	(/begin cpu/): Check that the cpu name hasn't been previously defined.
	(gen_comm_data): Print out CPU alias tables.
	(check_cpu): Match aliases when checking the CPU name.
	* config/arm/arm-protos.h (cpu_alias): New structure.
	(cpu_option): Add entry for aliases.
	* config/arm/arm-cpus.in (strongarm): Add aliases for strongarm110
	strongarm1100 and strongarm1110.
	(strongarm110, strongarm1100, strongarm1110): Delete CPU entries.
	(config/arm/arm-generic.md): Remove redundant references to
	strongarm110, strongarm1100 and strongarm1110.
	* common/config/arm/arm-common.c (arm_print_hint_for_cpu_option):
	Scan aliases for additional hints.
	(arm_parse_cpu_option_name): Also match a cpu name against the list
	of aliases.
	* config/arm/arm-tables.opt: Regenerated.
	* config/arm/arm-tune.md: Regenerated.

Committed to trunk.

R.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpu-alias.patch
Type: text/x-patch
Size: 9398 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20181108/89618179/attachment.bin>


More information about the Gcc-patches mailing list