by gwu78 · 9y ago · 0 comments
So many of these instructions I never see anyone use, ever.
No doubt there are some folks using them, but as mere mortals, do the rest of us really need all these features to control our small amount of commodity hardware? As a user, I have modest goals. Is it not true that Torvalds wrote his kernel with a similarly modest goal in mind: control over his own commodity computer?
The situation resembles that of an overcomplex software program where a majority of the features are unused by an even larger majority of its users. In other words the depth of features benefit only the very few people who use them.
Given the choice between several alternatives with differing levels of features I tend to opt for software that is less featureful and hence more simple. Call me simple-minded if you wish. The same goes for processors, although when it comes to hardware how much choice to we really have as end users? (Hobbyist boards excluded.)
For a taste of some non-x86 assmbler, I enjoyed experimenting with a MIPS simulator still found at spimsimulator.sourceforge.net. I can report that the non-GUI portion at least still compiles relatively cleanly on BSD. This simulator has been mentioned on HN several times.
I have a no problem with using a processor with fewer instructions even if I have to sacrafice something by making that choice -- I leave it to the experts to detail those sacrafices and why I would be a fool to make them. NB: I am already a fool so it may not be worth the effort.
How many HN readers have tried RISC-V? A poll for those who have not: will RISC-V inspire you to purchase a new computer?
Then I do some more research and find that all this flaky software is built on proprietary, minimally-documented hardware with its own stack of bugs, except those bugs will never get fixed because the IP is top-secret and the only ten people who understand it have already moved on to build the next product.
So RISC-V/lowRISC is enticing because it promises an architecture that is powerful enough to be more than a toy or academic exercise, and also fully open from the ground up, which the public can iterate on and finally fix bugs - or at least understand them.
(Yes I know, I'm mixing complaints about GPUs into a CPU conversation here...)
I'm also encouraged by the slowdown in Moore's Law - alternative architectures have historically been steamrollered by Intel's phenomenal process engineering capability. If process nodes reach a plateau, the mad miniaturization march of the last 50 years will pause for breath and let a much wider and deeper variety of hardware hackers get involved.
Approximately from the list above there are already 8x8x16 = 1024 "instructions", which within an order of magnitude correlates nicely with the estimates given in the article. The rest (probably dozens at most) are mainly for OS-oriented system management, and special operations done in hardware like AES (without which the equivalent software implementation would be orders of magnitude slower).
The main "simplification" which RISCs have done is restricted the operand types, so that e.g. most if not all the ALU ops must use register addressing modes, and all the other addressing modes (of which there are not many) are restricted to memory-register move instructions. That turns parts of the cartesian product into a sum, reducing the instruction count by the above measures, but IMHO is the wrong thing to do since now it means all software has to contain more instructions to do what the hardware would otherwise be able to figure out (and possibly optimise execution of) in a CISC. For example, x86 can express mem[reg + reg * scale + imm] = reg + mem[reg + reg * scale + imm] in a single instruction (decoded into multiple uops, which can be scheduled into whatever hardware resources are available) while a RISC would require several.
--
Usual P.S.: The ISA has become less and less relevant to processor performance since the mid 90s (when Intel and AMD introduced micro-ops to the x86 world by dynamic translation) and is now less relevant than ever before. What is relevant is developer mindshare, good compilers, availability of optimized algorithms, and manufacturers pouring billions into creating better scheduling and execution for µops.
Privilege separation models are finnicky, so it's probably not a good idea to rush that.
I think that if we can all throw our weight behind RISC-V, the availability, diversity, and good functioning of computer platforms will improve drastically.
https://news.ycombinator.com/item?id=8477254
However, they were much slower in the days of the P4 (which was really an oddity in x86 performance characteristics.)
They aren't for mere mortals though, they are for compilers.
Not directly, but whatever in it inspired the lowRISC team will likely have me buying one of their boards. Mostly for the minion cores on them, which meet a need I have.
So the instructions have to do more each (CISC), or we have to do a lot of instructions in parallel. Maybe RISC could shine in massively parallel processing units.