avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] [discussion] lpm support in avr-gcc


From: Bruce D. Lightner
Subject: Re: [avr-gcc-list] [discussion] lpm support in avr-gcc
Date: Tue, 27 Aug 2002 10:36:20 -0700

Joerg Wunsch wrote:
> 
> Harald Kipp <address@hidden> wrote:
> 
> > I don't know much about the compiler's internal structure,
> > but I guess, that both suggestions
> >
> >    1. Automatic recognition of PMEM pointers in assingments
> >    2. Using P modifier for string literals
> >
> > would require substantial changes, while the current way,
> > using the special attribute progmem, changes the runtime
> > lib only.
> 
> Using __attribute__ is IMHO fine.  But it would be ideal if
> this could automatically make gcc emit lpm instructions
> when accessing these variables.
> 
> --
> J"org Wunsch                                           Unix support engineer
> address@hidden        http://www.interface-systems.de/~j/
> avr-gcc-list at http://avr1.org

If we are taking a vote, IMNSHO I agree!  It is a small step with a positive
result.

I suspect that tighter AVR code will result because of this, based on my
experience using LPM macro(s).  The compiler can automatically "do the right
thing" with respect to the type of the object stored in program memory.  

I get tired of either having multiple "LPM macros" (i.e., for
char/uchar/short/ushort/long/ulong, etc.) or having to remember to cast the
result of the LPM() macro and/or explicitly assembling LPM() bytes into
bigger objects (e.g., ints).  If you are not careful, you either get
unneeded instructions (e.g., because of char vs. uchar -> int), or the wrong
answer!

So...how do we make it happen?  (I've got free beer if you've got the
expertise! :-)

Best regards,

Bruce

-- 
 Bruce D. Lightner
 Lightner Engineering
 La Jolla, California
 Email: address@hidden
 URL: http://www.lightner.net/lightner/bruce/
avr-gcc-list at http://avr1.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]