From patchwork Thu May 24 04:35:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel F. T. Gomes" X-Patchwork-Id: 27479 Received: (qmail 28472 invoked by alias); 24 May 2018 04:36:26 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 28390 invoked by uid 89); 24 May 2018 04:36:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=H*F:D*br X-HELO: mo20.mail-out.ovh.net From: "Gabriel F. T. Gomes" To: Subject: [RFC PATCH 3/5] Do not declare __mpn_extract_float128 when long double has binary128 format Date: Thu, 24 May 2018 01:35:51 -0300 Message-ID: <20180524043553.23569-4-gabriel@inconstante.eti.br> In-Reply-To: <20180524043553.23569-1-gabriel@inconstante.eti.br> References: <20180524043553.23569-1-gabriel@inconstante.eti.br> MIME-Version: 1.0 X-ClientProxiedBy: EX1.emp.local (172.16.2.1) To EX4.emp.local (172.16.2.4) X-Ovh-Tracer-Id: 4703446862251806403 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedthedrgeeigddugecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecu In the internal header include/gmp.h, __mpn_extract_float128 is declared whenever the float128 API is being built, but only when long double is not ABI-compatible with _Float128 (i.e.: when __HAVE_DISTINCT_FLOAT128). Checking for __HAVE_DISTINCT_FLOAT128 is currently enough for building glibc for all platforms. However, when powerpc64le adds support for long double with a third format (binary128), __mpn_extract_float128 will be used by the implementation of some long double functions, such as vfprintf/__printf_fp (at a first glance, it could seem illogical to use a float128 function for long double, but this design choice reduces the changes to the ABI, by reusing functions that are already exported). The reuse of this internal function will be achieve (in a later patch) with the redefinition of __mpn_extract_long_double to __mpn_extract_float128, similarly to what float128_private.h does. However, since __mpn_extract_long_double is redefined, it would get declared twice by include/gmp.h, with mismatching parameters. This patch adds a check for __HAVE_FLOAT128_UNLIKE_LDBL, which avoids the second declaration of __mpn_extract_float128. Tested for powerpc64le. * include/gmp.h (__mpn_extract_float128): Only declare when __HAVE_DISTINCT_FLOAT128 and __HAVE_FLOAT128_UNLIKE_LDBL. --- include/gmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gmp.h b/include/gmp.h index 657c7a0148..aa9299c67e 100644 --- a/include/gmp.h +++ b/include/gmp.h @@ -19,7 +19,7 @@ extern mp_size_t __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size, long double value) attribute_hidden; -#if __HAVE_DISTINCT_FLOAT128 +#if __HAVE_DISTINCT_FLOAT128 && __HAVE_FLOAT128_UNLIKE_LDBL extern mp_size_t __mpn_extract_float128 (mp_ptr res_ptr, mp_size_t size, int *expt, int *is_neg, _Float128 value)