This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: misc configury bits for decimal float runtime
- From: Ben Elliston <bje at au1 dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: dj at redhat dot com
- Date: Wed, 18 Jan 2006 10:14:24 +1100
- Subject: PATCH: misc configury bits for decimal float runtime
This patch, which follows on from one posted a short time ago, adds
the configury bits to built the decimal float runtime routines into
libgcc. This requires t-* Makefile fragment changes to activate it
via D32PBIT, D64PBIT and D128PBIT variables, so this patch will have
no visible effect.
Tested with a bootstrap on i686-pc-linux-gnu.
Okay for the trunk?
Ben
2005-12-18 Ben Elliston <bje@au.ibm.com>
* Makefile.in (D32PBIT_FUNCS): New.
(D64PBIT_FUNCS, D128PBIT_FUNCS): Likewise.
(libgcc.mk): Set D32PBIT, D64PBIT, D128PBIT, D32PBIT_FUNCS,
D64PBIT_FUNCS and D128PBIT_FUNCS.
(LIBGCC_DEPS): Include $(D32PBIT), $(D64PBIT), $(D128PBIT).
* mklibgcc.in Bring in the DFP support code if D32PBIT, D64PBIT or
D128PBIT are set.
(decnumber_dep): Define.
Index: Makefile.in
===================================================================
--- Makefile.in (revision 109843)
+++ Makefile.in (working copy)
@@ -1055,6 +1055,29 @@ TPBIT_FUNCS = _pack_tf _unpack_tf _addsu
_lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \
_tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf
+D32PBIT_FUNCS = _addsub_sd _div_sd _mul_sd _plus_sd _minus_sd \
+ _eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd \
+ _sd_to_si _sd_to_di _sd_to_usi _sd_to_udi \
+ _si_to_sd _di_to_sd _usi_to_sd _udi_to_sd \
+ _sd_to_sf _sd_to_df _sd_to_xf _sf_to_sd _df_to_sd _xf_to_sd \
+ _sd_to_dd _sd_to_td _unord_sd _conv_sd
+
+D64PBIT_FUNCS = _addsub_dd _div_dd _mul_dd _plus_dd _minus_dd \
+ _eq_dd _ne_dd _lt_dd _gt_dd _le_dd _ge_dd \
+ _dd_to_si _dd_to_di _dd_to_usi _dd_to_udi \
+ _si_to_dd _di_to_dd _usi_to_dd _udi_to_dd \
+ _dd_to_sf _dd_to_df _dd_to_xf \
+ _sf_to_dd _df_to_dd _xf_to_dd \
+ _dd_to_sd _dd_to_td _unord_dd _conv_dd
+
+D128PBIT_FUNCS = _addsub_td _div_td _mul_td _plus_td _minus_td \
+ _eq_td _ne_td _lt_td _gt_td _le_td _ge_td \
+ _td_to_si _td_to_di _td_to_usi _td_to_udi \
+ _si_to_td _di_to_td _usi_to_td _udi_to_td \
+ _td_to_sf _td_to_df _td_to_xf \
+ _sf_to_td _df_to_td _xf_to_td \
+ _td_to_sd _td_to_dd _unord_td _conv_td
+
# These might cause a divide overflow trap and so are compiled with
# unwinder info.
LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
@@ -1393,6 +1416,12 @@ libgcc.mk: config.status Makefile mklibg
DPBIT_FUNCS='$(DPBIT_FUNCS)' \
TPBIT='$(TPBIT)' \
TPBIT_FUNCS='$(TPBIT_FUNCS)' \
+ D32PBIT='$(D32PBIT)' \
+ D32PBIT_FUNCS='$(D32PBIT_FUNCS)' \
+ D64PBIT='$(D64PBIT)' \
+ D64PBIT_FUNCS='$(D64PBIT_FUNCS)' \
+ D128PBIT='$(D128PBIT)' \
+ D128PBIT_FUNCS='$(D128PBIT_FUNCS)' \
MULTILIBS=`$(GCC_FOR_TARGET) --print-multi-lib` \
EXTRA_MULTILIB_PARTS='$(EXTRA_MULTILIB_PARTS)' \
SHLIB_LINK='$(SHLIB_LINK)' \
@@ -1415,6 +1444,7 @@ LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES)
libgcc.mk $(srcdir)/libgcc2.c $(srcdir)/libgcov.c $(TCONFIG_H) \
$(MACHMODE_H) longlong.h gbl-ctors.h config.status $(srcdir)/libgcc2.h \
tsystem.h $(FPBIT) $(DPBIT) $(TPBIT) $(LIB2ADD) \
+ $(D32PBIT) $(D64PBIT) $(D128PBIT) \
$(LIB2ADD_ST) $(LIB2ADDEH) $(LIB2ADDEHDEP) $(EXTRA_PARTS) \
$(srcdir)/config/$(LIB1ASMSRC) \
$(srcdir)/gcov-io.h $(srcdir)/gcov-io.c gcov-iov.h
Index: mklibgcc.in
===================================================================
--- mklibgcc.in (revision 109843)
+++ mklibgcc.in (working copy)
@@ -28,6 +28,12 @@
# DPBIT_FUNCS
# TPBIT
# TPBIT_FUNCS
+# D32PBIT
+# D32PBIT_FUNCS
+# D64PBIT
+# D64PBIT_FUNCS
+# D128PBIT
+# D128PBIT_FUNCS
# LIBGCC
# MULTILIBS
# EXTRA_MULTILIB_PARTS
@@ -96,6 +102,12 @@ libgcov_c_dep='stmp-dirs $(srcdir)/libgc
# Dependencies for fp-bit.c
fpbit_c_dep='stmp-dirs config.status tsystem.h'
+# Dependencies for decnumber and friends. This is an overzealous set,
+# but at least we can be sure to recompile if anything gets modified.
+decnumber_dep='stmp-dirs $(srcdir)/../libdecnumber/decContext.h $(srcdir)/../libdecnumber/decNumber.h
+ $(srcdir)/../libdecnumber/decNumberLocal.h $(srcdir)/../libdecnumber/decimal32.h $(srcdir)/../libdecnumber/decimal64.h
+ $(srcdir)/../libdecnumber/decimal128.h $(srcdir)/../libdecnumber/decDPD.h $(srcdir)/../libdecnumber/decUtility.h'
+
# Flag whether we need eh_dummy.c
need_eh_dummy=
@@ -349,6 +361,49 @@ for ml in $MULTILIBS; do
fi
done
+ if [ "@enable_decimal_float@" = "yes" -a -z "$libgcc_so" ]; then
+ # Bring in the DFP support code if D32PBIT, D64PBIT or D128PBIT are set.
+ if [ -n "$D32PBIT" -o -n "$D64PBIT" -o -n "$D128PBIT" ] ; then
+ dec_filenames="decContext decNumber decRound decLibrary decUtility"
+ fi
+
+ # Only bring in decimal*.c files for types we support.
+ if [ -n "$D32PBIT" ] ; then
+ dec_filenames="$dec_filenames decimal32"
+ fi
+ if [ -n "$D64PBIT" ] ; then
+ dec_filenames="$dec_filenames decimal64"
+ fi
+ if [ -n "$D128PBIT" ] ; then
+ dec_filenames="$dec_filenames decimal128"
+ fi
+
+ for name in $dec_filenames ; do
+ out="libgcc/${dir}/${name}${objext}"
+ echo $out: "\$(srcdir)/../libdecnumber/${name}.c" $decnumber_dep
+ echo " $gcc_compile" $flags -c "\$(srcdir)/../libdecnumber/${name}.c" -o $out
+ echo $libgcc_a: $out
+ done
+
+ # For individual functions, loop over each variable by name.
+ for dpbit_var in D32PBIT D64PBIT D128PBIT ; do
+ dpfuncs_var="${dpbit_var}_FUNCS"
+ eval dpbit=\$$dpbit_var
+ eval dpfuncs=\$$dpfuncs_var
+
+ if [ "$dpbit" ]; then
+ for name in $dpfuncs; do
+ out="libgcc/${dir}/${name}${objext}"
+ echo $out: $dpbit $fpbit_c_dep
+ echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
+ -c $dpbit -o $out
+
+ echo $libgcc_a: $out
+ done
+ fi
+ done
+ fi
+
for file in $LIB2ADD; do
name=`echo $file | sed -e 's/[.][cS]$//' -e 's/[.]asm$//'`
oname=`echo $name | sed -e 's,.*/,,'`