Variable-length SVE now supports enough permutes to define vect_perm.
The change to vect_perm_supported is currently a no-op because the
function is only called with a count of 3.
2018-08-24 Richard Sandiford <richard.sandiford@arm.com>
gcc/testsuite/
* lib/target-supports.exp (vect_perm_supported): Only return
false for variable-length vectors if the permute size is not
a power of 2.
(check_effective_target_vect_perm)
(check_effective_target_vect_perm_byte)
(check_effective_target_vect_perm_short): Remove check for
variable-length vectors.
* gcc.dg/vect/slp-23.c: Add an XFAIL for variable-length SVE.
* gcc.dg/vect/slp-perm-10.c: Likewise.
* gcc.dg/vect/slp-perm-9.c: Add an XFAIL for variable-length vectors.
From-SVN: r263834
+2018-08-24 Richard Sandiford <richard.sandiford@arm.com>
+
+ * lib/target-supports.exp (vect_perm_supported): Only return
+ false for variable-length vectors if the permute size is not
+ a power of 2.
+ (check_effective_target_vect_perm)
+ (check_effective_target_vect_perm_byte)
+ (check_effective_target_vect_perm_short): Remove check for
+ variable-length vectors.
+ * gcc.dg/vect/slp-23.c: Add an XFAIL for variable-length SVE.
+ * gcc.dg/vect/slp-perm-10.c: Likewise.
+ * gcc.dg/vect/slp-perm-9.c: Add an XFAIL for variable-length vectors.
+
2018-08-24 Richard Sandiford <richard.sandiford@arm.com>
* gcc.target/aarch64/sve/bswap_1.c: New test.
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_strided8 && { ! { vect_no_align} } } } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided8 || vect_no_align } } } } } */
-/* We fail to vectorize the second loop with variable-length SVE but
- fall back to 128-bit vectors, which does use SLP. */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! vect_perm } } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_perm } } } */
+/* SLP fails for the second loop with variable-length SVE because
+ the load size is greater than the minimum vector size. */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_perm xfail { aarch64_sve && vect_variable_length } } } } */
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */
+/* SLP fails for variable-length SVE because the load size is greater
+ than the minimum vector size. */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm xfail { aarch64_sve && vect_variable_length } } } } */
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" { target { ! { vect_perm_short || vect_load_lanes } } } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm_short || vect_load_lanes } } } } */
-/* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target { vect_perm_short && { ! vect_perm3_short } } } } } */
+/* We don't try permutes with a group size of 3 for variable-length
+ vectors. */
+/* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target { vect_perm_short && { ! vect_perm3_short } } xfail vect_variable_length } } } */
/* { dg-final { scan-tree-dump-not "permutation requires at least three vectors" "vect" { target vect_perm3_short } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { { ! vect_perm3_short } || vect_load_lanes } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm3_short && { ! vect_load_lanes } } } } } */
} else {
set et_vect_perm_saved($et_index) 0
if { [is-effective-target arm_neon]
- || ([istarget aarch64*-*-*]
- && ![check_effective_target_vect_variable_length])
+ || [istarget aarch64*-*-*]
|| [istarget powerpc*-*-*]
|| [istarget spu-*-*]
|| [istarget i?86-*-*] || [istarget x86_64-*-*]
proc vect_perm_supported { count element_bits } {
set vector_bits [lindex [available_vector_sizes] 0]
- if { $vector_bits <= 0 } {
+ # The number of vectors has to be a power of 2 when permuting
+ # variable-length vectors.
+ if { $vector_bits <= 0 && ($count & -$count) != $count } {
return 0
}
set vf [expr { $vector_bits / $element_bits }]
if { ([is-effective-target arm_neon]
&& [is-effective-target arm_little_endian])
|| ([istarget aarch64*-*-*]
- && [is-effective-target aarch64_little_endian]
- && ![check_effective_target_vect_variable_length])
+ && [is-effective-target aarch64_little_endian])
|| [istarget powerpc*-*-*]
|| [istarget spu-*-*]
|| ([istarget mips-*.*]
if { ([is-effective-target arm_neon]
&& [is-effective-target arm_little_endian])
|| ([istarget aarch64*-*-*]
- && [is-effective-target aarch64_little_endian]
- && ![check_effective_target_vect_variable_length])
+ && [is-effective-target aarch64_little_endian])
|| [istarget powerpc*-*-*]
|| [istarget spu-*-*]
|| (([istarget i?86-*-*] || [istarget x86_64-*-*])