From patchwork Mon Sep 20 15:19:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 45203 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E7BCC385841F for ; Mon, 20 Sep 2021 15:20:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7BCC385841F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1632151230; bh=M2QNplPQvAhdxI9FAIAG9IAMp0fiuqf3EdDiYzr7BbI=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=BhtuQFRMeIZNJ7EavY7+b1dd2pDtHoiHD40BK7I9TWTSVsd3xi03BytLVswRSH5LM azI460yef/8m2uBy/kYiVuaEZ2ek++Mgb44u87wsokVYpHHU+udHkBm0mbmEr9TLRY iGOOeG6PrJBpCqs83bzrw45bYbqjD3fjC51310ZI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id BBC3F3858D3C for ; Mon, 20 Sep 2021 15:20:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BBC3F3858D3C Received: by mail-pg1-x52f.google.com with SMTP id e7so17689391pgk.2 for ; Mon, 20 Sep 2021 08:20:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M2QNplPQvAhdxI9FAIAG9IAMp0fiuqf3EdDiYzr7BbI=; b=PevzrkykfoPWKdp//0pwpe1zP60c2C2zLBaCerYCMTzzhjkU8Q4ocsMa1E345hMKt0 lKH8NTLGg4xoW+O3vX3BJqHQGb0+QBkLaNf05fi9lE1HOoEC0wyi6Y6w68Hr/Jo5klLb FwPHjUpcd84z0rHNmGCwfVDn6KJG1/j7i7/6gNaeJ+YF9GZur6wcVNsT3iIRhrJnCZc0 q8We6W8RHYFBEYcVxFgqKrROqazoQW7yK9zP9R2x7FTjTeWjTFx3u0HTzfRO2ja1ER+W yHYYm0p+0SdB7TKk7LhLKkail1uaIEVlOtHddYh6+C+Lb1l0+g5AaY2nYgVFfwB7eRj2 cLyg== X-Gm-Message-State: AOAM532OVAjg+5+GiU3kPqNJkRuTII7R/AP9vpaBIIIF0/K9QobvS84t GMmTbN2S5dYGr0FIRg6qNjqlmPUQcVCIxXC1uFU= X-Google-Smtp-Source: ABdhPJxiN0VGkrZNfx7szi54o99GfOVxfc5ePLgB6bH+68OZeYqoAZ7Yz2Dh87X8mMu0nWBCgtWus9i56szwKqFYPN8= X-Received: by 2002:a05:6a00:4:b0:43d:32f3:e861 with SMTP id h4-20020a056a00000400b0043d32f3e861mr26245158pfk.60.1632151199595; Mon, 20 Sep 2021 08:19:59 -0700 (PDT) MIME-Version: 1.0 References: <22B37A10-936C-4525-AF10-E0851E2AE94A@oracle.com> <20210917165921.GR304296@tucnak> <7D5441CF-EDBF-47AA-A5D1-453895B73A0F@oracle.com> In-Reply-To: <7D5441CF-EDBF-47AA-A5D1-453895B73A0F@oracle.com> Date: Mon, 20 Sep 2021 08:19:23 -0700 Message-ID: Subject: [PATCH] x86: Clean up gcc.target/i386/auto-init-* tests To: Qing Zhao , Uros Bizjak X-Spam-Status: No, score=-3030.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: Jakub Jelinek , Richard Biener , Nick Alcock via Gcc-patches Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" On Fri, Sep 17, 2021 at 10:32 AM Qing Zhao via Gcc-patches wrote: > > > > > On Sep 17, 2021, at 11:59 AM, Jakub Jelinek wrote: > > > > On Fri, Sep 17, 2021 at 04:55:22PM +0000, Qing Zhao wrote: > >> This is the patch to fix gcc.target/i386/auto-init-* tests. > >> > >> I have tested the change at X86_64-linux with > >> > >> make check-gcc RUNTESTFLAGS='--target_board=unix\{-m64,-m64/-march=skylake-avx512,-m64/-fstack-protector-all,-m64/-fstack-clash-protection,-m32/-mno-sse,-m32/-mtune=bonnell,-m32/-march=bonnell,-m32/-fstack-protector-all/-fstack-clash-protection\} i386.exp=auto-init*’ > >> > >> make check-gcc RUNTESTFLAGS='--target_board=unix\{-m64,-m64/-march=skylake-avx512/-fPIC,-m64/-fstack-protector-all/-fPIC,-m64/-fstack-clash-protection/-fPIC,-m32/-mno-sse/-fPIC,-m32/-mtune=bonnell/-fPIC,-m32/-march=bonnell/-fPIC,-m32/-fstack-protector-all/-fstack-clash-protection/-fPIC\} i386.exp=auto-init*’ > >> > >> Everything works fine. > >> > >> Okay for commit? > > > > LGTM. > > Thank you. > > I will commit the change soon. > > For the aarch64 tests, do you have a suggestion on what the option combination I should test? > Here is the followup patch to clean up these tests: 1. Replace ia32 with { ! lp64 } to enable ILP32 tests for -mx32. 2. Replace lp64 with { ! ia32 } to enable x86-64 ISA tests for -mx32. 3. For auto-init-3.c, add -msse and -mfpmath=387 for ia32. Any comments? From 79831005e6d63e17d077d3c94b6f3c1e097c3da8 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 20 Sep 2021 07:48:05 -0700 Subject: [PATCH] x86: Clean up gcc.target/i386/auto-init-* tests 1. Replace ia32 with { ! lp64 } to enable ILP32 tests for -mx32. 2. Replace lp64 with { ! ia32 } to enable x86-64 ISA tests for -mx32. 3. For auto-init-3.c, add -msse and -mfpmath=387 for ia32. * gcc.target/i386/auto-init-2.c: Replace ia32 with { ! lp64 }. * gcc.target/i386/auto-init-3.c (dg-options): Add -msse. (dg-additional-options): Add -mfpmath=387 for ia32. Replace lp64 with { ! ia32 }. Add a space after ia32. * gcc.target/i386/auto-init-4.c: Replace lp64 with { ! ia32 }. * gcc.target/i386/auto-init-5.c: Likewise. * gcc.target/i386/auto-init-padding-3.c: Likewise. * gcc.target/i386/auto-init-padding-7.c: Likewise. * gcc.target/i386/auto-init-padding-8.c: Likewise. * gcc.target/i386/auto-init-padding-9.c: Likewise. --- gcc/testsuite/gcc.target/i386/auto-init-2.c | 5 ++--- gcc/testsuite/gcc.target/i386/auto-init-3.c | 7 ++++--- gcc/testsuite/gcc.target/i386/auto-init-4.c | 7 +++---- gcc/testsuite/gcc.target/i386/auto-init-5.c | 4 +--- gcc/testsuite/gcc.target/i386/auto-init-padding-3.c | 6 ++---- gcc/testsuite/gcc.target/i386/auto-init-padding-7.c | 4 +--- gcc/testsuite/gcc.target/i386/auto-init-padding-8.c | 2 +- gcc/testsuite/gcc.target/i386/auto-init-padding-9.c | 4 ++-- 8 files changed, 16 insertions(+), 23 deletions(-) diff --git a/gcc/testsuite/gcc.target/i386/auto-init-2.c b/gcc/testsuite/gcc.target/i386/auto-init-2.c index b23f733a403..e22930ae89b 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-2.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-2.c @@ -33,6 +33,5 @@ void foo() /* { dg-final { scan-rtl-dump-times "0xfffffffffffffefe" 1 "expand" } } */ /* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 2 "expand" { target lp64 } } } */ /* { dg-final { scan-rtl-dump-times "0xfefefefefefefefe" 3 "expand" { target lp64 } } } */ -/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 4 "expand" { target ia32 } } } */ -/* { dg-final { scan-rtl-dump-times "0xfefefefefefefefe" 1 "expand" { target ia32 } } } */ - +/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 4 "expand" { target { ! lp64 } } } } */ +/* { dg-final { scan-rtl-dump-times "0xfefefefefefefefe" 1 "expand" { target { ! lp64 } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/auto-init-3.c b/gcc/testsuite/gcc.target/i386/auto-init-3.c index df317616db3..891eab1c40b 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-3.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-3.c @@ -1,6 +1,7 @@ /* Verify zero initialization for floating point type automatic variables. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64 -mtune=generic" } */ +/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64 -mtune=generic -msse" } */ +/* { dg-additional-options "-mfpmath=387" { target ia32 } } */ long double result; @@ -14,5 +15,5 @@ long double foo() return result; } -/* { dg-final { scan-assembler-times "pxor\t\\\%xmm0, \\\%xmm0" 3 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fldz" 3 { target ia32} } } */ +/* { dg-final { scan-assembler-times "pxor\t\\\%xmm0, \\\%xmm0" 3 { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler-times "fldz" 3 { target ia32 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/auto-init-4.c b/gcc/testsuite/gcc.target/i386/auto-init-4.c index 554a2c57eb6..7b46c74a073 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-4.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-4.c @@ -14,9 +14,8 @@ long double foo() return result; } -/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 1 "expand" { target lp64 } } } */ -/* { dg-final { scan-rtl-dump-times "\\\[0xfefefefefefefefe\\\]" 1 "expand" { target lp64 } } } */ -/* { dg-final { scan-rtl-dump-times "0xfffffffffffffffe\\\]\\\) repeated x16" 1 "expand" { target lp64 } } } */ +/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 1 "expand" { target { ! ia32 } } } } */ +/* { dg-final { scan-rtl-dump-times "\\\[0xfefefefefefefefe\\\]" 1 "expand" { target { ! ia32 } } } } */ +/* { dg-final { scan-rtl-dump-times "0xfffffffffffffffe\\\]\\\) repeated x16" 1 "expand" { target { ! ia32 } } } } */ /* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 2 "expand" { target ia32 } } } */ /* { dg-final { scan-rtl-dump-times "\\\[0xfefefefefefefefe\\\]" 2 "expand" { target ia32 } } } */ - diff --git a/gcc/testsuite/gcc.target/i386/auto-init-5.c b/gcc/testsuite/gcc.target/i386/auto-init-5.c index 27d971f8cf1..0e9d74f9852 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-5.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-5.c @@ -15,7 +15,5 @@ _Complex long double foo() return result; } -/* { dg-final { scan-assembler-times "\\.long\t0" 14 { target lp64 } } } */ +/* { dg-final { scan-assembler-times "\\.long\t0" 14 { target { ! ia32 } } } } */ /* { dg-final { scan-assembler-times "\\.long\t0" 12 { target ia32 } } } */ - - diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-3.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-3.c index 220a9f26348..7c20a28508f 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-3.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-3.c @@ -24,9 +24,7 @@ int foo () } /* { dg-final { scan-assembler "movl\t\\\$0," } } */ -/* { dg-final { scan-assembler "movl\t\\\$16," { target lp64 } } } */ -/* { dg-final { scan-assembler "rep stosq" { target lp64 } } } */ +/* { dg-final { scan-assembler "movl\t\\\$16," { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler "rep stosq" { target { ! ia32 } } } } */ /* { dg-final { scan-assembler "movl\t\\\$32," { target ia32 } } } */ /* { dg-final { scan-assembler "rep stosl" { target ia32 } } } */ - - diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-7.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-7.c index c136e1cffc4..c3823de905d 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-7.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-7.c @@ -18,6 +18,4 @@ int foo () } /* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\) repeated x16" 1 "expand" { target ia32 } } } */ -/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\)" 1 "expand" { target lp64 } } } */ - - +/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\)" 1 "expand" { target { ! ia32 } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-8.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-8.c index 45baa3c01a3..4f45755c90d 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-8.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-8.c @@ -18,4 +18,4 @@ int foo () } /* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\) repeated x16" 1 "expand" { target ia32 } } } */ -/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\)" 1 "expand" { target lp64 } } } */ +/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\)" 1 "expand" { target { ! ia32 } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c index eafa3272dab..a87b68b255b 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c @@ -19,7 +19,7 @@ int foo () } /* { dg-final { scan-assembler "movl\t\\\$0," } } */ -/* { dg-final { scan-assembler "movl\t\\\$20," { target lp64} } } */ -/* { dg-final { scan-assembler "rep stosq" { target lp64 } } } */ +/* { dg-final { scan-assembler "movl\t\\\$20," { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler "rep stosq" { target { ! ia32 } } } } */ /* { dg-final { scan-assembler "movl\t\\\$40," { target ia32} } } */ /* { dg-final { scan-assembler "rep stosl" { target ia32 } } } */ -- 2.31.1