3 ms·
You seem to be making your whole argument around some facts which you got wrong. The central points of your argument are often used in FUD, thus they are defini
by snvzz 5y ago
You seem to be making your whole argument around some facts which you got wrong. The central points of your argument are often used in FUD, thus they are definitely worth tackling here.
>Even the hard-to-believe "research" results published by RISC-V developers have always showed worse code density than ARM
the code size advantage of RISC-V is not artificial academic bullshit. It is real, it is huge, and it is trivial to verify. Just build any non-trivial application from source with a common compiler (such as GCC or LLVM's clang) and compare the sizes you get. Or look at the sizes of binaries in Linux distributions.
>the so-called better results were for the compressed extension, not for the normal encoding.
The C extension can be used anywhere, as long as the CPU supports the extension; most RISC-V profiles require it. This is in stark contrast with ARMv7's thumb, which was a literal separate CPU mode. Effort was put in making this very cheap for the decoder.
The common patterns where number of instructions is larger are made irrelevant by fusion. RISC-V has been thoroughly designed with fusion in mind, and is unique in this regard. It is within its right in calling itself the 5th generation RISC ISA because of this, even if everything else is ignored.
Fusion will turn most of these "2 instructions instead of one" into actually one instruction from the execution unit perspective. There's opportunities everywhere for fusion, the patterns are designed in. The cost of fusion on RISC-V is also very low, often quoted as 400 gates, allowing even simpler microarchitectures to implement it.
- theresistor 5y ago> This is in stark contrast with ARMv7's thumb, which was a literal separate CPU mode. This is disingenuous. arm32's Thumb-2 (which has been around since 2003) supports both 16-bit and 32-bit instructions in a single mode, making it directly comparable to RV32C.
- snvzz 5y agoYour statement does not run counter to mine quoted. Thumb-2 is better designed than Thumb was, but it is still a separate CPU mode. And it got far less use than it deserved, because of this. It doesn't do everything, and switching has a significant cost. This cost is in contrast with RISC-V's C extension.
- lonjil 5y agoThe ARMv8-M profile is Thumb-only, so on ARM microcontroller platforms there is no switching at all, and it does do everything, or at least everything you might want to do on a microcontroller, and has of course gotten a very large amount of use, considering how widely deployed those cores are.
- Dylan16807 5y agoIs thumb-only particularly good for density, compared to being able to mix instruction sizes?
- lonjil 5y agoThumb has both 16-bit and 32-bit instructions.
- Dylan16807 5y agoOh, you meant thumb and thumb-2.
- lonjil 5y ago"thumb-2" isn't really a thing. It's just an informal name from when more instructions were being added to thumb. it's still just thumb.
- brucehoult 5y agoThumb2 is a thing. Thumb is purely 16 bit instructions. Thumb2 is a mix of 16 bit and 32 bit instructions. As an illustrative example, in Thumb when the programmer writes "BL <offset>" or "BX <offset>" the assembler creates two undocumented 16 bit instructions next to each other which together have the desired effect. If you create those instructions yourself using e.g. .half directives (or if you're writing a JIT or compiler) then you can actually put other instructions between them, as long as you don't disturb the link register. In Thumb2 the bit patterns for BL and BX are the same, but they are an ACTUAL 32 bit instruction which can't be split up like it can in Thumb.
- Taniwha 5y agoThe main distinction is that the 16-bit RISCV-C ISA exactly maps to existing 32-bit RISCV instructions, its implementation only occurs in the decode pipe stage
- bpye 5y agoThe C extension is that, an extension. A RISC-V core with the C extension should still support the long encoding as well. There is no 16-bit variant specified, only 32, 64 and 128. There is an E version of the ISA with a reduced register set, but this is a separate thing.
- brucehoult 5y agoYou are mixing up integer register size and instruction length. RISC-V has variants with 32 bit, 64 bit, or (not yet fully specified or implemented) 128 bit registers. RISC-V has instructions of length 32 bits and, optionally but almost universally, 16 bit length.
- jaytaylor 5y agoI was surprised to find the top gOggle hits for "RISC-V fusion" (because I don't know WTF it even is) point to HN threads. Is this not discussed prominently elsewhere on the 'net? https://news.ycombinator.com/item?id=25554865 https://news.ycombinator.com/item?id=25554865 https://news.ycombinator.com/item?id=25554779 https://news.ycombinator.com/item?id=25554779 Is the Googrilla search engine really is starting to suck more and more, or is there something else going on in this case? The threads read more like a incomplete explanation with a polarized view than anything useful for understanding what fusion means in this context. Overall is give the ranking a score of D-.
- mda 5y agoTry 'risc V instructuin fusion" or "Risc V macro op fusion' Not that hard really. It is a well known subject. I hope people could stop whining everytime they mess up a search query.
- ksec 5y ago>I hope people could stop whining everytime they mess up a search query. I dont know. I have never seen anyone using the term "Fusion" by itself, may be it is specific to RISC-V crowd? It is always "macro-op fusion". So your parent 's search parameter isn't something out of order for someone how knows very little about hardware. And HN are full of Web developers so abstracted in the hierarchy they knows practically zero about hardware. And to be quite frankly honest the GP's point about Fusion had me confused for a sec as well.
- mananaysiempre 5y ago> ... is there something else going on in this case? There is: the term comes from general CPU design terminology and is not specific to RISC-V, although Google does find some RISC-V-specific materials for me given your query[1–3]. Look for micro- and macro-op fusion in Agner Fog’s manuals[4] or Wikichip[5], for example. [1]: https://riscv.org/wp-content/uploads/2016/07/Tue1130celio-fusion-finalV2.pdf https://riscv.org/wp-content/uploads/2016/07/Tue1130celio-fu... [2]: https://reviews.llvm.org/D73643 https://reviews.llvm.org/D73643 [3]: https://erik-engheim.medium.com/the-genius-of-risc-v-microprocessors-b19d735abaa6 https://erik-engheim.medium.com/the-genius-of-risc-v-micropr... [4]: https://www.agner.org/optimize/#manuals https://www.agner.org/optimize/#manuals [5]: https://en.wikichip.org/wiki/macro-operation_fusion https://en.wikichip.org/wiki/macro-operation_fusion
- ddingus 5y agoSo there really are more instructions in RAM, right? And then they get combined in the CPU, right? Won't those instructions need to be fetched / occupy cache?