rs6000: Fixes for tests including only <x86intrin.h>
authorPaul A. Clarke <pc@us.ibm.com>
Mon, 25 Oct 2021 20:18:33 +0000 (15:18 -0500)
committerPaul A. Clarke <pc@us.ibm.com>
Tue, 26 Oct 2021 17:02:44 +0000 (12:02 -0500)
commit7d37abedf58d664ccb9c06272303a10021ee36a7
tree760cfdd427e02623de8ae84c63190e19396e5e4e
parent5469d58d6620195c6275d11b474d686f5921c3ba
rs6000: Fixes for tests including only <x86intrin.h>

Tests which only include <x86intrin.h> expect many other include files
to be brought in, but not enough are.

Try to increase compatibility with x86 headers by:
- Create new immintrin.h, including the analogous subset of intrinsics
  headers available for powerpc.
- Create new x86gprintrin.h, serving exclusively as the umbrella for
  bmiintrin.h and bmi2intrin.h.
- Modify x86intrin.h:
  - Include new immintrin.h.
  - Remove mmintrin.h, xmmintrin.h, emmintrin.h, now included indirectly
    from immintrin.h.
  - Remove bmiintrin.h, bmi2intrin.h, now included indirectly from
    x86gprintrin.h (which is now included from immintrin.h).

Add the new files to gcc/config.gcc.

Also, fix up the testcase that provoked PR102719, which requires
Power8 vector support.

Fixes commit 29fb1e831bf1c25e4574bf2f98a9f534e5c67665.

2021-10-25  Paul A. Clarke  <pc@us.ibm.com>

gcc
PR target/102719
* config/rs6000/x86intrin.h: Move some included headers to new
headers.  Include new immintrin.h instead of those headers.
* config/rs6000/immintrin.h: New.
* config/rs6000/x86gprintrin.h: New.
* config.gcc (powerpc*-*-*): Add new headers to extra_headers.

gcc/testsuite
* gcc.target/powerpc/pr78102.c: Fix dg directives to require Power8
vector support.  Also, add -DNO_WARN_X86_INTRINSICS.
gcc/config.gcc
gcc/config/rs6000/immintrin.h [new file with mode: 0644]
gcc/config/rs6000/x86gprintrin.h [new file with mode: 0644]
gcc/config/rs6000/x86intrin.h
gcc/testsuite/gcc.target/powerpc/pr78102.c