Good points.  I overlooked the effect of using the same registers.  Change the 
register number so a different register is being used as often as possible.  
Also change the 1,000,000 to 1,000,000,000,000.  I hope that will be huge 
enough.  And replace the BCTR with some other instruction that doesn't stall 
the pipeline (assuming that BCTR does) to keep the executing code all within 
the same cache line and to keep looping. 
My point was to create a large number of consecutive non-stalling instructions 
all within one cache line and execute all of the instructions a truly huge 
number [1] of times.  Please correct my errors as well as pointing them out, 
and also comment on the design of this test rather than only on what I did 
wrong in the code.  Or design a better test that will give us an understanding 
of which instruction is the fastest way to zero a register so we can all write 
the most elegant code possible instead of always being told that there are too 
many variables to get a meaningful answer. 
  
Bill Fairchild 
  
[1] Keep squaring 1,000,000,000,000 enough times until it becomes truly huge 
enough. 

----- Original Message -----

From: "Kirk Talman" <[email protected]> 
To: [email protected] 
Sent: Tuesday, June 3, 2014 10:54:52 AM 
Subject: Re: XR vs SR 

> From: Tom Marchant <[email protected]> 

> I would expect that the code that you shown below would stall the 
> pipeline for every XR instruction. Why? because they all use the 
> same register. I wouldn't consider 128 million instructions to be 
> "truly huge" 

both instructions are pipeline stalls - both change a register. 

but because each changes a different register, does that mean they run 
simultaneously, i.e. in parallel? 

----------------------------------------- 
The information contained in this communication (including any 
attachments hereto) is confidential and is intended solely for the 
personal and confidential use of the individual or entity to whom 
it is addressed. If the reader of this message is not the intended 
recipient or an agent responsible for delivering it to the intended 
recipient, you are hereby notified that you have received this 
communication in error and that any review, dissemination, copying, 
or unauthorized use of this information, or the taking of any 
action in reliance on the contents of this information is strictly 
prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original 
message. Thank you 

Reply via email to