From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10886 invoked by alias); 25 Feb 2011 01:56:54 -0000 Received: (qmail 10783 invoked by uid 22791); 25 Feb 2011 01:56:53 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_TM X-Spam-Check-By: sourceware.org Received: from mail-iw0-f175.google.com (HELO mail-iw0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Feb 2011 01:56:48 +0000 Received: by iwn10 with SMTP id 10so750770iwn.20 for ; Thu, 24 Feb 2011 17:56:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.97.69 with SMTP id m5mr105565icn.135.1298599006461; Thu, 24 Feb 2011 17:56:46 -0800 (PST) Received: by 10.231.35.129 with HTTP; Thu, 24 Feb 2011 17:56:46 -0800 (PST) In-Reply-To: References: Date: Fri, 25 Feb 2011 08:05:00 -0000 Message-ID: Subject: Re: optimization, powerpc style From: kevin diggs To: "gcc-help@gcc.gnu.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg00402.txt.bz2 On Fri, Feb 11, 2011 at 11:15 AM, kevin diggs wrot= e: > > In both the 4.2.4 and 4.3.5 compiled versions of mesh, the mesh_start() r= outine > has a lengthy list of register assignments near the start of the > routine: > > .L241: > =A0 =A0 =A0 =A0lis 9,.LANCHOR0@ha =A0 =A0 =A0 # tmp459, > =A0 =A0 =A0 =A0lis 11,.LC47@ha =A0# tmp461, > =A0 =A0 =A0 =A0la 23,.LANCHOR0@l(9) =A0 =A0 # tmp460,, tmp459 > =A0 =A0 =A0 =A0lis 9,.LC48@ha =A0 # tmp463, > =A0 =A0 =A0 =A0la 19,.LC47@l(11) =A0 =A0 =A0 =A0# tmp462,, tmp461 > =A0 =A0 =A0 =A0la 18,.LC48@l(9) =A0 =A0 =A0 =A0 # tmp464,, tmp463 > =A0 =A0 =A0 =A0lis 11,.LC16@ha =A0# tmp465, > =A0 =A0 =A0 =A0lis 9,.LC50@ha =A0 # tmp467, > =A0 =A0 =A0 =A0la 17,.LC16@l(11) =A0 =A0 =A0 =A0# tmp466,, tmp465 > =A0 =A0 =A0 =A0la 22,.LC50@l(9) =A0 =A0 =A0 =A0 # tmp468,, tmp467 > =A0 =A0 =A0 =A0lis 11,.LC51@ha =A0# tmp469, > =A0 =A0 =A0 =A0lis 9,.LC57@ha =A0 # tmp471, > =A0 =A0 =A0 =A0la 21,.LC51@l(11) =A0 =A0 =A0 =A0# tmp470,, tmp469 > =A0 =A0 =A0 =A0la 20,.LC57@l(9) =A0 =A0 =A0 =A0 # tmp472,, tmp471 > =A0 =A0 =A0 =A0lis 11,.LC58@ha =A0# tmp473, > =A0 =A0 =A0 =A0lis 9,.LC59@ha =A0 # tmp475, > =A0 =A0 =A0 =A0la 16,.LC58@l(11) =A0 =A0 =A0 =A0# tmp474,, tmp473 > =A0 =A0 =A0 =A0la 15,.LC59@l(9) =A0 =A0 =A0 =A0 # tmp476,, tmp475 > =A0 =A0 =A0 =A0lis 11,.LC60@ha =A0# tmp477, > =A0 =A0 =A0 =A0lis 9,.LC53@ha =A0 # tmp480, > =A0 =A0 =A0 =A0la 14,.LC60@l(11) =A0 =A0 =A0 =A0# tmp478,, tmp477 > =A0 =A0 =A0 =A0la 24,.LC53@l(9) =A0 =A0 =A0 =A0 # tmp482,, tmp480 > > Later, when one of these is used you'll see: > > =A0 =A0 =A0 =A0mr 3,19 =A0#, tmp462 > =A0 =A0 =A0 =A0mr 4,31 =A0#, cmd > =A0 =A0 =A0 =A0mr 6,28 =A0#, id > =A0 =A0 =A0 =A0bl printk =A0 =A0 =A0 =A0# > > for .LC47, which is "<4>mesh_start: %p ser=3D%lu tgt=3D%d cmd=3D" > > These all end up in: > > .section =A0 =A0 =A0 =A0.rodata.str1.4,"aMS",@progbits,1 > > and will have addresses close to each other, right? I don't understand > why they can't do something like: > > lis 15,.LANCHOR0@ha > la 15,.LANCHOR0@l(15) > > and then do something like: > > la 3,(15) > > when each string is used. What am I missing? > > The above register loads also result in: > > =A0 =A0 =A0 =A0stmw 14,8(1) =A0 =A0 #, > and > =A0 =A0 =A0 =A0lmw 14,8(1) =A0 =A0 =A0#, > > for 4.3.5. A smaller set is saved in 4.1.2 > > =A0 =A0 =A0 =A0stmw 25,20(1) =A0 =A0#, > and > =A0 =A0 =A0 =A0lmw 25,20(1) =A0 =A0 #, > > Won't this lead to unneeded memory traffic and/or cache churning? > > kevin > Hi, Before I work on this, has it already been fixed in a newer release? Thanks! kevin