public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/106652] [C++23] P1467 - Extended floating-point types and standard names
Date: Wed, 19 Oct 2022 09:26:39 +0000	[thread overview]
Message-ID: <bug-106652-4-nuBX6pFiO4@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106652-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106652

--- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:ba281da28d34f9a78a07f6ee56ad2c754447966e

commit r13-3372-gba281da28d34f9a78a07f6ee56ad2c754447966e
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Oct 19 11:25:03 2022 +0200

    libstdc++-v3: Implement {,b}float16_t nextafter and some fixes [PR106652]

    The following patch implements nextafter for std::{,b}float16_t,
    though right now only without constexpr support, and adds a testcase for
it.
    The testcase unfortunately relevealed I've screwed up testing of my last
    patch.  I've tested earlier version of the patch with
    --target_board=unix/-std=c++23
    but didn't test the final version with that RUNTESTFLAGS, so missed
    an invalid call to std::sph_neumann (too many arguments) in the test.
    And, I've made a typo in the guard for numeric_limits (the reason
    for the guard is I wanted to avoid defining a large macro that nothing
    will then use because the std::{,b}float*_t types are C++23 only) and
    so numeric_limits wasn't specialized for the types at all but
    testsuite/18_support/headers/limits/synopsis_cxx23.cc test didn't
    detect that.
    In the nextafter implementation I'm calling __builtin_nextafterf
    to get various required side-effects for nextafter from 0/-0, or from max
    to inf or from min to largest subnormal to avoid needing to set errno
    inline, or use inline asm specific for each processor to force math
    evaluation barriers.  Dunno if
      #ifdef __INT16_TYPE__
        using __float16_int_type = __INT16_TYPE__;
      #else
        using __float16_int_type = short int;
      #endif
    isn't too ugly, perhaps we could just blindly use short int and hope
    or even assert it has the same size as _Float16 or __gnu_cxx::__bfloat16_t?
    Only aarch64, arm, csky, gcn, x86, nvptx and riscv support these types
    and all of them have 16-bit short (I think the only target with some
    other short size is avr with certain command line switches where both
    short and int are 8-bit, but such mode isn't compatible with C and C++
    requirements).

    2022-10-19  Jakub Jelinek  <jakub@redhat.com>

            PR c++/106652
            * include/std/limits: Fix a typo, 202202L -> 202002L.
            (numeric_limits::<_Float16>::radix,
numeric_limits::<_Float32>::radix,
            numeric_limits::<_Float64>::radix,
numeric_limits::<_Float128>::radix,
            numeric_limits::<__gnu_cxx::__bfloat16_t>::radix): Use
__FLT_RADIX__
            macro instead of type specific macros.
            * include/c_global/cmath (nextafter(_Float16, _Float16)): New
            overload.
            (nextafter(__gnu_cxx::__bfloat16_t, __gnu_cxx::__bfloat16_t)):
            Likewise.
            * testsuite/26_numerics/headers/cmath/functions_std_c++23.cc
            (test_functions): Uncomment nextafter test.  Fix up sph_neumann
call.
            * testsuite/26_numerics/headers/cmath/nextafter_c++23.cc: New test.

  parent reply	other threads:[~2022-10-19  9:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 17:14 [Bug c++/106652] New: " mpolacek at gcc dot gnu.org
2022-08-24 14:27 ` [Bug c++/106652] " jakub at gcc dot gnu.org
2022-08-24 14:49 ` jakub at gcc dot gnu.org
2022-08-24 16:56 ` jakub at gcc dot gnu.org
2022-08-24 17:35 ` joseph at codesourcery dot com
2022-08-25 12:51 ` jakub at gcc dot gnu.org
2022-08-25 12:55 ` jakub at gcc dot gnu.org
2022-08-25 14:39 ` jakub at gcc dot gnu.org
2022-09-09  9:44 ` jakub at gcc dot gnu.org
2022-09-09 18:12 ` jakub at gcc dot gnu.org
2022-09-10 10:20 ` jakub at gcc dot gnu.org
2022-09-10 10:22 ` jakub at gcc dot gnu.org
2022-09-10 17:28 ` jakub at gcc dot gnu.org
2022-09-10 17:31 ` jakub at gcc dot gnu.org
2022-09-10 18:13 ` jakub at gcc dot gnu.org
2022-09-27  6:18 ` cvs-commit at gcc dot gnu.org
2022-10-18  9:43 ` cvs-commit at gcc dot gnu.org
2022-10-19  9:26 ` cvs-commit at gcc dot gnu.org [this message]
2022-11-19  9:24 ` jakub at gcc dot gnu.org
2022-11-28 22:31 ` pinskia at gcc dot gnu.org
2022-12-09 15:20 ` pinskia at gcc dot gnu.org
2023-08-21 15:57 ` igorkuo at meta dot ua
2023-08-22 14:15 ` cvs-commit at gcc dot gnu.org
2023-08-22 14:16 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-106652-4-nuBX6pFiO4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).