This is the one in which facts are unequivocal. In 64 bit ISAs RISC-V code is consistently on average 20% or more smaller than x86_64 or arm64.
Anyone can verify this. Download the same version of the same OS e.g. Ubuntu 24.04 (or run them in Docker w qemu emulation, which only takes seconds) and compare the size of various programs that will have the same source code compiled regardless of the ISA e.g. bash, emacs, less ... take your pick. Use the `size` command and look at the TEXT size.
That's a flawed experiment. One should compare the same code compiled using either
-O0
or
-Os
. The reason being that current RISC-V cores are tiny, often lack vectorization, and don't benefit as much from loop unrolling as current ARM and x86 cores that
do have vector instructions and much larger physical register files.
I'm not saying it would completely upturn your findings, but if we take the example of vectorization - any time a compiler vectorizes a loop without knowing whether the number of iterations will be a multiple of the vector size, it has to generate another set of code to deal with the remainder. Because RISC-V isn't being compiled with vector support, it doesn't get an extra copy of loops like that.
You simply can't get into the kind of mess that Qualcomm is finding itself in with the Nuvia acquisition and using the core they designed. We kind of knew that Qualcomm and Apple (etc) can't license their Arm-compatible cores to someone else, but no one (including Q) had any idea that you also could not use someone else's Arm-compatible core by buying the company.
Actually, that's an oversimplification. Nuvia knew quite well that their Architecture License was non-transferrable. The reason Qualcomm thought it wouldn't be an issue is that they
also had an Architecture License. One significant point in the trial was how Nuvia
also had a Technology License and their design contained a tiny bit of IP from it. It seems more clear that this wouldn't be transferable, but they apparently decided not to worry about that.
This would be like someone licensing an IP core from SiFive, but then designing their own core and using a little bit of SiFive's IP in it, but then treating the core as their own. In fact, such a situation might've actually happened with Tenstorrent, who did start out using SiFive's cores before designing their own Ascalon cores. I doubt they'd be that brazen, but then I wouldn't have expected Nuvia to have an ARM Technology License, either.
At the low end, RISC-V has a lot of optional extensions that you can leave out if you don't need them, saving silicon area, cost, and energy consumption. Arm doesn't allow subsetting their ISAs. There are some optional things, but the compulsory base is very large -- similar to RISC-V's RVA23 etc profiles that specify a fixed and largish set of extensions for machines running Linux / Android etc.
That's a little bit of an apples vs. oranges comparison, because if you're designing a tiny embedded ARM, you'd use ARM's M-profile, not A-profile.
Also, what ARM does is to have a base ISA with lots of optional extensions you can take or leave. Granted, ARMv9-A rolls in a lot of the optional extensions from the ARMv8-A family. I think most distros' ARM images are still targeting baseline ARMv8-A, which is roughly akin to compiling for x86-64. That leaves out a lot of extensions.
I think most distros for RISC-V target RVA23, which is a similar situation to the above, except you don't even get NEON/SSE-level vector instructions.
And there are some things Arm simply doesn't offer, such as a 64 bit version of the Cortex-M0. Arm's 32 bit and 64 bit ISAs are very different
What ARM seems to be doing is focusing on Cortex-R as their embedded 64-bit ISA. Perhaps this is partly a consequence of RISC-V eating up so much of the low-cost microcontroller market than ARM doesn't want to invest a lot more in it.
As for AArch64 differing from AArch32, that's called
evolution. It's because the 64-bit ISA was designed long after the 32-bit one, not unlike how x86-64 came long after the 80386 extended x86 to 32-bits.
Such ISA evolution will certainly happen to RISC-V world, as well. There are limits to what you can do with ISA add-ons - sometimes, you need to introduce incompatibilities or do an even bigger reworking. Maybe it'll be called RISC-VI, by that point, but it will still put implementers in an awkward position of probably having to support both, for a time.