Hi,
(Oups! Wrong key. Sent an empty e-mail to pypy-dev, sorry...)
On Sat, May 28, 2005 at 01:28:40PM +0200, Armin Rigo wrote:
> > > - v_int1 = receive(Unsigned, arg=0)
> > > - v_int2 = receive(Unsigned, arg=1)
> > > + v_int1 = _receive_may_cast(s_int1, Unsigned, 0)
> > > + v_int2 = _receive_may_cast(s_int2, Unsigned, 1)
By the way, don't spend more time on this right now; I think it's a good
time to decide on a slightly less surprizing interface. Apart from the
whole global-fetching idea, another confusing aspect is that the
rtype_xyz() methods receive s_abc arguments that are not the main thing
they operate on -- they usually operate on variables (v_abc) instead.
So I am thinking about introducing a "high-level operation" concept and
changing the signature of the rtype_xyz() methods:
class __extend__(pairtype(SomeInteger, SomeInteger)):
def rtype_add(_, hlop, llops): # ignore the (s_int1, s_int2) pair
if hlop.s_result.unsigned:
v1, v2 = hlop.convertinputs(Unsigned, Unsigned)
v3 = llops.generate('uint_add', [v1, v2], resulttype=Unsigned)
return v3
else:
v1, v2 = hlop.convertinputs(Signed, Signed)
v3 = llops.generate('int_add', [v1, v2], resulttype=Signed)
return v3
Armin
_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev