re PR target/81193 (PowerPC GCC __builtin_cpu_is and __builtin_cpu_supports should...
authorMichael Meissner <meissner@linux.vnet.ibm.com>
Wed, 12 Jul 2017 23:07:50 +0000 (23:07 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Wed, 12 Jul 2017 23:07:50 +0000 (23:07 +0000)
commit3787ee47fc5c67bffa0508e8a9cc70acb8ce4278
tree77cf14d03bfbaab4f105ec33be51a615e6f4b6cc
parent1b68a156d636b8a67e13ac721718c1e1f213f969
re PR target/81193 (PowerPC GCC __builtin_cpu_is and __builtin_cpu_supports should warn about old libraries)

[gcc]
2017-07-12  Michael Meissner  <meissner@linux.vnet.ibm.com>

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  <meissner@linux.vnet.ibm.com>

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  <meissner@linux.vnet.ibm.com>

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
33 files changed:
gcc/ChangeLog
gcc/config/rs6000/rs6000-c.c
gcc/config/rs6000/rs6000.c
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/bmi-andn-1.c
gcc/testsuite/gcc.target/powerpc/bmi-andn-2.c
gcc/testsuite/gcc.target/powerpc/bmi-bextr-1.c
gcc/testsuite/gcc.target/powerpc/bmi-bextr-2.c
gcc/testsuite/gcc.target/powerpc/bmi-bextr-4.c
gcc/testsuite/gcc.target/powerpc/bmi-bextr-5.c
gcc/testsuite/gcc.target/powerpc/bmi-blsi-1.c
gcc/testsuite/gcc.target/powerpc/bmi-blsi-2.c
gcc/testsuite/gcc.target/powerpc/bmi-blsmsk-1.c
gcc/testsuite/gcc.target/powerpc/bmi-blsmsk-2.c
gcc/testsuite/gcc.target/powerpc/bmi-blsr-1.c
gcc/testsuite/gcc.target/powerpc/bmi-blsr-2.c
gcc/testsuite/gcc.target/powerpc/bmi-tzcnt-1.c
gcc/testsuite/gcc.target/powerpc/bmi-tzcnt-2.c
gcc/testsuite/gcc.target/powerpc/bmi2-bzhi32-1.c
gcc/testsuite/gcc.target/powerpc/bmi2-bzhi64-1.c
gcc/testsuite/gcc.target/powerpc/bmi2-mulx32-1.c
gcc/testsuite/gcc.target/powerpc/bmi2-mulx32-2.c
gcc/testsuite/gcc.target/powerpc/bmi2-mulx64-1.c
gcc/testsuite/gcc.target/powerpc/bmi2-mulx64-2.c
gcc/testsuite/gcc.target/powerpc/bmi2-pdep32-1.c
gcc/testsuite/gcc.target/powerpc/bmi2-pdep64-1.c
gcc/testsuite/gcc.target/powerpc/bmi2-pext32-1.c
gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1.c
gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c
libgcc/ChangeLog
libgcc/configure
libgcc/configure.ac