C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] *_HAS_SUBNORM

From: Aaron Ballman <aaron_at_[hidden]>
Date: Mon, 6 Dec 2021 11:01:46 -0500
On Thu, Dec 2, 2021 at 11:19 AM Fred J. Tydeman via Liaison
<liaison_at_[hidden]> wrote:
>
> Issue for C++ liason group.
>
> The WG14 paper:
> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2797.htm
> discusses several issues with the *_HAS_SUBNORM macros.

Thank you for bringing this up, Fred! I've CCed in the WG21 SG6
numerics study group as well as one of their chairs for their
awareness.

> Issue 1: What to do with *_HAS_SUBNORM?
> Choices:
> Remove now from C23 (and maybe C++) -- WG14 voted against this
> Make them obsolescent in C23
> Leave as is
> Expand (along the lines of the above paper)
>
> Issue 2:
> Since some people claim that nothing is said in C17 about flushing
> subnormals to zero, doing that is Undefined Behavior (UB).
>
> We suggest adding to 5.2.4.2.2 (to make clear it is not UB):
>
> Whether and in what cases subnormal numbers are treated as zeros is
> implementation defined. Subnormal numbers that in some cases are
> treated by arithmetic operations as zeros are properly classified as
> subnormal. However, object representations that could represent
> subnormal numbers but that are always treated by arithmetic operations
> as zeros are noncanonical zeros, and the values are properly
> classified as zero, not subnormal. IEC 60559 arithmetic (with default
> exception handling) always treats subnormal numbers as nonzero.
>
> Adding that is independent of issue 1.

I think we'll need some of the numeric experts to weigh in on the
specific details. One thing that would help is if you could add a
paper to the WG21 document log about the changes made by WG14 and what
changes you'd like to see WG21 make in response. I'm happy to add the
document to the log on your behalf, or if you think you'll have future
papers along these same lines, I can help you get set up in the system
so that you can add your own papers. When you go to add the document
to the WG21 document log, we can specify that the document should be
seen by the liaison group as well as the numerics group so it gets
appropriate review.

~Aaron

>
>
> ---
> Fred J. Tydeman Tydeman Consulting
> tydeman_at_[hidden] 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.
> _______________________________________________
> Liaison mailing list
> Liaison_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/liaison
> Searchable archives: http://lists.isocpp.org/liaison/2021/12/index.php

Received on 2021-12-06 10:02:37