From patchwork Tue Jun 27 15:39:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 781273 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 3wxqps1Rc0z9ryT for ; Wed, 28 Jun 2017 01:39:17 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="pa5kyB9P"; 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=ukgNoee2aQH+ju5llU0Uwluw6VXbWYNt8Mgb5MzQ9wOEaeEZglg1T doNFoDhpI+ulTeOEFMKI7IuU4d84MY34UC5KR3HgevfO7uXlSfTnrhPh5RIB1JWy U67CzRzT8k1x4peLXgGPVxsei4v020Zwq4Xwg6gu9qFdvbeFW3d0tg= 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=jd04aJz4m4RHRu0XLRag8sHBDv0=; b=pa5kyB9P1nXiMM4r9MHzowy8mzE5 HjXX0ZzLBOY3aElkhoTl3MD8YEAGhShTpPYoSrz1t7zdrQpbv8y06SXlnOIKirQg GPQSxiHIORRXbfzWFWIUr3txsjwngfQIeNFjNhx+fPHxGHHWmi4eAg3V20f7MNk9 OY7Vuc6bDyseO+c= Received: (qmail 51679 invoked by alias); 27 Jun 2017 15:39:06 -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 51664 invoked by uid 89); 27 Jun 2017 15:39:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR01-DB5-obe.outbound.protection.outlook.com Received: from mail-db5eur01on0040.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (104.47.2.40) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Jun 2017 15:39:04 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com (10.175.46.18) by AM5PR0802MB2387.eurprd08.prod.outlook.com (10.175.43.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15; Tue, 27 Jun 2017 15:39:01 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com ([fe80::a81e:e7d3:8fc6:7bb5]) by AM5PR0802MB2610.eurprd08.prod.outlook.com ([fe80::a81e:e7d3:8fc6:7bb5%18]) with mapi id 15.01.1220.011; Tue, 27 Jun 2017 15:39:01 +0000 From: Wilco Dijkstra To: GCC Patches , Kyrylo Tkachov CC: nd , Richard Earnshaw Subject: Re: [PATCH][ARM] Fix ldrd offsets Date: Tue, 27 Jun 2017 15:39:01 +0000 Message-ID: References: , , In-Reply-To: authentication-results: arm.com; dkim=none (message not signed) header.d=none; arm.com; dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM5PR0802MB2387; 7:D2foe34CrCS8UH2NB+dukns96MufIXq6/Kx7aaThYpZR5PrxrAfWl54DCb7yuQFDpPtD/PjGFS/VpF2wN4CRfRtCIvQ94Lpv1SbDrL/irCuvEqgH73249OAexJhpWvFR6cNnR/bhB9SfMEXDSDzZW+UIx7ueTprtRm/o35pBOwB97xFhI3+7rR4BFuFYzBxYtnH8f6xOCtds6yhK70CjTM+Iqw2mYSNgm8mjJzg6DsKXk7l5581maLhAQMM5GEMDfSyJfyB0faqGu6wEk15fkP39NQmRzt9rnL2iwxi0GRVOqe0idlwl4xq2Ou48Z5jfueZssFvnfgz4YWyX2oIrYmXp28oq8fmrDLO54OrcG2ao4EQu+O/ivfHsolay6yJOeniejaFjdh3rXXHYHJfMuJ4BeZy6XeyaauIglGPT2hxglZzUB2bjj4zdpU2SmIQvtVBx/k9V+JotmU6rKE1TPwrgX1ZPf7MEdn/oh0MYh731oIpI1ER2FsqXYfPZu3pd+5P31TnUMFkLc3/o/kp7G1kbLZzeXEKwbDYtaQOsRrrTH5tnRN3cDbSOrYCDXhhDO47fz51ZBDiIfUVvHl4lW+8tRRuqJBkzXRWTP0gHDYo3u8UEBuk7/WZNpYdPB4Sp557D2veH5sy6C456+9n26idEwAXQu1HH/EUhVJjcI8NwiYSS1YLNdZJN1OL93A4YaU0Mi/knqXIwGCspsQoYZY3Dyv2eXBigfL4Hm5ylbz3N83r1nRf8c69iMt2Oh+/VsivbjwRMdbUXtWUaWrCJJCb12B/ufZRy4DVHrtYdelE= x-ms-office365-filtering-correlation-id: fd43a331-51a8-4806-06a1-08d4bd72a289 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506067)(300135500095); SRVR:AM5PR0802MB2387; x-ms-traffictypediagnostic: AM5PR0802MB2387: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(236129657087228); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123564025)(20161123555025)(20161123560025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0802MB2387; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0802MB2387; x-forefront-prvs: 0351D213B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(6009001)(39840400002)(39450400003)(39860400002)(39850400002)(39410400002)(39400400002)(54534003)(377424004)(8676002)(14454004)(6436002)(76176999)(25786009)(6506006)(6116002)(54356999)(50986999)(7736002)(189998001)(102836003)(4326008)(81156014)(2906002)(74316002)(81166006)(5660300001)(55016002)(2900100001)(6636002)(305945005)(229853002)(72206003)(3660700001)(478600001)(8936002)(2950100002)(6246003)(9686003)(86362001)(3280700002)(53546010)(7696004)(5250100002)(99286003)(54906002)(38730400002)(33656002)(53936002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2387; H:AM5PR0802MB2610.eurprd08.prod.outlook.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jun 2017 15:39:01.4701 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2387 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;