[m-rev.] for review: define <<u and >>u

Zoltan Somogyi zoltan.somogyi at runbox.com
Tue Dec 6 16:53:33 AEDT 2022



On Tue, 6 Dec 2022 12:20:57 +1100 (AEDT), Julien Fischer <jfischer at opturion.com> wrote:

> 
> On Tue, 6 Dec 2022, Zoltan Somogyi wrote:
> 
> > Add <<u and >>u to library/{int,uint}*.m ...
> > 
> > ... along with their unchecked equivalents. These differ from <<, >> and
> > their unchecked equivalents in that they take the shift amount as a uint,
> > instead of an int.
> 
> That's fine. 

Thank you.

> At some point compiler/const_prop.m and
> compiler/simplify_goal_call.m will need to be updated to handlle
> the new operations.

It seems that simplify_goal_call.m already has the needed code;
the only mod it seems to need is deleting the comment about
<<u and >>u not existing yet :-)

As for const_prop, I have just done the required updates.
I found the existing code strange, in that uint_emu.m reduces
the unchecked shift ops to the checked ones,
which I think is the right thing to do, while int_emu.m does not.
And unchecked_{left,right}_shift in int_enu.m check their arguments
using code that is (a) different from the checks in {left,right}_shift
in int_emu.m, but (b) similar to the checks in {left,right}_shift in
uint_emu.m.

Peter, you wrote the original int_emu.m. Do you remember the
reason for (a)?

Zoltan.





More information about the reviews mailing list