This preview shows page 1. Sign up to view the full content.
Unformatted text preview: es serve simply to identify the program values being passed between the functional units. IA32 provides only a small number of such identiﬁers, constraining the amount of parallelism that can be expressed in programs. The occurrence of spilling can be seen by examining the assembly code. For example, within the ﬁrst loop for the code with eight-way parallelism we see the following instruction sequence:
type=INT, OPER = ’*’ x6 in -12(%ebp), data+i in %eax
1 2 3 movl -12(%ebp),%edi imull 24(%eax),%edi movl %edi,-12(%ebp) Get x6 from stack Multiply by data[i+6] Put x6 back In this code, a stack location is being used to hold x6, one of the eight local variables used to accumulate sums. The code loads it into a register, multiplies it by one of the data elements, and stores it back to the same stack location. As a general rule, any time a compiled program shows evidence of register spilling within some heavily used inner loop, it might be preferable to rewrite the code so that fewer temporary values are required. These include explicitly declared local variables as well as intermediate results be...
View Full Document
- Spring '10
- The American