From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 5F317396E862 for ; Thu, 17 Nov 2022 00:35:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5F317396E862 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668645319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zaXFSa6Z3ilUGOolmk4LIXBpNbWbPzuwxmabmBSqLY4=; b=DLrCEribTiohybDwu1AhNrLTKcnHYoAe/NqNsaBRGE0EeWCq0KV1CjZj69uBeJ8D47dvEO hQ7xcJ1QBhUvG9cNZaZQYjNWcBN2jxpeutwSFLaYpsXVRcvvTEL+pBlwteHxxEmV/L8I3S 7ANeQ4afndWA++OOsYlOq/gKjV7sVZI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-81-beqauKrjOuGlFk8BneBy_Q-1; Wed, 16 Nov 2022 19:35:11 -0500 X-MC-Unique: beqauKrjOuGlFk8BneBy_Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F37511C0519D; Thu, 17 Nov 2022 00:35:10 +0000 (UTC) Received: from localhost (unknown [10.33.36.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9B3E1121325; Thu, 17 Nov 2022 00:35:10 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Ensure std::to_chars overloads all declared in [PR107720] Date: Thu, 17 Nov 2022 00:35:08 +0000 Message-Id: <20221117003508.1432092-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tested powerpc64le-linux. Pushed to trunk. -- >8 -- 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. --- 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. -- 2.38.1