Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesHow to Optimize Your PowerPC Code


September 1995 / Book and CD-ROM Reviews / How to Optimize Your PowerPC Code
Tom Thompson

OPITMIZING POWERPC CODE by Gary Kacmarcik, Addison-Wesley, ISBN 0-201-40839-2, $39.95

The PowerPC market is growing, and many books covering the programming of this processor are being published. Optimizing PowerPC Code by Gary Kacmarcik tells how to write faster native code. The book starts with functional descriptions of the PowerPC 601's architecture and instruction set. The author describes such features as cache operation and branch prediction logic.

Once this groundwork is complete, Kacmarcik moves on to optimization tricks. Some of these are standard fare: using right shifts to replace multiply operations and multiplication to replace expensive divide operations (for numerous divide operations, multiplying with a recipro cal is faster). Other tricks involve mixing the instruction stream so that all the execution units are kept busy and avoiding pipeline stalls by modifying certain code structures, such as loop unrolling and code pasting (i.e., placing code-block duplicates elsewhere in an algorithm to increase the number of independent instructions that can be sent to execution units). Finally, there are nitty-gritty details about specific register dependencies and what can be done to avoid them.

It's important to note that this subject is discussed at a fairly high level. For example, the loop-unrolling examples are in C, although certain sections are peppered with assembly language output. Also, there's no treatment of development tools or a specific machine environment (e.g., the Power Mac's code implementation). However, the broad treatment Kacmarcik uses lets these techniques be applied to all PowerPC systems.


Tom Thompson is a BYTE senior technical editor at large who is the author of Power Mac intosh Programming Starter Kit (Hayden Books, 1994). You can reach him on AppleLink as T.THOMPSON or on the Internet or BIX at tom_thompson@bix.com .

Up to the Book and CD-ROM Reviews section contentsGo to next article: Establish A Web BeachheadSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network