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

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

RE: [avr-libc-dev] Inline assembler and compiler optimization


From: Weddington, Eric
Subject: RE: [avr-libc-dev] Inline assembler and compiler optimization
Date: Mon, 23 Mar 2009 18:07:43 -0600

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> org] On Behalf Of Joerg Wunsch
> Sent: Monday, March 23, 2009 4:27 PM
> To: address@hidden
> Subject: Re: [avr-libc-dev] Inline assembler and compiler optimization
> 
> As Weddington, Eric wrote:
> 
> > > Likewise, the same goes for using nop(), as tempting as it is.
> > > Again, _NOP() would be fine, as will __nop().
> 
> > Hmm. I think that might be included as part of the new builtins for
> > the AVR port.
> 
> I don't think there's a reason to have that as a builtin, when it can
> be so conveniently had as an inline asm statement.  That's much
> different from __delay_cycles.

There is already a precedent. There are other instructions that are added as 
builtins: sei, cli, wdr, sleep, swap, fmul*. The AVR32 port has many more. And 
other GCC ports (IIRC e.g. ARM) seem to include every instruction as a builtin.

I just checked the builtin patch, nop needs to be added to the list (but there 
is an implementation of it that is used for the delay_cycles).

> Well, it would rather be <avr/nojtag.h> :).  Rather something like
> <avr/mcufeatures.h> or such.  After all, it's about MCUCR/MCUCSR.

How about <avr/mcu.h> then? That's fairly short and easy to remember.




reply via email to

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