From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by sourceware.org (Postfix) with ESMTPS id 71A263858012; Wed, 31 Mar 2021 13:47:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 71A263858012 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=whitebox@nefkom.net Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4F9SL33tvQz1qtfH; Wed, 31 Mar 2021 15:47:23 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4F9SL33k0Yz1qqw9; Wed, 31 Mar 2021 15:47:23 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id xhfmT8oYideU; Wed, 31 Mar 2021 15:47:22 +0200 (CEST) X-Auth-Info: Xl2wfoQ9ZyQ5mzgpophZq0/2aHA+GvilAsLVToTD+BJa4vMP4hmP2kAR4t2OoVWV Received: from igel.home (ppp-46-244-172-40.dynamic.mnet-online.de [46.244.172.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 31 Mar 2021 15:47:22 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 144552C329D; Wed, 31 Mar 2021 15:47:21 +0200 (CEST) From: Andreas Schwab To: Siddhesh Poyarekar Cc: Siddhesh Poyarekar via Libc-alpha Subject: Re: [PATCH] ppc64le: Make shared libm routines work again for static programs References: <20210331051410.844754-1-siddhesh@sourceware.org> <87pmzf21ks.fsf@igel.home> <243baf90-6d39-6fb1-a1f3-0e7768298a62@sourceware.org> X-Yow: It's hard being an ARTIST!! Date: Wed, 31 Mar 2021 15:47:21 +0200 In-Reply-To: <243baf90-6d39-6fb1-a1f3-0e7768298a62@sourceware.org> (Siddhesh Poyarekar's message of "Wed, 31 Mar 2021 13:47:28 +0530") Message-ID: <87a6qj1lli.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2021 13:47:26 -0000 This appears to work. Andreas. >From ea7654a1bf82b4bf3cd2fb6b375a043746427232 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 31 Mar 2021 14:17:24 +0200 Subject: [PATCH] powerpc64le: Use ifunc for _Float128 functions also in libc --- .../powerpc/powerpc64/le/fpu/multiarch/Makefile | 14 +++++++++++--- .../powerpc64/le/fpu/multiarch/float128_private.h | 4 ++-- .../le/fpu/multiarch/math-type-macros-float128.h | 4 ++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile index 767805b510..fa3425fbc1 100644 --- a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile @@ -85,6 +85,7 @@ endif # ifeq ($(do_f128_multiarch),yes) +f128-ifunc-calls = s_modff128 s_scalbnf128 s_frexpf128 s_ldexpf128 gen-libm-f128-ifunc-routines = \ e_acosf128 e_acoshf128 e_asinf128 e_atan2f128 e_atanhf128 e_coshf128 \ e_expf128 e_fmodf128 e_hypotf128 e_j0f128 e_j1f128 e_jnf128 \ @@ -96,7 +97,7 @@ gen-libm-f128-ifunc-routines = \ s_tanhf128 s_truncf128 s_remquof128 e_log2f128 \ s_roundf128 s_nearbyintf128 s_sincosf128 s_fmaf128 s_lrintf128 \ s_llrintf128 s_lroundf128 s_llroundf128 e_exp10f128 \ - m_modff128 m_scalbnf128 m_frexpf128 m_ldexpf128 x2y2m1f128 \ + $(f128-ifunc-calls) $(f128-ifunc-calls:s_%=m_%) x2y2m1f128 \ gamma_productf128 lgamma_negf128 lgamma_productf128 s_roundevenf128 \ cargf128 conjf128 cimagf128 crealf128 cabsf128 e_scalbf128 s_cacosf128 \ s_cacoshf128 s_ccosf128 s_ccoshf128 s_casinf128 s_csinf128 \ @@ -118,19 +119,26 @@ f128-march-routines-ifunc = $(addsuffix -ifunc,$(gen-libm-f128-ifunc-routines)) f128-march-routines = $(f128-march-routines-p9) $(f128-march-routines-ifunc) f128-march-cpus = power9 -libm-routines += $(f128-march-routines) +f128-march-calls-p9 = $(addsuffix -power9,$(f128-ifunc-calls)) +f128-march-calls-ifunc = $(addsuffix -ifunc,$(f128-ifunc-calls)) +f128-march-calls = $(f128-march-calls-p9) $(f128-march-calls-ifunc) + +calls += $(f128-march-calls) +libm-routines += $(filter-out $(f128-march-calls), $(f128-march-routines)) generated += $(f128-march-routines) CFLAGS-float128-ifunc.c += $(type-float128-CFLAGS) $(no-gnu-attribute-CFLAGS) # Copy special CFLAGS for some functions +CFLAGS-s_modff128-power9.c += -fsignaling-nans CFLAGS-m_modff128-power9.c += -fsignaling-nans # Generate ifunc wrapper files and target specific wrappers around # each routine above. Note, m_%.c files are fixed up to include # s_%.c files. This is an artifact of the makefile rules which allow # some files to be compiled for libc and libm. -$(objpfx)gen-float128-ifuncs.stmp: Makefile +$(objpfx)gen-float128-ifuncs.stmp: \ + Makefile $(..)sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile $(make-target-directory) for gcall in $(gen-libm-f128-ifunc-routines); do \ ifile="$${gcall}"; \ diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/float128_private.h b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/float128_private.h index 08530df9a1..c613d4abae 100644 --- a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/float128_private.h +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/float128_private.h @@ -19,7 +19,7 @@ #ifndef _FLOAT128_PRIVATE_PPC64LE #define _FLOAT128_PRIVATE_PPC64LE 1 -#if IS_IN(libc) || !defined(_F128_ENABLE_IFUNC) +#ifndef _F128_ENABLE_IFUNC /* multiarch is not supported. Do nothing and pass through. */ #include_next #else @@ -94,6 +94,6 @@ F128_REDIR (__lgamma_productf128) #include #include -#endif /* !(IS_IN(libc) && defined(_F128_ENABLE_IFUNC) */ +#endif /* _F128_ENABLE_IFUNC */ #endif /* _FLOAT128_PRIVATE_PPC64LE */ diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/math-type-macros-float128.h b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/math-type-macros-float128.h index 59cfbb87d3..422ce211be 100644 --- a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/math-type-macros-float128.h +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/math-type-macros-float128.h @@ -21,7 +21,7 @@ #include_next -#if !IS_IN(libc) && defined(_F128_ENABLE_IFUNC) +#ifdef _F128_ENABLE_IFUNC /* Include fenv.h now before turning off PLT bypass. At minimum fereaiseexcept is used today. */ @@ -115,6 +115,6 @@ F128_REDIR (__w_log1pf128); /* Include the redirects shared with math_private.h users. */ #include -#endif /* !IS_IN(libc) && defined(_F128_ENABLE_IFUNC) */ +#endif /* _F128_ENABLE_IFUNC */ #endif /*_MATH_TYPE_MACROS_FLOAT128_PPC64_MULTI */ -- 2.31.1 -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."