[PATCH V3] Do not build Decimal/Float128 conversions if --disable-decimal-float.

Michael Meissner meissner@linux.ibm.com
Thu Mar 4 21:08:03 GMT 2021


[PATCH 2/2 V3] Do not build Decimal/Float128 conversions if --disable-decimal-float.

This patch disables building the Decimal/_Float128 conversion functions if the
user configured the compiler with the --disable-decimal-float option.

This is a much simpler patch to disable building the Decimal/Float128
conversion functions if decimal floating point was installed.  It follows the
method libgcc uses in Makefile to suppress building the normal Decimal support
functions if decimal floating point is disabled.

I have built bootstrap compilers for power9 little endian systems with the
three different long double formats (IBM 128-bit, IEEE 128-bit, and 64-bit) and
there were no regressions from previous runs.  I have also build bootstrap
compilers on a big endian power8 and there was no regression there either.

I built two cross compilers from X86_64 to PowerPC, one with normal switches
and the other with decimal floating point disabled.  I verified that the
Decimal/Float128 conversions are not enable.

Finally I built a compiler on a little endian system with an older GLIBC.  I
verified that the linker reports that __strtoieee128 and __sprintfieee128 are
not present, and aborts the link.

Can I check this patch into the master branch?

libgcc/
2021-03-04  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/t-float128 (fp128_dec_funcs): Do not set if
	--disable-decimal-float.
	(fp128_dec_objs): Do not set if --disable-decimal-float.
---
 libgcc/config/rs6000/t-float128 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128
index 8b089d4433c..83fbbb68788 100644
--- a/libgcc/config/rs6000/t-float128
+++ b/libgcc/config/rs6000/t-float128
@@ -23,8 +23,10 @@ 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
+ifeq ($(decimal_float),yes)
 fp128_dec_funcs		= _kf_to_sd _kf_to_dd _kf_to_td \
 			  _sd_to_kf _dd_to_kf _td_to_kf
+endif
 
 # Decimal <-> __ibm128 conversions
 ibm128_dec_funcs	= _tf_to_sd _tf_to_dd _tf_to_td \
@@ -81,8 +83,10 @@ $(fp128_obj)		 : $(srcdir)/config/rs6000/quad-float128.h
 # Force the TF mode to/from decimal functions to be compiled with IBM long
 # double.  Add building the KF mode to/from decimal conversions with explict
 # IEEE long double.
+ifeq ($(decimal_float),yes)
 fp128_dec_objs		= $(addsuffix $(objext),$(fp128_dec_funcs)) \
 			  $(addsuffix _s$(objext),$(fp128_dec_funcs))
+endif
 
 ibm128_dec_objs		= $(addsuffix $(objext),$(ibm128_dec_funcs)) \
 			  $(addsuffix _s$(objext),$(ibm128_dec_funcs))
@@ -90,7 +94,9 @@ ibm128_dec_objs		= $(addsuffix $(objext),$(ibm128_dec_funcs)) \
 FP128_CFLAGS_DECIMAL	= -mno-gnu-attribute -Wno-psabi -mabi=ieeelongdouble
 IBM128_CFLAGS_DECIMAL	= -mno-gnu-attribute -Wno-psabi -mabi=ibmlongdouble
 
+ifeq ($(decimal_float),yes)
 $(fp128_dec_objs)	: INTERNAL_CFLAGS += $(FP128_CFLAGS_DECIMAL)
+endif
 $(ibm128_dec_objs)	: INTERNAL_CFLAGS += $(IBM128_CFLAGS_DECIMAL)
 
 $(fp128_softfp_src) : $(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@)) $(fp128_dep)
-- 
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


More information about the Gcc-patches mailing list