Modern computer systems can have any of a wide range and variety of configurations. One important component of a computer system is the processor, also referred to as the central processing unit (CPU). The processor executes instructions from a software program, a process referred to as “running” the program. Although typically all processors perform this basic task, a wide variety of different processors are available from a number of different manufacturers. These different processors, especially those from different manufacturers, have different internal designs, also referred to as the processor “architecture”, and thus operate in different ways. Although the results from running a program on two different processors are typically the same, the way in which the processor obtains the result, as well as its speed, typically differ.
Many conventional processors, such as the Pentium® Pro processor and Pentium® processor with MMX™ technology (both available from Intel Corporation of Santa Clara, Calif.) are based on an architecture referred to as “x86”. Software programs can be written which are executable by any x86-compatible processor. However, various changes can also be made to a software program in order to allow it to be executed faster by a particular processor type. By way of example, a Pentium® processor with MMX™ technology is capable of executing additional instructions, i.e., those associated with the MMX™ technology, which a Pentium® Pro processor is not capable of executing. Given the advantages of using such instructions, it would be beneficial to provide a way for a programmer to include code customized to both the Pentium® processor with MMX™ technology and the Pentium® Pro processor in the same program.
However, a software programmer also typically wants his or her code to be executable by as many processors as possible, thereby allowing a greater share of the market to purchase his or her product. This desire, then, is balanced against the programmer's desire to write code that works efficiently and makes the best use of the processor which is executing it. One way to do so is to write a separate program for each possible processor which might execute the program. However, such a solution is problemsome in that it is time-intensive and costly, often resulting in a large amount of unnecessary duplication.
Another solution is to write a single program which includes different routines or functions designed to take advantage of the various capabilities of the processors which may run the program. However, one problem with this solution is that most programming languages do not allow multiple functions to have the same function name. Thus, the programmer must give the different functions for the different processors different names and correctly manage these different names throughout the rest of the program. This can be particularly difficult due to the requirement that all portions of the code must correctly identify the different functions by their different names.
Thus, a need exists for an improved way to customize programs for specific processors.