arm - Add support for aliases of CPU names
authorRichard Earnshaw <rearnsha@arm.com>
Thu, 8 Nov 2018 17:48:39 +0000 (17:48 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Thu, 8 Nov 2018 17:48:39 +0000 (17:48 +0000)
commitd4f680c672261642b47ecd72b6201825703bfa40
treedb810722833c964619c126774b9d89013d282049
parent28567c40e2c7c88e424283e8a1a6ff8cb7ba440c
arm - Add support for aliases of CPU names

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.

From-SVN: r265931
gcc/ChangeLog
gcc/common/config/arm/arm-common.c
gcc/config/arm/arm-cpus.in
gcc/config/arm/arm-generic.md
gcc/config/arm/arm-protos.h
gcc/config/arm/arm-tables.opt
gcc/config/arm/arm-tune.md
gcc/config/arm/parsecpu.awk