https://gcc.gnu.org/g:79427fed78d2531db6adc592f63d47ceaf0d5b49
commit 79427fed78d2531db6adc592f63d47ceaf0d5b49 Author: Michael Meissner <meiss...@linux.ibm.com> Date: Fri Jul 12 19:27:38 2024 -0400 Revert changes Diff: --- gcc/testsuite/lib/target-supports.exp | 8 ++++---- libgcc/config.host | 12 ++++++------ libgcc/config/rs6000/t-float128 | 2 +- libgcc/configure | 17 ++++++----------- libgcc/configure.ac | 17 ++++++----------- 5 files changed, 23 insertions(+), 33 deletions(-) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index ba64a1dbae87..b7df6150bcbd 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2979,7 +2979,7 @@ proc check_ppc_float128_sw_available { } { || [istarget *-*-darwin*]} { expr 0 } else { - set options "-mfloat128" + set options "-mfloat128 -mvsx" check_runtime_nocache ppc_float128_sw_available { volatile __float128 x = 1.0q; volatile __float128 y = 2.0q; @@ -3005,7 +3005,7 @@ proc check_ppc_float128_hw_available { } { || [istarget *-*-darwin*]} { expr 0 } else { - set options "-mfloat128 -mcpu=native" + set options "-mfloat128 -mvsx -mfloat128-hardware -mcpu=power9" check_runtime_nocache ppc_float128_hw_available { volatile __float128 x = 1.0q; volatile __float128 y = 2.0q; @@ -3947,7 +3947,7 @@ proc check_effective_target___float128 { } { proc add_options_for___float128 { flags } { if { [istarget powerpc*-*-linux*] } { - return "$flags -mfloat128" + return "$flags -mfloat128 -mvsx" } return "$flags" } @@ -7234,7 +7234,7 @@ proc check_effective_target_powerpc_float128_sw_ok { } { __float128 z = x + y; return (z == 3.0q); } - } "-mfloat128"] + } "-mfloat128 -mvsx"] } else { return 0 } diff --git a/libgcc/config.host b/libgcc/config.host index 261b08859a4d..9fae51d4ce7d 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1292,14 +1292,14 @@ powerpc*-*-linux*) 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/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128 index 2d93080f1174..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 -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/configure b/libgcc/configure index 39193456929a..a69d314374a3 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -5180,18 +5180,13 @@ esac esac case ${host} in -# Check if we can enable float128 support. Some systems (big endian) do not -# enable float128 by default, but they can enable it if -mfloat128 is used. -# However, the compiler must be compiled using at least --with-cpu=power7 to -# enable VSX support. If we build a default big endian system without using -# --with-cpu=power7, do not build the float128 libraries. VSX support is -# needed because float128 values are passed in VSX registers. -# -# 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" - CFLAGS="$CFLAGS -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 : @@ -5199,7 +5194,7 @@ if ${libgcc_cv_powerpc_float128+:} false; then : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -__float128 f128_add (__float128 a, __float128 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 dcc866ae5473..c2749fe09584 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -403,22 +403,17 @@ esac esac case ${host} in -# Check if we can enable float128 support. Some systems (big endian) do not -# enable float128 by default, but they can enable it if -mfloat128 is used. -# However, the compiler must be compiled using at least --with-cpu=power7 to -# enable VSX support. If we build a default big endian system without using -# --with-cpu=power7, do not build the float128 libraries. VSX support is -# needed because float128 values are passed in VSX registers. -# -# 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" - CFLAGS="$CFLAGS -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([__float128 f128_add (__float128 a, __float128 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])])