While going through the RISC-V Specification I've noticed that the 64-bit version differs from the 32-bit one in the fact, that it
- Widened the registers to 64-bit
- Changed the instructions to act on the whole 64-bit range.
- Added new instruction to perform 32-bit operations
This makes RV32 code incompatible to RV64. However if the 64-bit version had been implemented by:
- Widening the registers to 64-bit
- Renaming
ADD/SUB/SHL/..
toADDW/SUBW/SHLW/..
and keep them operating only on 32-bit with sign extend. - Add new instructions
ADD/SUB/SHL/..
orADDD/SUBD/SHLD/..
to act on the full 64-bit
This would have allowed RV32 programs to run on RV64 as well. For implementing the CPU the effort would remain the same since in both cases the 64-bit and the 32-bit instructions would have to be implemented and only the opcodes for the 64-bit and the 32-bit versions would have been swapped in contrast to the specification. (Except maybe for the multiply instruction.)
So why did RISC-V decided to assign new opcodes to the 32-bit operations instead of to the 64-bit operations in RV64?