https://gcc.gnu.org/g:aa366303d519602bef7b7425d15ce517a31e3291
commit aa366303d519602bef7b7425d15ce517a31e3291 Author: Michael Meissner <meiss...@linux.ibm.com> Date: Mon Jul 15 12:34:03 2024 -0400 Revert changes Diff: --- gcc/ChangeLog.bugs | 22 +--------------------- libgcc/config.host | 16 ++++++---------- libgcc/config/rs6000/t-float128 | 2 +- libgcc/config/rs6000/t-float128-vsx | 3 --- libgcc/configure | 29 +++++------------------------ libgcc/configure.ac | 17 +++++------------ 6 files changed, 18 insertions(+), 71 deletions(-) diff --git a/gcc/ChangeLog.bugs b/gcc/ChangeLog.bugs index f75ce1a0c83a..076ccebfc45e 100644 --- a/gcc/ChangeLog.bugs +++ b/gcc/ChangeLog.bugs @@ -1,24 +1,4 @@ -==================== Branch work171-bugs, patch #311 ==================== - -Use -mcpu=power7 if needed and not -mvsx to build float128 support. - -2024-07-12 Michael Meissner <meiss...@linux.ibm.com> - -libgcc/ - - PR target/115800 - PR target/113652 - * config.host (powerpc*-*-linux*): Do not enable the float128 hardware - and float128 power10 hardware support unless the basic float128 support - is added. Add support for building the float128 support when the default - compiler does not enable VSX. - * config/rs6000/t-float128 (FP128_CFLAGS_SW): Do not use -mvsx, instead - use FP128_CFLAGS_VSX to optionally add -mcpu=power7. - * config/rs6000/t-float128-vsx: New file. - * configure.ac (powerpc*-*-linux*): Determine if the default powerpc cpu - includes VSX support. - * configure: Regenerate. - +==================== Branch work171-bugs, patch #311 was reverted ==================== ==================== Branch work171-bugs, patch #310 was reverted ==================== ==================== Branch work171-bugs, patch #304 was reverted ==================== ==================== Branch work171-bugs, patch #303 was reverted ==================== diff --git a/libgcc/config.host b/libgcc/config.host index 804d12e8fd6a..9fae51d4ce7d 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1291,19 +1291,15 @@ powerpc*-*-linux*) esac if test $libgcc_cv_powerpc_float128 = yes; then - if test $libgcc_cv_powerpc_vsx = no; then - tmake_file="${tmake_file} rs6000/t-float128-vsx" - fi - 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/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128 index 8037a6290a82..b09b5664af0e 100644 --- a/libgcc/config/rs6000/t-float128 +++ b/libgcc/config/rs6000/t-float128 @@ -74,7 +74,7 @@ fp128_includes = $(srcdir)/soft-fp/double.h \ $(srcdir)/soft-fp/soft-fp.h # Build the emulator without ISA 3.0 hardware support. -FP128_CFLAGS_SW = -Wno-type-limits $(FLOAT128_CFLAGS_VSX) -mfloat128 \ +FP128_CFLAGS_SW = -Wno-type-limits -mvsx -mfloat128 \ -mno-float128-hardware -mno-gnu-attribute \ -I$(srcdir)/soft-fp \ -I$(srcdir)/config/rs6000 \ diff --git a/libgcc/config/rs6000/t-float128-vsx b/libgcc/config/rs6000/t-float128-vsx deleted file mode 100644 index c691546242d9..000000000000 --- a/libgcc/config/rs6000/t-float128-vsx +++ /dev/null @@ -1,3 +0,0 @@ -# Add -mcpu=power7 option if the default compiler does not support VSX - -FLOAT128_CFLAGS_VSX = -mabi=altivec -mcpu=power7 diff --git a/libgcc/configure b/libgcc/configure index ad12baf965f4..a69d314374a3 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -5180,32 +5180,13 @@ esac esac case ${host} in -# Test if the default compiler enables VSX. If it does not, we need to build -# the float128 bit support using -mcpu=power7 to enable the VSX instruction set. -# -# Also check if a new glibc is being used so that __builtin_cpu_supports can be -# used. +# 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" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if VSX is enabled by default" >&5 -$as_echo_n "checking if VSX is enabled by default... " >&6; } -if ${libgcc_cv_powerpc_vsx+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -vector double dadd (vector double a, vector double b) { return a + b; } -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - libgcc_cv_powerpc_vsx=yes -else - libgcc_cv_powerpc_vsx=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_vsx" >&5 -$as_echo "$libgcc_cv_powerpc_vsx" >&6; } - CFLAGS="$CFLAGS -mabi=altivec -mcpu=power7 -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 : diff --git a/libgcc/configure.ac b/libgcc/configure.ac index 47487d5be7bd..c2749fe09584 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -403,20 +403,13 @@ esac esac case ${host} in -# Test if the default compiler enables VSX. If it does not, we need to build -# the float128 bit support using -mcpu=power7 to enable the VSX instruction set. -# -# Also check if a new glibc is being used so that __builtin_cpu_supports can be -# used. +# 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" - AC_CACHE_CHECK([if VSX is enabled by default], - [libgcc_cv_powerpc_vsx], - [AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([vector double dadd (vector double a, vector double b) { return a + b; }])], - [libgcc_cv_powerpc_vsx=yes], - [libgcc_cv_powerpc_vsx=no])]) - CFLAGS="$CFLAGS -mabi=altivec -mcpu=power7 -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(