Compilers are a bit like Florida election officials: They're suddenly in the spotlight after years of relative anonymity.
The reason for the attention is the arrival of fast and complex 64-bit microprocessors, typified by Intel Corp.'s Itanium line. All of the sophisticated architectural innovations like parallelization and branch prediction, as well as the promises of significant performance gains, will mean little unless programmers can actually use these enhanced capabilities.
Writing code specifically for efficient parallel processing makes the difficult task of modern programming even more challenging. As a result, responsibility for achieving many of the performance claims of future 64-bit processors will fall on the shoulders of their next-generation compilers.
These performance-savvy compilers are already arriving from the research and development labs of Hewlett-Packard Co., Intel, MetaWare Inc., Microsoft Corp. and others. Last February, Mountain View, Calif.-based Silicon Graphics Inc. announced that its optimizing compilers delivered 30% to 100% better performance than existing compilers when teamed with Itanium processors running Linux.
Like their ancestors, optimizing compilers turn high-level programs into machine code. However, their extra contribution is making sure the translations handle memory -- particularly processor-level caches and parallelization -- as effectively as possible.
For example, Itanium processors are designed to simultaneously handle as many as six instructions per clock cycle. But to achieve this, a compiler must keep a steady stream of data flowing through the instruction pipeline.
One technique is to corral frequently used instructions into tight groups that the CPU can break into instruction strings and process simultaneously. Optimizing compilers also maximize cycle times through branch prediction, where the compiler attempts to predict the results of GOTO instructions, thus saving the CPU from having to locate outcomes dispersed throughout a program. Speculation, a related technique, has the optimizing compiler load instructions early, in an attempt to improve the CPU's performance. Some research labs, including the University of Illinois at Urbana-Champaign, have developed working examples of next-generation compilers.
Other Options
Interpreters also translate high-level programming code into machine language, but they do it line by line as the application runs. The computer that's running the high-level code must also run the interpreter in order to understand the program. Interpreters are valuable for testing newly written or modified code or teaching programming. Basic started as an interpreted teaching language.
Software that's compiled ahead of time runs faster than interpreted programs. Thus, compiled programs are preferred for large, enterprisewide applications, but they aren't as good for Internet Age applets destined to run on an unknown target machine.
The Java platform uses a third alternative, bytecode. With bytecode, a high-level program is translated into an intermediate form that can run on various hardware platforms. Java bytecode is morphed into machine-specific code through a real-time interpreter called the Java Virtual Machine (JVM). This JVM builds a dedicated mmemory space that houses applets and keeps them separate from the host system's storage.
Just-in-time (JIT) compilers promise to improve the performance of Java applications. Rather than letting the JVM run bytecode, a JIT compiler translates code into the host machine's native language. Thus, applications gain the performance enhancement of compiled code while maintaining Java's portability.
HP is taking a similar tack with its TurboChai compiler, a Java compiler for embedded applications. TurboChai aims to boost performance by translating the most frequently used code within a given embedded application. Through selective compiling, HP plans to control memory usage while achieving speeds comparable to those of JIT compilers. The TurboChai compiler takes Java bytecode as input, generates ANSI C source code and then uses any C compiler to generate optimized native code.
Last summer, Microsoft announced C#, an object-oriented programming language that embraces XML. Microsoft portrays the new language as a logical evolution of C and C++ for Web applications. Key modules will be the Common Language Runtime for C# and a special compiler that will turn traditional Cobol, Perl, Fortran or other code into an intermediate language that would then operate on Microsoft's new .Net platform.
End users are unlikely to become compiler junkies. Nevertheless, it may take a new generation of compilers to deliver the performance gains necessary to convince professionals that they need to embrace 64-bit hardware architectures.
| Developments in Development Tools |
| Development Tool | Whats New | Goals | | Optimizing Compilers | Achieve high CPU processing performance via parallelization, branch prediction, speculation | Help 64-bit processors realize their potential | | Just-in-Time Compilers | Compile real-time code on client machines | Improve performance of interpreted languages like Java | | Selective Compilers | Compile only the most frequently used code within embedded applications | Improve performance without draining precious memory resources |
|