Consider the following for-loop with a single if-else statement and its compiler-generated branch instructions. Suppose the processor uses a correlation branch predictor. When the for-loop executes,...

Consider the following for-loop with a single if-else statement and its compiler-generated branch instructions. Suppose the processor uses a correlation branch predictor. When the for-loop executes, the “then” section of the code executes when i is an even number (0, 2, 4, etc.) and the “else” section executes when i is an odd number. Do the following: a. Suppose the predictor uses a 2-bit BHR. Complete the following table for six iterations and determine the number of mispredictions, where “N” (predictor not taken), “T” (predict taken), “LN” (predict likely not taken), and “LT” (predict likely taken) are used to indicate the states of a 2-bit predictor where one 2-bit predictor is used for each of the execution paths BHR = NN, NY, YN, and YY. In the table, the state in a prior row is used to predict the branch direction as Y or N for the current instruction. For example, initially, when executing the “JMP endif” instruction where BHR = NN (no branching for “BGT” and no branching for “BLE”), the 2-bit predictor for BHR = NN is initialized to “T” because “JMP endif” branches. The next time that BHR = NN, the correlation predictor will predict “taken” for the current instruction. This is illustrated for BHR = NY in the table. b. Suppose the predictor uses a 3-bit BHR that identifies one of eight total execution paths as NNN, NNT, NTN, NTT, TNN, TNT, TTN, or TTT. However, which of the eight possible execution paths the program will follow depends on the data it processes.

Jan 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here