How close is RISC-V to RISC-I? (2017)
web.archive.org
web.archive.org
Interestingly since this article most of the "In RISC-V, but not RISC-I" instructions have been moved to extensions: Zicsr for the CSR instructions and Zifencei for the FENCE.I instruction (which turns out not to be useful for user processes running on a multicore processor with a multitasking OS like FreeBSD or Linux). That leaves only AUIPC, SBREAK (now called EBREAK), and FENCE. So it's even closer now than it was in 02017.
Yes. The better generic description would have been Branch with register + offset but the RISC-I specific language uses "Jump" for everything.
If the set of nontrivial programs is infinite, the situation is more complex, because an instruction set as normally defined is finite. Also, you can't equally weight every program from an infinite set, so you need some kind of weighting function among the programs. Which instruction set is ideal for encoding this infinite set of programs depends almost entirely on what that weighting function is. In fact, you can usually derive the optimal instruction set directly from the weighting function. Which is to say, when you design the weighting function, you are more or less designing the instruction set.
As retrac points out, it comes down to a question of tradeoffs. There's no objectively optimal answer to which tradeoffs you should prefer.
I took some notes some years ago on the subject of dense instruction sets, optimized for the number of bits to encode programs rather than the number of instructions; perhaps you will find them of interest: https://dercuano.github.io/notes/tiny-interpreters-for-micro...
Well you would want your instruction set to be Turing complete, but given that the stated goal was to only optimize for those programs for which you already added the super specialized instructions, you can just trivially add whatever “boring” instruction set you like and have uselessly checked that box, as well.
Bonus points if you use an instruction from a One Instruction Set Computer (https://en.wikipedia.org/wiki/One-instruction_set_computer ) just for style, and to claim that you have further minimized the instruction set for any program outside the stated domain!
Okay, add one more instruction TURX, which executes a Turing machine.
If you search for "frequency analysis of instruction sets" in Google Scholar you should find something.
One common bottleneck, orienting instruction set design, is the need to pull in constants (indeed the instructions themselves are). One could theoretically share them between functions, and think of smart ways to reduce the amount of code. But in practice this is futile, as the modern CPU is a race car on a highway, if not a train on rails, so it can't be bothered to stop and deal with that kind of smartness. There's just to much inertia behind you... once you approach the speed of light. The road itself should have all information needed to let the CPU drive the correct track. And no special cases.
In addition, almost all CPU's are designed to execute a C type machine abstraction, because that's the paradigm. Though I root for the Mill, my guess is we'll only see a different instruction set once the paradigm shifts towards another execution model, likely one that is less stack bound.
For all the performance a modern CPU has, and all the visual magic it can do, for most of us our PC's are still just as fast as 20 years ago. That is something that needs mending first. 100x faster, yet where did all those cycles go? Seems pathological to me.
Tech has been operating like politics: ever more promises. The vector that realizes itself from those promises is an increase of dependency, an increase of control and surveillance, and an erosion of self-reliance. They become stronger, not us. The paradigm forces you to think that the heroes of the paradigm, like big tech, are the solution, while they equally increase the problem. When a "Jedi instruction set" comes it is likely OoO like a christmas child.
Nobody would buy a PC that’s 100 times as fast but doesn’t have new abilities. 20 years ago, Blu-ray didn’t exist yet, and it featured unprecedented full HD video. Today, 4K more or less is the norm. The original iPhone (about 15 years old) had a 480 × 320 pixel screen. The latest ones have 1000+ × 2500+, at ¿quadruple? the screen refresh rate and ¿double? the number of bits per pixel.
Progress is even more enormous with cameras. Resolution had gone up relatively moderately (for iPhone from 2 megapixel ⇒ 48 megapixel), but the software behind it couldn’t realistically run on 20 year old hardware.
If we had to reserve some ram exclusively to that core even when not in use; I'd still want it for the times I have a very demanding task I'm waiting on.
This doesn't address all the bloat of course; but I'd like it.
OoO ? Overlooked? Overwritten? Overlooked or Overwritten?
Now any high performance stack machine is likely to decompose stack code to register renaming and micro-ops so some of that stuff is going to happen anyway (as it would in a register machine) and some stack ops (like dup) are going to disappear into the renamer (but then a compiler would do that as a CSE on a register machine)
Unfortunately you can't program it either in C or in Verilog, and it doesn't have multipliers, so it hasn't seen significant adoption. But its problem is that it's hard to program, not that its performance is poor.
You might be able to compile a C program to a floorplan of processors passing messages to one another, but it would be similar to writing a SystemC compiler which compiles C to, ultimately, a circuit netlist. The impedance mismatch is severe.
There have been studies comparing code-density of common algorithms compiled to or hand-optimised for different instruction sets. For instance: <https://web.eece.maine.edu/~vweaver/papers/iccd09/ll_documen...>
In general, the top densest have been 2-address CISC ISAs such as Motorola 680x0 and x86 variants, followed by 2-address RISC for embedded processors such as Super-H, ARM Thumb and RISC-V's C-extension.
The MIPS had 'trap on overflow ' integer arithmetic instructions but sadly the RISC-V doesn't have those..