[Cfp-interest] Fw: 18661-2 and 754

Ian McIntosh ianm at ca.ibm.com
Mon May 14 10:18:02 PDT 2018


Not all IEEE 754 operations guarantee a canonical result, do they?  Eg,
copying, negating, absolute value.  So we would have to "specify otherwise"
for those.

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

----- Forwarded by Ian McIntosh/Toronto/IBM on 2018-05-14 01:15 PM -----

From:	Jim Thomas <jaswthomas at sbcglobal.net>
To:	"Fred J. Tydeman" <tydeman at tybor.com>
Cc:	"cfp-interest at oakapple.net" <cfp-interest at oakapple.net>
Date:	2018-05-12 11:16 PM
Subject:	Re: [Cfp-interest] 18661-2 and 754
Sent by:	cfp-interest-bounces at oakapple.net





      On Feb 19, 2018, at 8:59 AM, Fred J. Tydeman <tydeman at tybor.com>
      wrote:

      18661-2 quantize has
       Nothing about non-canonical encodings.

We need a general statement about functions delivering canonical results
unless specified otherwise. We say this implicitly through the binding with
IEC 60559, but it would be good say it explicitly. It could go in part 1,
which introduces the concept of canonical representations into C.
5.2.4.2.2#5a ends with: "Typically, floating-point operations deliver
results with canonical representations.” We could append something like:
“IEC 60559 operations deliver results with canonical representations,
unless specified otherwise."

       Nothing about overflow.

The last sentence of the Description could say: The quantize functions do
not raise the ”overflow” or “underflow” floating-point exception.

       Nothing about 'invalid' (which would be in Annex F).

The decimal functions are intended to be specified in 7.12 to have IEC
60559 behavior. That is, all implementations that choose to provide them
must follow IEC 60559. This means we should be able to give the entire
specification in 7.12 without saying anything more in Annex F. Note that
the Description of the quantize functions states the requirement for”
inexact". It could do the same for “invalid":

   [2] The quantizedN functions compute, if possible, a value with the
   numerical value of x and the quantum exponent of y. If the quantum
   exponent is being increased, the value shall be correctly rounded; if
   the result does not have the same value as x, the “inexact”
   floating-point exception shall be raised. If the quantum exponent is
   being decreased and the significand of the result has more digits than
   the type would allow, the result is NaN, the “invalid” floating-point
   exception is raised, and a domain error occurs. If one or both operands
   are NaN the result is NaN. Otherwise if only one operand is infinite,
   the result is NaN, the “invalid” floating-point exception is raised, and
   a domain error occurs. If both operands are infinite, the result is
   DEC_INFINITY with the sign of x, converted to the type of the function.
   The quantize functions do not raise the”overflow” or “underflow”
   floating-point exceptions.



      754 has in 5.3.2
      ...this operation shall not propagate non-canonical encodings:
      quantize does not signal underflow or overflow.
      Otherwise if only one operand is infinite then the invalid operation
      exception is signaled and the result is a NaN.

      18661-2 llquantexp has
       Nothing about 'invalid' for infinite and NaN (which would be in
      Annex F).

Following the approach above:

   [2] The llquantexpdN functions compute the quantum exponent (5.2.4.2.2a)
   of a finite argument. If x is infinite or NaN, they compute LLONG_MIN,
   the “invalid” floating-point exception is raised, and a domain error
   occurs.

- Jim Thomas



      ---
      Fred J. Tydeman        Tydeman Consulting
      tydeman at tybor.com      Testing, numerics, programming
      +1 (702) 608-6093      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/20180514/3e7c9a9e/attachment.html 


More information about the Cfp-interest mailing list