Question: Consider this code as it is written it will create multiple stalls because of Control Hazards. We order the lines to eliminate the stalls Loop:

Consider this code as it is written it will create multiple stalls because of Control Hazards. We order the lines to eliminate the stalls
Loop: //3Dhyp = SQRT(a*a + b*b + c*c)
LDUR X1,[X15 #0]
MUL X11, X1 X1// A*A
LDUR X2,[X15,#8]
MUL X12, X2 X2// B*B
LDUR X3,[X15,#16]
MUL X13, X3, X3// C*C
ADD X14, X11, X12
ADD X14, X14, X13
SCVTF S1 X14// convert hyper hypotenuse to float
SQRT S1 S1// calc hyperhotenuse using SQRT
fcvtzu X1, S1// hyper hypotenuse to integer
ADDI X2, XZR,144// set X2 to 144
SUBS XZR, X1, X2// compare X1 to X2(144)
B.LT Loop // if hyper hypotenuse is >=144 we are done

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!