From patchwork Wed Jul 26 07:56:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hurugalawadi, Naveen" X-Patchwork-Id: 793743 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-458985-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Y5MIFssI"; dkim-atps=neutral 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 3xHS9V5wNdz9s7M for ; Wed, 26 Jul 2017 17:56:30 +1000 (AEST) 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:mime-version; q=dns; s=default; b=XGFBs2xHU67V1Sg7 1+nJszkudXGi8DcCwVPIKoP3mwQfS2ol7lmpEi4p4T+O4QBYPc5gAPQOeNqCS1eQ 99CM0Rzd2A81nb0gv0BejNYsLJrg9vYsJFbNDcVP2o0Gz2Jo+PGC/N6df+8RcvVX p8GY4hwRUx/vIlTdv9Tap2LQgXk= 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:mime-version; s=default; bh=dVO6VOFm1qN+H2WIXyaOeo p95eI=; b=Y5MIFssIdcW5sLZ/Sdl2AUEjRcgQ5xguU7DXJmKhiWGWdhQydakQ3X GV3mwdkeLyYDjfs4pzSx8V1lRbFexwmBl9hAodxvooUvD9BzRT12geLRUYGhbVSy B2Lne953/flN9Qgq39Jtq4bGAl5328Bcf6pn/0c5LHXMPGO8/k8AM= Received: (qmail 67522 invoked by alias); 26 Jul 2017 07:56:21 -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 67495 invoked by uid 89); 26 Jul 2017 07:56:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_WEB, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: NAM01-BY2-obe.outbound.protection.outlook.com Received: from mail-by2nam01on0051.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) (104.47.34.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Jul 2017 07:56:17 +0000 Received: from CO2PR07MB2693.namprd07.prod.outlook.com (10.166.214.6) by MWHPR07MB3421.namprd07.prod.outlook.com (10.164.206.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1282.10; Wed, 26 Jul 2017 07:56:14 +0000 Received: from CO2PR07MB2693.namprd07.prod.outlook.com ([10.166.214.6]) by CO2PR07MB2693.namprd07.prod.outlook.com ([10.166.214.6]) with mapi id 15.01.1261.025; Wed, 26 Jul 2017 07:56:13 +0000 From: "Hurugalawadi, Naveen" To: James Greenhalgh CC: "gcc-patches@gcc.gnu.org" , "Pinski, Andrew" , Marcus Shawcroft , Richard Earnshaw , "nd@arm.com" Subject: Re: [PATCH][AArch64] Add addr_type attribute Date: Wed, 26 Jul 2017 07:56:13 +0000 Message-ID: References: , <20170614143916.GE8010@arm.com> In-Reply-To: <20170614143916.GE8010@arm.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Naveen.Hurugalawadi@cavium.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MWHPR07MB3421; 7:kKUy+JgKD6Mo4WTtywUPJzs+VU5imCscSdOmvg6BTpFVSXn3Q2UYK9k/NAn6P3hvcxxx+C0cMKxci+B+g52ltceYfKkwnz8/yQFz2rj/0mz1WouFkbvKTDkMueCvTJcA0Tlh41v85QPUQiWnbkSlNRPt4jRCuAsFCITxNysp59fuoH2STtqz1A8GI7b/hxMFfIz4XfD1x/vZRp4o55wffb8Am18AIya7ubVjuNdh/6PqRB9J/6kPhaH0QNyWy0Ks029lEZ5Vd0WP8MKbp/UIMqVKF/zxzbECcVTDzTSHbrs0Xv/6PFVRc+NYW6Tr/G3Kc1g8nG3bZzRohVxuufD+M36iSZ/7yDcmPQt1wJenhe2QyqH8c7ewpWNuUBOprxpn/Twfa50yJqXlU/tyCQYkFrxFhnTRDFpHcolIGeQCKFLh06ldI4wfXhrcCQuWJfImWmyigOaozzJ/y+vFuhcPHtKd2C7FGVkR8WgFnsOqw7+7acQe5xELgOdC56ToEcoJJuimj6vaaP+GNpqaBK+BetYCXJXNgNVvYsC1pw0s0kxd8M96U5/xDGRDspTcoNu7ibqriXT/1AYZy6MDer5uP09peSCLlQGAWzsg4clR+bXQOJjfERbjNqR0eQA9uSP329oRascpxFPjGow5HYdhJxwdFMO61fgIDsDHmY4hV0tDOfbywY+m1PuMMVBN3SnpqWDD45NcHSE10GxVGAJIzwcBy5C5NgBTVysl+dsW9waOh5k3R9RORUunPjjFD6gGrennqHvuxbvMRdhFTiYuYPnRSci5Y/to3K/W6ZTa5WY= x-forefront-antispam-report: SFV:SKI; SCL:-1SFV:NSPM; SFS:(10009020)(6009001)(39850400002)(39400400002)(39410400002)(39840400002)(39450400003)(39860400002)(189002)(199003)(51914003)(99286003)(55016002)(97736004)(53936002)(6246003)(189998001)(9686003)(2900100001)(54906002)(101416001)(229853002)(81166006)(81156014)(66066001)(8936002)(8676002)(77096006)(6436002)(7736002)(86362001)(305945005)(106356001)(105586002)(4326008)(68736007)(25786009)(33656002)(14454004)(72206003)(478600001)(3280700002)(7696004)(2906002)(102836003)(3846002)(3660700001)(50986999)(76176999)(54356999)(6116002)(2950100002)(38730400002)(6916009)(110136004)(74316002)(99936001)(5660300001)(6506006); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3421; H:CO2PR07MB2693.namprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; x-ms-office365-filtering-correlation-id: 6ec66ad7-58da-404f-27cb-08d4d3fbc987 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(49563074)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR07MB3421; x-ms-traffictypediagnostic: MWHPR07MB3421: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123558100)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3421; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3421; x-forefront-prvs: 038002787A received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jul 2017 07:56:13.6162 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3421 Hi James, Thanks for the review and comments on the patch. >> What am I missing - you add a new function which is never called? >> Should this have been in series with a scheduling model change? Sorry. You are right. This patch is one in series for scheduling and addition of attributes to improve the performance. The function is part of the other patch which will be posted after testing. >> Note you need to include the POST ones for AARCH64 but >> it should be similar enough. Modified the patch as per your suggestion as in PowerPC. Please review the patch and let me know your comments on it. Bootstrapped and Regression tested on aarch64-thunder-linux. Thanks, Naveen diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index f876a2b..0fb62fc 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -212,6 +212,30 @@ ;; no predicated insns. (define_attr "predicated" "yes,no" (const_string "no")) +;; Does this instruction use indexed (that is, reg+reg) addressing? +;; This is used for load and store insns. If operand 0 or 1 is a MEM +;; it is automatically set based on that. If a load or store instruction +;; has fewer than two operands it needs to set this attribute manually +;; or the compiler will crash. +(define_attr "index" "no,yes" + (if_then_else (ior (match_operand 0 "index_address_mem") + (match_operand 1 "index_address_mem")) + (const_string "yes") + (const_string "no"))) + +;; Does this instruction use update addressing? +;; This is used for load and store insns. See the comments for "indexed". +(define_attr "update" "no,yes" + (if_then_else (ior (match_operand 0 "update_address_mem") + (match_operand 1 "update_address_mem")) + (const_string "yes") + (const_string "no"))) + +(define_attr "index_shift" "no,yes" + (if_then_else (ior (match_operand 0 "index_shift_address_mem") + (match_operand 1 "index_shift_address_mem")) + (const_string "yes") + (const_string "no"))) ;; ------------------------------------------------------------------- ;; Pipeline descriptions and scheduling ;; ------------------------------------------------------------------- @@ -546,7 +570,19 @@ operands[0] = gen_rtx_MEM (DImode, operands[0]); return pftype[INTVAL(operands[1])][locality]; } - [(set_attr "type" "load1")] + [(set_attr "type" "load1") + (set (attr "update") + (if_then_else (match_operand 0 "update_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index") + (if_then_else (match_operand 0 "index_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index_shift") + (if_then_else (match_operand 0 "index_shift_address_mem") + (const_string "yes") + (const_string "no")))] ) (define_insn "trap" @@ -1192,7 +1228,19 @@ ldp\\t%w0, %w2, %1 ldp\\t%s0, %s2, %1" [(set_attr "type" "load2,neon_load1_2reg") - (set_attr "fp" "*,yes")] + (set_attr "fp" "*,yes") + (set (attr "update") + (if_then_else (match_operand 1 "update_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index") + (if_then_else (match_operand 1 "index_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index_shift") + (if_then_else (match_operand 1 "index_shift_address_mem") + (const_string "yes") + (const_string "no")))] ) (define_insn "load_pairdi" @@ -1208,7 +1256,19 @@ ldp\\t%x0, %x2, %1 ldp\\t%d0, %d2, %1" [(set_attr "type" "load2,neon_load1_2reg") - (set_attr "fp" "*,yes")] + (set_attr "fp" "*,yes") + (set (attr "update") + (if_then_else (match_operand 1 "update_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index") + (if_then_else (match_operand 1 "index_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index_shift") + (if_then_else (match_operand 1 "index_shift_address_mem") + (const_string "yes") + (const_string "no")))] ) @@ -1227,7 +1287,19 @@ stp\\t%w1, %w3, %0 stp\\t%s1, %s3, %0" [(set_attr "type" "store2,neon_store1_2reg") - (set_attr "fp" "*,yes")] + (set_attr "fp" "*,yes") + (set (attr "update") + (if_then_else (match_operand 0 "update_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index") + (if_then_else (match_operand 0 "index_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index_shift") + (if_then_else (match_operand 0 "index_shift_address_mem") + (const_string "yes") + (const_string "no")))] ) (define_insn "store_pairdi" @@ -1243,7 +1315,19 @@ stp\\t%x1, %x3, %0 stp\\t%d1, %d3, %0" [(set_attr "type" "store2,neon_store1_2reg") - (set_attr "fp" "*,yes")] + (set_attr "fp" "*,yes") + (set (attr "update") + (if_then_else (match_operand 0 "update_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index") + (if_then_else (match_operand 0 "index_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index_shift") + (if_then_else (match_operand 0 "index_shift_address_mem") + (const_string "yes") + (const_string "no")))] ) ;; Operands 1 and 3 are tied together by the final condition; so we allow @@ -1261,7 +1345,19 @@ ldp\\t%s0, %s2, %1 ldp\\t%w0, %w2, %1" [(set_attr "type" "neon_load1_2reg,load2") - (set_attr "fp" "yes,*")] + (set_attr "fp" "yes,*") + (set (attr "update") + (if_then_else (match_operand 1 "update_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index") + (if_then_else (match_operand 1 "index_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index_shift") + (if_then_else (match_operand 1 "index_shift_address_mem") + (const_string "yes") + (const_string "no")))] ) (define_insn "load_pairdf" @@ -1277,7 +1373,19 @@ ldp\\t%d0, %d2, %1 ldp\\t%x0, %x2, %1" [(set_attr "type" "neon_load1_2reg,load2") - (set_attr "fp" "yes,*")] + (set_attr "fp" "yes,*") + (set (attr "update") + (if_then_else (match_operand 1 "update_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index") + (if_then_else (match_operand 1 "index_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index_shift") + (if_then_else (match_operand 1 "index_shift_address_mem") + (const_string "yes") + (const_string "no")))] ) ;; Operands 0 and 2 are tied together by the final condition; so we allow @@ -1295,7 +1403,19 @@ stp\\t%s1, %s3, %0 stp\\t%w1, %w3, %0" [(set_attr "type" "neon_store1_2reg,store2") - (set_attr "fp" "yes,*")] + (set_attr "fp" "yes,*") + (set (attr "update") + (if_then_else (match_operand 0 "update_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index") + (if_then_else (match_operand 0 "index_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index_shift") + (if_then_else (match_operand 0 "index_shift_address_mem") + (const_string "yes") + (const_string "no")))] ) (define_insn "store_pairdf" @@ -1311,7 +1431,19 @@ stp\\t%d1, %d3, %0 stp\\t%x1, %x3, %0" [(set_attr "type" "neon_store1_2reg,store2") - (set_attr "fp" "yes,*")] + (set_attr "fp" "yes,*") + (set (attr "update") + (if_then_else (match_operand 0 "update_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index") + (if_then_else (match_operand 0 "index_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index_shift") + (if_then_else (match_operand 0 "index_shift_address_mem") + (const_string "yes") + (const_string "no")))] ) ;; Load pair with post-index writeback. This is primarily used in function @@ -1328,7 +1460,8 @@ (match_operand:P 5 "const_int_operand" "n"))))])] "INTVAL (operands[5]) == GET_MODE_SIZE (mode)" "ldp\\t%2, %3, [%1], %4" - [(set_attr "type" "load2")] + [(set_attr "type" "load2") + (set_attr "update" "yes")] ) (define_insn "loadwb_pair_" @@ -1361,7 +1494,8 @@ (match_operand:GPI 3 "register_operand" "r"))])] "INTVAL (operands[5]) == INTVAL (operands[4]) + GET_MODE_SIZE (mode)" "stp\\t%2, %3, [%0, %4]!" - [(set_attr "type" "store2")] + [(set_attr "type" "store2") + (set_attr "update" "yes")] ) (define_insn "storewb_pair_" @@ -1397,7 +1531,28 @@ "@ sxtw\t%0, %w1 ldrsw\t%0, %1" - [(set_attr "type" "extend,load1")] + [(set_attr "type" "extend,load1") + (set (attr "update") + (cond [(eq_attr "alternative" "1") + (if_then_else (match_operand 1 "update_address_mem") + (const_string "yes") + (const_string "no")) + ] + (const_string "*"))) + (set (attr "index") + (cond [(eq_attr "alternative" "1") + (if_then_else (match_operand 1 "index_address_mem") + (const_string "yes") + (const_string "no")) + ] + (const_string "*"))) + (set (attr "index_shift") + (cond [(eq_attr "alternative" "1") + (if_then_else (match_operand 1 "index_shift_address_mem") + (const_string "yes") + (const_string "no")) + ] + (const_string "*")))] ) (define_insn "*load_pair_extendsidi2_aarch64" @@ -1410,7 +1565,19 @@ XEXP (operands[1], 0), GET_MODE_SIZE (SImode)))" "ldpsw\\t%0, %2, %1" - [(set_attr "type" "load2")] + [(set_attr "type" "load2") + (set (attr "update") + (if_then_else (match_operand 1 "update_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index") + (if_then_else (match_operand 1 "index_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index_shift") + (if_then_else (match_operand 1 "index_shift_address_mem") + (const_string "yes") + (const_string "no")))] ) (define_insn "*zero_extendsidi2_aarch64" @@ -1420,7 +1587,28 @@ "@ uxtw\t%0, %w1 ldr\t%w0, %1" - [(set_attr "type" "extend,load1")] + [(set_attr "type" "extend,load1") + (set (attr "update") + (cond [(eq_attr "alternative" "1") + (if_then_else (match_operand 1 "update_address_mem") + (const_string "yes") + (const_string "no")) + ] + (const_string "*"))) + (set (attr "index") + (cond [(eq_attr "alternative" "1") + (if_then_else (match_operand 1 "index_address_mem") + (const_string "yes") + (const_string "no")) + ] + (const_string "*"))) + (set (attr "index_shift") + (cond [(eq_attr "alternative" "1") + (if_then_else (match_operand 1 "index_shift_address_mem") + (const_string "yes") + (const_string "no")) + ] + (const_string "*")))] ) (define_insn "*load_pair_zero_extendsidi2_aarch64" @@ -1433,7 +1621,19 @@ XEXP (operands[1], 0), GET_MODE_SIZE (SImode)))" "ldp\\t%w0, %w2, %1" - [(set_attr "type" "load2")] + [(set_attr "type" "load2") + (set (attr "update") + (if_then_else (match_operand 1 "update_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index") + (if_then_else (match_operand 1 "index_address_mem") + (const_string "yes") + (const_string "no"))) + (set (attr "index_shift") + (if_then_else (match_operand 1 "index_shift_address_mem") + (const_string "yes") + (const_string "no")))] ) (define_expand "2" @@ -1449,7 +1649,28 @@ "@ sxt\t%0, %w1 ldrs\t%0, %1" - [(set_attr "type" "extend,load1")] + [(set_attr "type" "extend,load1") + (set (attr "update") + (cond [(eq_attr "alternative" "1") + (if_then_else (match_operand 1 "update_address_mem") + (const_string "yes") + (const_string "no")) + ] + (const_string "*"))) + (set (attr "index") + (cond [(eq_attr "alternative" "1") + (if_then_else (match_operand 1 "index_address_mem") + (const_string "yes") + (const_string "no")) + ] + (const_string "*"))) + (set (attr "index_shift") + (cond [(eq_attr "alternative" "1") + (if_then_else (match_operand 1 "index_shift_address_mem") + (const_string "yes") + (const_string "no")) + ] + (const_string "*")))] ) (define_insn "*zero_extend2_aarch64" @@ -1460,7 +1681,28 @@ and\t%0, %1, ldr\t%w0, %1 ldr\t%0, %1" - [(set_attr "type" "logic_imm,load1,load1")] + [(set_attr "type" "logic_imm,load1,load1") + (set (attr "update") + (cond [(eq_attr "alternative" "1,2") + (if_then_else (match_operand 1 "update_address_mem") + (const_string "yes") + (const_string "no")) + ] + (const_string "*"))) + (set (attr "index") + (cond [(eq_attr "alternative" "1,2") + (if_then_else (match_operand 1 "index_address_mem") + (const_string "yes") + (const_string "no")) + ] + (const_string "*"))) + (set (attr "index_shift") + (cond [(eq_attr "alternative" "1,2") + (if_then_else (match_operand 1 "index_shift_address_mem") + (const_string "yes") + (const_string "no")) + ] + (const_string "*")))] ) (define_expand "qihi2" @@ -5239,7 +5481,10 @@ UNSPEC_GOTSMALLPIC))] "" "ldr\\t%0, [%1, #:got_lo12:%a2]" - [(set_attr "type" "load1")] + [(set_attr "type" "load1") + (set_attr "update" "no") + (set_attr "index" "no") + (set_attr "index_shift" "no")] ) (define_insn "ldr_got_small_sidi" @@ -5251,7 +5496,10 @@ UNSPEC_GOTSMALLPIC)))] "TARGET_ILP32" "ldr\\t%w0, [%1, #:got_lo12:%a2]" - [(set_attr "type" "load1")] + [(set_attr "type" "load1") + (set_attr "update" "no") + (set_attr "index" "no") + (set_attr "index_shift" "no")] ) (define_insn "ldr_got_small_28k_" @@ -5283,7 +5531,10 @@ UNSPEC_GOTTINYPIC))] "" "ldr\\t%0, %L1" - [(set_attr "type" "load1")] + [(set_attr "type" "load1") + (set_attr "update" "no") + (set_attr "index" "no") + (set_attr "index_shift" "no")] ) (define_insn "aarch64_load_tp_hard" @@ -5325,7 +5576,10 @@ "" "adrp\\t%0, %A1\;ldr\\t%0, [%0, #%L1]" [(set_attr "type" "load1") - (set_attr "length" "8")] + (set_attr "length" "8") + (set_attr "update" "no") + (set_attr "index" "no") + (set_attr "index_shift" "no")] ) (define_insn "tlsie_small_sidi" @@ -5336,7 +5590,10 @@ "" "adrp\\t%0, %A1\;ldr\\t%w0, [%0, #%L1]" [(set_attr "type" "load1") - (set_attr "length" "8")] + (set_attr "length" "8") + (set_attr "update" "no") + (set_attr "index" "no") + (set_attr "index_shift" "no")] ) (define_insn "tlsie_tiny_" diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md index ad8a43c..df694d8 100644 --- a/gcc/config/aarch64/predicates.md +++ b/gcc/config/aarch64/predicates.md @@ -354,6 +354,44 @@ return aarch64_const_vec_all_same_int_p (op, -1); }) +;; Return 1 if the operand is a MEM with an update-form address. This may +;; also include update-indexed form. +(define_special_predicate "update_address_mem" + (match_test "(MEM_P (op) + && (GET_CODE (XEXP (op, 0)) == POST_INC + || GET_CODE (XEXP (op, 0)) == POST_DEC + || GET_CODE (XEXP (op, 0)) == POST_MODIFY + || GET_CODE (XEXP (op, 0)) == PRE_INC + || GET_CODE (XEXP (op, 0)) == PRE_DEC + || GET_CODE (XEXP (op, 0)) == PRE_MODIFY))")) + +;; Return 1 if the operand is an index-form address. +(define_special_predicate "index_address" + (match_test "(GET_CODE (op) == PLUS + && REG_P (XEXP (op, 0)) + && REG_P (XEXP (op, 1)))")) + +;; Return 1 if the operand is a MEM with an indexed-form address. +(define_special_predicate "index_address_mem" + (match_test "(MEM_P (op) + && (index_address (XEXP (op, 0), mode) + || (GET_CODE (XEXP (op, 0)) == PRE_MODIFY + && index_address (XEXP (XEXP (op, 0), 1), mode))))")) + +;; Return 1 if the operand is an index-form address. +(define_special_predicate "index_shift_address" + (match_test "(GET_CODE (op) == PLUS + && REG_P (XEXP (op, 0)) + && GET_CODE (XEXP (op, 1)) == ASHIFT + && REG_P (XEXP (XEXP (op, 1), 0)))")) + +;; Return 1 if the operand is a MEM with an indexed-form address. +(define_special_predicate "index_shift_address_mem" + (match_test "(MEM_P (op) + && (index_shift_address (XEXP (op, 0), mode) + || (GET_CODE (XEXP (op, 0)) == PRE_MODIFY + && index_shift_address (XEXP (XEXP (op, 0), 1), mode))))")) + ;; Predicates used by the various SIMD shift operations. These ;; fall in to 3 categories. ;; Shifts with a range 0-(bit_size - 1) (aarch64_simd_shift_imm)