[Cfp-interest] implementing tgmath for constant rounding modes

Fred J. Tydeman tydeman at tybor.com
Fri Jun 15 21:53:05 PDT 2012


On Wed, 13 Jun 2012 19:46:57 -0700 Jim Thomas wrote:
>
>> OK.  But, then we need to add words to our document telling what
>> that prefix is (so everyone does the same thing).
>
>I think specifying implementation interfaces is out of scope.

Then we are back to the problem of 3rd party library/header
venders, eg, Dinkenware, cannot portably create a header
that works with all compilers.  We need to document how
static rounded math library calls are done (either a new
keyword in the language or a specific prefix on the function
name).

A different viewpoint.  Static (or constant value) rounding
only affects the final result of the math library function
result.  And only makes sense for a correctly rounded math
function.  Hence, one math library function can be used for
all static rounding modes and just look at some indicator
of the static rounding mode wanted to do the final rounding.

So, have a global (thread local) flag to indicate the static 
result wanted.  And have the pragma that alters static 
rounding mode to gen code to alter that flag.

---
Fred J. Tydeman        Tydeman Consulting
tydeman at tybor.com      Testing, numerics, programming
+1 (775) 358-9748      Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.



More information about the Cfp-interest mailing list