

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CS433g: Computer System Organization – Fall 2005 Practice Set for Chapter 4
Problem 1
Consider the following format for predicated MIPS instructions:
(pT) ADD R1, R2, R
where the ADD instruction is predicated on the predicate register pT. Assume a set of 1-bit predicate registers that are set by a compare instruction of the form:
CMP.ne pT, pF = R8, R
The example above uses a not equal (.ne) comparison relation to match the code fragment above. (You can assume the availability of any comparison relation with two operands; i.e. .le for less than or equal to and .gt for greater than.) The above compare sets the 1-bit predicate registers as follows:
pT = (R8 != R0) pF = !(R8!= R0)
So pT is true if R8 is not equal to R0, and pF is the complement of pT.
Problem 2
Consider the following code excerpt from a larger set of instructions:
loop: SW 7(R1), R2 (1) ADD R1, R1, #8 (2) LW R2, 7(R1) (3) ADD R4, R2, R1 (4) SD 200(R7), F2 (5) BEZ R4, loop (6) SW 7(R4), R5 (7) . . .
List all data dependences between the above instructions that a compiler would find. Assume that this code fragment is a portion of a larger piece of code, but the instructions that are not shown do not create additional data dependences.
part, disregard any instructions that come in between the two dependent instructions.
Problem 3
Solve parts (a) and (b) of Exercise 4.23 in the book.