diff options
-rw-r--r-- | gas/ChangeLog | 11 | ||||
-rw-r--r-- | gas/config/tc-arm.c | 15 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/forbid-armv7-idiv-ext.d | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/forbid-armv7-idiv-ext.l | 3 |
4 files changed, 33 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 82b25ac..8c62992 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,14 @@ +2017-06-20 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. + 2017-06-21 Thomas Preud'homme <thomas.preudhomme@arm.com> * config/tc-arm.c (aeabi_set_public_attributes): Populate flags from diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 86acb86..a62c5f2 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -25963,6 +25963,13 @@ static const struct arm_option_extension_value_table arm_extensions[] = ARM_FEATURE_CORE_LOW (ARM_EXT_ADIV | ARM_EXT_DIV), ARM_FEATURE_CORE_LOW (ARM_EXT_V7A), ARM_FEATURE_CORE_LOW (ARM_EXT_V7R)), + /* Duplicate entry for the purpose of allowing ARMv7 to match in presence of + Thumb divide instruction. Due to this having the same name as the + previous entry, this will be ignored when doing command-line parsing and + only considered by build attribute selection code. */ + ARM_EXT_OPT ("idiv", ARM_FEATURE_CORE_LOW (ARM_EXT_DIV), + ARM_FEATURE_CORE_LOW (ARM_EXT_DIV), + ARM_FEATURE_CORE_LOW (ARM_EXT_V7)), ARM_EXT_OPT ("iwmmxt",ARM_FEATURE_COPROC (ARM_CEXT_IWMMXT), ARM_FEATURE_COPROC (ARM_CEXT_IWMMXT), ARM_ARCH_NONE), ARM_EXT_OPT ("iwmmxt2", ARM_FEATURE_COPROC (ARM_CEXT_IWMMXT2), @@ -26195,6 +26202,10 @@ arm_parse_extension (const char *str, const arm_feature_set *opt_set, else ARM_CLEAR_FEATURE (**ext_set_p, **ext_set_p, opt->clear_value); + /* Allowing Thumb division instructions for ARMv7 in autodetection + rely on this break so that duplicate extensions (extensions + with the same name as a previous extension in the list) are not + considered for command-line parsing. */ break; } @@ -27028,6 +27039,10 @@ s_arm_arch_extension (int ignored ATTRIBUTE_UNUSED) ARM_MERGE_FEATURE_SETS (cpu_variant, selected_cpu, *mfpu_opt); *input_line_pointer = saved_char; demand_empty_rest_of_line (); + /* Allowing Thumb division instructions for ARMv7 in autodetection rely + on this return so that duplicate extensions (extensions with the + same name as a previous extension in the list) are not considered + for command-line parsing. */ return; } diff --git a/gas/testsuite/gas/arm/forbid-armv7-idiv-ext.d b/gas/testsuite/gas/arm/forbid-armv7-idiv-ext.d new file mode 100644 index 0000000..85c7dc3 --- /dev/null +++ b/gas/testsuite/gas/arm/forbid-armv7-idiv-ext.d @@ -0,0 +1,4 @@ +# name: Forbidden idiv for ARMv7 +# source: blank.s +# as: -march=armv7+idiv +#error-output: forbid-armv7-idiv-ext.l diff --git a/gas/testsuite/gas/arm/forbid-armv7-idiv-ext.l b/gas/testsuite/gas/arm/forbid-armv7-idiv-ext.l new file mode 100644 index 0000000..76208d2 --- /dev/null +++ b/gas/testsuite/gas/arm/forbid-armv7-idiv-ext.l @@ -0,0 +1,3 @@ +Assembler messages: +[^:]*: extension does not apply to the base architecture +[^:]*: unrecognized option -march=armv7\+idiv |