3 ms·
> Actually, it turned out not to be that good a decision. The generated code is far less compact than x86 That isn't true with x86-64. I've measured the averag
by pcwalton 11y ago
> Actually, it turned out not to be that good a decision. The generated code is far less compact than x86
That isn't true with x86-64. I've measured the average instruction size of x86-64 in the wild and it ends up being almost exactly 4 bytes. REX prefixes add up fast.
- closure 11y agoSo across 64-bit ARM and x86-64, what is the ratio of instructions across the same program compiled by effectively the same compiler (modulo of course maturity in code selection and peephole optimization)? My guess is that x64-64 still saves quite a few pages of memory over 64-bit ARM on a large program.
- stephencanon 11y agoAs an experiment, I built CLAPACK (v3.2) for both arm64 and x86_64 with an up-to-date clang. x86_64 size: 5.2M arm64 size: 4.4M So on at least some large codebases, arm64 looks pretty efficient.
- haberman 11y agoThis isn't a robust counter argument for the same reason that clock speed is not a robust measure of overall cpu performance: not all instructions (or cycles) achieve the same amount of work.
- pcwalton 11y agoSure, but the advantage in terms of expressiveness surely goes to 3-address instructions (ARM) ather than 2-address ones (x86). See the sibling comment for an example of ARM being more compact in practice. The only way x86 could possibly pull ahead with a less expressive ISA would be if they got smaller instructions out of it, but they don't (thanks to the bloated REX prefixes).
- haberman 11y agoAs a RISC architecture, ARM makes loads and stores explicit. x86 can add/multiply to a memory location in a single instruction. AFAIK in ARM that would be three instructions. I think you'd definitely need to measure this before being able to claim what would "surely" be true.