From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20949 invoked by alias); 13 Jul 2009 21:30:44 -0000 Received: (qmail 20931 invoked by uid 22791); 13 Jul 2009 21:30:41 -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-vw0-f198.google.com (HELO mail-vw0-f198.google.com) (209.85.212.198) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Jul 2009 21:30:34 +0000 Received: by vwj36 with SMTP id 36so2118140vwj.0 for ; Mon, 13 Jul 2009 14:30:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.76.1 with SMTP id a1mr7943428vck.80.1247520632194; Mon, 13 Jul 2009 14:30:32 -0700 (PDT) In-Reply-To: <4A320A07.3020804@gmail.com> References: <4A03F8EA.5070705@gnu.org> <4A320A07.3020804@gmail.com> Date: Mon, 13 Jul 2009 21:30:00 -0000 Message-ID: Subject: Re: Code optimization only in loops From: Jean Christophe Beyler To: Paolo Bonzini Cc: "gcc@gcc.gnu.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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-07/txt/msg00225.txt.bz2 Sorry to be coming back to this problem, I'm working on many projects at the same time at the moment. The port actually has a shift-immediate. It actually sees it later in the fwprop pass: In insn 14, replacing (ashift:DI (reg:DI 79) (reg:DI 77)) with (ashift:DI (reg:DI 79) (const_int 3 [0x3])) Changed insn 14 deferring rescan insn with uid =3D 14. (not the same numbers but you get the idea). I don't understand why there is a problem here but it does seem that it is linked to the way my port handles the calculations of addresses. Thanks again if you have any ideas, or anything I can do to give information or ideas, Jc On Fri, Jun 12, 2009 at 3:55 AM, Paolo Bonzini wro= te: > Jean Christophe Beyler wrote: >> >> I've gone back to this problem (since I've solved another one ;-)). >> And I've moved forward a bit: >> >> It seems that if I consider an array of characters, there are no >> longer any shifts and therefore I do get my two loads with the use of >> an offset: > > The reason there are shifts instead of multiplies is that multiplications > are canonicalized to shifts whenever possible outside addresses, because a > shift instruction should be more efficient. > > The interesting dump should be fwprop which is where the address generati= on > happens. > > From your dumps, however, the problem seems to be that you do not have a > shift-by-immediate instruction. =A0You may consider adding it even though= it > does not apply to your assembly, either with define_insn_and_split or by > loosening the predicate and keeping a "r" constraint (or whatever you're > using now). > > Paolo >