
| Class | CPI on I1 | CPI on I2 | C1 Usage | C2 Usage | C3 Usage |
| A | 2 | 1 | 40% | 40% | 60% |
| B | 3 | 2 | 40% | 20% | 15% |
| C | 5 | 2 | 20% | 40% | 25% |
If the implementation of this instruction in hardware will increase the clock period of a single-cycle implementation by 10%, what percentage of swap operations in the instruction mix would recommend implementing it in hardware? (If implemented in hardware, a swap would take only 1 clock cycle, whereas if implemented as above it would take 3 clock cycles.)
For 5 points extra credit, find a way to implement the swap instruction in MIPS without destroying the contents of any third register or using memory. Hint: it can be done in the same number of instructions as the implementation that uses a third register.