Modern machines try to execute many instructions at the


Modern machines try to execute many instructions at the same time, including branching instructions. Thus, there is a severe cost if the machine speculatively follows one branch, when control actually goes another way (all the speculative work is thrown away). It is therefore desirable to minimize the number of branches. Notice that the implementation of a while-loop in Fig. 6.35(c) has two branches per interation: one to enter the body from the condition B and the other to jump back to the code for B. As a result, it is usually preferable to implement while (B) S as if it were if (B) f re- peat S until !(B) g. Show what the code layout looks like for this translation, and revise the rule for while-loops in Fig. 6.36

2102_images.png

Request for Solution File

Ask an Expert for Answer!!
Finance Basics: Modern machines try to execute many instructions at the
Reference No:- TGS01720139

Expected delivery within 24 Hours