[Cfp-interest] WG14 IEEE 754-C binding meeting minutes 2015/02/18

Ian McIntosh ianm at ca.ibm.com
Tue Feb 24 13:12:46 PST 2015


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.

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.

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.

- Ian McIntosh          IBM Canada Lab         Compiler Back End Support
and Development




From:	"Fred J. Tydeman" <tydeman at tybor.com>
To:	Ian McIntosh/Toronto/IBM at IBMCA
Cc:	"cfp-interest at oakapple.net" <cfp-interest at oakapple.net>, "Rajan
            Bhakta" <rbhakta at us.ibm.com>
Date:	2015-02-19 02:32 PM
Subject:	Re: [Cfp-interest] WG14 IEEE 754-C binding meeting minutes
            2015/02/18



On Thu, 19 Feb 2015 14:01:48 -0500 Ian McIntosh wrote:
>
>For #3 "Expressions of FP constants done at translation time, yet result
is
>inexact, so depends upon rounding mode.", the IBM POWER XL and z/OS
>compilers have an option -y to control which rounding mode to use for
>expressions evaluated at compile time.  Does that meet the requirement?
>

No, if I read you correctly.  I read that as a fixed
static rounding mode to use at translation time.

I am thinking of different parts of the code running
under different rounding modes.  Hence, the same
expression of FP constants evaluates to different values
in different parts of the code.

---
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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20150224/7844504d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20150224/7844504d/attachment.gif 


More information about the Cfp-interest mailing list