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

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

Re: [avr-gcc-list] suggestion


From: Royce Pereira
Subject: Re: [avr-gcc-list] suggestion
Date: Wed, 05 Jul 2006 21:08:04 +0530
User-agent: Opera Mail/9.00 (Win32)

Hi,
On Wed, 05 Jul 2006 17:57:50 +0530, <address@hidden> wrote:

> I'm a total newbie to avr-gcc and just compiled a first program. It merely
> fits the program memory so I've started to optimize..
>
> In my code there lots of places where 1-2-3 bits are flipped in I/O port:
>
>
>
> My suggestion is to optimize the case when 2 bits are set into 2 sbi
> commands, and when 2 bits are cleared into 2 cbi commands. It's quite
> easy to count number of 1s or 0s in the mask - and if there are exacly
> 2, apply this optimization.

Wherever you require this, just use 2 separate bit setting/ clearing statements 
in your C code itself.

--Royce.

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/




reply via email to

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