Question: ( i 1 ) foo: fld f 0 , 0 ( x 1 ) ; load X ( i ) to Reg ( f 0

(i1) foo: fld f0,0(x1) ; load X(i) to Reg(f0)
(i2) fmul.d f4, f0, f2 ; Reg(f4)= a*X(i)
(i3) fld f6,0(x2) ; load Y(i) to Reg(f6)
(i4) fadd.d f6, f4, f6 ; Reg(f6)= a*X(i)+ Y(i)
(i5) fsd f6,0(x2) ; store Reg(f6) to Y(i)
(i6) addi x1, x1,8 ; increase X index
(i7) addi x2, x2,8 ; increase Y index
(i8) sltu x4, x1, x3 ; test: continue loop?
(i9) bnez x4, foo ; loop if needed
Show how the loop would look both unscheduled by the compiler and after compiler scheduling, including any stalls or idle clock cycles. What is the execution time (in cycles) per element of the result vector Y, unscheduled and scheduled?
( i 1 ) foo: fld f 0 , 0 ( x 1 ) ; load X ( i )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!