From patchwork Thu Feb 23 16:57:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 731586 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 3vTgQd66NSz9s2P for ; Fri, 24 Feb 2017 03:57:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tESfImzr"; 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=r+v1E/q/NxqmsC4zY/SQW/IDzzqPcD4nyrTMl8z8tYeIhwfVHf578 9rQUY9Oa54CSb+ssWq6og0PF2ap2KQMMMwcP2YK8+Z8v4zVZ1+L8uDRqYCM7xI+h B6dW/eQNsjYVb6Wse6AejgG3c2s0RP2j0bxwOoFT3WMmf/lY7icm78= 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=V4yWgcAAfcTeMI9i3g7nO/Aps9o=; b=tESfImzrcUd6+GbYD3YVtRza7YIv dfOYNIwL/gIuRSyN2oX0nx6/KGkk73H8Wprzm4PWSKD91JqwybaXE0ase4INY6Fn T41AeR8KejEcSCJLBby0VxuotmlzusIBerKa0gE5AxBLaiKzMy/p7x2sdo6TiqnN F6L++DmcIIEQ5ds= Received: (qmail 127213 invoked by alias); 23 Feb 2017 16:57:26 -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 126980 invoked by uid 89); 23 Feb 2017 16:57:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, 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=HContent-Language:en-GB X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Received: from mail-he1eur01on0055.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (104.47.0.55) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Feb 2017 16:57:22 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com (10.175.46.18) by AM5PR0802MB2532.eurprd08.prod.outlook.com (10.175.45.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Thu, 23 Feb 2017 16:57:19 +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.0933.011; Thu, 23 Feb 2017 16:57:19 +0000 From: Wilco Dijkstra To: GCC Patches , Ramana Radhakrishnan , Kyrylo Tkachov CC: nd Subject: Re: [PATCH][ARM] Fix ldrd offsets Date: Thu, 23 Feb 2017 16:57:19 +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: 9aa5c393-c4c8-4faa-216e-08d45c0d078f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:AM5PR0802MB2532; x-microsoft-exchange-diagnostics: 1; AM5PR0802MB2532; 7:OSiF2Kp53hOEPfrcKxRA288vB91VxCyYti4NO3Y+WYfV1bTsB4m7ZCywpELpxynsd8+D5MoX3zJk3/+z5mzYA037mUkSYUenhWVMtlKdXJX+ikyPAjENV+Tlk/pVvZE+7aQgv1th3bLHIjykRxciVKIYmdhmDNui/DrpbbZ556cWago7hk/pqfiC+W78XPTFXxJCn1cwzV+PchwcPMKG/8j/0Wr2giArvw3CM43Zx5b9vbC72phAz3IakxK+JuWDcNehsbmJrU741mRXyoU0fr/h736p+9KIOsY2PMLWupMnW/T/1SP1m/cVB8jEJlQl/9usdr0dpcXnsSGKtorw0g== 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)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123558025)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148); SRVR:AM5PR0802MB2532; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2532; x-forefront-prvs: 02272225C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39410400002)(39850400002)(39840400002)(39860400002)(39450400003)(189002)(199003)(377424004)(54534003)(66066001)(6116002)(3846002)(102836003)(9686003)(76176999)(50986999)(2906002)(53936002)(54356999)(33656002)(6636002)(105586002)(4326007)(106116001)(106356001)(55016002)(99286003)(2900100001)(86362001)(92566002)(3280700002)(6506006)(6436002)(25786008)(3660700001)(77096006)(5660300001)(101416001)(189998001)(122556002)(7696004)(6246003)(38730400002)(450100001)(53546006)(229853002)(2950100002)(93886004)(74316002)(7736002)(8936002)(81166006)(8676002)(305945005)(97736004)(81156014)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2532; 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: 23 Feb 2017 16:57:19.4981 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2532 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;