[gcc(refs/users/aoliva/heads/testme)] testsuite: x86: vect_double should require SSE2

Alexandre Oliva aoliva@gcc.gnu.org
Sat Mar 28 16:25:46 GMT 2026


https://gcc.gnu.org/g:9b37bf525f1cabfb39b9cb757ba09d5281b78fd0

commit 9b37bf525f1cabfb39b9cb757ba09d5281b78fd0
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Sat Mar 28 13:00:23 2026 -0300

    testsuite: x86: vect_double should require SSE2
    
    g++.dg/alias-checks.C requires vect_double outside vect.exp, where
    -msse2 would have got enabled, but that effective_target passes even
    when SSE2 is indeed disabled and we're testing on ancient 32-bit
    hardware that doesn't even support SSE2.  Without SSE2, vectors of
    doubles aren't really available, and so we don't get the expected
    vectorizations and the test fails.
    
    ISTM, from the way vect_double is documented, that testing for
    sse2_runtime would be called for, but that feels excessive: since
    vect.exp enables -msse2 for compile-time vect tests, even when runtime
    support is not present, we should ideally be able to exercise
    compile-time vect_double tests.  But we can't test for (let alone
    cache results) with test- or testset compiler flags, or with compiler
    macros they'd define, or even depending on whether we're running a
    compile- or run-time test.  (The preexisting tests for __tune_atom__
    make me uncomfortable already.)
    
    So I'm sticking to the documented behavior of vect_double, even if
    that will lose us some compile-time vect_double testing on targets
    that can't run SSE2 code.  Most x86 variants in use have SSE2 anyway,
    so it's probably not a significant loss.
    
    I've amended vect_doubleint_cvt and vect_intdouble_cvt while at that,
    though there aren't any failing uses thereof AFAICT.
    
    
    for  gcc/testsuite/ChangeLog
    
            * lib/target-supports.exp
            (check_effective_target_vect_double): Check for sse2_runtime.
            (check_effective_target_vect_doubleint_cvt): Likewise.
            (check_effective_target_vect_intdouble_cvt): Likewise.

Diff:
---
 gcc/testsuite/lib/target-supports.exp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 3653f322dc3b..197161f56643 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -4840,6 +4840,7 @@ proc check_effective_target_vect_intfloat_cvt { } {
 proc check_effective_target_vect_doubleint_cvt { } {
     return [check_cached_effective_target vect_doubleint_cvt {
       expr { ([check_effective_target_x86]
+	      && [check-effective_target_sse2_runtime]
 	      && [check_no_compiler_messages vect_doubleint_cvt assembly {
 		   #ifdef __tune_atom__
 		   # error No double vectorizer support.
@@ -4863,6 +4864,7 @@ proc check_effective_target_vect_doubleint_cvt { } {
 proc check_effective_target_vect_intdouble_cvt { } {
     return [check_cached_effective_target vect_intdouble_cvt {
       expr { ([check_effective_target_x86]
+	      && [check-effective_target_sse2_runtime]
 	      && [check_no_compiler_messages vect_intdouble_cvt assembly {
 		  #ifdef __tune_atom__
 		  # error No double vectorizer support.
@@ -8473,6 +8475,7 @@ proc check_effective_target_vect_float_strict { } {
 proc check_effective_target_vect_double { } {
     return [check_cached_effective_target vect_double {
 	expr { ([check_effective_target_x86]
+		&& [check-effective_target_sse2_runtime]
 		&& [check_no_compiler_messages vect_double assembly {
 		  #ifdef __tune_atom__
 		  # error No double vectorizer support.


More information about the Gcc-cvs mailing list