1 # DP: Proposed patch for PR gas/12698
3 2011-04-15 Bernd Schmidt <bernds@codesourcery.com>
6 * config/tc-arm.c (m_profile_p): New function.
7 (parse_psr, do_t_mrs, do_t_msr): Use m_profile_p.
10 --- a/gas/config/tc-arm.c
11 +++ b/gas/config/tc-arm.c
13 static const arm_feature_set fpu_neon_ext_fma = ARM_FEATURE (0, FPU_NEON_EXT_FMA);
14 static const arm_feature_set fpu_vfp_ext_fma = ARM_FEATURE (0, FPU_VFP_EXT_FMA);
16 +/* Return whether FEATURES indicates an M profile CPU, without getting
17 + confused by ARM_ANY. */
19 +m_profile_p (arm_feature_set features)
21 + return (ARM_CPU_HAS_FEATURE (features, arm_ext_v6m)
22 + && !ARM_CPU_HAS_FEATURE (features, arm_ext_v7a));
25 static int mfloat_abi_opt = -1;
26 /* Record user cpu selection for object attributes. */
27 static arm_feature_set selected_cpu = ARM_ARCH_NONE;
29 const struct asm_psr *psr;
31 bfd_boolean is_apsr = FALSE;
32 - bfd_boolean m_profile = ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_m);
33 + bfd_boolean m_profile = m_profile_p (selected_cpu);
35 /* CPSR's and SPSR's can now be lowercase. This is just a convenience
36 feature for ease of use and backwards compatibility. */
37 @@ -10947,7 +10956,7 @@
39 int flags = inst.operands[1].imm & (PSR_c|PSR_x|PSR_s|PSR_f|SPSR_BIT);
41 - if (ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_m))
42 + if (m_profile_p (selected_cpu))
43 constraint (flags != 0, _("selected processor does not support "
44 "requested special purpose register"));
46 @@ -10979,7 +10988,7 @@
48 flags = inst.operands[0].imm;
50 - if (ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_m))
51 + if (m_profile_p (selected_cpu))
53 int bits = inst.operands[0].imm & (PSR_c|PSR_x|PSR_s|PSR_f|SPSR_BIT);