From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12393 invoked by alias); 13 Jan 2011 10:26:09 -0000 Received: (qmail 12365 invoked by uid 22791); 13 Jan 2011 10:26:08 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-fx0-f47.google.com (HELO mail-fx0-f47.google.com) (209.85.161.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Jan 2011 10:26:03 +0000 Received: by fxm17 with SMTP id 17so1482554fxm.20 for ; Thu, 13 Jan 2011 02:26:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.70.136 with SMTP id d8mr2202149faj.3.1294914360022; Thu, 13 Jan 2011 02:26:00 -0800 (PST) Received: by 10.223.70.129 with HTTP; Thu, 13 Jan 2011 02:25:59 -0800 (PST) In-Reply-To: References: <4D2C66FB.9090100@redhat.com> <201101121319.53218.paul@codesourcery.com> <1294844819.15132.1.camel@e102346-lin.cambridge.arm.com> Date: Thu, 13 Jan 2011 11:15:00 -0000 Message-ID: Subject: Re: [PATCH: ARM] PR 45335 Use ldrd and strd to access two consecutive words From: Ramana Radhakrishnan To: Carrot Wei Cc: Richard Earnshaw , Paul Brook , Nick Clifton , gcc-patches@gcc.gnu.org, ramana.radhakrishnan@arm.com Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes 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 X-SW-Source: 2011-01/txt/msg00812.txt.bz2 On Thu, Jan 13, 2011 at 9:27 AM, Carrot Wei wrote: > One question about the attribute length. It looks the attribute > expression is not very powerful according to > http://gcc.gnu.org/onlinedocs/gccint/Expressions.html#Expressions, > then how can I express following expressions: > > if (fix_cm3_ldrd && (operands[2] == operands[0])) Can't you express this as ? (set_attr "length" (and (ne (symbol_ref ("fix_cm3_ldrd") (const_int 0)) (eq (match_dup 2) (match_dup 0))) (const_int ) It's too early in the day and I haven't yet had my coffee but you probably get the picture. If you can't get separate constraints as Richard says or the logic as I mention above becomes too complicated which I suspect it might, it would be worth factoring out the logic into a common C function parameterised on counting vs emiting. Then you could just call the same function with and without the "emit/count" flag from the place where you set the length attribute and the place where you want to emit the assembler. Then the logic is in one place and more maintainable than having 2 implementatons of the same logic. HTH Ramana