Image couldn't load - you don't seem to have IPv6 connectivity

iljitsch.com

blog topics: BGP · IPv6 · more · my publications · my business: inet⁶ consult · contact: Twitter · LinkedIn · email

Transitioning the Mac from Intel to ARM CPUs (posted 2020-06-12)

There have been rumors that Apple will transition the Mac from Intel CPUs to ARM CPUs designed by Apple itself have been around for some years, and now they've come to a head: apparently, Apple will announce the transition at their WWDC conference a week and a half from now.

CPU transitions are nothing new for Apple. Back in 1984, the original Mac had a Motorola 68000 CPU. This was an advanced CPU at the time, running 32-bit software when cheap computers still used 8-bit 6502 or Z80 CPUs and PCs used 16-bit 8086 CPUs. Still, ten years later the 68000 family had run out of steam and Apple transitioned the Mac to PowerPC CPUs made by Motorola and later IBM.

However, PowerPC CPUs use a completely different instruction set than the one used by the 68K series. Apple largely solved that issue by including an emulator in the system that lets the PowerPC CPU execute 68000 code. Of course new software would be written for the PowerPC CPU. But apparently a good amount of 68000 code persisted for years in classic MacOS. A decade later, it became apparent that the PowerPC was no longer competitive with the Intel and AMD CPUs used in PCs. So in 2005, Apple announced that it would transition to Intel x86 CPUs. (Descendants of the 8086.) Again, Apple provided a way to keep old code running, this time using the Rosetta "dynamic binary translator". However, Rosetta was only used for PowerPC applications, not for parts of the system. These were all 100% x86.

Applications built using Apple's (still new) Xcode development environment would ship as "fat binaries" that contain both PowerPC and x86 code, so the app would run at maximum speed on both types of Macs. In fact, the last PowerPC G5 CPUs and the Core 2 Duo Intel x86 CPUs that Apple started shipping in 2007 were 64-bit CPUs. So a fat binary could even contain 32-bit PowerPC, 64-bit PowerPC, 32-bit x86 and 64-bit x86 code.

The transition from PowerPC to x86 was more complex than the one from 68K to PowerPC because 68K and PowerPC are both "big-endian" while x86 is "little-endian". What that means is that when the CPU stores the 16-bit binary value 11111111000000 in memory at location 3500, in big-endian, location 2000 holds 11111111 and 3501 holds 00000000. In little-endian, the lower part of the number comes first, so 00000000 in 3500 and 11111111 in 3501.

Shortly after announcing the transition to Intel CPUs, Apple allowed developers to buy/rent a development machine with an Intel CPU to test their applications. After the transition, they had to return that system to Apple.

So now, a decade and a half later, it looks like Apple is doing it again.

There are of course many questions. One is whether Apple will transition the entire Mac line, or maybe use ARM for the laptops and keep using Intel for the high end desktops, most notably the Mac Pro. Apple is leading the industry with its high performance ARM CPUs that it uses in the iPhone and iPad. In benchmarks such as Geekbench they often out-perform Intel CPUs, especially for single core tasks. However, I'm not sure how reliable Geekbench is. Also, running very fast for a few seconds is one thing, but doing the same for many minutes is very different and requires a good cooling system.

Also, does it make sense for Apple to compete with Intel and AMD for the highest performance CPUs? Apple doesn't sell too many of these high end systems, so it would be hard to recoup any investments. Still, the rumors indicate that the whole line will transition. But I still expect the non-pro laptops to adopt ARM first and the pro desktops to be the last.

Another big question is whether there will be some kind of emulation or translation this time, so existing x86 apps can run on the new ARM Macs. On the one hand, Apple is a forward-looking company that doesn't like bending over backwards to maintain the status quo. But they're also pragmatic if they need to be. For instance, they only shipped 32-bit Intel CPUs for about a year, but they didn't wait for 64-bit ones and subsequently had to support 32-bit CPUs for a good number of years.

All in all, I think they'll skip emulation and translation. They killed off 32-bit applications last year with MacOS 10.15 Catalina. There's probably still a few applications that are built with other tools than Apple's Xcode, but those must be very rare. Obviously Xcode will make it as easy as possible to create a fat binary with 64-bit x86 and 64-bit ARM code. So any application under active development, which of course includes Apple's as well as the big ones from Microsoft and Adobe that are sold as subscriptions, should be available as fat binaries that run on ARM Macs quickly, if not immediately. And that's probably enough for a good swath of Mac users.

I do wonder how many changes are necessary for existing apps to compile for and run on ARM. As ARM is little-endian like x86, and hand-crafted assembly code that was still common in the 1990s is barely used anymore, I believe "porting" applications to ARM will be very easy.

But what about testing? Do developers need an actual ARM system running MacOS to test their applications, or will the ARM versions behave the same as the x86 version so separate testing on ARM is unnecessary? (Obviously it helps to have an actual ARM system to test ARM-specific features and optimize performance.) Apple could sell/rent development machines like in 2005, but that seems difficult, with so many developers and all the current logistics/economics issues. I'm sure many people within Apple won't like the idea of using an iPad with a keyboard and a mouse or trackpad as an ARM development system. Then again, those iPads are already out there and can go back to being regular iPads after the transition is over, so it's a very pragmatic solution. Or perhaps emulation will work in the opposite direction this time around: a very precise ARM emulator so developers can test their applications without needing ARM hardware.

It's all very interesting, but at the same time I'm in no hurry to upgrade to an ARM Mac. I just hope that this transition will end the relentless push to change all kinds of things in MacOS and allow some time for consolidation and stability. With the Intel transition, I waited until 2007 and was pretty happy with the MacBook Pro I got then. So I'd be surprised if I ended up with an ARM Mac before mid-2022.

by .


Archives: 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020