[PATCH 5/10, GAS/ARM] Allow Thumb division as an extension for ARMv7

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


Hi,

=== Context ===

This patch is part of a patch series to add support for ARMv8-R
architecture. Its purpose is to allow ARMv7 to be selected in automatic
architecture selection in presence of Thumb division instructions.

=== Motivation ===

any-idiv.d and automatic-sdiv.d testcases in GAS testsuite expect
autodetection code to select ARMv7 in presence of Thumb integer
division. However, the definition of ARM_AEXT_V7 and thus ARM_ARCH_V7 do
not contain these instructions and the idiv extension is only available
for ARMv7-A and ARMv7-R. Therefore, under the stricter automatic
detection code proposed in the subsequent patch of the series ARMv7 is
refused if a Thumb division instruction is present.

=== Patch description ===

This patch adds a new "idiv" extension after the existing one that is
available to all ARMv7 targets. This new entry is ignored by all current
code parsing arm_extensions such that it would be unavailable on the
command-line and remain a purely internal hack, easily removed in favor
of a better solution later. This is considered though by the subsequent
patch reworking automatic detection of build attributes such that ARMv7
is allowed to match in present of Thumb division instructions. For good
measure, comments are added in all instances of code browsing
arm_extensions to mention the expected behavior in case of duplicate
entries as well as a new testcase.

ChangeLog entry is as follows:

*** gas/ChangeLog ***

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

	* config/tc-arm.c (arm_extensions): New duplicate idiv entry to enable
	Thumb division for ARMv7 architecture.
	(arm_parse_extension): Document expected behavior for duplicate
	entries.
	(s_arm_arch_extension): Likewise.
	* testsuite/gas/arm/forbid-armv7-idiv-ext.d: New test.
	* testsuite/gas/arm/forbid-armv7-idiv-ext.l: New expected output for
	above test.

=== Testing ===

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

Is this ok for master branch?

Best regards,

Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 05_allow_thumb_div_extension_armv7.patch
Type: text/x-patch
Size: 2845 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170621/93c603bd/attachment.bin>


More information about the Binutils mailing list