Power Macintosh: Developer‘s Can Test for Power Clean Code 1/96

As I buy more and more Power Macintosh computers with PowerPC 603, 603e, and 604 processors for my business, I am seeing more incidents of incompatibilities and poor performance. According to the Developer Technotes (pasted below), this could be a result of applications being compiled with compilers that do not generate Power Clean code.

Excerpt from Developer Technical Notes:

"The first generation Power Macintosh computers used the PowerPC 601 microprocessor, a microprocessor that bridged the new PowerPC architecture with the POWER architecture from which it descended. The PowerPC 601 implemented most of the old POWER instruction set as well as the newer PowerPC instruction set. Later versions of the microprocessor, namely the PowerPC 603 and 604, only implement the PowerPC instruction set, hence the term "power clean." Because of the differences in instruction set implementation, a possibility exists for incompatibility and poor performance, particularly in the area of compilers. Newer compilers, designed for the PowerPC instruction set, do not generate the old POWER instructions. However, compilers designed for the POWER instruction set are also being used to compile programs for the PowerPC instruction set. Most of those compilers have the option to suppress the generation of offending instructions. For example, the IBM xLc C compiler and the xLCC++ compiler have the option -garch=ppc. Developers using these compilers should verify that the options are in effect for all parts of their code. To be on the safe side, you should contact your compiler vendor to make sure that the compiler you are using does not generate POWER instructions."


Is there a utility available from Developer Technical Support that could help identify whether or not an application, extension, or control panel, uses old PowerPC 601 instructions not supported on the PowerPC 603, 603e, and 604 processors?
Apple is not aware of any end-user application or utility that can tell if a computer is running PowerPC 601 specific code. However, the developer of your application can check their code to be sure it is "Power Clean" using a Macintosh Programmer's Workshop (MPW) tool called DumpPEF. Developers should be using MPW version 2.0 or later. Here is more information from Developer Technical Support regarding this topic:

"The latest pre-release MPW DumpPEF tool (version 2.0b1 from E.T.O. #15) has an option, -w601, to scan for PowerPC 601 specific instructions. It is one way to test if your code is affected. Be aware, however, that DumpPEF cannot always distinguish between code and data and may flag POWER opcodes that are really data. You should check all warnings from DumpPEF to be sure they are not spurious. Even if the tool finds valid POWER opcodes, there is no guarantee the instructions are part of an executable code path. You should, of course, test your application on 603/604 hardware as soon as it is available."

This means the MPW tool DumpPEF version 2.0 or later will identify 601 specific instructions. If DumpPEF finds no 601 specific instructions, your code is considered Power Clean. Even if DumpPEF finds 601 instructions, your code may still be clean; you have to examine further the 601 code in question to ensure that DumpPEF is not reporting a 'false positive' due to reading data as code.


Support Information Services
Published Date: Feb 19, 2012