From: Michael Meissner <meissner@linux.ibm.com>
To: Michael Meissner <meissner@linux.ibm.com>,
gcc-patches@gcc.gnu.org,
Segher Boessenkool <segher@kernel.crashing.org>,
David Edelsohn <dje.gcc@gmail.com>,
Bill Schmidt <wschmidt@linux.ibm.com>,
Peter Bergner <bergner@linux.ibm.com>,
Joseph Myers <joseph@codesourcery.com>
Subject: [PATCH 3/3 V2] Do not build Decimal/Float128 conversions if decimal is disabled.
Date: Mon, 1 Mar 2021 12:19:50 -0500 [thread overview]
Message-ID: <20210301171950.GC9185@ibm-toto.the-meissners.org> (raw)
In-Reply-To: <20210301171432.GA7962@ibm-toto.the-meissners.org>
[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 <meissner@linux.ibm.com>
* 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
prev parent reply other threads:[~2021-03-01 17:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-01 17:14 [PATCH 0/3 V2] Honor --disable-decimal-float in PowerPC libgcc _Float128 Michael Meissner
2021-03-01 17:17 ` [PATCH 1/3 V2] Fix __sprintfkf prototype in libgcc Michael Meissner
2021-03-01 22:37 ` Segher Boessenkool
2021-03-01 17:18 ` [PATCH 2/3 V2] Do not include stdio.h in libgcc's Decimal/Float128 conversions Michael Meissner
2021-03-01 23:15 ` Segher Boessenkool
2021-03-02 21:25 ` Michael Meissner
2021-03-02 21:53 ` Segher Boessenkool
2021-03-03 19:12 ` Michael Meissner
2021-03-03 23:33 ` Joseph Myers
2021-03-04 1:01 ` Michael Meissner
2021-03-09 18:35 ` Segher Boessenkool
2021-03-01 17:19 ` Michael Meissner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210301171950.GC9185@ibm-toto.the-meissners.org \
--to=meissner@linux.ibm.com \
--cc=bergner@linux.ibm.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=segher@kernel.crashing.org \
--cc=wschmidt@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).