[fpc-devel] cortex-m0 support

Jeppe Græsdal Johansen jjohan07 at student.aau.dk
Tue Jan 10 13:18:40 CET 2012

Den 05-01-2012 03:35, David Welch skrev:
> With the cortex-m0 parts now hitting the market I think it is time to 
> bring up the topic of thumb support again, not arm not thumb2 but 
> thumb (the only common instruction set across almost the entire arm 
> family (the exception being the pre-armv4t)).
> cortex-m0 and -m1 are armv6-m based, the -m3 and -m4 are armv7m based.
> I count something like 20 armv6m instructions that are not in the all 
> thumb variants category.  something like 148 armv7m that are not 
> supported by armv6m nor all thumb variants.  Just a rough count.
> This is why you will see folks saying that the cortex-m0 and -m1 are 
> thumb only not thumb2.
> The cortex-m0 based mbed's have hit the street btw, available at 
> sparkfun and other places.  Note that gcc and llvm fail to build 
> working code for the cortex-m0, when you specify cortex-m0 you get 
> thumb2 code which fails miserably.
> David
Looks like it basically only has some branching instructions that can be 
32 bit, and thus use R8-R15. This means it'll be pretty easy to create a 
cg sharing a heap of code with the thumb2 cg.

An interesting idea however, could be to create a real Thumb cg, and let 
the Thumb2(armv7m) and Armv6m cg extend that. That would give the 
benefit that fpc could generate Thumb code on older platforms too

More information about the fpc-devel mailing list