This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PowerPC and Volatile



>Naturally, the locations we are talking about are declared volatile, so the 
>compiler does not optimize the code, but the PowerPC has its own 
>optimization in the form of pipelining, and it seems to be causing this 
>problem.
>
>The question is, should the compiler be inserting an "eieio" instruction at 
>the sequence points in the code, such as the end of the loop mentioned 
>above?  This PPC instruction tells the processor to hold off its 
>pipelining.  We have been inserting them in the code ourselves, but it is a 
>bit of a pain to have to do it.

No, the compiler can't automatically insert eieio instructions
since it doesn't know which pairs of *locations* need to have the eieio
synchronization.  That is something that only the hardware knows
about.  If it automatically put in an eieio before every volatile
reference, then it would uncecessarily slow down all volatile
accesses, even those between volatile locations that *don't* require it.

I understand that its a pain, but when dealing with memory mapped i/o
devices and high performance processors, its part of the price you pay
for the gain in speed.

-- 
Peter Barada                                   Peter.Barada@motorola.com
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)

"The real art of conversation is not only to say the right thing at the
right time, but also to leave unsaid the wrong thing at the tempting
moment."  -- Unknown

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]