From patchwork Fri Mar 4 13:25:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 592042 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 81544140213 for ; Sat, 5 Mar 2016 00:26:49 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=D6PhMToM; 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:in-reply-to:references :in-reply-to:references; q=dns; s=default; b=MiJIDpsuHVnCmfOE5+d 9m65tpZvjX7UqV46ZqCdGOiwH7JwalPanS14RlIDV6BdT6ICIHfL+x++dVVRYtDa kIrZ7Oa2jGkb7bsFyIWveGu4ljPqvM3tOV7izyBzT71/FN3PlsAaAWEDdUr0sHK/ gpdhaOlI8ls3DgjvnDeX56Qw= 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:in-reply-to:references :in-reply-to:references; s=default; bh=O3lDOaKFqFXWKAxZEFNLkHuR2 pE=; b=D6PhMToMf3hCP1PRBJ9OwemsnIDEeST/o0ZLMhdL4oX8vaKMvF8/R8wng jHwvE4DskliyadfiUuFxtdZSQL3Fw7e6jNjbog0W1s+xKoKG27OyzvU5Hz2fhFg8 UEpNs5TlhBeOiDl/sJ7FpR42XoAH+kuECJwaVZnhI+55LNPwx0= Received: (qmail 42580 invoked by alias); 4 Mar 2016 13:26:07 -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 42493 invoked by uid 89); 4 Mar 2016 13:26:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, LIKELY_SPAM_BODY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=Usd, similarly, usd, Hx-languages-length:2834 X-HELO: mail-wm0-f50.google.com Received: from mail-wm0-f50.google.com (HELO mail-wm0-f50.google.com) (74.125.82.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 04 Mar 2016 13:26:01 +0000 Received: by mail-wm0-f50.google.com with SMTP id l68so29196990wml.1 for ; Fri, 04 Mar 2016 05:26:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=5np7CNLTHoP+pEsAtIo9aGfvSzNkb4hD+RN0OPaO0vs=; b=UymCmJaKhU4vABet0o56NfQJj9qqXTM4hYiT2ITnAU75CoNZH3VFbvgkVR1tdwHyMp ucRAsQENhIRznJTuu0Rr1nBxDL70Ob5ib1RVFF/Q+/va73jBOli/b6+9AI25e1xrCyHQ Gyoy3Am24dG/c1E49dGam4x76tSymT2s/DOMENPjd7hz3tJzYjs7tXLDndfEBmnvSeo5 e4kO7nruxQL37o/c3/RKPZVuVxEBKpZQWx9+5Ua5CDNDYVHVHcHJWSqyFi5yjEzD4xWZ ZKu4n46j/x18BekIu9H+6j4sFTgsLrmlBPaI+68IikFt4tP5kYVkWAFtCvi90vGkWCTK HiNw== X-Gm-Message-State: AD7BkJKeV4bMkWTuBUNMWn+hYE5FkIBsxE/67na9ExGNO6MONZrR3ZyZQJHgIjD/HlxVqg== X-Received: by 10.28.46.82 with SMTP id u79mr5468441wmu.67.1457097958405; Fri, 04 Mar 2016 05:25:58 -0800 (PST) Received: from localhost (host86-138-94-184.range86-138.btcentralplus.com. [86.138.94.184]) by smtp.gmail.com with ESMTPSA id i1sm3306990wjs.45.2016.03.04.05.25.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Mar 2016 05:25:57 -0800 (PST) From: Andrew Burgess To: gcc-patches@gcc.gnu.org Cc: noamca@mellanox.com, Claudiu.Zissulescu@synopsys.com, Andrew Burgess Subject: [PATCH 05/10] gcc/arc: convert some constraints to define_constraint Date: Fri, 4 Mar 2016 13:25:37 +0000 Message-Id: <784abee55cddd8ad0f839747a7deb68028b3b864.1457097757.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes The define_memory_constraint allows for the address operand to be reloaded into a base register. However, for the constraints 'Us<' and 'Us>', which are used for matching 'push' and 'pop' instructions moving the address into a base register is not helpful. The constraints then should be define_constraint, not define_memory_constraint. Similarly the Usd constraint, used for generating small data area memory accesses, can't have its operand loaded into a register as the relocation for small data area symbols only works within ld/st instructions. gcc/ChangeLog: * config/arc/constraints.md (Usd): Convert to define_constraint. (Us<): Likewise. (Us>): Likewise. --- gcc/ChangeLog.NPS400 | 7 +++++++ gcc/config/arc/constraints.md | 18 +++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog.NPS400 b/gcc/ChangeLog.NPS400 index 71463df..5d1533c 100644 --- a/gcc/ChangeLog.NPS400 +++ b/gcc/ChangeLog.NPS400 @@ -1,3 +1,10 @@ +2016-03-01 Joern Rennecke + Andrew Burgess + + * config/arc/constraints.md (Usd): Convert to define_constraint. + (Us<): Likewise. + (Us>): Likewise. + 2016-02-01 Andrew Burgess * config/arc/arc.md (*loadqi_update): Replace use of 'rI' diff --git a/gcc/config/arc/constraints.md b/gcc/config/arc/constraints.md index 668b60a..b6954ad 100644 --- a/gcc/config/arc/constraints.md +++ b/gcc/config/arc/constraints.md @@ -269,11 +269,15 @@ (and (match_code "mem") (match_test "compact_store_memory_operand (op, VOIDmode)"))) -(define_memory_constraint "Usd" - "@internal - A valid _small-data_ memory operand for ARCompact instructions" - (and (match_code "mem") - (match_test "compact_sda_memory_operand (op, VOIDmode)"))) +; Don't use define_memory_constraint here as the relocation patching +; for small data symbols only works within a ld/st instruction and +; define_memory_constraint may result in the address being calculated +; into a register first. +(define_constraint "Usd" + "@internal + A valid _small-data_ memory operand for ARCompact instructions" + (and (match_code "mem") + (match_test "compact_sda_memory_operand (op, VOIDmode)"))) (define_memory_constraint "Usc" "@internal @@ -283,7 +287,7 @@ ;; ??? the assembler rejects stores of immediates to small data. (match_test "!compact_sda_memory_operand (op, VOIDmode)"))) -(define_memory_constraint "Us<" +(define_constraint "Us<" "@internal Stack pre-decrement" (and (match_code "mem") @@ -291,7 +295,7 @@ (match_test "REG_P (XEXP (XEXP (op, 0), 0))") (match_test "REGNO (XEXP (XEXP (op, 0), 0)) == SP_REG"))) -(define_memory_constraint "Us>" +(define_constraint "Us>" "@internal Stack post-increment" (and (match_code "mem")