Question

I'm trying to cross=compile a simple program with inline assembly for a variety of ARM processors. It contains the assembly instruction QSUB which according to this document is both a valid ARM and Thumb-2 instruction.

This compiles fine for me when building for a cortex-a8.

I get the compile error in the title when I try building for a cortex-m3 and can't figure out why. I attempted to force thumb mode with the compiler switch -mthumb, and then the error changes to "selected processor does not support thumb mode." I'm a bit confused because cortex-m3 does in fact support thumb mode.

Here's the compile options I'm using with codesourcery's gcc:

arm-none-linux-gnueabi-gcc helloworld.c -o a.out -lm -mthumb -mcpu=cortex-m3
Was it helpful?

Solution

QSUB is not mentioned in ARM's "Cortex-M3 Devices Generic User Guide" (Document DUI0552A).

Additionally, TI's "Cortex-M3/M4F Instruction Set, TECHNICAL USER'S MANUAL" indicates that QSUB is not supported on the Cortex-M3.

I think you're just going to have to believe what GCC is telling you...

OTHER TIPS

In accordance with TI the best gcc flags for cortex-a8 are

-march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -ffast-math -mfloat-abi=softfp

http://processors.wiki.ti.com/index.php/Cortex-A8

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top