by rob74 · 4y ago · 0 comments
By contrast, Apple was able to just create a new CPU based on the much more modern ARM architecture, and switch to it like they have already done two times before (from 68k to PowerPC and then to x86), because they control the whole Macintosh platform. Compare that to Microsoft's largely unsuccessful attempt of selling ARM-based Windows machines.
It's easy to take for granted how unusual it was the WinTel hegemony happened at all. As a fan of the breathtaking diversity of classic 80s desktop computing (Amiga, Atari, C64, Spectrum, MSX, etc), I lamented the steamroller of WinTel beige-box homogenization as it paved over so many divergent evolutionary branches. Yet the fact I can still install and run mass market consumer software products released in the mid-90s on Windows 11.
Yes, a high price was paid in both silicon and OS software to sustain such extraordinary backward compatibility - and is still being paid. While the utility of running circa-Win 95 software today in minimal, it's pretty amazing and I think the underlying stability in APIs, user interfaces and peripheral interfaces had under-appreciated positive impacts on the rapid prolife ation of desktop computing across society. Remember that the landline phone and cable companies initially envisioned the "home computer" to a be little more than a dumb terminal consumers would rent like a telephone handset. We're fortunate that vision failed when the commoditization of PCs allowed the home "internet terminal" to be a full user-owned and controlled computer with significant local processing and storage.
Wintel made a lot of good things possible that simply could never have happened in a fragmented market.
X86 instructions are variable-length: 1-15 bytes. And you do not know how long any instruction is until you read almost every byte of it (there is no length byte up front - it is just a list of prefixes). Thus to make a 4-wide decoder you need to ingest up to 60 bytes, and your decoder cannot start on instruction #2 till it finds the end of # 1. (Or guess, and rewind as needed). Much harder and a rather long dependency chain for decoder #4 to even get started.
Now say you want to go wider: 8-wide.
Arm64: copy and paste same decoders again. Done
X86: Now you need to ingest 120 bytes, and find even more boundaries, each depending on the previous - an even longer dependency chain. Decoder #8 cannot start till #1 - #7 are almost done. A mess nobody has managed to solve yet.
What an x86 processor does is fetch an entire cacheline of instructions at once. Working out which byte corresponds to instructions is a straightforward state machine--and state machines can be parallelized as reduction tree, because function application is associative! (This is usually described as "x86 processors start decoding, in parallel, every byte as if it were the start of a new instruction.) My guess for x86 is that resolving instruction length takes a single cycle, a single stage of the instruction decode pipeline.
It's actually hard to come up with x86 instructions that are 15 bytes long. Your typical general-purpose instruction is going to max out around 4 bytes (REX + other prefix + opcode + ModR/M byte), and even that's a little long. A "complex" memory instruction that moves a 4-byte constant into a register + constant offset will manage 12 bytes, but that's really the limit of practical instruction. So there's no point building a decoder capable of ingesting that many extra-long instructions a cycle because it is so synthetic a use case.
Sure, you could design a better compressed ISA for decoding than x86, but the impact of its complexity on processors is vastly oversold. Just look at how much die space the x86 decoders actually take up to see how little of an impact it has.
And how many instructions fit into it? Are you going to feed an 8-wide decoder with a single 64B cacheline? Especially with no promises that any instruction starts or ends on that boundary?
> It's actually hard to come up with x86 instructions that are 15 bytes long.
Something as simple and trivial as loading a 64-bit immediate into a register is a 10-byte instruction in x86... So for you to feed an 8-wide decoder even with such simple things as that, you're already at TWO cache lines ingested per cycle (80 bytes)... good luck with that...
I hear intel is hiring. Their current top of the line decoder is IIRC 5-wide. I am sure they’d like to hear your ideas as to how easy it is to decode x86 8-way
Of course internally the CPU has some huge number of registers. But it matters how many registers the machine code can speak of, and arm64 has 32 while x86 has 16. Consequently, x86 machine code has more cases of data flow obscured by spills to the stack. In a very sophisticated cpu, that might mean more decoding work to try to reconstruct the original data flow, or more likely (what’ll probably happen in most cpus), those spills will limit how wide the cpu can go.
I don’t know what limits you more in practice - the smaller number of registers or the variable length instructions. X86 throws at least one more limiter just for good measure: the TSO memory model, which causes memory effects to have dependencies between them in cases where they wouldn’t on arm.
Apple's M1 supports TSO (on ARM, obviously).
Microsoft failed at that multiple times in the past. Windows NT was initially available for multiple architectures, but that mostly ended with Windows 2000. Itanium got support until Server 2008 but non-server software support was very limited. Some Windows NT releases had a "workstation" label but application support, even from Microsoft, was between halfhearted and non-existent and the availability of some programs (such as Office) was almost a secret (I remember it existing for PPC, but never heard anything for MIPS or Alpha).
In a few months we will have both AMD and Apple on the same size, so we will finally get some idea of how the baggage compare then. It won't be a long situation, Apple will relatively soon after release a new on a smaller size again.
Like we just don’t know how much node size alone matters in the picture (or in the analogy, whether the improvement is only due to the bigger capacity battery vs better energy management at other places)
Yes, that's what interesting about this, how did they achieved the performance gap
How many more ARM chips have to get equivalent performance at a tiny fraction of the power before people will finally start considering that either AMD and Intel hire the most incompetent people out there or that ISA actually matters?
ARM could have extended their ARMv7 ISA to also be 64-bit without much trouble at all (plenty of space in the ISA). Instead, we got a ground up redesign that has more in common with MIPS64 than with ARMv7 (to the point that it's fascinating that ARM and some others bought MIPS just to get patent rights before immediately selling them off again).
I'm sure the go-to individual here is Jim Keller.
First, were his words free from constraint? If he said "x86 is crap and we should be using ARM or RISC-V" while working for those companies, how long would it take for him to be fired? Even if he were working at another company, saying that would burn a bridge that has kept him fed for decades. Would that be worth it?
He later said that if he were designing a new chip from the ground up, he'd probably go with RISC-V. He then proceeded to do that when he went to work for TensTorrent even though licensing ARM cores and adding their custom units on the side would be cheaper and faster to market. Given his connections, working with the AMD custom division would also be possible and would not only save some time and money for the startup, but would also have a massive set of available and heavily-optimized software working from the very start which would save even more money.
I'd say that his actions when free from corporate constraints show a definite opinion on the matter.
The TSO memory guarantee X86 is probably the exception, since Apple supports it on their M1s too for emulation.
I think it's significantly reduced the time / cost / difficulty in rolling out a new instruction set architecture.
Also, CPU technology (outside of tiny embedded chips) is a lot more uniform with fewer weird variations or cost-cutting shortcuts, and transistors are ridiculously cheap. You can assume 32/64-bit, little-endian, twos-complement math, IEEE-754 floats, etc.
LLVM is specifically meant to be a compiler backend that you write languages frontends against. It sort of solves the expression problem for programming languages, and there's a whole range of production-ready compilers out there using it. When they add support for an architecture, every one of those languages also gets a large part of the work to support it done for them.
ARM is nearly as old as x86 and has had just as many evolutions in architecture as x86.
In today’s world of “tick-tock-tock-tock-tock-tock” it’s easy to forget just how fast the semiconductor industry was moving during the 70’s-80’s. Just about every processor sold introduced a completely new architecture
Is that accurate?
x86 launched in 1978. (64bit in 2003).
ARM launched in 1985. (64bit in 2011).
> arm64 is the Apple ISA, it was designed to enable Apple’s microarchitecture plans. There’s a reason Apple’s first 64 bit core (Cyclone) was years ahead of everyone else, and it isn’t just caches.
> Arm64 didn’t appear out of nowhere, Apple contracted ARM to design a new ISA for its purposes. When Apple began selling iPhones containing arm64 chips, ARM hadn’t even finished their own core design to license to others.
> ARM designed a standard that serves its clients and gets feedback from them on ISA evolution. In 2010 few cared about a 64-bit ARM core. Samsung & Qualcomm, the biggest mobile vendors, were certainly caught unaware by it when Apple shipped in 2013.
> Apple planned to go super-wide with low clocks, highly OoO, highly speculative. They needed an ISA to enable that, which ARM provided.
> M1 performance is not so because of the ARM ISA, the ARM ISA is so because of Apple core performance plans a decade ago.
A715 in particular made it's decoder 20+% wider while reducing die area by 75% all due to eliminating 32-bit support.
https://m.gsmarena.com/arm_will_drop_32bit_support_in_the_bi...
ARM designs both the architecture specification and some reference designs. 32-bit support has been an optional part of the specification since ARMv8 in 2011.
The article you link is saying that ARM’s Cortex-A reference designs will no longer include 32-bit support, which has nothing to do with Apple since Apple uses their own custom designs. Apple dropped 32 bit support in their own designs in (IIRC) 2016.