< Forward Inline >
-------- Original Message --------
Message-ID: <425423FE.30C8D4DF@[EMAIL PROTECTED]
>
Subject: Re: shared_ptr on ppc?
References: ... <42541BB5.AE56E560@[EMAIL PROTECTED]
>
Alexander Terekhov wrote:
[...]
> Got it now. Thanks.
asm long atomic_decrement_weak( register long * pw ) {
<load-UNreserved>
<add -1>
<branch if zero to acquire>
{lw}sync
loop:
<load-reserved>
<add -1>
<branch if zero to acquire>
<store-conditional>
<branch if failed to loop else to done>
acquire:
isync
done:
<...>
}
asm long atomic_decrement_strong( register long * pw ) {
// Peter's state machine
loop0:
<load-reserved>
<add -1>
<branch if zero to loop0_acquire>
{lw}sync
loop1:
<store-conditional>
<branch if !failed to done>
loop2:
<load-reserved>
<add -1>
<branch if !zero to loop1>
<store-conditional>
<branch if failed to loop2 else to acquire>
loop0_acquire:
<store-conditional>
<branch if failed to loop0>
acquire:
isync
done:
<...>
}
All right now?
regards,
alexander.
< Forward Quoted > [Message-ID:
f4bc7d7d1041b71c5450aa06b68936ee@[EMAIL PROTECTED]
Hinnant wrote:
>
> On Apr 6, 2005, at 12:36 PM, Alexander Terekhov wrote:
>
> >
> > Alexander Terekhov wrote:
> >
> > [... asm long atomic_decrement_[weak|strong] ...]
> >
> > I suppose that CodeWarrior is smart enough to recognize the presence
of
> > msync instructions and will behave accordingly with respect to
compiler
> > caching/reordering across these routines. If not, things can go wild,
> > beware.
>
> Your assumption is correct. CodeWarrior won't reorder across these
> instructions.
>
> -Howard
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


|