<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 17, 2013, at 12:40 PM, Ian McIntosh <<a href="mailto:ianm@ca.ibm.com">ianm@ca.ibm.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><p><font size="2" face="sans-serif">The normal implementation of a unary + is to do nothing. In that case any non-canonical encodings are unchanged.</font><br></p></div></blockquote>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.</div><div><blockquote type="cite"><div><p>
<br>
<font size="2" face="sans-serif">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.</font><br></p></div></blockquote><div>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.</div><div><br></div><div>-Jim</div><blockquote type="cite"><div><p>
<br>
<font size="2" face="sans-serif">The wording should allow either.</font><br>
<br>
<font size="2" face="sans-serif">This applies to BFP too, in cases like the sign of zero, and in some non-IEEE implementations the exponent of zero.</font><br>
<br>
<font size="2" face="sans-serif">- Ian McIntosh IBM Canada Lab Compiler Back End Support and Development<br>
</font><br>
<br>
<span><graycol.gif></span><font size="2" color="#424282" face="sans-serif">"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</font><br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody><tr valign="top"><td width="1%"><span><ecblank.gif></span><br>
<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">From:</font></ul>
</td><td width="100%"><span><ecblank.gif></span><br>
<font size="1" face="sans-serif">"Fred J. Tydeman" <<a href="mailto:tydeman@tybor.com">tydeman@tybor.com</a>></font></td></tr>
<tr valign="top"><td width="1%"><span><ecblank.gif></span><br>
<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">To:</font></ul>
</td><td width="100%"><span><ecblank.gif></span><br>
<font size="1" face="sans-serif">"cfp-interest" <<a href="mailto:cfp-interest@ucbtest.org">cfp-interest@ucbtest.org</a>></font></td></tr>
<tr valign="top"><td width="1%"><span><ecblank.gif></span><br>
<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">Date:</font></ul>
</td><td width="100%"><span><ecblank.gif></span><br>
<font size="1" face="sans-serif">06/13/2013 10:22 PM</font></td></tr>
<tr valign="top"><td width="1%"><span><ecblank.gif></span><br>
<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">Subject:</font></ul>
</td><td width="100%"><span><ecblank.gif></span><br>
<font size="1" face="sans-serif">[Cfp-interest] DFP and unary +</font></td></tr>
<tr valign="top"><td width="1%"><span><ecblank.gif></span><br>
<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">Sent by:</font></ul>
</td><td width="100%"><span><ecblank.gif></span><br>
<font size="1" face="sans-serif"><a href="mailto:cfp-interest-bounces@oakapple.net">cfp-interest-bounces@oakapple.net</a></font></td></tr>
</tbody></table>
</p><hr width="100%" size="2" align="left" noshade="" style="color:#8091A5; "><br>
<br>
<br>
<tt><font size="2">Does a unary + operation propagate non-canonical encodings?<br>
<br>
WG14 N1722 11.1 Operators says that Unary Arithmetic operators<br>
in C11 follow the semantic of IEC 60559. But, 60559 has<br>
no mention of unary + operator.<br>
<br>
<br>
---<br>
Fred J. Tydeman Tydeman Consulting<br>
<a href="mailto:tydeman@tybor.com">tydeman@tybor.com</a> Testing, numerics, programming<br>
+1 (775) 287-5904 Vice-chair of PL22.11 (ANSI "C")<br>
Sample C99+FPCE tests: </font></tt><tt><font size="2"><a href="http://www.tybor.com/">http://www.tybor.com</a></font></tt><tt><font size="2"><br>
Savers sleep well, investors eat well, spenders work forever.<br>
<br>
_______________________________________________<br>
Cfp-interest mailing list<br>
<a href="mailto:Cfp-interest@oakapple.net">Cfp-interest@oakapple.net</a><br>
</font></tt><tt><font size="2"><a href="http://mailman.oakapple.net/mailman/listinfo/cfp-interest">http://mailman.oakapple.net/mailman/listinfo/cfp-interest</a></font></tt><tt><font size="2"><br>
<br>
</font></tt><br>
<br>
</div>
_______________________________________________<br>Cfp-interest mailing list<br><a href="mailto:Cfp-interest@oakapple.net">Cfp-interest@oakapple.net</a><br>http://mailman.oakapple.net/mailman/listinfo/cfp-interest<br></blockquote></div><br></body></html>