RE: [sv-ac] Re: [sv-bc] Re: if-else

From: Steven Sharp <sharp_at_.....>
Date: Thu Nov 01 2007 - 18:19:41 PDT
>You seem to have a different interpretation of what a correct
>implementation should be. :)
>
>I think you are incorrectly determining that the result of the
>arithmetic shift should be unsigned. That would be true in the case of
>an arithmetic or relational operation, but not in the case of equality.
>Equality has its own explicit rules for dealing with signedness.

I re-checked the 1364-2005 standard, and we actually put in a pretty
good description of the full rules for the relational and equality
operators.  In 5.5.2 it says

"However, there are two exceptions:
  
  -- The relational and equality operators have operands that are neither
     fully self-determined nor fully context-determined.  The operands
     shall affect each other as if they were context-determined operands
     with a result type and size (maximum of the two operand size) determined
     from them.  However, the actual result type shall always be 1 bit
     unsigned.  The type and size of the operand shall be independent of
     the rest of the expression and vice versa."
     
So if you have a signed and unsigned operand, they affect each other as
if they were context-determined operands with an unsigned result type.
That means that the unsignedness gets propagated down into them by the
usual rules for context-determined operands.  The results that I described
then follow.

You might want to test your own implementation on this...

Steven Sharp
sharp@cadence.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Nov 1 18:20:00 2007

This archive was generated by hypermail 2.1.8 : Thu Nov 01 2007 - 18:20:10 PDT