Fwd: [Vm-dev] urgent info required on Slang's shift treatment...

Eliot Miranda eliot.miranda at gmail.com
Tue Mar 3 20:55:30 UTC 2009


and again, forgive the duplication

---------- Forwarded message ----------
From: Igor Stasenko <siguctua at gmail.com>
Date: Tue, Mar 3, 2009 at 12:09 PM
Subject: Re: [Vm-dev] urgent info required on Slang's shift treatment...
To: Squeak Virtual Machine Development Discussion <
vm-dev at lists.squeakfoundation.org>



2009/3/3 Eliot Miranda <eliot.miranda at gmail.com>:
>
> Hi All,
>     I'm being bitten by Slang's treatment of bitShift: & >>.  In both
cases (generateBitShift:on:indent: & generateShiftRight:on:indent:) Slang
generates an unsigned shift by explicitly casting the shifted expression to
usqInt.  I can understand the benefit of having an unsigned shift.  But
there are times when one really needs a signed shift.  Further, the
Smalltalk versions of both bitShift: and >> are signed shifts.
> Dare I change e.g. generateShiftRight:on:indent: to leave the expression
alone and generate either a signed or an unsigned shift based on the
variable's declaration?  Or must I live with a maddening cCode: '(signed)'
inSmalltalk: [] carbuncle?
> E.
>

I think an easier way would be to add:

#<<+    #generateSignedShiftLeft:on:indent:
#>>+    #generateSignedShiftRight:on:indent:

in #initializeCTranslationDictionary
so you can use:

a <<+ b
or
a >>+ b

without writing horrible cCode:

--
Best regards,
Igor Stasenko AKA sig.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20090303/8f199200/attachment.htm


More information about the Vm-dev mailing list