From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18541 invoked by alias); 12 Nov 2009 13:40:51 -0000 Received: (qmail 18522 invoked by uid 22791); 12 Nov 2009 13:40:50 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pz0-f203.google.com (HELO mail-pz0-f203.google.com) (209.85.222.203) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Nov 2009 13:40:42 +0000 Received: by pzk41 with SMTP id 41so1527067pzk.0 for ; Thu, 12 Nov 2009 05:40:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.55.11 with SMTP id d11mr319015wfa.17.1258033240079; Thu, 12 Nov 2009 05:40:40 -0800 (PST) In-Reply-To: <4AF9A4B1.20704@redhat.com> References: <4AF9A4B1.20704@redhat.com> From: Mohamed Shafi Date: Thu, 12 Nov 2009 13:40:00 -0000 Message-ID: Subject: Re: How to split mulsi3 pattern To: Richard Henderson Cc: GCC Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg00330.txt.bz2 2009/11/10 Richard Henderson : > On 11/10/2009 05:48 AM, Mohamed Shafi wrote: >> >> (define_insn "mulsi3" >> =A0[(set (match_operand:SI 0 "register_operand" =A0 =A0 =A0 =A0 =A0 "=3D= &d") >> =A0 =A0 =A0 (mult:SI (match_operand:SI 1 "register_operand" =A0"%d") >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 (match_operand:SI 2 "register_operand" "d"))= )] > > Note that "%" is only useful if the constraints for the two operands are > different (e.g. only one operand accepts an immediate input). =A0When the= y're > identical, you simply waste cpu cycles asking reload to try the operands = in > the other order. > >> =A0[(set (match_dup 0) >> =A0 =A0 =A0 =A0(ashift:SI >> =A0 =A0 =A0 =A0 (plus:SI (mult:HI (unspec:HI [(match_dup 2)] UNSPEC_REG_= LOW) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (unspec:HI [(match_d= up 1)] UNSPEC_REG_HIGH)) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(mult:HI (unspec:HI [(match_dup 2)] U= NSPEC_REG_HIGH) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (unspec:HI [(match_d= up 1)] UNSPEC_REG_LOW))) >> =A0 =A0 =A0 =A0 (const_int 16))) >> =A0 (set (match_dup 0) >> =A0 =A0 =A0 =A0(plus:SI (match_dup 0) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (mult:HI (unspec:HI [(match_dup 2)] UNSP= EC_REG_LOW) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(unspec:HI [(match_du= p 1)] UNSPEC_REG_LOW))))] > > Well for one, your modes don't match. =A0You actually want your unspecs a= nd > MULTs to be SImode. > > You could probably usefully model the second insn as > > (define_insn "mulsi3_part2" > =A0[(set (match_operand:SI 0 "register_operand" "=3Dd") > =A0 =A0 =A0 =A0(plus:SI > =A0 =A0 =A0 =A0 =A0(mult:SI (zero_extend:SI > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (match_operand:HI 1 "register_ope= rand" "d")) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (zero_extend:SI > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (match_operand:HI 2 "register_ope= rand" "d"))) > =A0 =A0 =A0 =A0 =A0(match_operand:SI 3 "register_operand" "0")))] > =A0"" > =A0...) So i need to change the mode of the register from SI to HI after reloading. Is that allowed? Regards, Shafi