Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: gcc problem / why (or not) to use ARM mode

2005-07-19 by 42Bastian Schick

lpc2100_fan <lpc2100_fan@...> schrieb am Mon, 18 Jul 2005 16:03:08 
-0000:

> If you have a 16-bit memory interface or worse a 16-bit Flash
> interface, use Thumb mode under all circumstances! It is faster and
> smaller code.

Agree.

> If you have a 32-bit interface and any kind of waitstates associated
> with it, Thumb is probably still faster and always smaller. A 32-bit
> RAM with zero watistates though will give you up to 30% higher
> performance in ARM mode compared to Thumb with the up to 30% code size
> penalty.

Don't agree. At least not fully. If the CPU has a small cache (4 bytes),
then it fetches 2 thumb insns with one bus access.

I looked a lot into generated assembly code to check if I should use
Thumb or ARM, and in 99% of the cases there is no real benefit of the
ARM mode.
I even tried to re-write parts of the RTOS - I write for living - in ARM
mode and found that there is only in very small cases a benefit (and there
of course I use it).

> Using busses like the LPC2106 has them (128-bit to the Flash), ARM
> mode will definitely be faster. The same applies as for the RAM above.
> Using ARM mode for a complete program would be waste of code memory
> space, using ARM mode in interrupt service routines (that are entered
> in ARM mode anyhow) is a smart idea with the Philips devices.

In thumb-mode you can fetch up to 8 insns from flash instead of 4 ARM 
insns.
Giving the 30% you mentioned above, 8 thumb insns == 5.7 ARM insns.


-- 
42Bastian Schick

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.