The following table shows the percentage of MIPS instructions executed by category for average of SPEC2000 integer programs and SPEC2000 floating point programs.
| Instruction class | MIPS examples | Average CPI | Frequency | |
|---|---|---|---|---|
| Integer | Floating point | |||
| Arithmetic | add, sub, addi | 1.0 clock cycles | 24% | 48% |
| Data transfer | lw, sw, lb, sb, lui | 1.4 clock cycles | 36% | 39% |
| Logical | and, or, nor, andi, ori | 1.0 clock cycles | 18% | 5% |
| Conditional branch | beq, bne, slt, slti | 1.7 clock cycles | 18% | 6% |
| Jump | j, jr, jal | 1.2 clock cycles | 4% | 2% |
1.1 (4%) Using the average instruction mix information for the program SPEC2000fp, find the percentage of all memory accesses (both data and instruction) that are for reads. Assume that two-thirds of data transfers are loads.
1.2 (4%) Compute the effective CPI for MIPS. Average the instruction frequencies for SPEC2000int and SPEC2000fp to obtain the instruction mix.
1.3 (6%) Consider an architecture that is similar to MIPS except that it supports update addressing for data transfer instructions. If we run SPEC2000int using this architecture, some percentage of the data transfer instructions will be able to make use of the new instructions, and for each instruction changed, one arithmetic instruction can be eliminated. If 25% of the data transfer instructions can be changed, which will be faster for SPEC2000int, the modified MIPS architecture or the unmodified architecture? How much faster? (Assume that both architectures have CPI values as given in the above table and that the modified architecture has its cycle time increased by 20% in order to accommodate the new instructions.)
1.1 以每條指令為單位:instruction fetch 1 次(read);data transfer 0.39 次,其中 load \(\tfrac23\cdot0.39=0.26\)(read)、store \(0.13\)(write)
memory access 共 \(1+0.39=1.39\),read \(1+0.26=1.26\)
\(1.26/1.39\approx90.6\%\)
1.2 平均 mix:arithmetic 36%、data transfer 37.5%、logical 11.5%、branch 12%、jump 3%
\(\text{CPI}=0.36(1.0)+0.375(1.4)+0.115(1.0)+0.12(1.7)+0.03(1.2)=0.36+0.525+0.115+0.204+0.036\)
1.24
1.3 SPEC2000int,以 100 條指令為基準
原架構 cycles:\(24(1.0)+36(1.4)+18(1.0)+18(1.7)+4(1.2)=24+50.4+18+30.6+4.8=127.8\)
25% 的 data transfer 可改:\(36\times0.25=9\) 條,各省 1 條 arithmetic → arithmetic \(24\to15\),總指令 91 條
新架構 cycles:\(15(1.0)+36(1.4)+18(1.0)+18(1.7)+4(1.2)=118.8\)
設原 cycle time 為 \(T\):原 \(=127.8T\);新 \(=118.8\times1.2T=142.56T\)
\(142.56/127.8\approx1.116\)
原本(未修改)的 MIPS 較快,快約 1.12 倍(新架構慢約 12%)