Fix gcc.dg/vect/bb-slp-subgroups-2.c with 256bit vectors
Checks
Commit Message
The following adds vect128, vect256 and vect512 effective targets
and adjusts gcc.dg/vect/bb-slp-subgroups-2.c accordingly.
Tested on x86_64-unknown-linux-gnu, pushed.
* gcc.dg/vect/bb-slp-subgroups-2.c: Properly handle the
vect256 case.
---
gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c | 3 ++-
gcc/testsuite/lib/target-supports.exp | 18 ++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
@@ -39,4 +39,5 @@ main (int argc, char **argv)
}
/* { dg-final { scan-tree-dump-times "Basic block will be vectorized using SLP" 1 "slp2" } } */
-/* { dg-final { scan-tree-dump-times "optimized: basic block" 2 "slp2" } } */
+/* { dg-final { scan-tree-dump-times "optimized: basic block" 2 "slp2" { target { ! vect256 } } } } */
+/* { dg-final { scan-tree-dump-times "optimized: basic block" 1 "slp2" { target { vect256 } } } } */
@@ -8634,6 +8634,24 @@ proc check_effective_target_vect_variable_length { } {
return [expr { [lindex [available_vector_sizes] 0] == 0 }]
}
+# Return 1 if the target supports vectors of 512 bits.
+
+proc check_effective_target_vect512 { } {
+ return [expr { [lsearch -exact [available_vector_sizes] 512] >= 0 }]
+}
+
+# Return 1 if the target supports vectors of 256 bits.
+
+proc check_effective_target_vect256 { } {
+ return [expr { [lsearch -exact [available_vector_sizes] 256] >= 0 }]
+}
+
+# Return 1 if the target supports vectors of 128 bits.
+
+proc check_effective_target_vect128 { } {
+ return [expr { [lsearch -exact [available_vector_sizes] 128] >= 0 }]
+}
+
# Return 1 if the target supports vectors of 64 bits.
proc check_effective_target_vect64 { } {