mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
* 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.
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
@ -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;
|
||||
|
@ -1,3 +1,11 @@
|
||||
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
|
||||
|
2
gas/testsuite/gas/arm/armv8-a-bad.d
Normal file
2
gas/testsuite/gas/arm/armv8-a-bad.d
Normal file
@ -0,0 +1,2 @@
|
||||
#name: Invalid v8-a
|
||||
#error-output: armv8-a-bad.l
|
2
gas/testsuite/gas/arm/armv8-a-bad.l
Normal file
2
gas/testsuite/gas/arm/armv8-a-bad.l
Normal file
@ -0,0 +1,2 @@
|
||||
.*: Assembler messages:
|
||||
.*:7: Error: swp{b} use is obsoleted for ARMv8 and later
|
7
gas/testsuite/gas/arm/armv8-a-bad.s
Normal file
7
gas/testsuite/gas/arm/armv8-a-bad.s
Normal file
@ -0,0 +1,7 @@
|
||||
.syntax unified
|
||||
.text
|
||||
.arch armv8-a
|
||||
|
||||
// SWP
|
||||
.arm
|
||||
swp r0, r1, [r2]
|
@ -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
|
||||
|
@ -1,4 +1,5 @@
|
||||
.syntax unified
|
||||
swp r0, r1, [r2]
|
||||
.arch armv4
|
||||
swp r0, r1, [r2]
|
||||
.arch armv6
|
||||
|
@ -1,3 +1,7 @@
|
||||
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.
|
||||
|
@ -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; \
|
||||
|
Reference in New Issue
Block a user