From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6B77E3857C77; Tue, 18 Oct 2022 09:43:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B77E3857C77 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666086227; bh=m56ENkFtajpcs2rKTPkpKWxl1fHLtZnYX2WE6gchqvk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DBip9nFulvd53dD/6ePz9ap3VqwYmvonmWXX4gbCN4+2A2txMHnV0zUBPZRbOj2v4 8Kv5zPwRh+eE2Lu8ypWRMvQK7XX0+/MpaIwKnuxcCChhoy/t/WKJ8IB+ia3VmpviFH a3TaVRjMU5JT43qFbo4Pr4Sb0gyw6JnlwryhCpaw= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106652] [C++23] P1467 - Extended floating-point types and standard names Date: Tue, 18 Oct 2022 09:43:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106652 --- Comment #16 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:a23225fb4f764dfc3e3e729c7d7238f03f282aaa commit r13-3354-ga23225fb4f764dfc3e3e729c7d7238f03f282aaa Author: Jakub Jelinek Date: Tue Oct 18 11:37:13 2022 +0200 libstdc++: Partial library support for std::float{16,32,64,128}_t and std::bfloat16_t The following patch is partial support for std::float{16,32,64,128}_t and std::bfloat16_t in libstdc++. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html says that , , and need changes toom, but that isn't implemented so far. In the only thing missing I'm aware of is std::nextafter std::float16_t and std::bfloat16_t overloads (I think we probably need to implement that out of line somewhere, or inline? - might need inline asm barriers) and std::nexttoward overloads (those are intentional, you said there is a LWG issue about that). Also, this patch has the glibc 2.26+ std::float128_t support for platfo= rms where long double isn't IEEE quad format temporarily disabled because it depends on https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603665.html changes which aren't in yet. The patch also doesn't include any testcases to cover the changes, it isn't clear to me where to put that. 2022-10-18 Jakub Jelinek PR c++/106652 * include/std/stdfloat: New file. * include/std/numbers (__glibcxx_numbers): Define and use it for __float128 explicit instantiations as well as _Float{16,32,64,128} and __gnu_cxx::__bfloat16_t. * include/std/atomic (atomic<_Float16>, atomic<_Float32>, atomic<_Float64>, atomic<_Float128>, atomic<__gnu_cxx::__bfloat16_t>): New explicit instantiations. * include/std/type_traits (__is_floating_point_helper<_Float16>, __is_floating_point_helper<_Float32>, __is_floating_point_helper<_Float64>, __is_floating_point_helper<_Float128>, __is_floating_point_helper<__gnu_cxx::__bfloat16_t>): Likewise. * include/std/limits (__glibcxx_concat3_, __glibcxx_concat3, __glibcxx_float_n): Define. (numeric_limits<_Float16>, numeric_limits<_Float32>, numeric_limits<_Float64>, numeric_limits<_Float128>, numeric_limits<__gnu_cxx::__bfloat16_t>): New explicit instantiations. * include/bits/std_abs.h (abs): New overloads for _Float{16,32,64,128} and __gnu_cxx::__bfloat16_t. * include/bits/c++config (_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128): Define if long double is IEEE quad. (__gnu_cxx::__bfloat16_t): New using. * include/c_global/cmath (acos, asin, atan, atan2, ceil, cos, c= osh, exp, fabs, floor, fmod, frexp, ldexp, log, log10, modf, pow, si= n, sinh, sqrt, tan, tanh, fpclassify, isfinite, isinf, isnan, isnormal, signbit, isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered, acosh, asinh, atanh, cbrt, copysign, erf, erfc, exp2, expm1, fdim, fma, fmax, fmin, hypot, ilogb, lgamma, llrint, llround, log1p, log2, logb, lrint, lround, nearbyint, nextafter, remainder, rint, round, scalbln, scalbn, tgamma, tru= nc, lerp): New overloads with _Float{16,32,64,128} or __gnu_cxx::__bfloat16_t types. * config/os/gnu-linux/os_defines.h (_GLIBCXX_HAVE_FLOAT128_MATH= ): Prepare for definition if glibc 2.26 and later implements *f128 APIs but comment out the actual definition for now. * include/ext/type_traits.h (__promote<_Float16>, __promote<_Float32>, __promote<_Float64>, __promote<_Float128>, __promote<__gnu_cxx::__bfloat16_t>): New specializations. * include/Makefile.am (std_headers): Add stdfloat. * include/Makefile.in: Regenerated. * include/precompiled/stdc++.h: Include stdfloat. * testsuite/18_support/headers/stdfloat/types_std.cc: New test. * testsuite/18_support/headers/limits/synopsis_cxx23.cc: New te= st. * testsuite/26_numerics/headers/cmath/c99_classification_macros_c++23.cc: New test. * testsuite/26_numerics/headers/cmath/functions_std_c++23.cc: N= ew test. * testsuite/26_numerics/numbers/4.cc: New test. * testsuite/29_atomics/atomic_float/requirements_cxx23.cc: New test.=