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
.
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++.
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!