[<<][arm][>>][..]
Mon Sep 16 19:50:35 EDT 2013

Running Cortex-M4 DSP code on QEMU

The Cortex-M4 is not supported directly.  However, it seems that the
DSP instruction set is supported in ARM mode, at least just using
arm-none-eabi-gcc on "qadd r1,r2,r3" produces:

00000000 <.text>:
   0:	e1031052 	qadd	r1, r2, r3

As opposed to "-mcpu=cortex-m4 -mthumb" :

00000000 <.text>:
   0:	fa83 f182 	qadd	r1, r2, r3


Let's see if qemu in plain arm mode executes the first one.

  ... DSP instructions were added to the set. These are signified by
  an "E" in the name of the ARMv5TE and ARMv5TEJ architectures[1].

Qemu supports:

$ qemu-system-arm -cpu ?
Available CPUs:
  arm1026
  arm1136
  arm1136-r2
  arm1176
  arm11mpcore
  arm926
  arm946
  cortex-a15
  cortex-a8
  cortex-a9
  cortex-m3
  pxa250
  pxa255
  pxa260
  pxa261
  pxa262
  pxa270-a0
  pxa270-a1
  pxa270
  pxa270-b0
  pxa270-b1
  pxa270-c0
  pxa270-c5
  sa1100
  sa1110
  ti925t
  any

For GCC it's -mcpu=name:

  This specifies the name of the target ARM processor.  GCC uses this
  name to determine what kind of instructions it can emit when
  generating assembly code.  Permissible names are: arm2, arm250,
  arm3, arm6, arm60, arm600, arm610, arm620, arm7, arm7m, arm7d,
  arm7dm, arm7di, arm7dmi, arm70, arm700, arm700i, arm710, arm710c,
  arm7100, arm720, arm7500, arm7500fe, arm7tdmi, arm7tdmi-s, arm710t,
  arm720t, arm740t, strongarm, strongarm110, strongarm1100,
  strongarm1110, arm8, arm810, arm9, arm9e, arm920, arm920t, arm922t,
  arm946e-s, arm966e-s, arm968e-s, arm926ej-s, arm940t, arm9tdmi,
  arm10tdmi, arm1020t, arm1026ej-s, arm10e, arm1020e, arm1022e,
  arm1136j-s, arm1136jf-s, mpcore, mpcorenovfp, arm1156t2-s,
  arm1156t2f-s, arm1176jz-s, arm1176jzf-s, cortex-a5, cortex-a7,
  cortex-a8, cortex-a9, cortex-a15, cortex-r4, cortex-r4f, cortex-r5,
  cortex-m4, cortex-m3, cortex-m1, cortex-m0, xscale, iwmmxt, iwmmxt2,
  ep9312, fa526, fa626, fa606te, fa626te, fmp626, fa726te.

So, pick the simplest one with an 'E' in it.  Don't want an elaborate
boot massaging process..

Maybe -cpu=any is good for qemu?

So both cortex-a8 and cortex-a9 seem to work in ARM and THUMB mode.

[1] http://en.wikipedia.org/wiki/ARM_architecture#DSP_enhancement_instructions




[Reply][About]
[<<][arm][>>][..]