gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Beginner q: .thumb_func

#131328 - sourcerer - Thu Jun 14, 2007 12:08 pm

Hi,
When I check the assembly output from devkitPro on some DS samples I see every function starts with .thumb_func.
Does this mean all code runs in thumb mode? That seems odd/not so nice to me?

Any insights as always appreciated :o)

Kaj

#131336 - chishm - Thu Jun 14, 2007 1:09 pm

C code is compiled into Thumb instructions by default in the template makefiles. This is specified on the line that reads:
Code:
ARCH   :=   -mthumb -mthumb-interwork

It's the -mthumb that does it, by the way. Thumb instructions tend to take up less space and are faster to execute from EXRAM, since it is read on a 16 bit bus. When the code is executed out of cache or ITCM, ARM code is quicker, due to the 32 bit bus and more basic operations being performed by each instruction.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#131337 - sourcerer - Thu Jun 14, 2007 1:30 pm

Ah, thanks, that makes sense :o)

Guess in the end it comes down to getting timers around my code to see what is faster.

K