From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31419 invoked by alias); 9 Nov 2009 15:26:43 -0000 Received: (qmail 31409 invoked by uid 22791); 9 Nov 2009 15:26:42 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Nov 2009 15:26:38 +0000 Received: from zps78.corp.google.com (zps78.corp.google.com [172.25.146.78]) by smtp-out.google.com with ESMTP id nA9FQZSb006617 for ; Mon, 9 Nov 2009 15:26:35 GMT Received: from pwj19 (pwj19.prod.google.com [10.241.219.83]) by zps78.corp.google.com with ESMTP id nA9FPqC3006264 for ; Mon, 9 Nov 2009 07:26:32 -0800 Received: by pwj19 with SMTP id 19so1831174pwj.34 for ; Mon, 09 Nov 2009 07:26:32 -0800 (PST) Received: by 10.115.87.33 with SMTP id p33mr13828439wal.101.1257780392545; Mon, 09 Nov 2009 07:26:32 -0800 (PST) Received: from coign.google.com ([67.218.106.251]) by mx.google.com with ESMTPS id 22sm2136161pxi.10.2009.11.09.07.26.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Nov 2009 07:26:31 -0800 (PST) To: Mohamed Shafi Cc: Richard Henderson , GCC Subject: Re: How to write shift and add pattern? References: <4A97E98C.8040009@redhat.com> From: Ian Lance Taylor Date: Mon, 09 Nov 2009 15:26:00 -0000 In-Reply-To: (Mohamed Shafi's message of "Mon\, 9 Nov 2009 18\:22\:58 +0530") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00252.txt.bz2 Mohamed Shafi writes: > Ok the constrain for address register is 'a'. Thats typo in the > pattern that i given here. The proper pattern is > > (define_insn "*saddl" > [(set (match_operand:SI 0 "register_operand" "=a,d") > (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "a,d") > (match_operand:SI 2 "const24_operand" "J,J")) > (match_operand:SI 3 "register_operand" "0,0")))] > > So how can i choose the address registers over data registers if that > is more profitable? If it is cheaper to move two values from data registers to address registers than it is to use two data registers for this instruction, then you should omit the d,d,J alternative. If it is cheaper to move one value from a data register to an address register than it is to use two data registers for this instruction, then you should use !, as in "=a,!d". Otherwise you should use ?, as in "=a,?d". You can additional ?'s for additional tuning if appropriate. Ian