public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Uros Bizjak <uros@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-8991] testsuite: Fix a couple of x86 issues in gcc.dg/vect testsuite
Date: Wed, 14 Feb 2024 20:10:41 +0000 (GMT)	[thread overview]
Message-ID: <20240214201041.812143861002@sourceware.org> (raw)

https://gcc.gnu.org/g:430c772be3382134886db33133ed466c02efc71c

commit r14-8991-g430c772be3382134886db33133ed466c02efc71c
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Wed Feb 14 21:09:35 2024 +0100

    testsuite: Fix a couple of x86 issues in gcc.dg/vect testsuite
    
    A compile-time test can use -march=skylake-avx512 for all x86 targets,
    but a runtime test needs to check avx512f effective target if the
    instructions can be assembled.
    
    The runtime test also needs to check if the target machine supports
    instruction set we have been compiled for.  The testsuite uses check_vect
    infrastructure, but handling of AVX512F+ ISAs was missing there.
    
    Add detection of __AVX512F__ and __AVX512VL__, which is enough to handle
    all currently mentioned target processors in the gcc.dg/vect testsuite.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.dg/vect/pr113576.c (dg-additional-options):
            Use -march=skylake-avx512 for avx512f effective target.
            * gcc.dg/vect/pr98308.c (dg-additional-options):
            Use -march=skylake-avx512 for all x86 targets.
            * gcc.dg/vect/tree-vect.h (check_vect): Handle __AVX512F__
            and __AVX512VL__.

Diff:
---
 gcc/testsuite/gcc.dg/vect/pr113576.c  | 2 +-
 gcc/testsuite/gcc.dg/vect/pr98308.c   | 2 +-
 gcc/testsuite/gcc.dg/vect/tree-vect.h | 6 +++++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/vect/pr113576.c b/gcc/testsuite/gcc.dg/vect/pr113576.c
index decb7abe2f75..b6edde6f8e2c 100644
--- a/gcc/testsuite/gcc.dg/vect/pr113576.c
+++ b/gcc/testsuite/gcc.dg/vect/pr113576.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O3" } */
-/* { dg-additional-options "-march=skylake-avx512" { target { x86_64-*-* i?86-*-* } } } */
+/* { dg-additional-options "-march=skylake-avx512" { target avx512f } } */
 
 #include "tree-vect.h"
 
diff --git a/gcc/testsuite/gcc.dg/vect/pr98308.c b/gcc/testsuite/gcc.dg/vect/pr98308.c
index aeec9771c553..d74431200c74 100644
--- a/gcc/testsuite/gcc.dg/vect/pr98308.c
+++ b/gcc/testsuite/gcc.dg/vect/pr98308.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-O3" } */
-/* { dg-additional-options "-march=skylake-avx512" { target avx512f } } */
+/* { dg-additional-options "-march=skylake-avx512" { target x86_64-*-* i?86-*-* } } */
 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
 
 extern unsigned long long int arr_86[];
diff --git a/gcc/testsuite/gcc.dg/vect/tree-vect.h b/gcc/testsuite/gcc.dg/vect/tree-vect.h
index c4b814412166..1e4b56ee0e15 100644
--- a/gcc/testsuite/gcc.dg/vect/tree-vect.h
+++ b/gcc/testsuite/gcc.dg/vect/tree-vect.h
@@ -38,7 +38,11 @@ check_vect (void)
     /* Determine what instruction set we've been compiled for, and detect
        that we're running with it.  This allows us to at least do a compile
        check for, e.g. SSE4.1 when the machine only supports SSE2.  */
-# if defined(__AVX2__)
+# if defined(__AVX512VL__)
+    want_level = 7, want_b = bit_AVX512VL;
+# elif defined(__AVX512F__)
+    want_level = 7, want_b = bit_AVX512F;
+# elif defined(__AVX2__)
     want_level = 7, want_b = bit_AVX2;
 # elif defined(__AVX__)
     want_level = 1, want_c = bit_AVX;

                 reply	other threads:[~2024-02-14 20:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240214201041.812143861002@sourceware.org \
    --to=uros@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).