aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Gretton-Dann <matthew.gretton-dann@arm.com>2012-08-24 07:52:49 +0000
committerMatthew Gretton-Dann <matthew.gretton-dann@arm.com>2012-08-24 07:52:49 +0000
commit59d09be6f5643112208f203bcf8a613d89ae776b (patch)
tree7a9000498949d2ecfd04933d0b2c014a91bfd8c6
parentbca3892142429f819023a157be90c4d855cf93f8 (diff)
downloadgdb-59d09be6f5643112208f203bcf8a613d89ae776b.zip
gdb-59d09be6f5643112208f203bcf8a613d89ae776b.tar.gz
gdb-59d09be6f5643112208f203bcf8a613d89ae776b.tar.bz2
* gas/config/tc-arm.c (check_obsolete): New function.
(do_rd_rm_rn): Check swp{b} for obsoletion. * gas/testsuite/gas/arm/armv8-a-bad.d: New testcase. * gas/testsuite/gas/arm/armv8-a-bad.l: Likewise. * gas/testsuite/gas/arm/armv8-a-bad.s: Likewise. * gas/testsuite/gas/arm/depr-swp.l: Update for change in expected output. * gas/testsuite/gas/arm/depr-swp.s: Add additional test. * include/opcode/arm.h (ARM_CPU_IS_ANY): New define.
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-arm.c30
-rw-r--r--gas/testsuite/ChangeLog8
-rw-r--r--gas/testsuite/gas/arm/armv8-a-bad.d2
-rw-r--r--gas/testsuite/gas/arm/armv8-a-bad.l2
-rw-r--r--gas/testsuite/gas/arm/armv8-a-bad.s7
-rw-r--r--gas/testsuite/gas/arm/depr-swp.l5
-rw-r--r--gas/testsuite/gas/arm/depr-swp.s1
-rw-r--r--include/ChangeLog4
-rw-r--r--include/opcode/arm.h3
10 files changed, 60 insertions, 7 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 0af7f05..7148cb1 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
2012-08-24 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+ * config/tc-arm.c (check_obsolete): New function.
+ (do_rd_rm_rn): Check swp{b} for obsoletion.
+
+2012-08-24 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+
* config/tc-arm.h (arm_ext_v8): New variable.
(fpu_vfp_ext_armv8): Likewise.
(fpu_neon_ext_armv8): Likewise.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 101f86b..af4a1e5 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -7373,6 +7373,23 @@ do_rn_rd (void)
inst.instruction |= inst.operands[1].reg << 12;
}
+static bfd_boolean
+check_obsolete (const arm_feature_set *feature, const char *msg)
+{
+ if (ARM_CPU_IS_ANY (cpu_variant))
+ {
+ as_warn ("%s", msg);
+ return TRUE;
+ }
+ else if (ARM_CPU_HAS_FEATURE (cpu_variant, *feature))
+ {
+ as_bad ("%s", msg);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
do_rd_rm_rn (void)
{
@@ -7383,12 +7400,15 @@ do_rd_rm_rn (void)
constraint (Rn == inst.operands[0].reg || Rn == inst.operands[1].reg,
_("Rn must not overlap other operands"));
- /* SWP{b} is deprecated for ARMv6* and ARMv7. */
- if (warn_on_deprecated
- && ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6))
- as_warn (_("swp{b} use is deprecated for this architecture"));
-
+ /* SWP{b} is obsolete for ARMv8-A, and deprecated for ARMv6* and ARMv7.
+ */
+ if (!check_obsolete (&arm_ext_v8,
+ _("swp{b} use is obsoleted for ARMv8 and later"))
+ && warn_on_deprecated
+ && ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v6))
+ as_warn (_("swp{b} use is deprecated for ARMv6 and ARMv7"));
}
+
inst.instruction |= inst.operands[0].reg << 12;
inst.instruction |= inst.operands[1].reg;
inst.instruction |= Rn << 16;
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index dd0254d..6b8d34a 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,13 @@
2012-08-24 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+ * gas/arm/armv8-a-bad.d: New testcase.
+ * gas/arm/armv8-a-bad.l: Likewise.
+ * gas/arm/armv8-a-bad.s: Likewise.
+ * gas/arm/depr-swp.l: Update for change in expected output.
+ * gas/arm/depr-swp.s: Add additional test.
+
+2012-08-24 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+
* gas/arm/attr-march-all.d: Update for change in expected
output.
* gas/arm/attr-mfpu-vfpv4-d16.d: Likewise.
diff --git a/gas/testsuite/gas/arm/armv8-a-bad.d b/gas/testsuite/gas/arm/armv8-a-bad.d
new file mode 100644
index 0000000..94e130c
--- /dev/null
+++ b/gas/testsuite/gas/arm/armv8-a-bad.d
@@ -0,0 +1,2 @@
+#name: Invalid v8-a
+#error-output: armv8-a-bad.l
diff --git a/gas/testsuite/gas/arm/armv8-a-bad.l b/gas/testsuite/gas/arm/armv8-a-bad.l
new file mode 100644
index 0000000..2c9a147
--- /dev/null
+++ b/gas/testsuite/gas/arm/armv8-a-bad.l
@@ -0,0 +1,2 @@
+.*: Assembler messages:
+.*:7: Error: swp{b} use is obsoleted for ARMv8 and later
diff --git a/gas/testsuite/gas/arm/armv8-a-bad.s b/gas/testsuite/gas/arm/armv8-a-bad.s
new file mode 100644
index 0000000..a6d55c7
--- /dev/null
+++ b/gas/testsuite/gas/arm/armv8-a-bad.s
@@ -0,0 +1,7 @@
+ .syntax unified
+ .text
+ .arch armv8-a
+
+ // SWP
+ .arm
+ swp r0, r1, [r2]
diff --git a/gas/testsuite/gas/arm/depr-swp.l b/gas/testsuite/gas/arm/depr-swp.l
index e5052a7..830f13b 100644
--- a/gas/testsuite/gas/arm/depr-swp.l
+++ b/gas/testsuite/gas/arm/depr-swp.l
@@ -1,3 +1,4 @@
[^:]*: Assembler messages:
-[^:]*:5: Warning: swp{b} use is deprecated for this architecture
-[^:]*:7: Warning: swp{b} use is deprecated for this architecture
+[^:]*:2: Warning: swp{b} use is obsoleted for ARMv8 and later
+[^:]*:6: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
+[^:]*:8: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
diff --git a/gas/testsuite/gas/arm/depr-swp.s b/gas/testsuite/gas/arm/depr-swp.s
index e5c1df3..ceb7d41 100644
--- a/gas/testsuite/gas/arm/depr-swp.s
+++ b/gas/testsuite/gas/arm/depr-swp.s
@@ -1,4 +1,5 @@
.syntax unified
+swp r0, r1, [r2]
.arch armv4
swp r0, r1, [r2]
.arch armv6
diff --git a/include/ChangeLog b/include/ChangeLog
index 58ad5ae..d6b329f 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,5 +1,9 @@
2012-08-24 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+ * opcode/arm.h (ARM_CPU_IS_ANY): New define.
+
+2012-08-24 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+
* elf/arm.h (TAG_CPU_ARCH_V8): New define.
(MAX_TAG_CPU_ARCH): Update.
* opcode/arm.h (ARM_EXT_V8): New define.
diff --git a/include/opcode/arm.h b/include/opcode/arm.h
index 1c350c8..1ac38a0 100644
--- a/include/opcode/arm.h
+++ b/include/opcode/arm.h
@@ -269,6 +269,9 @@ typedef struct
#define ARM_CPU_HAS_FEATURE(CPU,FEAT) \
(((CPU).core & (FEAT).core) != 0 || ((CPU).coproc & (FEAT).coproc) != 0)
+#define ARM_CPU_IS_ANY(CPU) \
+ ((CPU).core == ((arm_feature_set)ARM_ANY).core)
+
#define ARM_MERGE_FEATURE_SETS(TARG,F1,F2) \
do { \
(TARG).core = (F1).core | (F2).core; \