From patchwork Fri Nov 4 16:17:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Toma Tabacu X-Patchwork-Id: 691299 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t9RnP10GGz9vFt for ; Sat, 5 Nov 2016 03:17:28 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="J6KuqPj6"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:references:in-reply-to :content-type:content-transfer-encoding:mime-version; q=dns; s= default; b=nngQKoqTP4VWwPLeXggnko2Uet5C65Ll9ppJJq++VTewYXa5T7svh 6064HzoYrr9J//CMGWGIbzCS+FrJVPrSi95hXkvvHOlrVNMWidlyoyQIkz7yPyWt E3ldkIIFgLsRCEeDhyB/IZgoJgHgGdj00A1+/IVoxq4g8GqtV5dqD0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:references:in-reply-to :content-type:content-transfer-encoding:mime-version; s=default; bh=ncZJtJS+H6WthOE3HmttrzRWhLU=; b=J6KuqPj65sPIuflAhBqO9lkm8CMN +Uvz4J5pkCFZUC/qb0t+jZGSpaMzLbWJ3Ha1Dg7zwL3MSxn9v+NuAIana5Ag6ReQ wEVhybJwR6x0bgMCzHq2v6R1odFEiHCw1JxPawRaHVpJGI0hsZScRwAbLVGkxBSw pNxUnITHVTBWicM= Received: (qmail 108013 invoked by alias); 4 Nov 2016 16:17:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 107995 invoked by uid 89); 4 Nov 2016 16:17:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=owner@gcc.gnu.org, U*owner, ownergccgnuorg, sk:ownerg X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 04 Nov 2016 16:17:09 +0000 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 522F9392C9AC8; Fri, 4 Nov 2016 16:17:02 +0000 (GMT) Received: from HHMAIL-X.hh.imgtec.org (10.100.10.113) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.294.0; Fri, 4 Nov 2016 16:17:05 +0000 Received: from HHMAIL01.hh.imgtec.org ([fe80::710b:f219:72bc:e0b3]) by HHMAIL-X.hh.imgtec.org ([fe80::3509:b0ce:371:2b%18]) with mapi id 14.03.0294.000; Fri, 4 Nov 2016 16:17:04 +0000 From: Toma Tabacu To: Toma Tabacu , Matthew Fortune , "gcc-patches@gcc.gnu.org" CC: "catherine_moore@mentor.com" Subject: RE: [PATCH, testsuite] MIPS: Downgrade R6 to R5 if tests need branch-likely instructions. Date: Fri, 4 Nov 2016 16:17:04 +0000 Message-ID: References: <6D39441BF12EF246A7ABCE6654B0235380AB630C@HHMAIL01.hh.imgtec.org> In-Reply-To: MIME-Version: 1.0 X-IsSubscribed: yes > From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches- > owner@gcc.gnu.org] On Behalf Of Toma Tabacu > Sent: 04 November 2016 15:25 > To: Matthew Fortune; gcc-patches@gcc.gnu.org > Cc: catherine_moore@mentor.com > Subject: RE: [PATCH,testsuite] MIPS: Downgrade R6 to R5 if tests need branch- > likely instructions. > > > From: Matthew Fortune > > Sent: 03 November 2016 13:07 > > To: Toma Tabacu; gcc-patches@gcc.gnu.org > > Cc: catherine_moore@mentor.com > > Subject: RE: [PATCH,testsuite] MIPS: Downgrade R6 to R5 if tests need > > branch-likely instructions. > > > > Toma Tabacu writes: > > > The gcc.target/mips/wrap-delay.c test was failing on mips-img-* > > > toolchains because it was using -mbranch-likely with an R6 target, and > > > branch- likely instructions were removed in R6. > > > > > > This patch makes the testsuite downgrade to R5 if the -mbranch-likely > > > option is present and we're targeting R6. > > > > > > Tested with mips-img-elf and mips-img-linux-gnu. > > > > Hi Toma, > > > > Welcome to GCC development, thanks for your first patch. As you can see > > from Catherine's reply the change looks good. I'll just cover some > > housekeeping issues... > > > > > gcc/testsuite/ > > > * gcc.target/mips/mips.exp: Add check for -mbranch-likely in > > > condition for R5 downgrade. > > > > Changelogs are an art form which will take some getting used to. This is > > almost there but needs to reference the function affected. > > > > * gcc.target/mips/mips.exp (mips-dg-options): Downgrade to R5 > > for -mbranch-likely and infer -mno-branch-likely for R6. > > > > I have extended the comment as well as there is an additional change > > needed for this patch ideally. > > > > > diff --git a/gcc/testsuite/gcc.target/mips/mips.exp > > > b/gcc/testsuite/gcc.target/mips/mips.exp > > > index 7c24140..382d69c 100644 > > > --- a/gcc/testsuite/gcc.target/mips/mips.exp > > > +++ b/gcc/testsuite/gcc.target/mips/mips.exp > > > @@ -1176,7 +1176,8 @@ proc mips-dg-options { args } { > > > || [mips_have_test_option_p options "-mpaired- > > > single"] > > > || [mips_have_test_option_p options "- > > > mnan=legacy"] > > > || [mips_have_test_option_p options "- > > > mabs=legacy"] > > > - || [mips_have_test_option_p options "!HAS_LSA"]) > > > } { > > > + || [mips_have_test_option_p options "!HAS_LSA"] > > > + || [mips_have_test_option_p options "-mbranch- > > > likely"]) } { > > > if { $gp_size == 32 } { > > > mips_make_test_option options "-mips32r5" > > > } else { > > > > Please can you make sure to retain the original patch formatting when > > posting. I suspect you have copied this out of a putty session or similar and > > have therefore lost the tabs. > > > > The extra change is that in the post-arch option processing we will need to > > infer -mno-branch-likely for the $isa_rev > 5 case much like we infer - > > mnan=2008 and -mabs=2008. This is so that when running the testsuite using > > -mips32r5 or earlier, with -mbranch-likely as part of the user-supplied test > > flags, then a test which is upgraded to > > mips32r6 does not attempt to use -mbranch-likely. > > > > Hope that wasn't too cryptic! > > > > Thanks, > > Matthew > > The updated patch below includes the improved ChangeLog comment, correct > formatting, and the post-arch enforcing of -mno-branch-likely for R6. > > Regards, > Toma > > gcc/testsuite/ChangeLog: > > * gcc.target/mips/mips.exp (mips-dg-options): Downgrade to R5 > for -mbranch-likely and infer -mno-branch-likely for R6. > > diff --git a/gcc/testsuite/gcc.target/mips/mips.exp > b/gcc/testsuite/gcc.target/mips/mips.exp > index 7c24140..6b7c46f 100644 > --- a/gcc/testsuite/gcc.target/mips/mips.exp > +++ b/gcc/testsuite/gcc.target/mips/mips.exp > @@ -1176,7 +1176,8 @@ proc mips-dg-options { args } { > || [mips_have_test_option_p options "-mpaired-single"] > || [mips_have_test_option_p options "-mnan=legacy"] > || [mips_have_test_option_p options "-mabs=legacy"] > - || [mips_have_test_option_p options "!HAS_LSA"]) } { > + || [mips_have_test_option_p options "!HAS_LSA"]) > + || [mips_have_test_option_p options "-mbranch-likely"]) } { > if { $gp_size == 32 } { > mips_make_test_option options "-mips32r5" > } else { > @@ -1345,6 +1346,7 @@ proc mips-dg-options { args } { > mips_make_test_option options "-mno-paired-single" > mips_make_test_option options "-mnan=2008" > mips_make_test_option options "-mabs=2008" > + mips_make_test_option options "-mno-branch-likely" > } > if { [regexp {^-march=(octeon|loongson)} $arch] } { > mips_make_test_option options "-mno-micromips" An extra closing parenthesis sneaked in the previous version. Removed in the patch below. Sorry about that. Regards, Toma gcc/testsuite/ChangeLog: * gcc.target/mips/mips.exp (mips-dg-options): Downgrade to R5 for -mbranch-likely and infer -mno-branch-likely for R6. diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp index 7c24140..39f44ff 100644 --- a/gcc/testsuite/gcc.target/mips/mips.exp +++ b/gcc/testsuite/gcc.target/mips/mips.exp @@ -1176,7 +1176,8 @@ proc mips-dg-options { args } { || [mips_have_test_option_p options "-mpaired-single"] || [mips_have_test_option_p options "-mnan=legacy"] || [mips_have_test_option_p options "-mabs=legacy"] - || [mips_have_test_option_p options "!HAS_LSA"]) } { + || [mips_have_test_option_p options "!HAS_LSA"] + || [mips_have_test_option_p options "-mbranch-likely"]) } { if { $gp_size == 32 } { mips_make_test_option options "-mips32r5" } else { @@ -1345,6 +1346,7 @@ proc mips-dg-options { args } { mips_make_test_option options "-mno-paired-single" mips_make_test_option options "-mnan=2008" mips_make_test_option options "-mabs=2008" + mips_make_test_option options "-mno-branch-likely" } if { [regexp {^-march=(octeon|loongson)} $arch] } { mips_make_test_option options "-mno-micromips"