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

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

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


From: Paul Brook
Subject: [avr-gcc-list] Re: AVR byte swap optimization
Date: Sat, 18 Nov 2006 16:46:26 +0000
User-agent: KMail/1.9.5

> 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.

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

Paul




reply via email to

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