Instructions Required for Operations on Simple Data Types

Comparison of ￿oating poin t instructions and in teger instructions is not v alid because the ￿oating point instructions ma y execute in a di￿eren t cycle from the in teger instructions and may require sync hronization. The instructions that compute ￿oating-poin t arithmetic are done in a coprocessor and do not execute in a single mac hine cycle. However, the instructions that compute integer arithmetic are done in a CPU and complete in a single mac hine cycle. Figure 5-3 sho ws examples of the instructions for operations on simple data t ypes.

These examples assume the follo wing characteristics are true: Unoptimized code Well aligned operands No range or over￿ow checking

Figure 5-3. Instructions Operations on Simple Data Types

Optimize Arrays

The compiler does not alwa ys initialize array elemen ts when an array is created. Ensure that all variables are properly initialized. Uninitialized v ariables that did not cause problems on MPE V/E-based systems ma y cause programs to abort on MPE/iX-based systems. Figure 5-4 shows examples of array optimization.

Figure 5-4. Optimizing Arrays

5-6 Optimizing a Program