[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] suggestion
From: |
David Breeze |
Subject: |
Re: [avr-gcc-list] suggestion |
Date: |
Wed, 05 Jul 2006 13:37:44 +0100 |
Hi,
There are situations, hardware related, where 2 sbi or cbi instructions would
cause problems as there would be a significant time (clock dependant) between
setting/clearing the bits.
David
>>> <address@hidden> 05 July 2006 13:27 >>>
that is, just one word to toggle one bit and 3 words to toggle 2+ bits.
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.
I was able to save ~100 bytes and fit my program into 4K, just by optimizing
these often used bit-tweaking places in my program.
If someone would have time to implement this kind of optimization for
I/O ports, that would be really great! I've never dealt with compilers
and just don't know how to do that..
_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed. If
an addressing or transmission error has misdirected
this e-mail, please notify the author by replying to this e-mail. If you are
not the intended recipient you must not use, disclose, copy, print or rely on
this e-mail.
Joy Mining Machinery Limited/P&H Minepro Services aims to prevent the
propagation of viruses, but cannot guarantee that this email is virus free.
You are advised to scan all attachments and open them at your own risk.
Joy Mining Machinery Limited/P&H Minepro Services may monitor outgoing and
incoming e-mails and other telecommunications on its e-mail and
telecommunication systems.
-Privacy - UK-