https://gcc.gnu.org/g:1ffb92e1bd8f9ae1c091ba7782916be67861f7e9
commit 1ffb92e1bd8f9ae1c091ba7782916be67861f7e9 Author: Michael Meissner <meiss...@linux.ibm.com> Date: Tue Jun 18 12:15:15 2024 -0400 Revert changes Diff: --- gcc/config/rs6000/rs6000.cc | 13 +------------ libgcc/config.host | 14 ++++++-------- libgcc/configure | 19 ++++++------------- libgcc/configure.ac | 19 ++++++------------- libgfortran/configure | 7 ++----- libgfortran/configure.ac | 3 --- libgfortran/kinds-override.h | 2 +- 7 files changed, 22 insertions(+), 55 deletions(-) diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index ea36e651b446..c5c4191127e4 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -4146,8 +4146,7 @@ rs6000_option_override_internal (bool global_init_p) the keyword as well as the type. */ TARGET_FLOAT128_TYPE = TARGET_FLOAT128_ENABLE_TYPE && TARGET_VSX; - /* IEEE 128-bit floating point requires VSX support. Disable IEEE 128-bit on - legacy 32-bit LE systems. */ + /* IEEE 128-bit floating point requires VSX support. */ if (TARGET_FLOAT128_KEYWORD) { if (!TARGET_VSX) @@ -4155,16 +4154,6 @@ rs6000_option_override_internal (bool global_init_p) if ((rs6000_isa_flags_explicit & OPTION_MASK_FLOAT128_KEYWORD) != 0) error ("%qs requires VSX support", "-mfloat128"); - TARGET_FLOAT128_TYPE = 0; - rs6000_isa_flags &= ~(OPTION_MASK_FLOAT128_KEYWORD - | OPTION_MASK_FLOAT128_HW); - } - else if (!TARGET_POWERPC64 && !BYTES_BIG_ENDIAN) - { - if ((rs6000_isa_flags_explicit & OPTION_MASK_FLOAT128_KEYWORD) != 0) - error ("%qs requires 64-bit support on little endian systems", - "-mfloat128"); - TARGET_FLOAT128_TYPE = 0; rs6000_isa_flags &= ~(OPTION_MASK_FLOAT128_KEYWORD | OPTION_MASK_FLOAT128_HW); diff --git a/libgcc/config.host b/libgcc/config.host index 9e3b21e98fdd..9fae51d4ce7d 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1290,18 +1290,16 @@ powerpc*-*-linux*) ;; esac - # If the compiler is not configured for IEEE 128-bit, do not include the - # power9 and power10 hardware support libraries if test $libgcc_cv_powerpc_float128 = yes; then tmake_file="${tmake_file} rs6000/t-float128" + fi - if test $libgcc_cv_powerpc_float128_hw = yes; then - tmake_file="${tmake_file} rs6000/t-float128-hw" + if test $libgcc_cv_powerpc_float128_hw = yes; then + tmake_file="${tmake_file} rs6000/t-float128-hw" + fi - if test $libgcc_cv_powerpc_3_1_float128_hw = yes; then - tmake_file="${tmake_file} rs6000/t-float128-p10-hw" - fi - fi + if test $libgcc_cv_powerpc_3_1_float128_hw = yes; then + tmake_file="${tmake_file} rs6000/t-float128-p10-hw" fi extra_parts="$extra_parts ecrti.o ecrtn.o ncrti.o ncrtn.o" diff --git a/libgcc/configure b/libgcc/configure index 7ac132b71693..a69d314374a3 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -5180,14 +5180,13 @@ esac esac case ${host} in -# Determine if the system can support VSX, which is needed to support -# __float128. Little endian 32-bit cannot be supported, since those systems do -# not support VSX. All of the little endian 64-bit systems require VSX support -# (power8 and above). With big endian, the default might not include VSX, but -# we can build the libgcc __float128 support with VSX enabled. +# At present, we cannot turn -mfloat128 on via #pragma GCC target, so just +# check if we have VSX (ISA 2.06) support to build the software libraries, and +# whether the assembler can handle xsaddqp for hardware support. Also check if +# a new glibc is being used so that __builtin_cpu_supports can be used. powerpc*-*-linux*) saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mabi=altivec -mfloat128" + CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5 $as_echo_n "checking for PowerPC ISA 2.06 to build __float128 libraries... " >&6; } if ${libgcc_cv_powerpc_float128+:} false; then : @@ -5195,13 +5194,7 @@ if ${libgcc_cv_powerpc_float128+:} false; then : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && !defined(_ARCH_PPC64) - #error "32-bit little endian does not support VSX for __float128" - #endif - #if !defined(__ARCH_PWR8) - #pragma GCC target ("cpu=power8") - #endif - vector double dadd (vector double a, vector double b) { return a + b; } +vector double dadd (vector double a, vector double b) { return a + b; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : libgcc_cv_powerpc_float128=yes diff --git a/libgcc/configure.ac b/libgcc/configure.ac index 2893665208df..c2749fe09584 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -403,24 +403,17 @@ esac esac case ${host} in -# Determine if the system can support VSX, which is needed to support -# __float128. Little endian 32-bit cannot be supported, since those systems do -# not support VSX. All of the little endian 64-bit systems require VSX support -# (power8 and above). With big endian, the default might not include VSX, but -# we can build the libgcc __float128 support with VSX enabled. +# At present, we cannot turn -mfloat128 on via #pragma GCC target, so just +# check if we have VSX (ISA 2.06) support to build the software libraries, and +# whether the assembler can handle xsaddqp for hardware support. Also check if +# a new glibc is being used so that __builtin_cpu_supports can be used. powerpc*-*-linux*) saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mabi=altivec -mfloat128" + CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" AC_CACHE_CHECK([for PowerPC ISA 2.06 to build __float128 libraries], [libgcc_cv_powerpc_float128], [AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && !defined(_ARCH_PPC64) - #error "32-bit little endian does not support VSX for __float128" - #endif - #if !defined(__ARCH_PWR8) - #pragma GCC target ("cpu=power8") - #endif - vector double dadd (vector double a, vector double b) { return a + b; }])], + [AC_LANG_SOURCE([vector double dadd (vector double a, vector double b) { return a + b; }])], [libgcc_cv_powerpc_float128=yes], [libgcc_cv_powerpc_float128=no])]) diff --git a/libgfortran/configure b/libgfortran/configure index 2708e5c7eca4..11a1bc5f0708 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -5981,9 +5981,6 @@ if test "x$GCC" = "xyes"; then #if __SIZEOF_LONG_DOUBLE__ != 16 #error long double is double #endif - #if !defined(__VSX__) - #error VSX is not available - #endif int main () { @@ -12850,7 +12847,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12853 "configure" +#line 12850 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12956,7 +12953,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12959 "configure" +#line 12956 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index cfaeb9717ab8..cca1ea0ea970 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -148,9 +148,6 @@ if test "x$GCC" = "xyes"; then AC_PREPROC_IFELSE( [AC_LANG_PROGRAM([[#if __SIZEOF_LONG_DOUBLE__ != 16 #error long double is double - #endif - #if !defined(__VSX__) - #error VSX is not available #endif]], [[(void) 0;]])], [AM_FCFLAGS="$AM_FCFLAGS -mabi=ibmlongdouble -mno-gnu-attribute"; diff --git a/libgfortran/kinds-override.h b/libgfortran/kinds-override.h index 51f440e53232..f6b4956c5caa 100644 --- a/libgfortran/kinds-override.h +++ b/libgfortran/kinds-override.h @@ -30,7 +30,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #endif /* Keep these conditions on one line so grep can filter it out. */ -#if defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG_DOUBLE__ == 16 && defined(__VSX__) +#if defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG_DOUBLE__ == 16 typedef _Float128 GFC_REAL_17; typedef _Complex _Float128 GFC_COMPLEX_17; #define HAVE_GFC_REAL_17