


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!



Homework 3 Total Points: 41 Points Due Date: Feb 29, 2008 by 5:00 pm – NO LATE SUBMISSIONS Directions:
(b) [6 points] What are all the dependencies in your new basic block? Problem 2 [8 points] The example on page G 30 uses a speculative load instruction to move a load above its guarding branch instruction. Consider the following code: instr.1 ; arbitrary instruction instr.2 ; next instruction in block
... ; intervening instructions BEQZ R1, null ; check for null pointer L.D F2, 0(R1) ; load using pointer ADD.D F4, F0, F2 ; dependent ADD.D ... ... null:... ; handle null pointer (a) [4 points] Write the above code using a speculative load (sL.D) and a speculation check instruction (SPECCK) to preserve exception behavior. Where should the load instruction move to to best hide its potentially long latency? (b) [4 points] Assume a speculation check instruction that branches to recovery code. Write the above code speculating on both the load and the dependent add. Use a speculative load, a nonspeculative add, a check instruction, and the block of recovery code. How should the speculated load and the add be scheduled with respect to each other?
Consider a system with 4 way set associative cache of 256 KB. The cache line size is 8 words (32 bits per word). The smallest addressable unit is a byte, and memory addresses are 64 bits long. (a) [3 points] Show the division of the bits in a memory address and how they are used to access the cache.
Cache Access Case Cache state change Way prediction entry Tag and valid bits Cache data Desired data is in the predicted way No change Desired data is in the non predicted way Desired data is not in the L2 cache (d) [2 points] For a 1024 KB L2 cache with 64 byte blocks and 8 way set associativity, how many way prediction table entries are needed? (e) [2 points] For an 8 MB L2 cache with 128 byte blocks and 2 way set associativity, how many way prediction table entries are needed? (f) [2 points] What is the difference in the way that the R10000 with only 8K way prediction table entries will support the cache in part d) versus the cache in part e)? Hint: Think about the similarity between a way prediction table and a branch prediction table.