| > Much content on HN says the opposite 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. |
I generally agree, but want to point out that they aren't "free" either. Look at contemporary wide OoO Arm cores, most (Apple Silicon, C1-Ultra, ...) have half the throughput on flag reading/writing instructions than the equivalent instruction without the flag write (ADD vs ADC vs ADDS). So clearly the cost is high enough to drive towards such tradeoffs being made.