7 ms·
I can tell you what's missing: a POPCOUNT instruction. Yes, there is one in the proposed "B" extension. Not good enough: it won't be in the smaller chips, or e
by ncmncm 6y ago
I can tell you what's missing: a POPCOUNT instruction.
Yes, there is one in the proposed "B" extension. Not good enough: it won't be in the smaller chips, or even in the biggest ones for a good while.
But the article is interesting in noting all the stuff that we just don't see when we buy a gadget. The amount of sheer engineering effort that goes into real products that millions of people rely on is stunning. It takes a very large amount of actual money changing hands to generate the amount of invisible effort that is needed to support the things we use every day. The lack of that expenditure will make RISC-V adoption much slower than we might otherwise expect.
- avianes 6y ago> it won't be in the smaller chips, or even in the biggest ones for a good while. Where does this statement come from? Do you have any sources or arguments to justify that?
- AnimalMuppet 6y agoI'm not the one you're asking. But... there's many a slip between spec and chip. That is, creating a spec that says that it includes a POPCOUNT instruction is easier (except perhaps for politics and bureaucracy) than actually implementing one in a chip, going through layout, producing masks, and starting production. Then it takes a while for those chips to work their way through the supply chain to general availability. How long? I don't know. But I suspect that it's a non-trivial amount of time. How long until that instruction is available in all chips that are manufactured? Longer.
- avianes 6y agoFrist, we are talking about RISC-V. The ISA is not finished. So yes, it will take time, but that's not the point. > How long until that instruction is available in all chips that are manufactured? Longer. The author didn't say it would take a long time, he said that "it won't be in the smaller chips". And "even in the biggest ones for a good while". But what is "for a good while" when nobody is already using RISC-V for performance?
- AnimalMuppet 6y agoIn your last paragraph, you sound like you're agreeing with ncmncm (that it will be a while), but arguing that it doesn't matter. (Or are you arguing that we can't tell how to define "for a good while" because nobody is already using the chip for performance?)
- avianes 6y agoI agree that the transition to RISC-V (if it's going to happen) will take time, I do not agree that it will take even longer for the B extension. That's why I disagree with him.
- brandmeyer 6y ago> but that's not the point. Its 2020. We've known how RISC machine's evolve for 3 decades or so, yet RISC-V rewound the clock almost back to the beginning. "Let them eat extensions" is a recipe for fragmentation. MIPS actually experienced this in the field. ARM floating-point did for many years, too.
- andrekandre 6y ago> "Let them eat extensions" is a recipe for fragmentation. not neccessarily in machine mode (think firmware or hypervisor level) you can trap on unrecognized instructions and handle them retroactively in software), so maybe fragmentation wont be (at least technically) a big issue....
- brandmeyer 6y agoI remember the awful days of fake hard-float support in ARMv4. Trapping to the kernel and doing soft float there was was 10x worse than just doing soft float in userspace in the first place. Now, imagine doing that for xor-and-rotate, or bitfield insert/extract. Or leading zero count, or indexed memory access. No. Thanks.
- 6y ago
- ncmncm 6y agoI am the one you are asking. Manifestly, the B extension isn't in any of the chips being produced now, to my knowledge. It's a proposed extension, not finalized. So, until it is finalized, I don't expect it to be implemented in production. We don't know how long it will be until it is finalized, but the draft had not been updated in more than a year, when I last checked. For all we know, it may never become a standard extension. Somebody said they were trying to get the POPCOUNT instruction removed even from the extension, or made an optional part of it. It's a large extension, so (like other large extensions) it won't be implemented on the smaller chips that will also lack, e.g., floating point or vector units, or 64-bit registers and instructions, and for the same reason. I don't know why I would need sources. What seems surprising about the statement that something that is not considered finished is not being built into chips, or that something huge will not be included in small chips?
- avianes 6y ago> Manifestly, the B extension isn't in any of the chips being produced now The RISC-V chips produced today are not made for performance or be competitive, they are proof of concepts, toys and prototypes. The current state of the RISC-V spec is not competitive with either ARM or x86. Therefore why use this as a comparison point? > It's a proposed extension, not finalized. Like many other extensions such as the Packed SIMD one, the Vector one and Hypervisor one. These 3 are probably even more important than bit manipulation for performance and are not finalized either. The RISC-V ISA is still under construction. > It's a large extension, so (like other large extensions) it won't be implemented on the smaller chips that will also lack. Did you know that it's stipulated in the RISC-V spec that instructions not present in the hardware can be emulated in software? This makes it possible, in a small chip, to handle an extension as large as B without the need to implement all the instructions. > For all we know, it may never become a standard extension. Somebody said they were trying to get the POPCOUNT instruction removed even from the extension, or made an optional part of it. > I don't know why I would need sources. You need a source because you make surprising assertions.
- ncmncm 6y agoI see that you do not understand that an emulated popcount instruction would be worse than useless. If you found anything I said surprising, it is only by not having thought things through. You would better learn to do that.
- cpeterso 6y agoTIL that “popcount” is an abbreviation of “population count”.
- cpach 6y agoAs someone not familiar with hardware at this level, what is the significance of leaving out popcount?
- Const-me 6y agoSome algorithms and data formats become couple times faster when appropriate bit manipulation instructions are used. Check this PR where I managed to substantially speed up an open source library: https://github.com/AcademySoftwareFoundation/openvdb/pull/493 https://github.com/AcademySoftwareFoundation/openvdb/pull/49... That's just 3 instructions, bsr, bsf, and popcnt.
- cpach 6y agoCool! Quite interesting discussion in the PR.
- ncmncm 6y ago40% overall performance improvements are often welcomed.
- Const-me 6y agoThat OpenVDB data structure is a sparse hierarchical collection with a huge count of small 3D blocks of voxels. They use bit masks in the blocks to track which voxels are empty, and which contain the payload data or higher resolution child blocks. That’s why these bit manipulation instructions contributed that much to the overall performance of the library. I saw similar approach in other software as well. Not necessarily for voxels, also 2D data, and trees where nodes use bits to track children.
- ncmncm 6y agoBitmap representations are seriously underused throughout the software world. I am used to getting 10x performance improvements where they are first introduced. A popcount instruction often accounts for much of that.
- gchadwick 6y ago> Yes, there is one in the proposed "B" extension. Not good enough: it won't be in the smaller chips, or even in the biggest ones for a good while. The lowRISC Ibex core which I work on and whilst not the smallest core is definitely at the small end has full bitmanip extension support: https://github.com/lowrisc/ibex https://github.com/lowrisc/ibex Yes the extension isn't finalised yet but we're not expecting much change so we can tweak the implementation to match the ratified standard when it appears. I'd also note bitmanip is broken up into subgroups so it's possible smaller cores will only implement the simple stuff (e.g. Popcount) to avoid the overhead of the full implementation.
- ncmncm 6y agoAre there any such chips? Do we know when there will be any, or whether?
- monocasa 6y agoThe cores I compare the smaller RV cores to (the ARMv*-M cores) don't seem to have a popcount instruction either, not even in their new Helium vector ISA. If it's a deficiency at that gate count, it's one RV doesn't have to compete on it seems.
- ncmncm 6y agoMeaning, it offers no advantage over them? How does that make it better able to compete? When you are coming from far behind, as RV is, you need to be better just to pull even.
- monocasa 6y agoI'm saying the lack of a popcount isn't a deficiency, considering that it's competitors don't have it either. And given the huge amount of work ARM put into the Helium ISA, I wouldn't be surprised if the instruction simply didn't make sense at that gate count anyway. For cores that go down to 12K gates like a CortexM0 or the smaller RV32E cores, popcount in the ALU is a distinct non zero cost. And yeah, you for sure need to be better to compete. Zero fees is a large chunk of what'll get you there for these tiny cores. When you're being compared on borderline ascetic area efficiency, adding features works against you.