|
From: | Graham Davies |
Subject: | Re: [avr-chat] Missed Optimisation ? |
Date: | Tue, 01 Mar 2011 09:58:02 -0500 |
bob wrote:
by this logic the missing 'OR' instructions could also affect external hardware as they are read-modify-write, but these are optimised away.
No, no, no. The entire statement is read-modify-write. Read 32-bits, modify 32-bits and write back 32-bits. Once you've got the 32-bits, if you know that only one byte will ever change, there is no need to fiddle with the others. Just write them back as they were. To break this up into multiple read-modify-writes would be totally in violation of the use of the volatile storage qualifier.
Graham.
[Prev in Thread] | Current Thread | [Next in Thread] |