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

Ralph Becket rbeck at microsoft.com
Thu Mar 15 03:26:04 AEDT 2001


> From: Peter Ross [mailto:peter.ross at miscrit.be]
> 
> scale(S, P0) = P :-
>     PO => p(X, Y),
>     NewX := S * X,
>     P <= p(NewX, Y).
> 
> I would argue that we should represent it as the following in the HLDS,
> thus allowing structure reuse to see the box/unboxing, and reuse the
> cells where possible.  Of course when floats are unboxed then we revert
> back to the original HLDS representation.
> 
> scale(S, P0) = P :-
>     P0 => p(BoxedX, BoxedY),
>     BoxedX => box(X),
>     BoxedY => box(Y),
>     NewX := S * X,
>     NewBoxedX <= box(NewX),         % Reuse the BoxedX cell>
>     NewBoxedY <= box(Y),            % Reuse the BoxedY cell.
>     P <= p(NewBoxedX, NewBoxedY).   % Reuse the P0 cell.
> 
> What are the problems with this suggestion?

(Forgive me if I'm revealing my ignorance here...)

I thought that the idea behind the HLDS was that every lvar occupied
exactly one machine word/register, hence for `NewX := S * X' on
floats all the variables there are pointers to machine floats, rather 
than machine floats themselves.

If that's the case, wouldn't it be simpler to just add SR versions
of the float operations?

Cheers,

Ralph
--------------------------------------------------------------------------
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