@@ -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
@@ -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 \
new file mode 100644
@@ -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
@@ -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; }
@@ -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],