From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id E0C4D3939C37 for ; Mon, 1 Mar 2021 17:19:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E0C4D3939C37 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 121H7HGM061526; Mon, 1 Mar 2021 12:19:56 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3712hyw6uf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 01 Mar 2021 12:19:56 -0500 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 121H7PMm062142; Mon, 1 Mar 2021 12:19:55 -0500 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 3712hyw6u0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 01 Mar 2021 12:19:55 -0500 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 121HGah0020191; Mon, 1 Mar 2021 17:19:54 GMT Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by ppma02dal.us.ibm.com with ESMTP id 3710sqa305-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 01 Mar 2021 17:19:54 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp07027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 121HJrTl25624892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Mar 2021 17:19:53 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2CA07136051; Mon, 1 Mar 2021 17:19:53 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3CDB9136055; Mon, 1 Mar 2021 17:19:52 +0000 (GMT) Received: from ibm-toto.the-meissners.org (unknown [9.65.200.124]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTPS; Mon, 1 Mar 2021 17:19:52 +0000 (GMT) Date: Mon, 1 Mar 2021 12:19:50 -0500 From: Michael Meissner To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn , Bill Schmidt , Peter Bergner , Joseph Myers Subject: [PATCH 3/3 V2] Do not build Decimal/Float128 conversions if decimal is disabled. Message-ID: <20210301171950.GC9185@ibm-toto.the-meissners.org> Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn , Bill Schmidt , Peter Bergner , Joseph Myers References: <20210301171432.GA7962@ibm-toto.the-meissners.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210301171432.GA7962@ibm-toto.the-meissners.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-03-01_12:2021-03-01, 2021-03-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 mlxlogscore=999 impostorscore=0 clxscore=1015 phishscore=0 malwarescore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103010137 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_MANYTO, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 17:20:02 -0000 [PATCH 3/3 V2] Do not build Decimal/Float128 conversions if decimal is disabled. This patch suppresses building the Decimal <-> Float128 conversions if the user used --disable-decimal-float when configuring GCC. I have done bootstraps on a little endian power9 system with each of the long double variants (128-bit IBM, 128-bit IEEE, 64-bit) enabled, and there were no regressions in each of the builds with the previous version. In addition, I have built 2 cross compilers from my x86_64 system to little endian PowerPC Linux. One build enabled decimal support and one disabled the decimal support. On the build that disabled decimal support, I verified that the _Float128 <-> Decimal conversions were not built. Can I check this patch into the master branch for GCC 11? libgcc/ 2021-03-01 Michael Meissner * config.host (powerpc*-*-linux*): Add t-float128-dec if Decimal arithmetic is supported. * config/rs6000/t-float128: Add conditions to suppress building the Decimal <-> Float128 conversions if --disable-decimal-float. * config/rs6000/t-float128-dec: New file. * configure.ac (powerpc*-*-linux*): Record whether decimal arithmetic is supported. * configure: Regenerate. --- libgcc/config.host | 6 ++++++ libgcc/config/rs6000/t-float128 | 4 ++++ libgcc/config/rs6000/t-float128-dec | 4 ++++ libgcc/configure | 21 ++++++++++++++++++++- libgcc/configure.ac | 7 +++++++ 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 libgcc/config/rs6000/t-float128-dec diff --git a/libgcc/config.host b/libgcc/config.host index f808b61be70..4ab1952899f 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1217,6 +1217,12 @@ powerpc*-*-linux*) esac if test $libgcc_cv_powerpc_float128 = yes; then + # Enable building the decimal/Float128 conversions if decimal + # arithmetic is supported in the compiler. + if test $libgcc_cv_powerpc_float128_dec = yes; then + tmake_file="${tmake_file} rs6000/t-float128-dec" + fi + tmake_file="${tmake_file} rs6000/t-float128" fi diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128 index 6fb1a3d871b..1d9a0a5e7d7 100644 --- a/libgcc/config/rs6000/t-float128 +++ b/libgcc/config/rs6000/t-float128 @@ -23,6 +23,9 @@ fp128_softfp_shared_obj = $(addsuffix -sw_s$(objext),$(fp128_softfp_funcs)) fp128_softfp_obj = $(fp128_softfp_static_obj) $(fp128_softfp_shared_obj) # Decimal <-> _Float128 conversions +# FP128_DECIMAL_CONVERT is set in t-float128-dec if decimal arithmetic is +# supported. +ifeq ($(FP128_DECIMAL_CONVERT),yes) fp128_dec_funcs = _kf_to_sd _kf_to_dd _kf_to_td \ _sd_to_kf _dd_to_kf _td_to_kf @@ -33,6 +36,7 @@ fp128_decstr_funcs = _strtokf _sprintfkf # Decimal <-> __ibm128 conversions ibm128_dec_funcs = _tf_to_sd _tf_to_dd _tf_to_td \ _sd_to_tf _dd_to_tf _td_to_tf +endif # New functions for software emulation fp128_ppc_funcs = floattikf floatuntikf fixkfti fixunskfti \ diff --git a/libgcc/config/rs6000/t-float128-dec b/libgcc/config/rs6000/t-float128-dec new file mode 100644 index 00000000000..2873006bb36 --- /dev/null +++ b/libgcc/config/rs6000/t-float128-dec @@ -0,0 +1,4 @@ +# Enable building the Float128/Decimal conversion routines. If decimal support +# is not enabled, this makefile fragment is not included. + +FP128_DECIMAL_CONVERT = yes diff --git a/libgcc/configure b/libgcc/configure index 78fc22a5784..23de3a3adfc 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -4913,7 +4913,7 @@ case "$host" in case "$enable_cet" in auto) # Check if target supports multi-byte NOPs - # and if assembler supports CET insn. + # and if compiler and assembler support CET insn. cet_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fcf-protection" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5228,6 +5228,25 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_powerpc_float128" >&5 $as_echo "$libgcc_cv_powerpc_float128" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC __float128 libraries with decimal support" >&5 +$as_echo_n "checking for PowerPC __float128 libraries with decimal support... " >&6; } +if ${libgcc_cv_powerpc_float128_dec+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +_Float128 convert (_Decimal128 a) { return a; } +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libgcc_cv_powerpc_float128_dec=yes +else + libgcc_cv_powerpc_float128_dec=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_powerpc_float128_dec" >&5 +$as_echo "$libgcc_cv_powerpc_float128_dec" >&6; } + CFLAGS="$CFLAGS -mpower9-vector -mfloat128-hardware" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 3.0 to build hardware __float128 libraries" >&5 $as_echo_n "checking for PowerPC ISA 3.0 to build hardware __float128 libraries... " >&6; } diff --git a/libgcc/configure.ac b/libgcc/configure.ac index ed50c0e9b49..389dcad7701 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -435,6 +435,13 @@ powerpc*-*-linux*) [libgcc_cv_powerpc_float128=yes], [libgcc_cv_powerpc_float128=no])]) + AC_CACHE_CHECK([for PowerPC __float128 libraries with decimal support], + [libgcc_cv_powerpc_float128_dec], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([_Float128 convert (_Decimal128 a) { return a; }])], + [libgcc_cv_powerpc_float128_dec=yes], + [libgcc_cv_powerpc_float128_dec=no])]) + CFLAGS="$CFLAGS -mpower9-vector -mfloat128-hardware" AC_CACHE_CHECK([for PowerPC ISA 3.0 to build hardware __float128 libraries], [libgcc_cv_powerpc_float128_hw], -- 2.22.0 -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meissner@linux.ibm.com, phone: +1 (978) 899-4797