From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126885 invoked by alias); 24 Mar 2017 17:51:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 126828 invoked by uid 89); 24 Mar 2017 17:51:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f178.google.com Received: from mail-wr0-f178.google.com (HELO mail-wr0-f178.google.com) (209.85.128.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Mar 2017 17:51:14 +0000 Received: by mail-wr0-f178.google.com with SMTP id u1so6498977wra.2 for ; Fri, 24 Mar 2017 10:51:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=exZKCftodXGssYKK3lsb8sZ3/IffinAkZ1szqS0yYJQ=; b=YPB1LknoynjXuZ/UF0BObBKYDKMjTRnLngHhFkKr+/jHIDHqoW99vQU5aQPcjE9kKj iBorUMkBhBy+B2nsnRqzjE7p4isDWK+yoIJvX/cdqXfHh5tdH/S0jtWDMWHiUKtYQJlh 6ueWu+DSeFfFtdZzazV2O/NW7m1mj25dgdYdmwexilwTJ9G9MQarvzlQAqCIPsAIemNg m0tGyoF9/0WhZ8sqBBPedo7HhAGIbRMM5WYYnDCJFhd3OM69kWl4Y4kNEPsXddF+GBus JqpGHqY6DaTnZZAKkhMBSkHf2mXEgoOA4yL+YGjN3//8YQZCyo+0rvo0KHjnveEV5PBe 8+Kw== X-Gm-Message-State: AFeK/H0xolLP/KLGKJ/gv+cbhxrWyy+7F9HOPrKuwqRe0Kl4uGXVtdUdVieztnWYZTmb5A== X-Received: by 10.223.165.6 with SMTP id i6mr9683875wrb.18.1490377873211; Fri, 24 Mar 2017 10:51:13 -0700 (PDT) Received: from localhost (host86-135-139-146.range86-135.btcentralplus.com. [86.135.139.146]) by smtp.gmail.com with ESMTPSA id t79sm2708755wmd.29.2017.03.24.10.51.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Mar 2017 10:51:12 -0700 (PDT) Date: Fri, 24 Mar 2017 17:54:00 -0000 From: Andrew Burgess To: Claudiu Zissulescu Cc: gcc-patches@gcc.gnu.org, Francois.Bedard@synopsys.com Subject: Re: [PATCH 2/5] [ARC] Fix detection of long immediate for load/store operands. Message-ID: <20170324175111.GJ30605@embecosm.com> References: <1490010210-9489-1-git-send-email-claziss@synopsys.com> <1490010210-9489-3-git-send-email-claziss@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1490010210-9489-3-git-send-email-claziss@synopsys.com> X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.6.1 (2016-04-27) X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg01317.txt.bz2 * Claudiu Zissulescu [2017-03-20 12:43:27 +0100]: > ARC can use scaled offsets when loading (i.e. ld.as rA,[base, > offset]). Where base and offset can be a register or an immediate > operand. The scaling only applies on the offset part of the > instruction. The compiler can accept an address like this: > > (plus:SI (mult:SI (reg:SI 2 r2 [orig:596 _2129 ] [596]) > (const_int 4 [0x4])) > (const_int 60 [0x3c])) > > Hence, to emit this instruction we place the (const_int 60) into base > and the register into offset to take advantage of the scaled offset > facility of the load instruction. As a result the length of the load > instruction is 8 bytes. However, the long_immediate_loadstore_operand > predicate used for calculating the length attribute doesn't recognize > this address and returns a wrong decision leading to a wrong length > computation for a load instruction using the above address. > > gcc/ > 2016-09-21 Claudiu Zissulescu > > * config/arc/predicates.md (long_immediate_loadstore_operand): > Consider scaled addresses cases. Looks good thanks, Andrew > --- > gcc/config/arc/predicates.md | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/gcc/config/arc/predicates.md b/gcc/config/arc/predicates.md > index 0dec736..8dd8d55 100644 > --- a/gcc/config/arc/predicates.md > +++ b/gcc/config/arc/predicates.md > @@ -148,6 +148,11 @@ > { > rtx x = XEXP (op, 1); > > + if ((GET_CODE (XEXP (op, 0)) == MULT) > + && REG_P (XEXP (XEXP (op, 0), 0)) > + && CONSTANT_P (x)) > + return 1; > + > if (GET_CODE (x) == CONST) > { > x = XEXP (x, 0); > -- > 1.9.1 >