From patchwork Thu Feb 2 14:45:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 723061 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 3vDjVW5dbbz9s7B for ; Fri, 3 Feb 2017 01:46:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tc4EzkIl"; 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=P4nbOiFWK0IxnIVV4xZk33N2gLH5k7MJh4vRWOCMXOQcHlp6Pqs3v ePn2WXwOvYEupTQkMCfIY80RLTQvRdyRAHQOlUb/YqWxS4eQ7PCjTowBxJPAY/R9 jPDurPuU1FXy/HIpBcOy00ii5rLZ3zKWor5MChRGCcOw8f7VLc0bto= 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=ohoyq6R3Fd0jBx2nS3lLJWb1TRw=; b=tc4EzkIliGG3BoQ5yOyZueGAmGGs DvPI5/oSb0+/t7l+HR6LHOMwMI+XpdUJiSkJkFbImp9La5xFLkRf1MNkgmcyDz8e 2HFxMfHxk5kum5Ox/2FtVbqHjYgoC8AAOU/tyqgazkKjSOZY7xwYNn53DmTIJ5FS 1+qx8UGIOdvLnzc= Received: (qmail 96972 invoked by alias); 2 Feb 2017 14:45: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 96883 invoked by uid 89); 2 Feb 2017 14:45: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=4095, Assume, intval, INTVAL X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr00050.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (40.107.0.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 Feb 2017 14:45:45 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com (10.175.46.18) by AM5PR0802MB2529.eurprd08.prod.outlook.com (10.175.45.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12; Thu, 2 Feb 2017 14:45: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.0874.020; Thu, 2 Feb 2017 14:45:42 +0000 From: Wilco Dijkstra To: GCC Patches , Ramana Radhakrishnan , Kyrylo Tkachov CC: nd Subject: Re: [PATCH][ARM] Fix ldrd offsets Date: Thu, 2 Feb 2017 14:45: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: c0650a72-7ffc-40dc-920d-08d44b7a29b3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:AM5PR0802MB2529; x-microsoft-exchange-diagnostics: 1; AM5PR0802MB2529; 7:WrCX3S7U49IS4hgOLRO+dHLernGf49rGpBTpKBIMorAf31nPrZFIr37o8NqWwQXf+QboLSCZgAWxXJByf+9UREGXFBB0aVLaFZRvLaoj+Dx9oSCKu552PqA4PeR/HIZkCL8akgNi2Alf1d63lzfv0MBdM94V63gN0AVlq495f39xwD4BDrKmc+dyXvyletZRxdi621/S6ihDIALo2i8pRLIctmM0L4lJ2RneQcWhTmspehxHBM3MiNG6SCDpHPLOmdOp10JchYpJCAOq1OzZbZSqi8kohTFVebEzsWvPITpjbZGeIv9eUNjH88mSKskrMPSiEN1BvKlGYi/LIuAPBLCt6ffQ7RWLnKK8lNKqdIJ5ybdGrxgz7BMs/SeTTl7pVbE4OGx+TU1vXLZCRzrif2XUWd4NlxWrU/eT3o4uAO50qoQhfDE0ReJWi+6JPdsdIyba3PN5hAH1MMbBiWCY+G1XpWSEBFHOIdMfY4Imtzm8fvy/2/TYnTJbZdofWkWLR8b92eekR7MWoB6ABRfTWGzGJIwOjXFSK8kixqX7c3sRXNAsSqIDlQ9kVWEqzNAD 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)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123558025)(20161123562025)(20161123560025)(20161123564025)(6072148); SRVR:AM5PR0802MB2529; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2529; x-forefront-prvs: 02065A9E77 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39450400003)(39850400002)(39840400002)(39410400002)(54534003)(377424004)(199003)(189002)(2900100001)(3660700001)(99286003)(229853002)(53936002)(38730400001)(6636002)(76176999)(105586002)(77096006)(4326007)(5660300001)(54356999)(7696004)(2950100002)(106116001)(106356001)(86362001)(50986999)(33656002)(97736004)(101416001)(92566002)(68736007)(25786008)(122556002)(6506006)(5001770100001)(93886004)(66066001)(3280700002)(6436002)(6116002)(74316002)(450100001)(7736002)(3900700001)(102836003)(81166006)(2906002)(3846002)(9686003)(55016002)(305945005)(189998001)(81156014)(8676002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2529; H:AM5PR0802MB2610.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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: 02 Feb 2017 14:45:42.1167 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2529 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;