Commit f5cd4f8c by Richard Sandiford Committed by Richard Sandiford

Define vect_perm for variable-length SVE

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
parent 8c2f568c
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.
* gcc.target/aarch64/sve/bswap_2.c: Likewise.
* gcc.target/aarch64/sve/bswap_3.c: Likewise.
......
......@@ -107,8 +107,8 @@ int main (void)
/* { 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 } } } } */
......@@ -50,4 +50,6 @@ int main ()
}
/* { 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 } } } } */
......@@ -59,7 +59,9 @@ int main (int argc, const char* argv[])
/* { 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 } } } } } */
......@@ -5758,8 +5758,7 @@ proc check_effective_target_vect_perm { } {
} 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-*-*]
......@@ -5824,7 +5823,9 @@ proc check_effective_target_vect_perm { } {
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 }]
......@@ -5864,8 +5865,7 @@ proc check_effective_target_vect_perm_byte { } {
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-*.*]
......@@ -5904,8 +5904,7 @@ proc check_effective_target_vect_perm_short { } {
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-*-*])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment