From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7451 invoked by alias); 6 Nov 2009 16:17:28 -0000 Received: (qmail 7441 invoked by uid 22791); 6 Nov 2009 16:17:27 -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 mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Nov 2009 16:17:20 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nA6GHJgQ020312; Fri, 6 Nov 2009 11:17:19 -0500 Received: from stone.twiddle.home (vpn-227-33.phx2.redhat.com [10.3.227.33]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nA6GHIi9004442; Fri, 6 Nov 2009 11:17:19 -0500 Message-ID: <4AF44C0D.5090902@redhat.com> Date: Fri, 06 Nov 2009 16:17:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: Mohamed Shafi CC: GCC Subject: Re: How to write shift and add pattern? References: <4A97E98C.8040009@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00142.txt.bz2 On 11/06/2009 05:29 AM, Mohamed Shafi wrote: > The target that i am working on has 1& 2 bit shift-add patterns. > GCC is not generating shift-add patterns when the shift count is 1. It > is currently generating add operations. What should be done to > generate shift-add pattern instead of add-add pattern? I'm not sure. You may have to resort to matching (set (match_operand 0 "register_operand" "") (plus (plus (match_operand 1 "register_operand" "") (match_dup 1)) (match_operand 2 "register_operand" "")))) But you should debug make_compound_operation first to figure out what's going on for your port, because it's working for x86_64: long foo(long a, long b) { return a*2 + b; } leaq (%rsi,%rdi,2), %rax # 8 *lea_2_rex64 ret # 26 return_internal r~