Search for question
Question

Consider the following loop:

for (i=0; i<64; i++)

X[i] = a* x[i] + b;

Here is the assembly code for the loop. Assume that prior to the loop, i is in R1, 64*4

is in R2, a is in FO, and b is in F2.

10: Id F4, X(R1)

11: mul F4, F4, FO

12: add F4, F4, F2

13: st F4, X(R1)

14: addi R1, R1, #4

15: bne R1, R2, 10

Consider a processor with 32-element vector processor. The processor has four

fully-pipelined vector execution units: a 2-cycle load unit, a 2-cycle store unit, a 2-

cycle FP adder, and a 4-cycle FP multiplier.

The vector processor does not supports chaining. How long would it take the

original loop to execute on this processor? You ignore overlaps between

multiple vector chains and the scalar code for setting up each group of vector

operations.

a.200 cycles

b.48 cycles

c.148 cycles

d.32 cycles

e.74 cycles

f.120 cycles

g.100 cycles

h.52 cycles

i.150 cycles