37b Subj : Re: Memory visibility and MS Interlocked instructions To : comp.programming.threads From : Peter Dimov Date : Thu Aug 25 2005 03:35 pm Alexander Terekhov wrote: > Peter Dimov wrote: > [...] > > Can you give approximate PPC translation for the expression > > > > fValueHasBeenComputed.load(msync::cchlb_true) > > > > assuming that the compiler is not smart/atomics-aware and can't just > > insert the isync after the 'if'? (IOW, it can't analyze and optimize > > the 'load' in context... a library implementation, for example.) > > lwz r4,0(r3) #load shared data > cmpw r4,r4 #set CR0 to "equal" > bne- $-8 #branch never taken > --- > > and just add isync after "branch never taken". That's what I thought. In this case there is no difference between cchlb_true and cchlb (and ccacq, and even plain acq because of the fake control dependency.) . 0