From patchwork Fri Mar 27 21:18:01 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: 38642 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 27476385E009 for ; Fri, 27 Mar 2020 21:18:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 27476385E009 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02RL46Ao128686 for ; Fri, 27 Mar 2020 17:18:15 -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 2yxw7hjt2c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Mar 2020 17:18:15 -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 02RLH8Ej022058 for ; Fri, 27 Mar 2020 21:18:14 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma04dal.us.ibm.com with ESMTP id 2ywawgthcb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Mar 2020 21:18:14 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02RLIDIe13107838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 27 Mar 2020 21:18:13 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1247A136053 for ; Fri, 27 Mar 2020 21:18:13 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6FF6613605D for ; Fri, 27 Mar 2020 21:18:12 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.139.44]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP for ; Fri, 27 Mar 2020 21:18:12 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCH v2 10/10] powerpc64le: Enable support for IEEE long double Date: Fri, 27 Mar 2020 16:18:01 -0500 Message-Id: <20200327211801.31234-11-murphyp@linux.vnet.ibm.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200327211801.31234-1-murphyp@linux.vnet.ibm.com> References: <20200327211801.31234-1-murphyp@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-27_08:2020-03-27, 2020-03-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 suspectscore=1 bulkscore=0 priorityscore=1501 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003270169 X-Spam-Status: No, score=-25.7 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: Fri, 27 Mar 2020 21:18:18 -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 1c88c95d1c..d74a74fccb 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,11 @@ Major new features: * New locale added: ckb_IQ (Kurdish/Sorani spoken in Iraq) + * 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: [Add deprecations, removals and changes affecting compatibility here] diff --git a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps index 73f18cf1df..695c5eee7e 100644 --- a/sysdeps/powerpc/fpu/libm-test-ulps +++ b/sysdeps/powerpc/fpu/libm-test-ulps @@ -1264,21 +1264,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 55e0c48f5d..2fdee66efd 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 2229a1dcc0..c0ca0d6907 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2247,3 +2247,96 @@ 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 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