[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] CAS in FC0



On Thu, Mar 21, 2002 at 04:53:58AM +0100, Christophe wrote:
[...]
> > > loadaddr 0f,r5
> > > move r2,r3 // our node address to push
> > > 0:
> > > load_tagged [r1],r2       // read top
> > > store r2,[r3]                    // node->link = top
> > > store_tagged r3,[r1],r4 // top = node
> > > jump.nz r4,r0,r63             // return to caller if ok
> > > jump r0,r5
> >
> > Yep. But beware! `store r2,[r3]' must not clear the tag, or else this
> > function will loop forever.
> 
> r3 is the address of our node which becomes our top node
> r1 is the address of a pointer where to store the address of our top node
> 
> so it should not be a problem unless you fear that our LSU entry which contains
> the address of r1 is discarded by our "store [r3],r2" ?

Exactly.  It's not really our problem, as long as our implementation of
tags is correct, but it may become a common pitfall for programmers.

> > One more point to consider: Do we really need an extra load_tag?
> > Tagging could as well be done for all loads.
> 
> It is what I said to Yann. If we have no equivalent of llp/scp, I suppose we
> don't need an extra load_tag in fact.
> 
> One pdf file si speaking about a load conditional, that is a load which can
> fails if locked (like our store conditional). I don't know the advantage. I
> should reread this pdf.

Me too.

-- 
 Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
 "All I wanna do is have a little fun before I die"
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/