value range propagation for _bitwise_ OR
"Jérôme M. Berger"
jeberger at free.fr
Mon Apr 12 14:04:07 PDT 2010
Don wrote:
> Jérôme M. Berger wrote:
>> Steven Schveighoffer wrote:
>>> On Sun, 11 Apr 2010 22:36:33 -0400, Rainer Deyke <rainerd at eldwood.com>
>>> wrote:
>>>> On 4/11/2010 13:16, Ali Çehreli wrote:
>>>>> Rainer Deyke wrote:
>>>> If you want 100% percent accuracy then you probably shouldn't be using
>>>> (min, max) pairs to represent your ranges anyway, since this is already
>>>> a simplification.
>>> Range propagation is needed to determine if you can put a value into a
>>> smaller type.
>>
>> If that was all we wanted, we wouldn't need to have a precise maxOr
>> since the output of the "or" operation is guaranteed to fit in the
>> same width as the operands. The reason we need to be precise is for
>> future propagation, at which point being able to handle holes in the
>> range could be useful (but too expensive in both time and memory to
>> be practical in a compiler).
>>
>> Jerome
>
> Remember that the OR may be part of a larger expression. There may be
> something like:
>
> uint a, b;
> ubyte c = (a|b) + 6;
>
That is why I started my reply with "if that was all we wanted"...
Jerome
--
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20100412/9efb022d/attachment.pgp>
More information about the Digitalmars-d
mailing list