avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] What is '__AVR_HAVE_MUL__'?


From: Anatoly Sokolov
Subject: Re: [avr-libc-dev] What is '__AVR_HAVE_MUL__'?
Date: Tue, 30 Jan 2007 20:46:20 +0300

Hi.

>
>> New ATtiny devices also have LPM Rx, Z+ instruction.  When I added
>> avr25 architecture in GCC, I have introduced two gcc macros
>> __AVR_HAVE_MOVW__ and __AVR_HAVE_LPMX__. Now I have added
>> __AVR_HAVE_MUL__ macro in GCC for avr4 and avr5 architectures.
>
> Does that mean __AVR_ENHANCED__ will eventually become obsolete then?


I consider that the __AVR_ENHANCED__ macro should be obsolete. I asked Denis 
the sanction to remove __AVR_ENHANCED__ from the GCC 4.3 or later version, 
but he was against. Hence the __AVR_ENHANCED__  will be present in the 
compiler still some time.

>
> How are the different compiler and library versions playing together?
> Say, we have an older compiler that doesn't know anything about the
> new macros but only sets __AVR_ENHANCED__, will the library code then
> assume all of __AVR_HAVE_MOVW__, __AVR_HAVE_LPMX__, and
> __AVR_HAVE_MUL__?
>

__AVR_HAVE_*__ macros are defined in  'include/avr/io.h' and 
'common/macros.inc' files so:

#ifndef __AVR_HAVE_MOVW__
#  if  defined(__AVR_ENHANCED__) && __AVR_ENHANCED__
#   define __AVR_HAVE_MOVW__ 1
#  endif
#endif

If compiler knows only __AVR_ENHANCED__ macro, __AVR_HAVE_*__  macros are 
defined when defined __AVR_ENHANCED__ (i.e. for avr4 and avr5).

Anatoly. 






reply via email to

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