<html><body>
<p><font size="2" face="sans-serif">For your requirement, I think our best answer is the -qfloat=nofold option, which stops almost all compile time floating-point constant expression evaluation (except for static initialization). That's overkill but would get the job done. And I should add a qualifier: That doesn't work yet in the new front end used in our new little endian Linux C/C++ compilers, but it will be fixed.</font><br>
<br>
<font size="2" face="sans-serif">I think a better answer is that whenever fenv is used or trapping on floating-point exceptions is used, the compiler should automatically suppress folding either of everything (for fenv) or of specific operations that would lead to an activated exception (for trapping on floating-point exceptions). We have done that in some places, but it's a fairly big job to do everywhere and we have made no commitment to do more. The only cases we've done so far were when an infinity or NaN was generated, not underflow and not inexact.</font><br>
<br>
<font size="2" face="sans-serif">Maybe C should have a standard pragma to set the compile time rounding mode at a lexical block level? Not that I want to try to implement that.</font><br>
<font size="2" face="sans-serif"><br>
- Ian McIntosh IBM Canada Lab Compiler Back End Support and Development<br>
</font><br>
<br>
<img width="16" height="16" src="cid:1__=0ABBF765DFF473D88f9e8a93df938@ca.ibm.com" border="0" alt="Inactive hide details for "Fred J. Tydeman" ---2015-02-19 02:32:42 PM---On Thu, 19 Feb 2015 14:01:48 -0500 Ian McIntosh wrote: "><font size="2" color="#424282" face="sans-serif">"Fred J. Tydeman" ---2015-02-19 02:32:42 PM---On Thu, 19 Feb 2015 14:01:48 -0500 Ian McIntosh wrote: ></font><br>
<br>
<font size="1" color="#5F5F5F" face="sans-serif">From:        </font><font size="1" face="sans-serif">"Fred J. Tydeman" <tydeman@tybor.com></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">To:        </font><font size="1" face="sans-serif">Ian McIntosh/Toronto/IBM@IBMCA</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Cc:        </font><font size="1" face="sans-serif">"cfp-interest@oakapple.net" <cfp-interest@oakapple.net>, "Rajan Bhakta" <rbhakta@us.ibm.com></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Date:        </font><font size="1" face="sans-serif">2015-02-19 02:32 PM</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Subject:        </font><font size="1" face="sans-serif">Re: [Cfp-interest] WG14 IEEE 754-C binding meeting minutes        2015/02/18</font><br>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt><font size="2">On Thu, 19 Feb 2015 14:01:48 -0500 Ian McIntosh wrote:<br>
><br>
>For #3 "Expressions of FP constants done at translation time, yet result is<br>
>inexact, so depends upon rounding mode.", the IBM POWER XL and z/OS<br>
>compilers have an option -y to control which rounding mode to use for<br>
>expressions evaluated at compile time. Does that meet the requirement?<br>
><br>
<br>
No, if I read you correctly. I read that as a fixed<br>
static rounding mode to use at translation time.<br>
<br>
I am thinking of different parts of the code running<br>
under different rounding modes. Hence, the same <br>
expression of FP constants evaluates to different values<br>
in different parts of the code.<br>
<br>
---<br>
Fred J. Tydeman Tydeman Consulting<br>
tydeman@tybor.com 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>
</font></tt><br>
</body></html>