Question: Ex 3 : Consider the following loop, where x , y , z , w , and output are vectors of equal length: for (
Ex: Consider the following loop, where x y z w and output are vectors of equal length:
for i ; i ; i
outputixiyiziwi;
a Convert the loop into Vector MIPS code with appropriate comments explaining each step.
b Estimate the number of scalar MIPS instructions needed to execute the loop without vectorization.
c Explain the advantages of vectorizing this code and how it improves performance over the scalar version
Ex: Instruction Sequence:
Addi $t $t ; $t $t
Lw $t$t ; $t Mem$t
Sub $t $t $t ; $t $t $t
Mul $t $t $t ; $t $t $t
Add $t $t $t ; $t $t $t
a List all the data dependencies and their types RAW WAR, WAW
b Assuming the sequence is executed correctly and that the initial values of $t $t $t $t and $t are and respectively, what will be the final values of $t $t $t $t and $t Assume memory location contains the value
c Assuming there are neither forwarding nor hazard detection units, what will be the final values of $t $t $t $t and $t in this case?
d Explain how branch prediction works in MIPS architecture and what role it plays in pipelining.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
