[ARM] Separate extensions from architectures in arm_cpus
authorThomas Preud'homme <thomas.preudhomme@arm.com>
Wed, 21 Jun 2017 12:16:56 +0000 (13:16 +0100)
committerThomas Preud'homme <thomas.preudhomme@arm.com>
Wed, 21 Jun 2017 13:11:14 +0000 (14:11 +0100)
commit996b5569bf24fe29dcd832a068d9f42b2903f48b
treee6c11706c545acc0b86df863841573fe674eda18
parent20bd1b6ba53491e4979c03a4f679d0d17b9b9046
[ARM] Separate extensions from architectures in arm_cpus

=== Context ===

This patch is part of a patch series to add support for ARMv8-R
architecture. Its purpose is to distinguish for a CPU the feature bits
coming from its architecture from the feature bits coming from
extension(s) available in this CPU.

=== Motivation ===

This distinction is necessary to allow the Tag_CPU_arch build attribute
value to be exactly as per the architecture of the selected CPU. With
mixed architecture and extension feature bit, it is impossible to find
an architecture with an exact match of feature bit and the build
attribute value logic must then select the closest match which might not
be the right architecture.

=== Patch description ===

The patch creates a new field in the arm_cpus table to hold the feature
set for the extensions available in each CPU. The existing architecture
feature set is then updated to remove those feature bit. The patch also
takes advantage of all the lines being changed to reindent the whole
table.

Note: This patch *adds* a memory leak due to mcpu_cpu_opt sometimes
pointing to dynamically allocated feature bits which is never freeed.
The subsequent patch in the series solves this issue as well as a
preexisting identical issue in arm_parse_extension. The patches are kept
separate for ease of review since they are both big enough already.

2017-06-21  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gas/
* config/tc-arm.c (struct arm_cpu_option_table): New ext field.
(ARM_CPU_OPT): Add parameter to set new ext field and reorder canonical
name field just after the name field.
(arm_cpus): Move extension feature bit from value field to ext field,
reorder parameter according to changes in ARM_CPU_OPT and reindent.
(arm_parse_cpu): Point mcpu_cpu_opt to a bitfield merging the value and
ext field from the selected arm_cpus entry.
(s_arm_cpu): Likewise.
gas/ChangeLog
gas/config/tc-arm.c
This page took 0.026631 seconds and 4 git commands to generate.