Comment by zozbot234

Comment by zozbot234 2 days ago

3 replies

There's not a strong case for redoing the RISC-V encoding with a new RISC-VI unless they run out of 32-bit encoding space outright, due to e.g. extensive new vector-like or AI-like instructions. And then they could free up a huge amount of encoding space trivially by moving to a 2-address format throughout with Rd=Rs1 and using a simple instruction fusion approach MOV Rd ← Rs1; OP Rd ← etc. for the former 3-address case.

(Any instruction that can be similarly rephrased as a composition of more restricted elementary instructions is also a candidate for this macro-insn approach.)

phkahler 2 days ago

>> Any instruction that can be similarly rephrased as a composition of more restricted elementary instructions is also a candidate for this macro-insn approach.

I really like the idea of composition or standard prefixes. My favorite is the idea of replacing cmp/branch with "if". Where the condition is a predicate for the following instruction. For RISC-V it would eat a large part of the 16bit opcodes. Some form of load/store might be a good use for the remaining 16bit ops. Other things that might be a good prefix could be encoding data types (8,16,32,64 bit, sign extended, float, double) or a source/destination register. It might be interesting to see how a full ISA might be decomposed into smaller instruction fragments.

  • zozbot234 2 days ago

    > "if". Where the condition is a predicate for the following instruction

    This is just a forward skip, which is optimized to a predicated insn already in some implementations.

    • phkahler a day ago

      >> > "if". Where the condition is a predicate for the following instruction

      >> This is just a forward skip, which is optimized to a predicated insn already in some implementations.

      True, but make it a 16bit prefix and apply to all (or selected) instructions.