3 ms·
You say that the benefit is 'huge' but why should I care about code density on a modern CPU with gigabytes of memory and large caches? From a performance persp
by klelatti 5y ago
You say that the benefit is 'huge' but why should I care about code density on a modern CPU with gigabytes of memory and large caches?
From a performance perspective what is the evidence that this actually provides an advantage?
- zozbot234 5y agoBecause the fastest cache levels are tiny, even in the largest and most advanced CPU's. There's plenty of evidence for the performance benefits of improved density and terseness in both code and data.
- klelatti 5y agoThe M1 has a 192k instruction cache for performance cores which is not ‘tiny’. If there is lots of evidence for the performance benefits of improved density vs the alternative of fixed instruction width in real world CPUs then I’m sure you’ll be able to cite it.
- snvzz 5y ago>The M1 has a 192k instruction cache for performance cores which is not ‘tiny’. ARMv8 and ARMv9 have poor code density. These cache are large as a workaround to that. This isn't free, as besides making the die larger (and thus lower yields), the L1's clock speed is limited due to its size.
- avianes 5y agoTo clarify, I'm not saying that RISC-V code density of C extension is a big advantage over its competitors, but it is a huge benefit for RISC-V. You are right, code density is perhaps not that critical today. And it is difficult to quantify its relevance as code density is always related to other variables such as instruction expressiveness, numbers of uop emitted, etc. But I still think that code density is important for RISC-V. Because RISC-V philosophy to reach high performance is to use very simple instructions that can be combined together and take advantage of macro-op fusion. I think RISC-V without macro-op fusion can't reach the performance of other ISA. But RISC-V with all these simple and not very expressive instructions and without C extension has a pretty bad code density which could cost a lot because it is not at the competitors' level. So if we think of RISC-V as a macro-op fusion oriented ISA, then the C extension becomes important to be competitive. I don't know what is better between a "macro-fusion" oriented arch or a "complex-instruction" oriented arch, future will tell us.
- klelatti 5y agoThanks for clarifying - interesting to see a different philosophy being tried.