[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-chat] Missed Optimisation ?
From: |
bob |
Subject: |
Re: [avr-chat] Missed Optimisation ? |
Date: |
Tue, 01 Mar 2011 15:46:17 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 |
On 01/03/11 15:33, Colin O'Flynn wrote:
> Hi Bob,
>
> One consideration is that reading or writing might have side-effects on a
> memory-mapped peripheral.
>
> So if you were accessing a peripheral with a pointer to a volatile uint32_t,
> and issue the |= command, you might actually be expecting the CPU to perform
> the memory read & write. The simple act of reading the memory could clear a
> flag for example.
>
> My personal thought process with the volatile keyword is I assume the
> compiler does *all* memory accesses, even the unnecessary ones.
>
> Regards,
>
> -Colin
Hi Colin,
by this logic the missing 'OR' instructions could also affect external
hardware as they are read-modify-write, but these are optimised away.
Cheers,
Bob
RE: [avr-chat] Missed Optimisation ?, Boyapati, Anitha, 2011/03/02
RE: [avr-chat] Missed Optimisation ?, Boyapati, Anitha, 2011/03/02
Re: [avr-chat] Missed Optimisation ?, bob, 2011/03/01
Re: [avr-chat] Missed Optimisation ?,
bob <=
Re: [avr-chat] Missed Optimisation ?, Graham Davies, 2011/03/01