Re: errata/463: 4.1.13: Zero fill in ?: even if signed or x/z

From: Steven Sharp (sharp@cadence.com)
Date: Fri Aug 05 2005 - 17:50:00 PDT

  • Next message: stefen@boyd.com: "Re: pending/678"

    The following reply was made to PR errata/463; it has been noted by GNATS.

    From: Steven Sharp <sharp@cadence.com>
    To: etf-bugs@boyd.com, Brad.Pierce@synopsys.com
    Cc:
    Subject: Re: errata/463: 4.1.13: Zero fill in ?: even if signed or x/z
    Date: Fri, 5 Aug 2005 20:43:18 -0400 (EDT)

     If you ignore the obsolete text from v1995, and concentrate on the
     new rules in 4.5, I think it is clear enough.
     
     The legs of a ?: are context-determined, so you apply the rules in 4.5.1
     (in slightly shortened form here)
     
       -- For non-self-determined operands the following rules apply:
          if any operand is unsigned, the result is unsigned
          if all operands are signed, the result will be signed, except as noted
     
     So if either leg is unsigned, the result is unsigned.
     
     Then you apply the rule in 4.5.2 that says
     
       -- Propagate the type and size of the expression back down to the
          context-determined operands of the expression. In general, any
          context-determined operand of an operator shall be the same type
          and size as the result of the operator.
          
     So if the result is unsigned, both operands are unsigned.
     
     Therefore, if either leg is unsigned, then so is the other.
     
     With this new text added to 4.5.2 in the 2005 draft, I think it is now
     spelled out.
     
     Steven Sharp
     sharp@cadence.com
     



    This archive was generated by hypermail 2.1.4 : Fri Aug 05 2005 - 17:50:30 PDT and
    sponsored by Boyd Technology, Inc.