[m-dev.] introduce box/unbox float operators in HLDS

Peter Ross peter.ross at miscrit.be
Thu Mar 15 22:23:08 AEDT 2001


On Thu, Mar 15, 2001 at 03:08:48AM -0800, Ralph Becket wrote:
> > From: Peter Ross [mailto:peter.ross at miscrit.be]
> > Sent: 15 March 2001 10:55
> > >
> > > > If that's the case, wouldn't it be simpler to just add SR versions
> > > > of the float operations?
> > >
> > > That sounds to me like a much easier way of solving the problem
> > > that Pete is trying to solve.
> > >
> > It doesn't help for the following code
> > 
> > swap(p(X, Y), p(Y, X)).
> > 
> > There is no floating point operation, yet we will still unbox and then
> > box the X and Y cells on the MLDS backend, while the LLDS backend
> > doesn't do the box and unbox and hence introduces aliases between the
> > two headvars.
> 
> I don't understand why the MLDS would unbox either argument.  Either
> (1) this code is polymorphic, in which case you don't need to unbox or
> (2) in this case we know that X and Y are floats, and whether they're
> boxed or not still doesn't make any difference that I can see.
> 
The case is 2) and you are correct, there is no need to unbox and then
rebox the arguments, but that is what the current code generator does.
Why, I am sure fjh will let us know.

Pete
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list