From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 7A94A396E837; Thu, 17 Nov 2022 00:34:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A94A396E837 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668645292; bh=ICiah+jJqiDvfpMJ6zMNJz+Un4QEPtuRndAXkMbll1A=; h=From:To:Subject:Date:From; b=XS8hbNY9YlhOq8sM0BNMXGVKKgDlwBoAisGtEA8NTPewdl88Mt24JblTAE0mCv8ph W9K4N/RHJoYk+nYmXze2zlUkOiMC2VZSqcZ5Hc/sn5jSdeJJTYVuFUwpnRjq0WQcWC Ezjv9uGrrSSNDdz3O/0mZ3bWWi/07aI+JQpV7uA4= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-4117] libstdc++: Ensure std::to_chars overloads all declared in [PR107720] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 80909529c9a2fc0aa0ccc285da2c9cc233c04aa7 X-Git-Newrev: f69a8299c1d95548e1539227fb7b8f5581aeb29b Message-Id: <20221117003452.7A94A396E837@sourceware.org> Date: Thu, 17 Nov 2022 00:34:51 +0000 (GMT) List-Id: https://gcc.gnu.org/g:f69a8299c1d95548e1539227fb7b8f5581aeb29b commit r13-4117-gf69a8299c1d95548e1539227fb7b8f5581aeb29b Author: Jonathan Wakely Date: Wed Nov 16 20:47:39 2022 +0000 libstdc++: Ensure std::to_chars overloads all declared in [PR107720] For powerpc64le we need to be able to format both of __ieee128 and __ibm128, so we need the std::to_chars overloads for both types to be visible at once. The __ieee128 overloads are always visible in C++23 mode, because they're used to implement the _Float128 overloads. The __ibm128 overloads are only visible when long double is __ibm128. libstdc++-v3/ChangeLog: PR libstdc++/107720 * include/std/format [_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT]: Declare overloads of std::to_chars for the alternative long double type. Diff: --- libstdc++-v3/include/std/format | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index 1afcd042bc2..f4fc85a16d2 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -1237,6 +1237,34 @@ namespace __format using __float128_t = __ieee128; # define _GLIBCXX_FORMAT_F128 1 +#ifdef __LONG_DOUBLE_IEEE128__ + // These overloads exist in the library, but are not declared. + // Make them available as std::__format::to_chars. + to_chars_result + to_chars(char*, char*, __ibm128) noexcept + __asm("_ZSt8to_charsPcS_e"); + + to_chars_result + to_chars(char*, char*, __ibm128, chars_format) noexcept + __asm("_ZSt8to_charsPcS_eSt12chars_format"); + + to_chars_result + to_chars(char*, char*, __ibm128, chars_format, int) noexcept + __asm("_ZSt8to_charsPcS_eSt12chars_formati"); +#elif __cplusplus == 202002L + to_chars_result + to_chars(char*, char*, __ieee128) noexcept + __asm("_ZSt8to_charsPcS_u9__ieee128"); + + to_chars_result + to_chars(char*, char*, __ieee128, chars_format) noexcept + __asm("_ZSt8to_charsPcS_u9__ieee128St12chars_format"); + + to_chars_result + to_chars(char*, char*, __ieee128, chars_format, int) noexcept + __asm("_ZSt8to_charsPcS_u9__ieee128St12chars_formati"); +#endif + #elif defined _GLIBCXX_LDOUBLE_IS_IEEE_BINARY128 // Format 128-bit floating-point types using long double.