Why x86 is unfathomably bloated

10 points by abnercoimbre 8 hours ago on lobsters | 14 comments

icefox | 7 hours ago

Very reductive view. OS's will use instructions that userland doesn't. Numerical code will use stuff that "discrete/logic problem solving" code like LLVM doesn't. Highly tuned numerical code will use stuff that numerical code doesn't. Who knows what the heck JIT's will use.

Really, it doesn't say "why", just makes a claim with a tiny shred of evidence. That's not exactly a convincing argument, let alone good science. Do the same experiment on arm32, arm64 and risc-v and compare.

I've done this sort of thing before, a couple times, though I admit not with much more depth.

abareplace | 4 hours ago

I did a similar analysis years ago. Most of instructions in a real program are dedicated to moving things between registers and memory, passing arguments, and calling functions. Complex instructions are quite rare.

icefox | 3 hours ago

Yep. I suspect they mostly make a difference in tight loops, but tight loops don't form most of a program's instruction count.

But all of these are measuring static instruction count, now that I think of it, which really is not what we usually care about. I would be interested to see something like one of these, but measure how many times each type of instruction is executed.

an_origamian | 8 hours ago

LLVM is a compiler. How much floating point does it do?

fzakaria | 8 hours ago

How important are those very used instructions though?

Not clear from that 1 liner if those are static binaries or it searches their whole closure of dynamic libraries.

david_chisnall | 6 hours ago

AArch64 has a bunch of conditional move variants. One of them is rarely used, but cuts the dynamic instruction count of the hot loop in some compression algorithms by over 10%, while adding almost zero area overhead to implementations. An analysis like the one in the article would tell you that it’s a pointless instruction.

fzakaria | 6 hours ago

That is exactly my thinking; there is probably some principle that the most impactful instructions are probably the least used. (Pareto?)

essen | 7 hours ago

This explains why x86 is so power-hungry compared to ARM or RISC-V.

The relative power consumption difference between something like x86 and arm are so multi-factorial putting it down to ISA encoding space bloat fells offensive.

What about the memory model? Who ever said the CPU core was the one consuming all the power? What about the micro-op cache?

classichasclass | an hour ago

There were some analyses a number of years ago that basically concluded energy consumed by the instruction decoder was easily dwarfed by other components of the chip - and I say this as an inveterate x86 detractor. It just doesn't seem to make much difference.

kev009 | 5 hours ago

Don't arm64 and powerpc64 have essentially the same magnitude (i.e. 1000) of instructions as amd64? And that has little to nothing to do with power efficiency.

icefox | 3 hours ago

Yep. I am not an expert but encoding complexity seems to be a bigger deal than just count. And the larger your chip is, the smaller instruction decoder is a smaller part of your chip in proportion.

classichasclass | 59 minutes ago

ppc64, definitely. There's a base set but the number to run most code (e.g., Linux) is at least 900.

olegkovalov | 7 hours ago

Better to check Chromium, LibreOffice, etc. Any specialized software will be biased. Same for Unreal Engine, more math ops.

But yeah, dat make sense that x86 is huge now.

abareplace | 4 hours ago

Comment removed by its author

chbarts | 41 minutes ago

Hey, welcome back to the 1980s! I mean, does the VAX really need all those opcodes? POLY? Really? What if we trimmed down the instructions to ones we can implement in a way that's easy to pipeline, don't do anything that needs a lot of complex state management with microcode, and shove a lot of registers into it?

OK, to save everyone the suspense: RISC came, RISC went, and it turns out the very-much-CISC x86 is capable of being made performant enough to beat even the architectures that have "neat tricks", like the SPARC with its register windows. We could definitely trim the x86, although when Intel tried it with the x86S it didn't do too well, but it doesn't actually seem to matter when you get right down to it. The x86 has BCD opcodes and a 16-bit mode and two privilege rings nobody seems to use and it's still a performance juggernaut.