Quote:
Originally Posted by jcollins
Actually, it's pretty easy. Just right click on a file you want to compile with ARM. Select "Get Info" and make sure the "Build" tab is selected. Should be an large text field. In this text field add "-mno-thumb" and that file will be compiled for ARM.
That works for me on my iPhone app. Alternatively you can use the "#pragma arm" and "#pragma thumb" directives to wrap your ARM code.
|
Good to know. The armcc compiler I use at work supports the same pragmas but I couldn't find any gcc documentation about that.
tawpie, here's the deal with ARM vs Thumb code. ARM code is a larger instruction set and has a lot shiny options that can give you faster performance. But Thumb code is 16 bits/instruction (half the size of ARM code) so you end up with a smaller code image. Smaller code means more of your code is cached and less time in general fetching instructions. So it definitely depends on your application which is optimal.
Probably, it's better to leave everything in Thumb mode and put only the most critical pieces in ARM mode (inner loops, heavy calculations, etc).