From patchwork Wed Dec 14 16:40:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 705724 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 3tf2Q94GHLz9t0v for ; Thu, 15 Dec 2016 03:41:05 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="hKEav7AN"; 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=bv0blA3icrAwJaAhV5rzBEL8LTl5RwBKecfSvlNxfXaYGLtRrcGLI UOJxlUthDZvVbxHkL6bkgf0OnR05uPtXu6ZW8an5MqkYejMawYiiVZ2CVbQdpb60 wmbu2ZXIzxxTEK2dJBcKJIvGBmkVA4U8AKNBzrhI9heByAOxxoCuYU= 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=1CREbfbfYGsMHLAizSB6JJ5FXG8=; b=hKEav7ANAGJ+Yv7CTpj2NJtBVZqt ES35DEJQXidNYib6fOlu8j5umEYVCYujFlfnu+SPrHfyWEydLGqqY1R80DMAPXAz ONRYM9kEHsR/aCocY+J+L2N8uvfBAPRm23nJcU2y7BqUF6dfnkirzvf78aSZOrDZ hKrZ+V2qn3h+UtU= Received: (qmail 25371 invoked by alias); 14 Dec 2016 16:40:56 -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 25350 invoked by uid 89); 14 Dec 2016 16:40:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1746, HAccept-Language:en-GB, Sent X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com Received: from mail-ve1eur01on0072.outbound.protection.outlook.com (HELO EUR01-VE1-obe.outbound.protection.outlook.com) (104.47.1.72) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Dec 2016 16:40:45 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com (10.175.46.18) by AM5PR0802MB2530.eurprd08.prod.outlook.com (10.175.45.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Wed, 14 Dec 2016 16:40:42 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com ([10.175.46.18]) by AM5PR0802MB2610.eurprd08.prod.outlook.com ([10.175.46.18]) with mapi id 15.01.0771.014; Wed, 14 Dec 2016 16:40:42 +0000 From: Wilco Dijkstra To: GCC Patches , Ramana Radhakrishnan , Kyrylo Tkachov CC: nd Subject: Re: [PATCH][ARM] Fix ldrd offsets Date: Wed, 14 Dec 2016 16:40:42 +0000 Message-ID: References: , In-Reply-To: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; x-ms-office365-filtering-correlation-id: 332948f7-3dcb-4acf-bbd8-08d4243ff1fa x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:AM5PR0802MB2530; x-microsoft-exchange-diagnostics: 1; AM5PR0802MB2530; 7:Ef/aLPFRB9xLVGc1TCgoao3PdM7wvDtwddJRHUkoxzGBSoTDMwZB1t6WgFsZ4wOyaDU4IofK8yZKV6NPlZJ3vYJYPgnSzl2y94bbsiuvn1R7xixzVpOQ4XArRyD/CZnLuSwp2mrSobDeP2JJnodGNCl/sFAj7EdYfrRP4xDRlwxvxgRFYthteoVhm8s6GFiS1fBhxo2uUBT/fF4CajWbP9ieilfS3eO4RvQv1Rm1Qz2xk7ZTUQJFaHD4ikaP9XB4lUJj1V8MYyTMdZXKurOSZ86l9W9dNZzigFNBAd/KyX6F5UszVnUCUz4uYNZbewEJWbkcIHMmtzCqCkQNsquWkJdvfOkROXnXUJXAAZhNAm3eQqgyX4zV3nj4G/4P7RJBOffPDDrTli1EPsogFvOCadR6saPNlzfY24Ivu/FA8gDXdTdWYyBUIBOH6nf8kASjpLoaeLy4Z6XlFuagRvOfCA== nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:AM5PR0802MB2530; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2530; x-forefront-prvs: 01565FED4C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39860400002)(39450400003)(39840400002)(39850400002)(39410400002)(189002)(199003)(54534003)(377424004)(2906002)(7696004)(8676002)(305945005)(33656002)(3900700001)(74316002)(81166006)(7736002)(3660700001)(8936002)(81156014)(6636002)(3280700002)(97736004)(102836003)(86362001)(189998001)(6436002)(6116002)(5001770100001)(3846002)(2900100001)(92566002)(229853002)(38730400001)(76176999)(76576001)(106356001)(101416001)(5660300001)(450100001)(50986999)(4326007)(66066001)(9686002)(68736007)(54356999)(106116001)(122556002)(105586002)(6506006)(77096006)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2530; H:AM5PR0802MB2610.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Dec 2016 16:40:42.5601 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2530 ping From: Wilco Dijkstra Sent: 03 November 2016 12:20 To: GCC Patches Cc: nd Subject: [PATCH][ARM] Fix ldrd offsets     Fix ldrd offsets of Thumb-2 - for TARGET_LDRD the range is +-1020, without -255..4091.  This reduces the number of addressing instructions when using DI mode operations (such as in PR77308). Bootstrap & regress OK. ChangeLog: 2015-11-03  Wilco Dijkstra      gcc/         * config/arm/arm.c (arm_legitimate_index_p): Add comment.         (thumb2_legitimate_index_p): Use correct range for DI/DF mode. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 3c4c7042d9c2101619722b5822b3d1ca37d637b9..5d12cf9c46c27d60a278d90584bde36ec86bb3fe 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -7486,6 +7486,8 @@ arm_legitimate_index_p (machine_mode mode, rtx index, RTX_CODE outer,          {            HOST_WIDE_INT val = INTVAL (index);   +         /* Assume we emit ldrd or 2x ldr if !TARGET_LDRD. +            If vldr is selected it uses arm_coproc_mem_operand.  */            if (TARGET_LDRD)              return val > -256 && val < 256;            else @@ -7613,11 +7615,13 @@ thumb2_legitimate_index_p (machine_mode mode, rtx index, int strict_p)        if (code == CONST_INT)          {            HOST_WIDE_INT val = INTVAL (index); -         /* ??? Can we assume ldrd for thumb2?  */ -         /* Thumb-2 ldrd only has reg+const addressing modes.  */ -         /* ldrd supports offsets of +-1020. -            However the ldr fallback does not.  */ -         return val > -256 && val < 256 && (val & 3) == 0; +         /* Thumb-2 ldrd only has reg+const addressing modes. +            Assume we emit ldrd or 2x ldr if !TARGET_LDRD. +            If vldr is selected it uses arm_coproc_mem_operand.  */ +         if (TARGET_LDRD) +           return IN_RANGE (val, -1020, 1020) && (val & 3) == 0; +         else +           return IN_RANGE (val, -255, 4095 - 4);          }        else          return 0;