3 ms·
I'm guessing some misguided attempt at unifying: "They're all a kind of branch". The instruction here is JALR rd,rs1,offs. It takes three arguments: rd, the de
by Jasper_ 7y ago
I'm guessing some misguided attempt at unifying: "They're all a kind of branch". The instruction here is JALR rd,rs1,offs.
It takes three arguments: rd, the destination register to put the return address in (it should always be the ABI-defined link register, e.g. t1), rs1, the source register that jump should be relative to (it should always be the link register for a return, and 0 for a call/branch). To a software guy, there's elegance in unifying the three cases, but there's really no such principle in hardware. It just makes the implementation more complex, since branch/call/return all greatly differ for prediction, prefetching, etc.
- tachyonbeam 7y agoI would argue that it's not that elegant in software either. By unifying the instruction, you lose semantic information about what the program is trying to do.