On 26 May 2015 at 18:13, aurelio remonda <aurelioremo...@gmail.com> wrote: > There are 85 instructions labeled as DSP (all of them thumb2), im just > testing on disas_thumb2_insn if the feature is enabled before the > instruction is generated.i.e. > if (!arm_dc_feature(s, ARM_FEATURE_DSP)) goto illegal_op; > Im using DDI0439B_cortex_m4_r0p0_trm - Cortex-M4 Technical Reference Manual > (there's s table of dsp instructions on page 33) and this > http://www.lpcware.com/system/files/1100969_Cortex-Inst.jpg as reference.
Ah, right. I suggest we call this ARM_FEATURE_THUMB_DSP /* DSP insns supported in the Thumb encodings */ and in arm_cpu_realizefn() just after the bit where we set ARM_FEATURE_CBAR you want: if (arm_feature(ARM_FEATURE_THUMB2) && !arm_feature(ARM_FEATURE_M)) { set_feature(env, ARM_FEATURE_THUMB_DSP); } because all A and R profile cores with Thumb2 have these instructions. You'll also want to set the THUMB_DSP feature bit for your new M4 core in its cortex_m4_initfn(), and that should be enough. (I think "THUMB_DSP" is better than "DSP" because in the ARM encoding we won't look at this feature bit, because the presence of the insns is determined by the architecture version -- some come in in v5 and the rest in v6.) For floating point, is it sufficient to turn on ARM_FEATURE_VFP4 for the M4, or does that enable too much? thanks -- PMM