MC48 Homework 2 (Fall 1996)
Due: September 25, 1996
-
(The following is essentially exercise "3.n5", and you should refer to
it as such in your questionnaire responses.) Consider an architecture
similar to MIPS except that it supports update addressing (like the
PowerPC, see pp. 163-164) for data transfer instructions. If we run
gcc using this architecture, some percentage of the data transfer
instructions shown in Figure 3.35 will be able to make use of the new
instructions and for each instruction changed, one arithmetic
instruction can be eliminated. You can assume both architectures have
CPI values as given in Exercise 3.22 and that the modified
architecture has its cycle time increased by 10% in order to
accommodate the new instructions.
-
If 50% of the data transfer instructions can be changed which will
be faster for gcc, the modified MIPS architecture or the unmodified
architecture? How much faster?
-
What if only 25% of the data transfer instructions can be changed?
-
Do exercise 3.11 on page 185. This exercise tells you to use at most
one branch or jump each time through the loop; as a clarification,
this means that you are allowed to use as many branches or jumps as
you like, so long as the number of times all but one of them are
executed doesn't scale with the number of loop iterations. That is,
if you write the number of branches or jumps executed as a linear
function of the number of loop iterations, n, in the form
An + B, then the coefficient A must be 1, but
the constant term B can be anything you like. As an
additional clarification, 10 iterations of the loop should be
interpreted as meaning that the loop body is executed 10 times, not
that the loop test is executed 10 times. (Either interpretation would
be acceptable as long as you were consistent about it and made it explicit.)
-
Do exercise 3.18 on page 186. The registers referred to as
$2
and $3
in that exercise are what we have
been referring to as $v0
and $v1
, and you are
welcome to use either pair of names in your solution. (The exercise's
use of $2
and $3
is a holdover from the
first edition of the book.)
Instructor: Max Hailperin