From patchwork Wed Sep 18 14:02:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Earnshaw X-Patchwork-Id: 275741 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D99C32C00CE for ; Thu, 19 Sep 2013 00:02:17 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=vZKvVJO/zcIFLwv+x /G6LfiYGGgnPvx4o4SzRIxs2TG7AkyhUG/VI8lnkbbQXS2IQXOM47GtChbLvouNw +T9rzGHQsKWhkNvFamxB+WOl/v249JwDWm3k3rc9Z4caFJFZi7sodR7WRnAoJudH 9P1F490s/hUxoPcXxQAHn6QBlc= 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 :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=l0zcKgHWiXFceP1fqo96bp6 IIFY=; b=y1nfjCebEC0HcEQcnJodPlwAtbaR7eSsVlY3iQ03qJJURMXLgy2nqnh U3JbDvOvpUYa3Sj1bQgTEPHQdfzYR4fcgs6xi3ntODYTFI1WMTZS+phLuijWbASq +WsVPIZ6ByHoVbYfHBnM10Dk7qHgD1pPQQdEjQVyZqzbKFqjuk5E= Received: (qmail 7723 invoked by alias); 18 Sep 2013 14:02:11 -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 7705 invoked by uid 89); 18 Sep 2013 14:02:11 -0000 Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Sep 2013 14:02:11 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_NO, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 18 Sep 2013 15:02:08 +0100 Received: from [10.1.208.33] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 18 Sep 2013 15:02:08 +0100 Message-ID: <5239B25F.9050608@arm.com> Date: Wed, 18 Sep 2013 15:02:07 +0100 From: Richard Earnshaw User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: gcc-patches Subject: Re: [PATCH, ARM] Validate that target really supports LDRD/STRD before use References: <5239B212.2040907@arm.com> In-Reply-To: <5239B212.2040907@arm.com> X-MC-Unique: 113091815020804301 X-IsSubscribed: yes On 18/09/13 15:00, Richard Earnshaw wrote: > On ARM targets that normally support LDRD/STRD there are tuning > parameters that express the preference for using these instructions over > LDM/STM. However, that's only a preference and when the architecture > and tuning options differ (for example, tuning for Cortex-A15 but using > the ARMv5 ISA) then it is essential to ensure that the architecture also > has the instructions. > > R. > > 2013-09-18 Richard Earnshaw > > * arm.c (arm_get_frame_offsets): Validate architecture supports > LDRD/STRD before accepting the tuning preference. > (arm_expand_prologue): Likewise. > (arm_expand_epilogue): Likewise. > > Committed to trunk. A 4.8 back-port will follow. > > R. > > And this time with the patch... R. --- arm.c (revision 202671) +++ arm.c (local) @@ -17955,7 +17956,8 @@ arm_get_frame_offsets (void) if (! any_sibcall_could_use_r3 () && arm_size_return_regs () <= 12 && (offsets->saved_regs_mask & (1 << 3)) == 0 - && (TARGET_THUMB2 || !current_tune->prefer_ldrd_strd)) + && (TARGET_THUMB2 + || !(TARGET_LDRD && current_tune->prefer_ldrd_strd))) { reg = 3; } @@ -18380,7 +18382,8 @@ arm_expand_prologue (void) } } - if (current_tune->prefer_ldrd_strd + if (TARGET_LDRD + && current_tune->prefer_ldrd_strd && !optimize_function_for_size_p (cfun)) { if (TARGET_THUMB2) @@ -24649,7 +24652,8 @@ arm_expand_epilogue (bool really_return) } else { - if (current_tune->prefer_ldrd_strd + if (TARGET_LDRD + && current_tune->prefer_ldrd_strd && !optimize_function_for_size_p (cfun)) { if (TARGET_THUMB2)