At first sight VFP4 is sufficient, im focusing on DSP instructions because
FPU is optional on Cortex-M4 (there is Cortex-M4 and Cortex-M4F) so on
cortex_m4_initfn im not adding ARM_FEATURE_VFP4 (right now I dont have the
time to fully check this).
I'd like to point out that i did not implement any board, so on armv7m_init
function of armv7m.c the cpu_model is still cortex-m3 as it should, as far
as i know the board will use this function to name cpu_model (i.e
stellaris.c will call armv7m_init and cpu_model will be "cortex-m3")


2015-05-26 14:34 GMT-03:00 Peter Maydell <peter.mayd...@linaro.org>:

> 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
>

Reply via email to