📜 ⬆️ ⬇️

Disadvantages of RISC-V

I originally wrote this document a few years ago, as an execution core verification engineer in ARM. Of course, my opinion was influenced by in-depth work with the executive cores of different processors. So do it for a discount, please: maybe I'm too categorical.

However, I still believe that the creators of RISC-V could do much better. On the other hand, if I had designed a 32-bit or 64-bit processor today, I would probably have implemented just such an architecture to take advantage of the existing tools.

The article originally described the RISC-V 2.0 instruction set. For version 2.2, it made some updates.

Original Foreword: Some Personal Opinion


The RISC-V instruction set has been reduced to an absolute minimum. Much attention is paid to minimizing the number of instructions, normalizing coding, etc. This desire for minimalism has led to false orthogonality (such as reusing the same instruction for transitions, calls, and returns) and mandatory verbosity, which inflates both size and quantity instructions.
')
For example, here is the C code:

int readidx(int *p, size_t idx) { return p[idx]; } 

This is a simple case of indexing an array, a very common operation. This is the compilation for x86_64:

 mov eax, [rdi+rsi*4] ret 

or ARM:

 ldr r0, [r0, r1, lsl #2] bx lr // return 

However, for RISC-V, the following code is required:

 slli a1, a1, 2 add a0, a1, a1 lw a0, a0, 0 jalr r0, r1, 0 // return 

Simplification RISC-V simplifies the decoder (i.e., the CPU front end) by executing more instructions. But scaling the width of the pipeline is a complex problem, while decoding slightly (or strongly) irregular instructions is well implemented (the main difficulty arises when it is difficult to determine the length of the instruction: this is especially evident in the x86 instruction set with numerous prefixes).

The simplification of the set of instructions should not be brought to the limit. Register and register addition with a shift of the register memory is a simple and very common instruction in programs, and it is very easy for the processor to effectively implement it. If the processor is not able to implement the instruction directly, then it can be relatively easy to break it down into its components; this is a much simpler problem than merging sequences of simple operations.

We must distinguish between “complex” specific instructions of CISC processors - complicated, rarely used and inefficient instructions - from “functional” instructions common to CISC and RISC processors, which combine a small sequence of operations. The latter are used frequently and with high performance.

Mediocre implementation



poorly



Awful


Source: https://habr.com/ru/post/461785/


All Articles