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

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

RE: [avr-gcc-list] Re: AVR byte swap optimization


From: Eric Weddington
Subject: RE: [avr-gcc-list] Re: AVR byte swap optimization
Date: Sat, 18 Nov 2006 20:20:34 -0700

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> org] On Behalf Of Paul Brook
> Sent: Saturday, November 18, 2006 9:46 AM
> To: address@hidden; Shaun Jackman
> Cc: address@hidden
> Subject: [avr-gcc-list] Re: AVR byte swap optimization
> 
> > Ideally, this macro would expand to three mov instructions 
> and a ret.
> > Is there anything I can do to help GCC along here? I'm 
> using GCC 4.1.0
> > with -O2.
> >
> > I won't bother to show bswap_32 here, which produces a real 
> disaster!
> > Think 47 instructions, for what should be 6.
> 
> Use gcc head, __builtin_bswap and make sure the AVR backend 
> implements the 
> bswap rtl patterns.

There's the problem. You can't just glibly say "make sure the AVR backend
implements the bswap rtl patterns". There are precious few volunteers who
are familiar enough with gcc internals and the avr port in particular to go
do just that. AFAIK, there is no bswap rtl pattern in the avr port, at least
there doesn't seem to be in 4.1.1.

 
> Future versions of gcc may also be able to recognise these 
> idioms without 
> using the builtin, but AFAIK that's not been implemented yet.

Plus there is a long lead time between when it is implemented on HEAD, then
branched, released from a branch, and then when it shows up in binary
distributions.

Eric Weddington





reply via email to

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