Re: signed types


Subject: Re: signed types
From: Shalom Bresticker (Shalom.Bresticker@motorola.com)
Date: Thu Oct 11 2001 - 02:27:16 PDT


Yes, we already know about these 2 mistakes.

Muzaffer Kal wrote:

> * section 4.1.7 paragrahp 2 says "when two operands of unequal bit lengths
> are used, the smaller operand shall be zero filled on the most significant
> bit side to extend to the size of the larger operand". Same section
> paragraph 6 says "when both operands of a relational expression are signed
> integral operands (...) then the expression shall be interpreted as a
> comparison between signed values ...".
> I think these two statements are in conflict. I don't think it makes sense
> to zero extend the smaller operand if the comparison is to be between signed
> values. I think relational operators also should conform to section 4.5.2
> step 4 which says "extend the size of each operand (...) to the size of the
> expression. Perform sign extension if and only if the operand type (...) is
> signed" so the smaller operand should be signed extended.
>
> * section 4.1.8 paragraph 1, sentence 2 says "these four operators bit for
> bit, with zero filling if the two operands are of unequal bit length". If
> both operands are signed, the expression type should be signed (per 4.5.1
> step 12) and section 4.5.2. step 4 should apply.

--
**************************************************************************
Shalom Bresticker                           Shalom.Bresticker@motorola.com
Motorola Semiconductor Israel, Ltd.                  Tel #: +972 9 9522268
P.O.B. 2208, Herzlia 46120, ISRAEL                   Fax #: +972 9 9522890
**************************************************************************



This archive was generated by hypermail 2b28 : Thu Oct 11 2001 - 02:32:21 PDT