From patchwork Mon Aug 31 06:19:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongtao Liu X-Patchwork-Id: 1354128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=iAjH20Au; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bg0Q202YHz9sTF for ; Mon, 31 Aug 2020 16:18:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6749D3850420; Mon, 31 Aug 2020 06:18:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6749D3850420 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598854709; bh=D59uk+qwBIYL9RNEC7+ImxboWtoP5hzhc2f1kBoU7qI=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=iAjH20AuRJ/MNuQYxZGpmDSG0sFaYAZQdAYKyNDOeBGC9Hm7w0Q+CH1A7HZBWSkNJ V1pQ5xfe4PxgcehWYQt4zjKNbCC2S9jmm3fTay8Ex2q6dz7dWPYSfbchJhLgAa9orz O03eQWwDxibzkYBUJA1Te3oRuIahLo2StR1S9QtI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by sourceware.org (Postfix) with ESMTPS id 6D644385ED4A for ; Mon, 31 Aug 2020 06:18:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6D644385ED4A Received: by mail-vs1-xe35.google.com with SMTP id q67so586794vsd.5 for ; Sun, 30 Aug 2020 23:18:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=D59uk+qwBIYL9RNEC7+ImxboWtoP5hzhc2f1kBoU7qI=; b=hCg97EcBMfpr9jJtwKM+JShsQxg48My/nZtE41AOBtg6lPGFunhTukT9gIOIaJvOim eCvqH5Ipeo+aP0Xe+dIZ3y4VVJWU4lUqtf3zYzpdbHYnRNsEYUemeXR0t1S47dE/PClP zUFyADF3oV+Z4HIMtaZMrSfAD4s7cHBioBEF1kbZYidD8K1R6UAKm/KoexAqol5zhUfm 8JdFIpLDP488bccRK2ks6ClGBgt57ZJyPk0StLBALEwk5d8jfh5n3nBz0Sa6gcvc0CZ9 z4YWSEgrkk/ZC/EBi5D4T9CCtJWpiWnXjLya6xnaCm8XCE7Obeehly+Y4AvVAGFaW8Ko O3mw== X-Gm-Message-State: AOAM533rZZcCZsRKVzvRzxwiDHyjT9sYayZZ7Hafm8+sjZL+auhOpPUl JCSJP1ri8zRx5V1T7RbX16XxdWrWa1P2J6IbxGU25Pwr+v+Kgw== X-Google-Smtp-Source: ABdhPJzJCihY/Bc0d3O5pnXysbBvEkyPOA7fmOnjeF7Ft+xFDx+wGOYG25b7h3PZ64XvLoEHgL+U2V7pfcAbpymbRwY= X-Received: by 2002:a67:1a47:: with SMTP id a68mr39534vsa.84.1598854705797; Sun, 30 Aug 2020 23:18:25 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 31 Aug 2020 14:19:17 +0800 Message-ID: Subject: [PATCH] Adjust testcase To: GCC Patches X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hongtao Liu via Gcc-patches From: Hongtao Liu Reply-To: Hongtao Liu Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi: This patch is to adjust testcases which failed the regression test when gcc is built with -march=skylake-avx512. Also add runtime check for AVX512 tests. gcc/testsuite/ChangeLog: PR target/96246 PR target/96855 PR target/96856 PR target/96857 * g++.target/i386/avx512bw-pr96246-2.C: Add runtime check for AVX512BW. * g++.target/i386/avx512vl-pr96246-2.C: Add runtime check for AVX512BW and AVX512VL * g++.target/i386/avx512f-helper.h: New header. * gcc.target/i386/pr92658-avx512f.c: Add -mprefer-vector-width=512 to avoid impact of different default mtune which gcc is built with. * gcc.target/i386/avx512bw-pr95488-1.c: Ditto. * gcc.target/i386/pr92645-4.c: Add -mno-avx512f to avoid impact of different default march which gcc is built with. From 80effa00835d53962608a3607ef79da243a6dc5a Mon Sep 17 00:00:00 2001 From: liuhongt Date: Mon, 31 Aug 2020 10:54:13 +0800 Subject: [PATCH] Adjust testcase. gcc/testsuite/ChangeLog: PR target/96246 PR target/96855 PR target/96856 PR target/96857 * g++.target/i386/avx512bw-pr96246-2.C: Add runtime check for AVX512BW. * g++.target/i386/avx512vl-pr96246-2.C: Add runtime check for AVX512BW and AVX512VL * g++.target/i386/avx512f-helper.h: New header. * gcc.target/i386/pr92658-avx512f.c: Add -mprefer-vector-width=512 to avoid impact of different default mtune which gcc is built with. * gcc.target/i386/avx512bw-pr95488-1.c: Ditto. * gcc.target/i386/pr92645-4.c: Add -mno-avx512f to avoid impact of different default march which gcc is built with. --- .../g++.target/i386/avx512bw-pr96246-2.C | 9 +++++--- .../g++.target/i386/avx512f-helper.h | 1 + .../g++.target/i386/avx512vl-pr96246-2.C | 21 +++++++++++++------ .../gcc.target/i386/avx512bw-pr95488-1.c | 2 +- gcc/testsuite/gcc.target/i386/pr92645-4.c | 2 +- .../gcc.target/i386/pr92658-avx512f.c | 2 +- 6 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 gcc/testsuite/g++.target/i386/avx512f-helper.h diff --git a/gcc/testsuite/g++.target/i386/avx512bw-pr96246-2.C b/gcc/testsuite/g++.target/i386/avx512bw-pr96246-2.C index b96b7c7c932..30a1b959573 100644 --- a/gcc/testsuite/g++.target/i386/avx512bw-pr96246-2.C +++ b/gcc/testsuite/g++.target/i386/avx512bw-pr96246-2.C @@ -3,6 +3,10 @@ /* { dg-require-effective-target avx512bw } */ /* { dg-options "-O2 -std=c++14 -mavx512bw" } */ +#define AVX512BW + +#include "avx512f-helper.h" + #include "avx512bw-pr96246-1.C" #define RUNTIME_TEST(vtype, num) \ @@ -24,8 +28,8 @@ } \ while (0) -int -main (void) +void +test_512 (void) { RUNTIME_TEST (v64qi, 64); RUNTIME_TEST (v32hi, 32); @@ -33,5 +37,4 @@ main (void) RUNTIME_TEST (v8di, 8); RUNTIME_TEST (v16sf, 16); RUNTIME_TEST (v8df, 8); - return 0; } diff --git a/gcc/testsuite/g++.target/i386/avx512f-helper.h b/gcc/testsuite/g++.target/i386/avx512f-helper.h new file mode 100644 index 00000000000..09b6bcbf77a --- /dev/null +++ b/gcc/testsuite/g++.target/i386/avx512f-helper.h @@ -0,0 +1 @@ +#include "../../gcc.target/i386/avx512f-helper.h" diff --git a/gcc/testsuite/g++.target/i386/avx512vl-pr96246-2.C b/gcc/testsuite/g++.target/i386/avx512vl-pr96246-2.C index 9a16f0d2c9e..db9dce2caef 100644 --- a/gcc/testsuite/g++.target/i386/avx512vl-pr96246-2.C +++ b/gcc/testsuite/g++.target/i386/avx512vl-pr96246-2.C @@ -4,6 +4,11 @@ /* { dg-require-effective-target avx512vl } */ /* { dg-options "-O2 -std=c++14 -mavx512bw -mavx512vl" } */ +#define AVX512VL +#define AVX512BW + +#include "avx512f-helper.h" + #include "avx512vl-pr96246-1.C" #define RUNTIME_TEST(vtype, num) \ @@ -25,17 +30,21 @@ } \ while (0) -int -main (void) +void +test_256 (void) { - RUNTIME_TEST (v16qi, 16); RUNTIME_TEST (v32qi, 32); RUNTIME_TEST (v16hi, 16); - RUNTIME_TEST (v4si, 4); RUNTIME_TEST (v8si, 8); - RUNTIME_TEST (v4sf, 4); RUNTIME_TEST (v8sf, 8); RUNTIME_TEST (v4di, 4); RUNTIME_TEST (v4df, 4); - return 0; +} + +void +test_128 (void) +{ + RUNTIME_TEST (v16qi, 16); + RUNTIME_TEST (v4si, 4); + RUNTIME_TEST (v4sf, 4); } diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c index 594e511868d..e6e0ac2fd82 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c @@ -1,6 +1,6 @@ /* PR target/95488 */ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512bw" } */ +/* { dg-options "-O2 -mavx512bw -mprefer-vector-width=512" } */ /* { dg-final { scan-assembler-times "vpmovzxbw" 4 } } */ /* { dg-final { scan-assembler-times "vpmullw\[^\n\]*zmm" 2 } } */ /* { dg-final { scan-assembler-times "vpmovwb" 2 } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr92645-4.c b/gcc/testsuite/gcc.target/i386/pr92645-4.c index 5d459040846..28a3f9a3527 100644 --- a/gcc/testsuite/gcc.target/i386/pr92645-4.c +++ b/gcc/testsuite/gcc.target/i386/pr92645-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx2 -fdump-tree-optimized -Wno-psabi" } */ +/* { dg-options "-O2 -mavx2 -fdump-tree-optimized -Wno-psabi -mno-avx512f" } */ typedef unsigned int u32v4 __attribute__((vector_size(16))); typedef unsigned short u16v16 __attribute__((vector_size(32))); diff --git a/gcc/testsuite/gcc.target/i386/pr92658-avx512f.c b/gcc/testsuite/gcc.target/i386/pr92658-avx512f.c index 2ba29074a81..e9ee3d24232 100644 --- a/gcc/testsuite/gcc.target/i386/pr92658-avx512f.c +++ b/gcc/testsuite/gcc.target/i386/pr92658-avx512f.c @@ -1,6 +1,6 @@ /* PR target/92658 */ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-vectorize -mavx512f" } */ +/* { dg-options "-O2 -ftree-vectorize -mavx512f -mprefer-vector-width=512" } */ typedef unsigned char v8qi __attribute__((vector_size (8))); typedef unsigned char v16qi __attribute__((vector_size (16))); -- 2.18.1