xjag74 <detlef.weidner@...> schrieb am Wed, 14 Dec 2005 14:51:16
-0000:
> void functionname(void)
> {
> unsigned char x=0;
>
> or
>
> void functionname(void)
> {
> unsigned long x=0;
>
> The first example uses less stack, but it takes a longer time for
> initialization when calling the function cause the 8 bit have to be
> masked out.
> Am I right with that supposition?
Both version use the same amount of stack since the stack must be 4 byte
aligened on a ARM7.
The unsigned char version will in many cases need more instruction with gcc
because it often does a 8->32 bit promoting (although a ldrb would
suffice).
My hint: Look at the assmbly output (-S option for gcc) !
--
42Bastian SchickMessage
Re: [lpc2000] GCC - locals performance
2005-12-16 by 42Bastian Schick
Attachments
- No local attachments were found for this message.