From patchwork Thu Mar 11 15:25:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1451311 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=) Received: from sourceware.org (unknown [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 4DxCT857Whz9sR4 for ; Fri, 12 Mar 2021 02:26:03 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 245D13897833; Thu, 11 Mar 2021 15:26:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTP id 7B768388C02A for ; Thu, 11 Mar 2021 15:25:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7B768388C02A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oliva@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 5290011677B; Thu, 11 Mar 2021 10:25:58 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 93EMrybc9Gg3; Thu, 11 Mar 2021 10:25:58 -0500 (EST) Received: from free.home (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id 05AFF116775; Thu, 11 Mar 2021 10:25:57 -0500 (EST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 12BFPhsY146199 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Mar 2021 12:25:47 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: add sqrt options and test for sqrt support in ppc tests Organization: Free thinker, does not speak for AdaCore Date: Thu, 11 Mar 2021 12:25:43 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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: , Cc: David Edelsohn , Segher Boessenkool Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Some powerpc tests that require the fsqrt insn to be enabled explicitly use the -mpowerpc-gpopt option. This fails if the fsqrt opcode is not available on the target machine. Switch to dg-add-options sqrt_insn for compile tests, that adds the option for the feature (pending approval of another patch for the same PR), and to dg-require-effective-target sqrt_insn for execution tests. This patch depends on the recent patch for PR99352, and on the proposed patch for PR99371. This was regstrapped on x86_64-linux-gnu, and tested with a cross to a ppc64-vxworks7r2 that has no -mpowerpc-gpopt disabled by default, and that raises Illegal Instruction exceptions upon encountering a fsqrt. I'm now regstrapping it on ppc64-linux-gnu, just to be sure. Ok to install? for gcc/testsuite/ChangeLog PR testsuite/99371 * gcc.target/powerpc/pr46728-10.c: Drop explicit -mpowerpc-gpopt in favor of dg-require-effective-target sqrt_insn. * gcc.target/powerpc/pr46728-11.c: Likewise. * gcc.target/powerpc/pr46728-13.c: Likewise. * gcc.target/powerpc/pr46728-14.c: Likewise. * gcc.target/powerpc/pr46728-15.c: Likewise. * gcc.target/powerpc/recip-7.c: Likewise. * gcc.target/powerpc/pr46728-1.c: Drop explicit -mpowerpc-gpopt in favor of dg-add-options sqrt_insn. * gcc.target/powerpc/pr46728-2.c: Likewise. * gcc.target/powerpc/pr46728-3.c: Likewise. * gcc.target/powerpc/pr46728-4.c: Likewise. * gcc.target/powerpc/pr46728-5.c: Likewise. * gcc.target/powerpc/pr46728-7.c: Likewise. * gcc.target/powerpc/pr46728-8.c: Likewise. TN: U302-010 --- gcc/testsuite/gcc.target/powerpc/pr46728-1.c | 3 ++- gcc/testsuite/gcc.target/powerpc/pr46728-10.c | 3 ++- gcc/testsuite/gcc.target/powerpc/pr46728-11.c | 3 ++- gcc/testsuite/gcc.target/powerpc/pr46728-13.c | 3 ++- gcc/testsuite/gcc.target/powerpc/pr46728-14.c | 3 ++- gcc/testsuite/gcc.target/powerpc/pr46728-15.c | 3 ++- gcc/testsuite/gcc.target/powerpc/pr46728-2.c | 3 ++- gcc/testsuite/gcc.target/powerpc/pr46728-3.c | 3 ++- gcc/testsuite/gcc.target/powerpc/pr46728-4.c | 3 ++- gcc/testsuite/gcc.target/powerpc/pr46728-5.c | 3 ++- gcc/testsuite/gcc.target/powerpc/pr46728-7.c | 3 ++- gcc/testsuite/gcc.target/powerpc/pr46728-8.c | 3 ++- gcc/testsuite/gcc.target/powerpc/recip-7.c | 3 ++- 13 files changed, 26 insertions(+), 13 deletions(-) diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-1.c b/gcc/testsuite/gcc.target/powerpc/pr46728-1.c index fc2cd7d7c9c56..b561d8b6e42f9 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr46728-1.c +++ b/gcc/testsuite/gcc.target/powerpc/pr46728-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */ +/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */ +/* { dg-add-options sqrt_insn } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-10.c b/gcc/testsuite/gcc.target/powerpc/pr46728-10.c index 3be4728d333a4..cdde53b8de037 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr46728-10.c +++ b/gcc/testsuite/gcc.target/powerpc/pr46728-10.c @@ -1,6 +1,7 @@ /* { dg-do run } */ /* { dg-skip-if "-mpowerpc-gpopt not supported" { powerpc*-*-darwin* } } */ -/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt" } */ +/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm" } */ +/* { dg-require-effective-target sqrt_insn } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-11.c b/gcc/testsuite/gcc.target/powerpc/pr46728-11.c index 43b6728a4b812..62b49b1479345 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr46728-11.c +++ b/gcc/testsuite/gcc.target/powerpc/pr46728-11.c @@ -1,6 +1,7 @@ /* { dg-do run } */ /* { dg-skip-if "-mpowerpc-gpopt not supported" { powerpc*-*-darwin* } } */ -/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt" } */ +/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm" } */ +/* { dg-require-effective-target sqrt_insn } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-13.c b/gcc/testsuite/gcc.target/powerpc/pr46728-13.c index b9fd63973b728..3e55fa86e0b7c 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr46728-13.c +++ b/gcc/testsuite/gcc.target/powerpc/pr46728-13.c @@ -1,6 +1,7 @@ /* { dg-do run } */ /* { dg-skip-if "-mpowerpc-gpopt not supported" { powerpc*-*-darwin* } } */ -/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt" } */ +/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm" } */ +/* { dg-require-effective-target sqrt_insn } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-14.c b/gcc/testsuite/gcc.target/powerpc/pr46728-14.c index 5affff13bdb6c..472b9d5b60120 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr46728-14.c +++ b/gcc/testsuite/gcc.target/powerpc/pr46728-14.c @@ -1,6 +1,7 @@ /* { dg-do run } */ /* { dg-skip-if "-mpowerpc-gpopt not supported" { powerpc*-*-darwin* } } */ -/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt" } */ +/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm" } */ +/* { dg-require-effective-target sqrt_insn } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-15.c b/gcc/testsuite/gcc.target/powerpc/pr46728-15.c index b4c9660626962..7198a29794b4b 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr46728-15.c +++ b/gcc/testsuite/gcc.target/powerpc/pr46728-15.c @@ -1,6 +1,7 @@ /* { dg-do run } */ /* { dg-skip-if "-mpowerpc-gpopt not supported" { powerpc*-*-darwin* } } */ -/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt" } */ +/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm" } */ +/* { dg-require-effective-target sqrt_insn } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-2.c b/gcc/testsuite/gcc.target/powerpc/pr46728-2.c index 77679873b957f..727dea6ff907e 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr46728-2.c +++ b/gcc/testsuite/gcc.target/powerpc/pr46728-2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */ +/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */ +/* { dg-add-options sqrt_insn } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-3.c b/gcc/testsuite/gcc.target/powerpc/pr46728-3.c index db972168cb953..ebd86de11ff67 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr46728-3.c +++ b/gcc/testsuite/gcc.target/powerpc/pr46728-3.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */ +/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */ +/* { dg-add-options sqrt_insn } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-4.c b/gcc/testsuite/gcc.target/powerpc/pr46728-4.c index 249898ac0361b..184afabc72309 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr46728-4.c +++ b/gcc/testsuite/gcc.target/powerpc/pr46728-4.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "No __builtin_cbrt" { powerpc*-*-darwin* } } */ -/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */ +/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */ +/* { dg-add-options sqrt_insn } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-5.c b/gcc/testsuite/gcc.target/powerpc/pr46728-5.c index e15e7c0977e33..938a5f15a9faa 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr46728-5.c +++ b/gcc/testsuite/gcc.target/powerpc/pr46728-5.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "No __builtin_cbrt" { powerpc*-*-darwin* } } */ -/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */ +/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */ +/* { dg-add-options sqrt_insn } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-7.c b/gcc/testsuite/gcc.target/powerpc/pr46728-7.c index 2b7d0940a0f10..f1e49381bd4a0 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr46728-7.c +++ b/gcc/testsuite/gcc.target/powerpc/pr46728-7.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */ +/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */ +/* { dg-add-options sqrt_insn } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/pr46728-8.c b/gcc/testsuite/gcc.target/powerpc/pr46728-8.c index 7d2af12db859f..786dfad378449 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr46728-8.c +++ b/gcc/testsuite/gcc.target/powerpc/pr46728-8.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "No __builtin_cbrt" { powerpc*-*-darwin* } } */ -/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt -fno-ident" } */ +/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -fno-ident" } */ +/* { dg-add-options sqrt_insn } */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/recip-7.c b/gcc/testsuite/gcc.target/powerpc/recip-7.c index 12b1e9cd6f9e6..a488bd6647697 100644 --- a/gcc/testsuite/gcc.target/powerpc/recip-7.c +++ b/gcc/testsuite/gcc.target/powerpc/recip-7.c @@ -1,7 +1,8 @@ /* { dg-do run { target { powerpc*-*-linux* powerpc*-ibm-aix* } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-require-effective-target ppc_recip_hw } */ -/* { dg-options "-O3 -ftree-vectorize -ffast-math -mrecip -mpowerpc-gfxopt -mpowerpc-gpopt -mpopcntb" } */ +/* { dg-require-effective-target sqrt_insn } */ +/* { dg-options "-O3 -ftree-vectorize -ffast-math -mrecip -mpowerpc-gfxopt -mpopcntb" } */ /* Check reciprocal estimate functions for accuracy. */