https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82847

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |uros at gcc dot gnu.org

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
So a possible fix would be to require vect_perm_short tests to append
appropriate x86 flags for compiling (likewise for vect_perm_byte).

This particular testcase starts passing when SSSE3 is enabled.

The situation on x86 is that not all permutation masks are equal so I don't
expect that one can append random subtarget flags enabling or disabling ISAs
and still have all vectorizer tests pass as expected.

Not sure what the desired way of fixing this is.

Some targets have things like mips_msa which checks whether -mmsa was given
but x86 has targets like sse4 which checks whether we can assemble SSE4
instructions (with explicitely adding -msse4).  That looks somewhat
inconsistent to me.  So we could go for a sse3a_enabled target and condition
vect_perm_short on that.  But it would of course be a lie as already SSE2
can do a subset of short permutes via pshufhw/pshuflw and punpck*,
in fact any short permute should be synthesizable via those.

All testcases now using vect_perm_{short,byte} will fail on x86 if you enable
recent enough ISAs:

FAIL: gcc.dg/vect/pr81196.c scan-tree-dump-times vect "vectorized 1 loops" 2
FAIL: gcc.dg/vect/slp-perm-8.c scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: gcc.dg/vect/slp-perm-8.c scan-tree-dump-times vect "vectorizing stmts
using SLP" 1
FAIL: gcc.dg/vect/slp-perm-9.c scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: gcc.dg/vect/slp-perm-9.c scan-tree-dump-times vect "permutation requires
at least three vectors" 1

that said, I'll happily do testcase / targets-supports.exp adjustments but
I'm unsure of the general direction we want to go with all those
vectorizer related effective targets.

For now I think

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp       (revision 258552)
+++ gcc/testsuite/lib/target-supports.exp       (working copy)
@@ -5788,6 +5788,7 @@ proc check_effective_target_vect_perm_by
                 && ![check_effective_target_vect_variable_length])
             || [istarget powerpc*-*-*]
             || [istarget spu-*-*]
+            || [istarget i?86-*-*] || [istarget x86_64-*-*]
             || ([istarget mips-*.*]
                 && [et-is-effective-target mips_msa])
             || ([istarget s390*-*-*]
@@ -5828,6 +5829,7 @@ proc check_effective_target_vect_perm_sh
                 && ![check_effective_target_vect_variable_length])
             || [istarget powerpc*-*-*]
             || [istarget spu-*-*]
+            || [istarget i?86-*-*] || [istarget x86_64-*-*]
             || ([istarget mips*-*-*]
                  && [et-is-effective-target mips_msa])
             || ([istarget s390*-*-*]

should be done given vect_perm includes x86 already.  Then we need to
adjust the above failing testcases somehow - but how?

Reply via email to