710 views
0 votes
0 votes

Consider the following loop.

𝑙𝑜𝑜𝑝:
1. 𝑆𝑈𝐵𝐼 𝑅1,𝑅1,#1

2. 𝐿𝐷 𝑅3,0(𝑅2)

3. 𝐿𝐷 𝑅4,4(𝑅2)

4. 𝑀𝑈𝐿 𝑅5,𝑅3,𝑅4

5. 𝐴𝐷𝐷 𝑅3,𝑅5,𝑅6

6. 𝐴𝐷𝐷𝐼 𝑅2,𝑅2,#8

7. 𝐵𝑁𝐸𝑍 𝑅1,𝑙𝑜𝑜𝑝

8. 𝐴𝐷𝐷 𝑅10,𝑅11,𝑅12

identify all data dependencies (potential data hazards) in the given code snippet. Assume the loop takes exactly one iteration to complete. Specify if the data dependence is RAW, WAW or WAR.

solution:   1) 1  7 (RAW)
2) 2  4 (RAW)
3) 2  5 (WAW)
4) 2  6 (WAR)
5) 3  4 (RAW)

6) 3  6 (WAR)

7) 4  5 (RAW)
8) 4  5 (WAR)

There is no WAR or RAW from 7  1 because the loop only executes for a single iteration.please explain how 

Please log in or register to answer this question.

Related questions

3 votes
3 votes
0 answers
1
1 votes
1 votes
1 answer
2
arch asked Dec 19, 2017
1,456 views
0 votes
0 votes
0 answers
3
pa-try asked Dec 14, 2017
768 views
0 votes
0 votes
1 answer
4
gari asked Sep 10, 2017
416 views
Do we have to see the WAW and WAR dependency in adjacent instructions or the full set of instructions ?