[PATCH 1/10, GAS/ARM] Separate extensions from architectures in arm_cpus

Thomas Preudhomme thomas.preudhomme@foss.arm.com
Wed Jun 21 10:03:00 GMT 2017


Hi,

=== 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.

ChangeLog entry is as follows:

*** gas/ChangeLog ***

2017-01-26  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* 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.


=== Testing ===

Testsuite shows no regression when run for arm-none-eabi targets.

Is this ok for master?

Best regards,

Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01_separate_extension_architecture_arm_cpus.patch
Type: text/x-patch
Size: 25514 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170621/094ce0d3/attachment.bin>


More information about the Binutils mailing list