by sylware · 2w ago · 0 comments
The transition is going, if any, will be tough: basically you would need a "x86_64" hardware 'slow' mode, on the side of the 'clean' and light RISC one.
z/Arch, x86, ARM, PowerPC, and SPARC all have condition codes. They all have OOO implementations and all but SPARC have really, really fast implementations.
---
µops are not at all like RISC instructions. They tend to be quite big, for example, or have really strange encodings (that vary from place to place inside the CPU). A group of 2-4 µops may share a single wide literal field (or bigger literals will be encoded with a number of µops or something else crazy).
Pentium Pro (P6) had a µops length (at some point inside the CPU) of around 115 bits, for example.
µops also typically expose the pipeline(s) to some extent which is just ugly and very, very for from being clean.
You don't have to look far, the RISC-V spec makes this incorrect claim.
> µops are not at all like RISC instructions
Yeah. Zen μops are actually documented to be variable length (at least when stored in the μop cache, but presumably elsewhere). And μops hold both a memory load and an ALU operation... very CISC.
It's only the full read-modify-write instructions that still get split into two μops. And I doubt it's actually two fully independent μops, because seems a waste to send the instruction through the AGU twice.
And RISC-V as its sweet spot roughly set for implementation simplicity, namely some core design choices show a strong difference here.
Obviously µops are encoded specific to some µarchitecture, but their "operations" may tell us what would be a "good" ISA for performance, and many seem to agree that this ISA would be "RISC" based. This what I intended to say.
Doesn't mean they are right. It's mostly just RISC-V fans blindly repeating the RISC-V justification for not having flags without understanding the situation.
And it's only RISC-V (and MIPS before it) which sticks to this position. Most other high-performance RISC arches have flags. Including ARMv8, a complete departure from 32-bit ARM, and one which was explicitly designed with high-performance OoO cores in mind. ARMv8 dropped many fun RISC features from Arm32, but they kept flags.
Really, the cost for flags on OoO cores isn't that high. You have already implemented everything you need to rename regular registers, which you can reuse to implement flag renaming too. It costs a tiny bit of area and maybe a little routing complexity, but doesn't have any impact on fmax.
> but their "operations" may tell us what would be a "good" ISA for performance, and many seem to agree that this ISA would be "RISC" based.
Well... given that the current μops of x86 cores aren't RISC-like, (because they are variable length, and aren't load-store), your suggested philosophy would not result in a RISC-like replacement ISA for x86.
Like, the weaker form of your argument is probably correct. If we were designing a replacement x86 ISA, then the current μops of various x86 implementations would be a good inspiration for informing what that ISA could look like.
It's only the strong form that I disagree with: There is no good reason for any ISA to be a 1:1 mapping of the μops it decodes into. And there are many good arguments for not doing that. μops can be arbitrarily wide, as they are only used for internal purposes. Instructions need to be dense and compressed, as code density can have a large impact on performance. There is no good reason why a single instruction shouldn't decode to two or even hundreds of μops... that's just good compression.
Not only are they compact, they also make it crystal clear that the cache line in question should be marked exclusive as soon as it gets read.
The x86 does not have that much implementation complexity. There's the complexity you always get from high-performance implementations, but Apple, ARM, and IBM pay for that, too. The main issue is that there's just a lot to implement and verify.