The following makes use of the sse2, avx2 and avx512f effective
targets to enable additional vect.exp testing. This suffers from
check procs like check_avx2_available not seeing the extra flags,
making hardening the testsuite against variance with the effective
target impossible.
I have filed PR124066 for this testsuite issue.
* lib/target-supports.exp (check_vect_support_and_set_flags):
For x86 add sse2, avx2 and avx512f to the set of EFFECTIVE_TARGETS
to test. Drop DEFAULT_VECTCFLAGS.
---
gcc/testsuite/lib/target-supports.exp | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/gcc/testsuite/lib/target-supports.exp
b/gcc/testsuite/lib/target-supports.exp
index c8791827556..11a24020b1f 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -7631,6 +7631,16 @@ proc check_effective_target_arm_acq_rel { } {
}]
}
+proc add_options_for_sse2 { flags } {
+ return "$flags -msse2"
+}
+proc add_options_for_avx2 { flags } {
+ return "$flags -mavx2"
+}
+proc add_options_for_avx512f { flags } {
+ return "$flags -mavx512f"
+}
+
# Add the options needed for MIPS Paired-Single.
proc add_options_for_mpaired_single { flags } {
@@ -12542,11 +12552,12 @@ proc check_vect_support_and_set_flags { } {
set dg-do-what-default compile
}
} elseif { [check_effective_target_x86] } {
- lappend DEFAULT_VECTCFLAGS "-msse2"
- if { [check_effective_target_sse2_runtime] } {
- set dg-do-what-default run
- } else {
- set dg-do-what-default compile
+ lappend EFFECTIVE_TARGETS sse2
+ if { [check_effective_target_avx2] } {
+ lappend EFFECTIVE_TARGETS avx2
+ }
+ if { [check_effective_target_avx512f] } {
+ lappend EFFECTIVE_TARGETS avx512f
}
} elseif { [istarget mips*-*-*]
&& [check_effective_target_nomips16] } {
--
2.51.0