21.01.2013 Views

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

LPA: A First Approach to the Loop Processor Architecture 279<br />

iterations of the loop. In the next iteration of the loop, <strong>in</strong>struction @12 will also<br />

read logical register r4. However, the loop w<strong>in</strong>dow does not conta<strong>in</strong> the correct<br />

virtual tag value (v9.0 <strong>in</strong>stead of v13.0). It happens because the loop w<strong>in</strong>dow<br />

states that the register value depends on an <strong>in</strong>struction outside the captured<br />

loop, which was true for that iteration but not for the subsequent ones.<br />

In order to correctly capture dependences between the <strong>in</strong>structions <strong>in</strong>side the<br />

loop body, it is necessary to execute a third iteration of the loop. Therefore, when<br />

the second iteration f<strong>in</strong>ishes, LPA exits the Captur<strong>in</strong>g Loop state and enters the<br />

Captur<strong>in</strong>g Dependences state. LPA rema<strong>in</strong>s <strong>in</strong> the Captur<strong>in</strong>g Dependences state<br />

dur<strong>in</strong>g the third iteration of the loop. The source operands of the <strong>in</strong>structions are<br />

renamed as usual, check<strong>in</strong>g the correspond<strong>in</strong>g entries of the LVM. As happened<br />

dur<strong>in</strong>g the previous iteration, the contents of the LVM entries are also stored <strong>in</strong><br />

the loop w<strong>in</strong>dow. However, when the target register of an <strong>in</strong>struction requires<br />

a new virtual tag, the rVT component of the tag does not change. New virtual<br />

tags are generated <strong>in</strong>creas<strong>in</strong>g the value of the iVT component by one.<br />

Figure 5 shows a snapshot of the LVM at the end of the third iteration of<br />

our loop example, as well as the state of the loop w<strong>in</strong>dow. Now, the dependence<br />

between <strong>in</strong>struction @28 and <strong>in</strong>struction @12 is correctly stored. Instruction @28<br />

<strong>in</strong> the second iteration generates a value that is associated to virtual tag @13.0<br />

(Figure 4). In the current iteration, <strong>in</strong>struction @12 reads the value associated<br />

to virtual tag @13.0, while the new <strong>in</strong>stance of <strong>in</strong>struction @28 generates a<br />

new value that is associated to virtual tag @13.1 and later read by <strong>in</strong>struction<br />

@32. Extend<strong>in</strong>g this mapp<strong>in</strong>g for the next iteration is straightforward, s<strong>in</strong>ce it<br />

is only necessary to <strong>in</strong>crement the iVT field by one. Dur<strong>in</strong>g the fourth iteration,<br />

<strong>in</strong>struction @12 will read the value associated to virtual tag v13.1 and <strong>in</strong>struction<br />

@28 will generate a value that will be associated to virtual tag v13.2 andlater<br />

read by <strong>in</strong>struction @32.<br />

2.3 Fetch<strong>in</strong>g from the Loop W<strong>in</strong>dow<br />

After the third iteration f<strong>in</strong>ishes, the loop w<strong>in</strong>dow conta<strong>in</strong>s enough <strong>in</strong>formation to<br />

feed the dispatch logic with <strong>in</strong>structions that are already decoded and renamed.<br />

Figure 6 shows how to generalize the <strong>in</strong>formation stored dur<strong>in</strong>g previous loop<br />

iterations. Let i be the current loop iteration. The rVT values assigned to all<br />

registers rema<strong>in</strong> equal dur<strong>in</strong>g the whole loop execution. The <strong>in</strong>structions that<br />

store a value <strong>in</strong> a register dur<strong>in</strong>g current iteration get the value i for the iVT<br />

component of the virtual tag associated to its target. Those <strong>in</strong>structions that<br />

read a value def<strong>in</strong>ed <strong>in</strong> the previous iteration will get the value i − 1fortheiVT<br />

component, while those <strong>in</strong>structions that read a value def<strong>in</strong>ed <strong>in</strong> the current<br />

iteration will get the value i for the iVT component. Instructions that read a<br />

value def<strong>in</strong>ed outside the loop body will get the value 0 for the iVT component.<br />

When an <strong>in</strong>struction is fetched from the loopw<strong>in</strong>dow,therVTvaluestored<br />

<strong>in</strong> the loop w<strong>in</strong>dow is ma<strong>in</strong>ta<strong>in</strong>ed for both the source operands and the target<br />

register. For each of these registers that has the I bit set to one, the iVT value<br />

stored <strong>in</strong> the loop w<strong>in</strong>dow is <strong>in</strong>creased by one to generate the new virtual tag<br />

that will be used <strong>in</strong> the next loop iteration. The iVT value is not <strong>in</strong>creased if the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!