From 3787ee47fc5c67bffa0508e8a9cc70acb8ce4278 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Wed, 12 Jul 2017 23:07:50 +0000 Subject: re PR target/81193 (PowerPC GCC __builtin_cpu_is and __builtin_cpu_supports should warn about old libraries) [gcc] 2017-07-12 Michael Meissner PR target/81193 * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): If GLIBC provides the hardware capability bits, define the macro __BUILTIN_CPU_SUPPORTS__. * config/rs6000/rs6000.c (cpu_expand_builtin): Generate a warning if GLIBC does not provide the hardware capability bits. Add a gcc_unreachable call if the built-in cpu function is neither __builtin_cpu_is nor __builtin_cpu_supports. (rs6000_get_function_versions_dispatcher): Change the warning that an old GLIBC is used which does not export the capability bits to be an error. * doc/extend.texi (target_clones attribute): Document the restriction that GLIBC 2.23 or newer is needed on the PowerPC. (PowerPC built-in functions): Document that GLIBC 2.23 or newer is needed by __builtin_cpu_is and __builtin_cpu_supports. Document the macros defined by GCC if the newer GLIBC is available. [gcc/testsuite] 2017-07-12 Michael Meissner PR target/81193 * gcc.target/powerpc/bmi-andn-1.c: Add guard against using __builtin_cpu_supports with old GLIBC's. * gcc.target/powerpc/bmi-andn-2.c: Likewise. * gcc.target/powerpc/bmi-bextr-1.c: Likewise. * gcc.target/powerpc/bmi-bextr-2.c: Likewise. * gcc.target/powerpc/bmi-bextr-4.c: Likewise. * gcc.target/powerpc/bmi-bextr-5.c: Likewise. * gcc.target/powerpc/bmi-blsi-1.c: Likewise. * gcc.target/powerpc/bmi-blsi-2.c: Likewise. * gcc.target/powerpc/bmi-blsmsk-1.c: Likewise. * gcc.target/powerpc/bmi-blsmsk-2.c: Likewise. * gcc.target/powerpc/bmi-blsr-1.c: Likewise. * gcc.target/powerpc/bmi-blsr-2.c: Likewise. * gcc.target/powerpc/bmi-tzcnt-1.c: Likewise. * gcc.target/powerpc/bmi-tzcnt-2.c: Likewise. * gcc.target/powerpc/bmi2-bzhi32-1.c: Likewise. * gcc.target/powerpc/bmi2-bzhi64-1.c: Likewise. * gcc.target/powerpc/bmi2-mulx32-1.c: Likewise. * gcc.target/powerpc/bmi2-mulx32-2.c: Likewise. * gcc.target/powerpc/bmi2-mulx64-1.c: Likewise. * gcc.target/powerpc/bmi2-mulx64-2.c: Likewise. * gcc.target/powerpc/bmi2-pdep32-1.c: Likewise. * gcc.target/powerpc/bmi2-pdep64-1.c: Likewise. * gcc.target/powerpc/bmi2-pext32-1.c: Likewise. * gcc.target/powerpc/bmi2-pext64-1.c: Likewise. * gcc.target/powerpc/cpu-builtin-1.c: Likewise. [libgcc] 2017-07-12 Michael Meissner PR target/81193 * configure.ac (PowerPC float128 hardware support): Test whether we can use __builtin_cpu_supports before enabling the ifunc handler. * configure: Regenerate. From-SVN: r250165 --- libgcc/ChangeLog | 8 ++++++++ libgcc/configure | 11 +++++++---- libgcc/configure.ac | 11 +++++++---- 3 files changed, 22 insertions(+), 8 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 1a4de2c..36e0847 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,11 @@ +2017-07-12 Michael Meissner + + PR target/81193 + * configure.ac (PowerPC float128 hardware support): Test whether + we can use __builtin_cpu_supports before enabling the ifunc + handler. + * configure: Regenerate. + 2017-07-10 Vineet Gupta * config.host: Remove uclibc from arc target spec. diff --git a/libgcc/configure b/libgcc/configure index 42dda7f..15d34b2 100644 --- a/libgcc/configure +++ b/libgcc/configure @@ -4975,10 +4975,10 @@ esac esac case ${host} in -# 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. +# 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 -mvsx -mfloat128" @@ -5013,6 +5013,9 @@ else #ifndef AT_PLATFORM #error "AT_PLATFORM is not defined" #endif + #ifndef __BUILTIN_CPU_SUPPORTS__ + #error "__builtin_cpu_supports is not available" + #endif vector unsigned char add (vector unsigned char a, vector unsigned char b) { vector unsigned char ret; diff --git a/libgcc/configure.ac b/libgcc/configure.ac index 6bcaad6..da49971 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -376,10 +376,10 @@ esac esac case ${host} in -# 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. +# 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 -mvsx -mfloat128" @@ -398,6 +398,9 @@ powerpc*-*-linux*) #ifndef AT_PLATFORM #error "AT_PLATFORM is not defined" #endif + #ifndef __BUILTIN_CPU_SUPPORTS__ + #error "__builtin_cpu_supports is not available" + #endif vector unsigned char add (vector unsigned char a, vector unsigned char b) { vector unsigned char ret; -- cgit v1.1