aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@arm.com>2017-06-21 14:09:38 +0100
committerThomas Preud'homme <thomas.preudhomme@arm.com>2017-06-21 14:11:14 +0100
commit6c290d5387f770a6b098162f0a0f9ea420de540d (patch)
tree0f91f45bc9f50f6889c62ab693ff602a6a5d23a0
parentc168ce07e5b4a2a0258c796748899e1ba2e6dc7c (diff)
downloadgdb-6c290d5387f770a6b098162f0a0f9ea420de540d.zip
gdb-6c290d5387f770a6b098162f0a0f9ea420de540d.tar.gz
gdb-6c290d5387f770a6b098162f0a0f9ea420de540d.tar.bz2
[ARM] Simplify Tag_DSP_extension selection logic
=== Context === This patch is part of a patch series to add support for ARMv8-R architecture. Its purpose is to simplify the logic to decide whether to set Tag_DSP_extension. === Motivation === To decide whether to set Tag_DSP_extension, the current code was checking whether the flags had DSP instruction but the architecture selected for Tag_CPU_arch did not have any. This was necessary because extension feature bit were not available separately. This is no longer necessary and can be simplified. === Patch description === The patch change the logic to set Tag_DSP_extension to check whether any DSP feature bit is set in the extension feature bit, as per the definition of that build attribute. The patch also removes all definitions of arm_arch which is now unneeded. 2017-06-21 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.c (aeabi_set_public_attributes): Test *mcpu_ext_opt to decide whether to set Tag_DSP_extension build attribute value. Remove now useless arm_arch variable.
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-arm.c28
2 files changed, 11 insertions, 23 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 462c921..4c8fc41 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,11 @@
2017-06-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
+ * config/tc-arm.c (aeabi_set_public_attributes): Test *mcpu_ext_opt to
+ decide whether to set Tag_DSP_extension build attribute value. Remove
+ now useless arm_arch variable.
+
+2017-06-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
* config/tc-arm.c (dyn_mcpu_ext_opt): New static variable.
(dyn_march_ext_opt): Likewise.
(md_begin): Copy extension feature bits alongside architecture ones.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 2be50f5..88f3dc9 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -26600,7 +26600,6 @@ aeabi_set_public_attributes (void)
char profile;
int virt_sec = 0;
int fp16_optional = 0;
- arm_feature_set arm_arch = ARM_ARCH_NONE;
arm_feature_set flags;
arm_feature_set tmp;
arm_feature_set arm_arch_v8m_base = ARM_ARCH_V8M_BASE;
@@ -26640,7 +26639,6 @@ aeabi_set_public_attributes (void)
if (ARM_CPU_HAS_FEATURE (tmp, p->flags))
{
arch = p->val;
- arm_arch = p->flags;
ARM_CLEAR_FEATURE (tmp, tmp, p->flags);
}
}
@@ -26657,27 +26655,18 @@ aeabi_set_public_attributes (void)
&& !ARM_CPU_HAS_FEATURE (flags, arm_ext_v7a)
&& ARM_CPU_HAS_FEATURE (flags, arm_ext_v7m)
&& ARM_CPU_HAS_FEATURE (flags, arm_ext_v6_dsp))
- {
- arch = TAG_CPU_ARCH_V7E_M;
- arm_arch = (arm_feature_set) ARM_ARCH_V7EM;
- }
+ arch = TAG_CPU_ARCH_V7E_M;
ARM_CLEAR_FEATURE (tmp, flags, arm_arch_v8m_base);
if (arch == TAG_CPU_ARCH_V8M_BASE && ARM_CPU_HAS_FEATURE (tmp, arm_arch_any))
- {
- arch = TAG_CPU_ARCH_V8M_MAIN;
- arm_arch = (arm_feature_set) ARM_ARCH_V8M_MAIN;
- }
+ arch = TAG_CPU_ARCH_V8M_MAIN;
/* In cpu_arch_ver ARMv8-A is before ARMv8-M for atomics to be detected as
coming from ARMv8-A. However, since ARMv8-A has more instructions than
ARMv8-M, -march=all must be detected as ARMv8-A. */
if (arch == TAG_CPU_ARCH_V8M_MAIN
&& ARM_FEATURE_CORE_EQUAL (selected_cpu, arm_arch_any))
- {
- arch = TAG_CPU_ARCH_V8;
- arm_arch = (arm_feature_set) ARM_ARCH_V8A;
- }
+ arch = TAG_CPU_ARCH_V8;
/* Tag_CPU_name. */
if (selected_cpu_name[0])
@@ -26716,15 +26705,8 @@ aeabi_set_public_attributes (void)
aeabi_set_attribute_int (Tag_CPU_arch_profile, profile);
/* Tag_DSP_extension. */
- if (ARM_CPU_HAS_FEATURE (flags, arm_ext_dsp))
- {
- arm_feature_set ext;
-
- /* DSP instructions not in architecture. */
- ARM_CLEAR_FEATURE (ext, flags, arm_arch);
- if (ARM_CPU_HAS_FEATURE (ext, arm_ext_dsp))
- aeabi_set_attribute_int (Tag_DSP_extension, 1);
- }
+ if (dyn_mcpu_ext_opt && ARM_CPU_HAS_FEATURE (*dyn_mcpu_ext_opt, arm_ext_dsp))
+ aeabi_set_attribute_int (Tag_DSP_extension, 1);
/* Tag_ARM_ISA_use. */
if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v1)