From patchwork Thu Apr 23 21:09:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 38860 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 7C249396EC63 for ; Thu, 23 Apr 2020 21:09:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7C249396EC63 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03NL8f4r090664 for ; Thu, 23 Apr 2020 17:09:52 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 30jtk32su3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 17:09:52 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03NL3Cvt012338 for ; Thu, 23 Apr 2020 21:09:51 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma04dal.us.ibm.com with ESMTP id 30fs677pqh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 21:09:51 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03NL9pJm53739918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 23 Apr 2020 21:09:51 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EAA26124052 for ; Thu, 23 Apr 2020 21:09:50 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9C9612405B for ; Thu, 23 Apr 2020 21:09:50 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.141.68]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP for ; Thu, 23 Apr 2020 21:09:50 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCHv3 6/6] powerpc64le: Enable support for IEEE long double Date: Thu, 23 Apr 2020 16:09:48 -0500 Message-Id: <91e53fc22389f772490f62f44e05d3aa29fc11b1.1587675931.git.murphyp@linux.vnet.ibm.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-23_16:2020-04-23, 2020-04-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 suspectscore=1 impostorscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230151 X-Spam-Status: No, score=-30.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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: Thu, 23 Apr 2020 21:09:55 -0000 From: "Gabriel F. T. Gomes" Changes since v5: - Rebase against inline math test removal Changes since v4: - More Makefile massaging - Add ULPs for ieee128 only _Float128 redirects - Update for glibc 2.32 - Add short NEWS entry Changes since v4: - Removed the redirections code (moved to a separate commit). No changes since v3. Changes since v2: - Added definition of LDBL_IBM128_COMPAT_VERSION and LDBL_IBM128_VERSION (moved from a previous commit). Changes since v1: - Use __LONG_DOUBLE_USES_FLOAT128 directly. -- 8< -- On platforms where long double may have two different formats, i.e.: the same format as double (64-bits) or something else (128-bits), building with -mlong-double-128 is the default and function calls in the user program match the name of the function in Glibc. When building with -mlong-double-64, Glibc installed headers redirect such calls to the appropriate function. Likewise, the internals of glibc are now built against IEEE long double. However, the only (minimally) notable usage of long double is difftime. --- NEWS | 5 + sysdeps/powerpc/fpu/libm-test-ulps | 4 + sysdeps/powerpc/powerpc64/le/Implies-before | 1 + sysdeps/powerpc/powerpc64/le/Makefile | 4 + .../powerpc64/le/ldbl-128ibm-compat-abi.h | 8 ++ .../linux/powerpc/powerpc64/le/libc.abilist | 93 ++++++++++++++ .../linux/powerpc/powerpc64/le/libm.abilist | 117 ++++++++++++++++++ 7 files changed, 232 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ldbl-128ibm-compat-abi.h diff --git a/NEWS b/NEWS index dac306c4c3..d4b528296e 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,11 @@ Major new features: * The GNU C Library now loads audit modules listed in the DT_AUDIT and DT_DEPAUDIT dynamic section entries of the main executable. +* powerpc64le supports IEEE128 long double libm/libc redirects when + using the -mabi=ieeelongdouble to compile C code on supported GCC + toolchains. It is recommended to use GCC 8 or newer when testing + this option. + Deprecated and removed features, and other changes affecting compatibility: * The deprecated header and the sysctl function have been diff --git a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps index 1c989e020f..cd2a5fed45 100644 --- a/sysdeps/powerpc/fpu/libm-test-ulps +++ b/sysdeps/powerpc/fpu/libm-test-ulps @@ -1266,21 +1266,25 @@ ldouble: 1 Function: "gamma": double: 3 float: 4 +float128: 5 ldouble: 3 Function: "gamma_downward": double: 4 float: 4 +float128: 8 ldouble: 15 Function: "gamma_towardzero": double: 4 float: 3 +float128: 5 ldouble: 16 Function: "gamma_upward": double: 4 float: 5 +float128: 8 ldouble: 11 Function: "hypot": diff --git a/sysdeps/powerpc/powerpc64/le/Implies-before b/sysdeps/powerpc/powerpc64/le/Implies-before index 7c20db4e97..2139f4dae8 100644 --- a/sysdeps/powerpc/powerpc64/le/Implies-before +++ b/sysdeps/powerpc/powerpc64/le/Implies-before @@ -1,4 +1,5 @@ # On PowerPC we use the IBM extended long double format. +ieee754/ldbl-128ibm-compat ieee754/ldbl-128ibm ieee754/ldbl-opt ieee754/dbl-64 diff --git a/sysdeps/powerpc/powerpc64/le/Makefile b/sysdeps/powerpc/powerpc64/le/Makefile index 6afa1228dd..05ab13d85c 100644 --- a/sysdeps/powerpc/powerpc64/le/Makefile +++ b/sysdeps/powerpc/powerpc64/le/Makefile @@ -20,6 +20,10 @@ no-gnu-attribute-CFLAGS = -mno-gnu-attribute # We built an object file and extract the desired .gnu.attributes section # to be inserted into lib{c,m}.so. ifeq ($(build-shared),yes) + +# Build everything with IEEE 128-bit long double. +sysdep-CFLAGS += -mabi=ieeelongdouble -Wno-psabi $(no-gnu-attribute-CFLAGS) + before-compile += $(common-objpfx)no_ldbl_gnu_attribute.bin $(common-objpfx)no_ldbl_gnu_attribute.bin: $(..)sysdeps/powerpc/powerpc64/le/no_ldbl_gnu_attribute.c diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ldbl-128ibm-compat-abi.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ldbl-128ibm-compat-abi.h new file mode 100644 index 0000000000..34c7b6bed6 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ldbl-128ibm-compat-abi.h @@ -0,0 +1,8 @@ +/* ABI version for long double switch to IEEE 128-bit floating point.. + This is used by the Versions and math_ldbl_opt.h files in + sysdeps/ieee754/ldbl-128ibm-compat/. It gives the ABI version where + long double == ibm128 was replaced with long double == _Float128 + for libm *l functions and libc functions using long double. */ + +#define LDBL_IBM128_VERSION GLIBC_2.32 +#define LDBL_IBM128_COMPAT_VERSION GLIBC_2_32 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index 2b6a76d9c2..0c2513a4b3 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2248,4 +2248,97 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __argp_errorieee128 F +GLIBC_2.32 __argp_failureieee128 F +GLIBC_2.32 __asprintf_chkieee128 F +GLIBC_2.32 __asprintfieee128 F +GLIBC_2.32 __dprintf_chkieee128 F +GLIBC_2.32 __dprintfieee128 F +GLIBC_2.32 __errieee128 F +GLIBC_2.32 __error_at_lineieee128 F +GLIBC_2.32 __errorieee128 F +GLIBC_2.32 __errxieee128 F +GLIBC_2.32 __fprintf_chkieee128 F +GLIBC_2.32 __fprintfieee128 F +GLIBC_2.32 __fscanfieee128 F +GLIBC_2.32 __fwprintf_chkieee128 F +GLIBC_2.32 __fwprintfieee128 F +GLIBC_2.32 __fwscanfieee128 F +GLIBC_2.32 __isoc99_fscanfieee128 F +GLIBC_2.32 __isoc99_fwscanfieee128 F +GLIBC_2.32 __isoc99_scanfieee128 F +GLIBC_2.32 __isoc99_sscanfieee128 F +GLIBC_2.32 __isoc99_swscanfieee128 F +GLIBC_2.32 __isoc99_vfscanfieee128 F +GLIBC_2.32 __isoc99_vfwscanfieee128 F +GLIBC_2.32 __isoc99_vscanfieee128 F +GLIBC_2.32 __isoc99_vsscanfieee128 F +GLIBC_2.32 __isoc99_vswscanfieee128 F +GLIBC_2.32 __isoc99_vwscanfieee128 F +GLIBC_2.32 __isoc99_wscanfieee128 F +GLIBC_2.32 __obstack_printf_chkieee128 F +GLIBC_2.32 __obstack_printfieee128 F +GLIBC_2.32 __obstack_vprintf_chkieee128 F +GLIBC_2.32 __obstack_vprintfieee128 F +GLIBC_2.32 __printf_chkieee128 F +GLIBC_2.32 __printf_sizeieee128 F +GLIBC_2.32 __printfieee128 F +GLIBC_2.32 __qecvtieee128 F +GLIBC_2.32 __qecvtieee128_r F +GLIBC_2.32 __qfcvtieee128 F +GLIBC_2.32 __qfcvtieee128_r F +GLIBC_2.32 __qgcvtieee128 F +GLIBC_2.32 __scanfieee128 F +GLIBC_2.32 __snprintf_chkieee128 F +GLIBC_2.32 __snprintfieee128 F +GLIBC_2.32 __sprintf_chkieee128 F +GLIBC_2.32 __sprintfieee128 F +GLIBC_2.32 __sscanfieee128 F +GLIBC_2.32 __strfmon_lieee128 F +GLIBC_2.32 __strfmonieee128 F +GLIBC_2.32 __strfromieee128 F +GLIBC_2.32 __strtoieee128 F +GLIBC_2.32 __strtoieee128_l F +GLIBC_2.32 __swprintf_chkieee128 F +GLIBC_2.32 __swprintfieee128 F +GLIBC_2.32 __swscanfieee128 F +GLIBC_2.32 __syslog_chkieee128 F +GLIBC_2.32 __syslogieee128 F +GLIBC_2.32 __vasprintf_chkieee128 F +GLIBC_2.32 __vasprintfieee128 F +GLIBC_2.32 __vdprintf_chkieee128 F +GLIBC_2.32 __vdprintfieee128 F +GLIBC_2.32 __verrieee128 F +GLIBC_2.32 __verrxieee128 F +GLIBC_2.32 __vfprintf_chkieee128 F +GLIBC_2.32 __vfprintfieee128 F +GLIBC_2.32 __vfscanfieee128 F +GLIBC_2.32 __vfwprintf_chkieee128 F +GLIBC_2.32 __vfwprintfieee128 F +GLIBC_2.32 __vfwscanfieee128 F +GLIBC_2.32 __vprintf_chkieee128 F +GLIBC_2.32 __vprintfieee128 F +GLIBC_2.32 __vscanfieee128 F +GLIBC_2.32 __vsnprintf_chkieee128 F +GLIBC_2.32 __vsnprintfieee128 F +GLIBC_2.32 __vsprintf_chkieee128 F +GLIBC_2.32 __vsprintfieee128 F +GLIBC_2.32 __vsscanfieee128 F +GLIBC_2.32 __vswprintf_chkieee128 F +GLIBC_2.32 __vswprintfieee128 F +GLIBC_2.32 __vswscanfieee128 F +GLIBC_2.32 __vsyslog_chkieee128 F +GLIBC_2.32 __vsyslogieee128 F +GLIBC_2.32 __vwarnieee128 F +GLIBC_2.32 __vwarnxieee128 F +GLIBC_2.32 __vwprintf_chkieee128 F +GLIBC_2.32 __vwprintfieee128 F +GLIBC_2.32 __vwscanfieee128 F +GLIBC_2.32 __warnieee128 F +GLIBC_2.32 __warnxieee128 F +GLIBC_2.32 __wcstoieee128 F +GLIBC_2.32 __wcstoieee128_l F +GLIBC_2.32 __wprintf_chkieee128 F +GLIBC_2.32 __wprintfieee128 F +GLIBC_2.32 __wscanfieee128 F GLIBC_2.32 pthread_sigmask F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist index d479a64fca..aa45e2639c 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist @@ -1097,3 +1097,120 @@ GLIBC_2.31 totalordermagf32x F GLIBC_2.31 totalordermagf64 F GLIBC_2.31 totalordermagf64x F GLIBC_2.31 totalordermagl F +GLIBC_2.32 __acoshieee128 F +GLIBC_2.32 __acosieee128 F +GLIBC_2.32 __asinhieee128 F +GLIBC_2.32 __asinieee128 F +GLIBC_2.32 __atan2ieee128 F +GLIBC_2.32 __atanhieee128 F +GLIBC_2.32 __atanieee128 F +GLIBC_2.32 __cabsieee128 F +GLIBC_2.32 __cacoshieee128 F +GLIBC_2.32 __cacosieee128 F +GLIBC_2.32 __canonicalizeieee128 F +GLIBC_2.32 __cargieee128 F +GLIBC_2.32 __casinhieee128 F +GLIBC_2.32 __casinieee128 F +GLIBC_2.32 __catanhieee128 F +GLIBC_2.32 __catanieee128 F +GLIBC_2.32 __cbrtieee128 F +GLIBC_2.32 __ccoshieee128 F +GLIBC_2.32 __ccosieee128 F +GLIBC_2.32 __ceilieee128 F +GLIBC_2.32 __cexpieee128 F +GLIBC_2.32 __cimagieee128 F +GLIBC_2.32 __clog10ieee128 F +GLIBC_2.32 __clogieee128 F +GLIBC_2.32 __conjieee128 F +GLIBC_2.32 __copysignieee128 F +GLIBC_2.32 __coshieee128 F +GLIBC_2.32 __cosieee128 F +GLIBC_2.32 __cpowieee128 F +GLIBC_2.32 __cprojieee128 F +GLIBC_2.32 __crealieee128 F +GLIBC_2.32 __csinhieee128 F +GLIBC_2.32 __csinieee128 F +GLIBC_2.32 __csqrtieee128 F +GLIBC_2.32 __ctanhieee128 F +GLIBC_2.32 __ctanieee128 F +GLIBC_2.32 __erfcieee128 F +GLIBC_2.32 __erfieee128 F +GLIBC_2.32 __exp10ieee128 F +GLIBC_2.32 __exp2ieee128 F +GLIBC_2.32 __expieee128 F +GLIBC_2.32 __expm1ieee128 F +GLIBC_2.32 __f32addieee128 F +GLIBC_2.32 __f32divieee128 F +GLIBC_2.32 __f32mulieee128 F +GLIBC_2.32 __f32subieee128 F +GLIBC_2.32 __f64addieee128 F +GLIBC_2.32 __f64divieee128 F +GLIBC_2.32 __f64mulieee128 F +GLIBC_2.32 __f64subieee128 F +GLIBC_2.32 __fabsieee128 F +GLIBC_2.32 __fdimieee128 F +GLIBC_2.32 __floorieee128 F +GLIBC_2.32 __fmaieee128 F +GLIBC_2.32 __fmaxieee128 F +GLIBC_2.32 __fmaxmagieee128 F +GLIBC_2.32 __fminieee128 F +GLIBC_2.32 __fminmagieee128 F +GLIBC_2.32 __fmodieee128 F +GLIBC_2.32 __frexpieee128 F +GLIBC_2.32 __fromfpieee128 F +GLIBC_2.32 __fromfpxieee128 F +GLIBC_2.32 __getpayloadieee128 F +GLIBC_2.32 __hypotieee128 F +GLIBC_2.32 __ilogbieee128 F +GLIBC_2.32 __j0ieee128 F +GLIBC_2.32 __j1ieee128 F +GLIBC_2.32 __jnieee128 F +GLIBC_2.32 __ldexpieee128 F +GLIBC_2.32 __lgammaieee128 F +GLIBC_2.32 __lgammaieee128_r F +GLIBC_2.32 __llogbieee128 F +GLIBC_2.32 __llrintieee128 F +GLIBC_2.32 __llroundieee128 F +GLIBC_2.32 __log10ieee128 F +GLIBC_2.32 __log1pieee128 F +GLIBC_2.32 __log2ieee128 F +GLIBC_2.32 __logbieee128 F +GLIBC_2.32 __logieee128 F +GLIBC_2.32 __lrintieee128 F +GLIBC_2.32 __lroundieee128 F +GLIBC_2.32 __modfieee128 F +GLIBC_2.32 __nanieee128 F +GLIBC_2.32 __nearbyintieee128 F +GLIBC_2.32 __nextafterieee128 F +GLIBC_2.32 __nextdownieee128 F +GLIBC_2.32 __nexttoward_to_ieee128 F +GLIBC_2.32 __nexttowardf_to_ieee128 F +GLIBC_2.32 __nexttowardieee128 F +GLIBC_2.32 __nextupieee128 F +GLIBC_2.32 __powieee128 F +GLIBC_2.32 __remainderieee128 F +GLIBC_2.32 __remquoieee128 F +GLIBC_2.32 __rintieee128 F +GLIBC_2.32 __roundevenieee128 F +GLIBC_2.32 __roundieee128 F +GLIBC_2.32 __scalbieee128 F +GLIBC_2.32 __scalblnieee128 F +GLIBC_2.32 __scalbnieee128 F +GLIBC_2.32 __setpayloadieee128 F +GLIBC_2.32 __setpayloadsigieee128 F +GLIBC_2.32 __significandieee128 F +GLIBC_2.32 __sincosieee128 F +GLIBC_2.32 __sinhieee128 F +GLIBC_2.32 __sinieee128 F +GLIBC_2.32 __sqrtieee128 F +GLIBC_2.32 __tanhieee128 F +GLIBC_2.32 __tanieee128 F +GLIBC_2.32 __tgammaieee128 F +GLIBC_2.32 __totalorderieee128 F +GLIBC_2.32 __totalordermagieee128 F +GLIBC_2.32 __truncieee128 F +GLIBC_2.32 __ufromfpieee128 F +GLIBC_2.32 __ufromfpxieee128 F +GLIBC_2.32 __y0ieee128 F +GLIBC_2.32 __y1ieee128 F +GLIBC_2.32 __ynieee128 F