News for hackers. Stuff that matters.
Re:Three of Apple and Google’s former star chip designers la... by tyingq on Saturday November 23, 2019 @08:00AM (#21613885)
Interesting view. The SIMD, Vector, and Hypervisor RISCV extensions, as well as things like OoOE seem to contradict your claim. Are you saying they intended to target the high end, and failed? Or that they never intended to target the high end?
Re:Three of Apple and Google’s former star chip designers la... by Symmetry on Saturday November 23, 2019 @08:57AM (#21614118)
There are a lot of things about the RISCV design that come from a very ideological place and hurt in a high end design. Yes, there are extensions and designs with high end features, that's certainly true, and I'm sure people someone will be making a high end version at some point. But the ISA isn't very well suited to it compared to Power or ARM.

By default, code density on RISC-V is pretty bad. You can try to solve that by using variable length instructions which many high end RISC-V projects intend to do but having variable length instructions means your front end is going to have to be more complicated to reach the same level of performance that a fixed width instruction machine can achieve.

More instructions for a task means your back end also has to execute more instructions to reach the same level of performance. One way to do better is to fuse together ISA-level instructions into a smaller number of more complex instructions that get executed in your core. This is something that basically every high end design does but RISC-V would have to do it far more extensively than other architectures to achieve a similar level of density on the back end which makes designing a high end core more complex and possibly uses extra pipeline stages making mispredicts more costly.

And more more criticisms here: https://gist.github.com/erincandescent/8a10eeeea1918ee4f9d99...

EDIT: But in fairness it looks like conditional move might be getting added to the bit manipulation RISC-V extension which would fix one big pain point.

This isn't to say that RISC-V is bad. It's simplicity makes it wonderful for low end designs. It's extensibility makes it great for higher level embedded uses where you might want to add some instruction that makes your life easier for your hard driver controller or whatever in a way that would require a very expensive architecture license if you were using ARM. It's open, which would be great if you were making a high end open-source core for other people to use except the Power ISA just opened up so if I were to start a project like that I'd use that instead.

Re:Three of Apple and Google’s former star chip designers la... by zozbot234 on Saturday November 23, 2019 @09:07AM (#21614167)
> By default, code density on RISC-V is pretty bad.

Code density with the C extension is competitive with x86, which is very good for a RISC. And the C extension is not even that hard on the decoder, since most or even all 'compressed' instructions have a single uncompressed counterpart. It's easier to implement than what ARM32 does with Thumb.

> One way to do better is to fuse together ISA-level instructions into a smaller number of more complex instructions that get executed in your core.

Insn fusion has in fact been endorsed by the designers of RISC-V as an expected approach in high-end designs. The RISC-V spec even gives "suggested" sequences for things like overflow checking, that can be transparently insn-fused if an implementation supports it.

Re:Three of Apple and Google’s former star chip designers la... by Symmetry on Saturday November 23, 2019 @09:19AM (#21614213)
Yes, RISC-V's instruction compression is easier to use than Thumb. But there's a reason no arm server uses compressed instructions and ARM dropped it from A64.
Re:Three of Apple and Google’s former star chip designers la... by jabl on Saturday November 23, 2019 @06:18PM (#21617286)
I don't think it's as easy as saying that Aarch64 dropped thumb, therefore compressed instructions are dumb.

- Like somebody already pointed out, thumb is a different mode, whereas RISC-V C (RVC) can be freely mixed with normal 32-bit instructions.

- And speaking of higher end processors, x86 does very well in that space despite requiring much more complex decode than RVC.

- Aarch64 has more complex addressing modes (base + index<<shift in particular) whereas RISC-V needs both RVC and fusion to do the same with similar code size and execution slot occupation. Personally, I'm leaving towards thinking that it was a mistake for RISC-V to not support such addressing modes. Unless you're aiming for something really super-constrained in terms of gate counts, having an adder and small shifter as part of your memory pipeline(s) seem like an obvious choice. And thus, having single instructions to use those pipelines isn't really committing any sins against the RISC philosophy.

Re:Three of Apple and Google’s former star chip designers la... by atq2119 on Saturday November 23, 2019 @10:10AM (#21614475)
Enlighten us: what is that reason?
Re:Three of Apple and Google’s former star chip designers la... by Symmetry on Saturday November 23, 2019 @02:45PM (#21616066)
As far as I can tell the reason is that with variable length instructions you have a mux layer between fetch and decode that sends the right set of bytes to the right decode slot. Your first set of 16 bits is certainly going into the first decoder but your fourth might be going to the second, third, or fourth depending on previous decoding. Or maybe not, I've only worked with fixed width instructions when getting into the weeds of processors and only entirely designed a simple five stage classic RISC myself. So don't take the above too seriously.

What you should take seriously is that three of the four big RISC ISAs - MIPS, ARM, and POWER - all have extensions for variable length instructions. They all use them in embedded systems where program memory size is a big factor in your bill of materials and reducing that can save you money. But none of them use it on their high end processors. So I think we can conclude that the power/transistor cost of fetching a number of variable length instructions per clock is higher than the cost of expanding the L1 instruction cache to deal with full size instructions.

Re:Three of Apple and Google’s former star chip designers la... by legulere on Saturday November 23, 2019 @03:57PM (#21616494)
Thumb works as an alternative encoding that you have to switch to and where you just have a subset of the instructions available. Switching has at least the same cost as a branch. My guess is that this is the reason why thumb is avoided often.

RISC-V on the other hand has an encoding scheme that already from the beginning allowed instructions with longer and shorter encodings. You can just mix compressed instructions with normal ones.

Re:Three of Apple and Google’s former star chip designers la... by atq2119 on Monday November 25, 2019 @04:33PM (#21633044)
Thank you for clarifying. It still seems wrong, somehow. Admittedly I don't know enough detail about Thumb and the others, but if the variable-length encoding is a simple design like RISC-V's, it's hard to imagine that extra layer to be so expensive as to eliminate the benefits of an effectively increased I$. It would be nice to be able to dig deeper into the details of this.
Re:Three of Apple and Google’s former star chip designers la... by monocasa on Saturday November 23, 2019 @03:42PM (#21616395)
At most, you're looking at an extra pipeline stage for all of that. The less I$ pressure is almost certainly worth it.

The real cost you're looking at is the complexity for instructions to straddle cache lines and MMU pages, but even then it's less of a deal than you might think.

Re:Three of Apple and Google’s former star chip designers la... by Taniwha on Saturday November 23, 2019 @06:06PM (#21617229)
Nope, done right the cost is a layer of 2:1 muxes and some control logic to pass data between decoders, and 16 flops to hold a partially decoded instruction between fetch bundles
Re:Three of Apple and Google’s former star chip designers la... by atq2119 on Monday November 25, 2019 @04:29PM (#21633015)
It's more complicated than that if you want to decode multiple instructions per cycles, which you have to for high-end designs. I still agree with monocasa that it's almost certainly going to be worth it for the reduced I$ pressure.
Re:Three of Apple and Google’s former star chip designers la... by monocasa on Saturday November 23, 2019 @06:15PM (#21617274)
For sure, it's just that this little bit could necessitate a pipeline stage if that was the critical timing path somehow already. Just trying to be as friendly to their argument as possible before taking it on.
Re:Three of Apple and Google’s former star chip designers la... by Someone on Saturday November 23, 2019 @06:00PM (#21617193)
x64 has that problem, in the extreme (max length of an instruction is 15 bytes) doesn’t it?

It must be a pain to design its instruction decoder, but I don’t think that’s insurmountable for high end processors.

Or do I misunderstand your argument?

Re:Three of Apple and Google’s former star chip designers la... by Symmetry on Sunday November 24, 2019 @08:49AM (#21620389)
Yes, it certainly does. As far as I can tell it takes more engineer hours to make an efficient x86 front end than it does a RISC front end and the RISC designs I see tend to balance their pipelines so that they're wider in front than x86 designs typically are. Everything here is a matter of "all else being equal" and the talent and hard work of the design team are more important than any of the ISA differences we're talking about here.