]> git.ipfire.org Git - thirdparty/gcc.git/commit
vect: Pass mode to gather/scatter tests
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 30 Nov 2021 09:52:27 +0000 (09:52 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 30 Nov 2021 09:52:27 +0000 (09:52 +0000)
commit0fb2ab504067ad0d2179622861dd71140b736afe
treecd5e27b00734b699b573147f38b34bafe0a71fa6
parentb1d15146b636120f49fbecdb65302ac8d3b48e8b
vect: Pass mode to gather/scatter tests

vect_check_gather_scatter had a binary “does this target support
internal gather/scatter functions” test.  This dates from the time when
we only handled gathers and scatters via direct target support, with
x86_64 using built-in functions and aarch64 using IFNs.  But now that we
can emulate gathers, we need to check whether the gather for a particular
mode is going to be emulated or not.

Without this, enabling SVE regresses emulated Advanced SIMD gather
sequences in cases where SVE isn't used.

Livermore kernel 15 can now be vectorised with Advanced SIMD when
SVE is enabled.

gcc/
* genopinit.c (main): Turn supports_vec_gather_load and
supports_vec_scatter_store into signed char arrays and remove
supports_vec_gather_load_cached and supports_vec_scatter_store_cached.
* optabs-query.c (supports_vec_convert_optab_p): Add a mode parameter.
If the mode is not VOIDmode, test only for that mode.
(supports_vec_gather_load_p): Likewise.
(supports_vec_scatter_store_p): Likewise.
* optabs-query.h (supports_vec_gather_load_p): Likewise.
(supports_vec_scatter_store_p): Likewise.
* tree-vect-data-refs.c (vect_check_gather_scatter): Pass the
vector mode to supports_vec_gather_load_p and
supports_vec_scatter_store_p.

gcc/testsuite/
* gfortran.dg/vect/vect-8.f90: Bump number of vectorized loops
to 25 for SVE.
* gcc.target/aarch64/sve/gather_load_10.c: New test.
gcc/genopinit.c
gcc/optabs-query.c
gcc/optabs-query.h
gcc/testsuite/gcc.target/aarch64/sve/gather_load_10.c [new file with mode: 0644]
gcc/testsuite/gfortran.dg/vect/vect-8.f90
gcc/tree-vect-data-refs.c