|
From: Cary R. <cy...@ya...> - 2008-04-22 18:05:08
|
--- On Tue, 4/22/08, Stephen Williams <st...@ic...> wrote:
> Hmm, ideally, I would like the left shift in a
> self-determined
> context like this to take on the size of the largest
> possible
> value that it can emit, but I think that can lead to
> crazyness.
> For example, if val were an integer (32bits) then the width
> of
> the shift expression would be 2**32. NAK!
>
> So I'm thinking that for left shift, if the left side
> is an
> unsized constant and the right side is non-consant, then it
> should take on the size of the integer. If both sides are
> constant, then it should take on exactly the right size.
> Does
> that sound workable to you?
The standard says this should be the same as integer, but given that this is a self determined context I don't see how making constant values smaller would be a problem. They will be zero extended to fit whatever is really needed in the end. And I like the idea of a constant larger than an integer doing the right thing.
Cary
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
|