[Cfp-interest] DFP and unary +

James W Thomas jaswthomas at sbcglobal.net
Mon Jun 17 18:43:53 PDT 2013


On Jun 17, 2013, at 12:40 PM, Ian McIntosh <ianm at ca.ibm.com> wrote:

> The normal implementation of a unary + is to do nothing.  In that case any non-canonical encodings are unchanged.
> 
Unary + returns the value of its operand, which doesn't preclude changing non-canonical encodings. Note that IEEE 754 says copy, negate, and absolute value affect only the sign bit, but then goes on to say that these operations "may propagate non-canonical encodings", implying that they may not. The encoding is at a lower level of abstraction. Changing a non-canonical encoding does not change the value.
> 
> An alternate implementation is to add the value to zero.  Non-canonical encodings would be made canonical.  I don't know of any implementations that do that.
> 
This wouldn't a valid implementation, because it might change the sign of a zero operand and might change the value of a signaling NaN.

-Jim
> 
> The wording should allow either.
> 
> This applies to BFP too, in cases like the sign of zero, and in some non-IEEE implementations the exponent of zero.
> 
> - Ian McIntosh          IBM Canada Lab         Compiler Back End Support and Development
> 
> 
> <graycol.gif>"Fred J. Tydeman" ---06/13/2013 10:22:18 PM---Does a unary + operation propagate non-canonical encodings? WG14 N1722 11.1 Operators says that Unar
> 
> <ecblank.gif>
> From:
> <ecblank.gif>
> "Fred J. Tydeman" <tydeman at tybor.com>
> <ecblank.gif>
> To:
> <ecblank.gif>
> "cfp-interest" <cfp-interest at ucbtest.org>
> <ecblank.gif>
> Date:
> <ecblank.gif>
> 06/13/2013 10:22 PM
> <ecblank.gif>
> Subject:
> <ecblank.gif>
> [Cfp-interest] DFP and unary +
> <ecblank.gif>
> Sent by:
> <ecblank.gif>
> cfp-interest-bounces at oakapple.net
> 
> 
> 
> Does a unary + operation propagate non-canonical encodings?
> 
> WG14 N1722 11.1 Operators says that Unary Arithmetic operators
> in C11 follow the semantic of IEC 60559.  But, 60559 has
> no mention of unary + operator.
> 
> 
> ---
> Fred J. Tydeman        Tydeman Consulting
> tydeman at tybor.com      Testing, numerics, programming
> +1 (775) 287-5904      Vice-chair of PL22.11 (ANSI "C")
> Sample C99+FPCE tests: http://www.tybor.com
> Savers sleep well, investors eat well, spenders work forever.
> 
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest
> 
> 
> 
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20130617/1a694894/attachment-0001.html 


More information about the Cfp-interest mailing list