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

Re: [f-cpu] Memory add/sub



> hello, 
  
> i really wonder what this thing is really about... 
> anyway. 
;-) 
 
> Michael Riepe wrote: 
> > On Sun, Sep 01, 2002 at 03:30:53PM +0200, Cedric BAIL wrote: 
> > >   If we want to correctly manage a stack with pop/push operation, we 
> > > need a add/sub operator that preserve the LSU information bit. 
 
> really ? 
yes 
 
> push/pop is just one use of pointer updates, and the existing 
> post-increment (with register or immediate modifier) has 
> already been discussed, right ? 
 
Yes, and you perhaps forgot that the solution need a add/sub before 
doing a pop after the last push. 
  
> > > I propose something 
> > > like that : madd[0-7] and msub[0-7]. I don't know if we need size for 
> > > this operation or endian, I think not. Stream information is needed 
> > > if we want to implement them by simply multipling the number of LSU. 
 
> do you mean that you want to add or substract up to 7 bytes from a 
> pointer ? 
 
euh... I was speacking about stream in the instruction (all load/store have  
it). You know the cray like feature ;-) 
 
> the existing post-increment does this already, and you get a load or 
> store for free. If you want to hust update the pointer, "load" R0 so the 
> result is cancelled. "Think RISC". Or should i say : project yourself in an 
> over-simplified world. 
 
I say no, it doesn't update the pointer before memory operation. And in 
a lot of case we need that (compiler need it when they manipulate object 
or in certain case the stack because of big jump). 
 
> > >   In the same idea I think we need to affect some stream, for 
> > > example 0 for unknow stream and 7 for stack. What did you think 
> > > about that ? 
 
> allocating stream now would reduce our scalability in the future : 
> we still have a lot of other means to do specific things : we can add 
> some instructions for example. 
 
I think that not a good solution. But what append if you compiler 
can detect that stack and malloc are not the same stream and want to allocate 
them. It can't because he will use external librairie that will always use 
the default stream 0. So he will never be able to use them ! 
 
So if we don't say any thing about stream now before any application 
are written, we can remove this feature I think. And I don't see why 
adding instructions or delaying the problem will solve it. 
  
> > I already outlined the need for such a `pointer add' instruction last 
> > year. Programs that deal with structures (or classes/objects) will 
> > need it quite often. 
> then just do a "load" to this pointer, put the result in R0 
> and update the pointer with the register or immediate value you want. 
 
??? What are you doing ??? You prefer to do a memory operation 
instead of only updating a pointer ? In fact you use a hack to do 
something like madd/msub, but that isn't clean ! Think RISC, don't 
forget ;-) 
  
> Is a specific instruction really needed ? 
 
Yes, and absolutely yes ! Or you must specially handle load/store 
to R0, you prefer to complexify a complex instruction instead of 
adding a simpler instruction... 
 
 
Cedric  
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/