* config/tc-arm.c (md_assemble): Improve diagnostic when attempting

to use ARM instructions on non-ARM-supporting cores.
	(autoselect_thumb_from_cpu_variant): New function. Switch on Thumb
	mode automatically based on cpu variant.
	(md_begin): Call above function.
This commit is contained in:
Julian Brown 2006-08-16 10:33:50 +00:00
parent 07161fb2ba
commit 3e9e4fcfb0
2 changed files with 27 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2006-08-16 Julian Brown <julian@codesourcery.com>
* config/tc-arm.c (md_assemble): Improve diagnostic when attempting
to use ARM instructions on non-ARM-supporting cores.
(autoselect_thumb_from_cpu_variant): New function. Switch on Thumb
mode automatically based on cpu variant.
(md_begin): Call above function.
2006-08-16 Julian Brown <julian@codesourcery.com>
* config/tc-arm.c (opcode_lookup): Allow Neon type suffixes to be

View File

@ -13844,7 +13844,7 @@ md_assemble (char *str)
ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used,
arm_ext_v6t2);
}
else
else if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v1))
{
/* Check that this instruction is supported for this CPU. */
if (!opcode->avariant ||
@ -13877,6 +13877,12 @@ md_assemble (char *str)
ARM_MERGE_FEATURE_SETS (arm_arch_used, arm_arch_used,
*opcode->avariant);
}
else
{
as_bad (_("attempt to use an ARM instruction on a Thumb-only processor "
"-- `%s'"), str);
return;
}
output_inst (str);
}
@ -18957,6 +18963,16 @@ set_constant_flonums (void)
abort ();
}
/* Auto-select Thumb mode if it's the only available instruction set for the
given architecture. */
static void
autoselect_thumb_from_cpu_variant (void)
{
if (!ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v1))
opcode_select (16);
}
void
md_begin (void)
{
@ -19057,6 +19073,8 @@ md_begin (void)
ARM_MERGE_FEATURE_SETS (cpu_variant, *mcpu_cpu_opt, *mfpu_opt);
autoselect_thumb_from_cpu_variant ();
arm_arch_used = thumb_arch_used = arm_arch_none;
#if defined OBJ_COFF || defined OBJ_ELF