From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <4.3.2.20010411111546.00c3c100@falcon.si.com> Date: Wed, 11 Apr 2001 11:21:11 -0400 To: linuxppc-dev@lists.linuxppc.org From: Jerry Van Baren Subject: Re: another difference in gcc (2v) ? In-Reply-To: <200104111415.f3BEFkQ28728@ashley.ivey.uwo.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-linuxppc-dev@lists.linuxppc.org List-Id: I don't see any problem with the scheduled version. The cmpwi mnemonic doesn't use the "." because it always updates the condition register (yes, they are inconsistent mnemonics). The subf and srawi don't affect the CR (no "." in them), so the CR is still valid when the branch is evaluated. gvb At 10:15 AM 4/11/01 -0400, Kevin B. Hendricks wrote: >Hi, > >Lost in the huge diff was one other change, this time in the actual code >itself. > >Can anyone tell me if this code resequence is legal? The diff (-) lines >show the nonworking disassembled code (generated by -O2) while the >diff's (+) lines show the working code (generated by -O2 >-fno-schedule-insns -fno-schedule-insns2. > >Notice that when correct, the "cmpwi r3,0" code comes right before the >branch ("beq") while in the non-working code it has been resequenced to >come before lots of other instructions that may be setting a condition >register value (subf and srawi). > >Is this a correct resequence? I seem to remember something about a "." >being added to some assmebler instructions to indicate that it impacts a >condition register yet I see no indication of it in this sequence. > >- 1c4: 80 61 00 38 lwz r3,56(r1) >- 1c8: 80 01 00 44 lwz r0,68(r1) >- 1cc: 2c 03 00 00 cmpwi r3,0 >- 1d0: 7c 03 00 50 subf r0,r3,r0 >- 1d4: 7c 00 16 70 srawi r0,r0,2 >+ 1c4: 80 01 00 44 lwz r0,68(r1) >+ 1c8: 80 61 00 38 lwz r3,56(r1) >+ 1cc: 7c 03 00 50 subf r0,r3,r0 >+ 1d0: 7c 00 16 70 srawi r0,r0,2 >+ 1d4: 2c 03 00 00 cmpwi r3,0 > 1d8: 41 82 00 14 beq 1ec >rchicalName(configmgr::configapi::NodeAccess &)+0x1e8> > > >Thanks, > >Kevin > > ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/