Arm vs x86 - Key Differences Explained

preview_player
Показать описание
With Apple moving away from Intel and making its own CPUs based on the Arm architecture, it is important to understand the differences in the history, architecture, and design philosophies between these two giants.

History of x86 - 0:28
History of Arm - 3:56
History of Apple using Arm - 7:45
Differences - 11:40
CISC vs RISC - 13:30
False Assumptions - 16:07
Future - 19:05




#garyexplains
Рекомендации по теме
Комментарии
Автор

The biggest problem that x86 has are its strong guarantees. Every CPU architecture gives programmers implicit grantees. If they require guarantees beyond that, they have to explicitly request those or work around the fact that they are not available. Having lots of guarantees makes writing software much easier but at the same time causes a problem for multicore CPUs. That's because all guarantees must be uphold across all cores, no matter how many there are. This puts an increasingly amount of burden on the bus that interconnects the single cores, as well as any shared caches between them. The guarantees that ARM gives are much weaker (just as the ones of PPC and RISC-V are much weaker), which makes it much easier so scale those CPUs to a bigger amount of cores, without requiring a bus system that needs to become drastically fast or drastically complex, as such a bus system will draw more and more power and at some point become the bottleneck of the entire CPU. And this is something Intel and AMD cannot change for x86, not without breaking all backward compatibility with existing code.

Now as for what "guarantees" actually means, let me give you some examples: If one core writes data first to address A and then to address B and another core monitors address B and sees it has changed, will it also see that A has changed? Is it guaranteed that other cores see write actions in the same order they were performed by some core? Do cores even perform write actions in any specific order to begin with? How do write actions and read actions sort towards each other across cores? Do they sort at all? Are some, all, or none of write actions atomic? Over 99% of the time none of these questions matter to code that you write, yet even though less than 1% of all code needs to know the answers to these questions, the CPU has to stick to whatever it promises 100% of the time. So the less it promises, the easier for the CPU to keep it and the less work must be invested into keeping it.

When Microsoft switched from x86 in the fist Xbox to PPC in the Xbox360, a lot of code broke because that code was not legit in the first place. The only reason why this code was working correctly so far were the strong guarantees of the x86 architecture. With PPC having weaker guarantees, this code would only work sometimes on these CPUs, causing very subtle, hard to trace bugs. Only when programmers correctly applied atomic operations and memory barriers, as well as used guarded data access (e.g. using mutexes or semaphores), the code was still working correctly as when using these, the compiler understands exactly which guarantees your code needs to be correct, and knowing for which CPU you are compiling, it also knows whether it has to do something to make your code work correctly or whether it will work correctly "on its own" as the CPU gives enough guarantees for that, in which case the compiler will do nothing. I see code every second day that only works coincidentally as it's being used on a CPU that has certain guarantees but this very same code would fail on other CPUs for sure. At least if they have multiple cores, there are multiple CPUs in the system, or the CPU executes code in parallel as if there were multiple cores (think of hyper-threading).

The guarantees of x86 were no issue when CPUs had a single core and systems had a single CPU but they increasingly become an issue with the number of cores rising. Of course, there are server x86 CPUs with a huge number of cores but take a look at their bus diagrams. Notice how much more complex their bus systems are compared to the consumer x86 CPUs? And this is an issue if you want fast CPUs with many cores running at low power, providing long battery life and not requiring a complex cooling system or otherwise will run at very high temperature. And cores is currently the easiest way to scale CPUs, as making the cores run at higher speed is much harder (the clock frequency of CPUs is currently usually below what it used to be before all CPUs got multicore) and it's even harder to make the CPU faster without raising clock frequency and adding more cores as most optimizations possible have already been done. That's why vendors need to resort to all kind of trickery to get more speed out of virtually nothing and these tricks causes other issues, like security issues.

Think of Meltdown, Spectre, and Spectre-NG. These attacks used flaws in the way how optimizations were implemented to make CPUs faster without actually making them faster, e.g. by using speculative execution, so the CPU is not faster but it still can perform work when it otherwise couldn't and it it was doing the work correctly, it appears to be faster. If what it has just done turns out to be wrong, though, it had to rollback what it just did and this rollback was imperfect as they didn't clean up the cache, thinking that nobody can look directly into it anyway, so why would that matter? But that assumption was wrong. By abusing another of these tricks to make CPUs faster, branch prediction, it is possible to reveal what is currently cached and what isn't and that way software can get access to memory it should never have access to.

So I think the days of x86 are counted. It will not die tomorrow but it will eventually die as in many aspects x86 is inferior to ARM and RISC-V who both give you more computational power for less money and less electric power and this is not a temporarily thing, as no matter what trickery and shrinking they are going to apply make x86 faster, the same trickery and shrinking can also be applied to ARM and RISC-V to make them faster as well, yet on top of that, it will always be easier to give them more cores as well and that's why they keep winning in the long term.

xcoder
Автор

I stopped midway saying to myself, why I feel like I was tricked into a college lecture and not noticing it except midway but still liking it

zerlegend
Автор

Nice to hear from someone who actually knows what they are talking about. Not for the sake of making youTube content.

ProcashFloyd
Автор

There are thousands of useless videos "Apple moving to it's own silicon!!!"...but this is the only video that is actually informative.

octacore
Автор

Struggled to find someone who can actually explain something as complex as Arm v x86 in such straightforward terms. thank you.

Charlie-jfwb
Автор

Nobody can explain it better than you. Thanks for packing it all under 21 mins. I know it's tough.

goombah_ninja
Автор

Just to give a feedback: The pronunciation of the name Dobberpuhl was perfect.

yogevbocher
Автор

I'm an ex-DECie tech guy too. Glad to see someone helping to explain their place in history. All these years later, I'm still heart broken.

lilmsgs
Автор

Gary, you’ve been there and done that ⭐️

mohammedmohammed
Автор

The possibilities for how this will go and how it will effect the industry or other players in said industry is endless. Very interesting next few years for numerous reasons, this being a big one. Great vid too btw.

hi_tech_reptiles
Автор

Really great to hear someone who knows about Acorn. In 1986 I lived in North-western Ontario (Canada). Our library put in a desk with 6 computers on it. They were the North American version of the BBC Micro, made by Acorn. It was the first computer I worked on. I didn't find out about the ARM chip and the Archimedes until the mid nineties. And it was shortly after that time that ARM was spun off. BTW, Acorn was owned by Olivetti at this time. When I found out about the Raspberry Pi, I got onboard. I had a model A chip, and then I bought a Pi 4 just in time for Covid, so I could use my camera module to have a second camera for Zoom.

ricgal
Автор

In your slide listing the major differences in RISC v CISC, one thing that struck ME as relevant because of my interest in compilers and which admittedly may not be particularly worth mentioning depending on your audience, is that RISC instructions also tend to be more uniform in the sense that if you want to do an add instruction, for example, you don't have to really think about what instructions are allowed with which registers. Also, the instruction pointer register is just a regular general purpose register while that register is often special purpose in other architectures. It's awkward and roundabout to even access. Often you need odd tricks like to use Intel's call instruction as if you're calling a function for its side effect of pushing the instruction pointer to the stack. Then from there, you can pop the value off. But in arm, you just have it in one of your normal registers. Obviously, you must beware if you dump random garbage into it that you'll start running code from a different place in memory but that should be obvious. Yet such uniformity can eat space and so the THUMB instructions don't have it.

TurboGoth
Автор

This video is so underrated like lol you explained something I was never able to understand in just 20 minutes

aaaaea
Автор

My father was working for DEC at that time, and he told me a lot about the Alpha chip and their foray into 64bit before AMD and Intel brought their consumer 64bit chips to market. He also told me about the purchase by Compaq(and subsequently HP) and that a lot of people weren't keen on the purchase as there was concern all their efforts would disappear.
These days DEC is barely a whisper when people talk about tech history, but I still remember sitting at an ivory CRT with the red 'DIGITAL' branding on it.

Edit: Thanks Gary for the little nostalgia trip.

thecalvinprice
Автор

Absolutely beneficial I learned a lot. I still have a lot more learning to do. Definitely subscribed and will be pulling up other videos that you’ve done for additional information.

adj
Автор

Gary is arguably the best person to explain these kind of topics in layman's terms. Intel will finally get some humolity lesson.

dalobucaram
Автор

Thank you! You get extra points for mentioning Elite - I played that so much on a Commodore 64 when I was around 16

jeroenstrompf
Автор

Wow I learn a lot just from watching your video, thanks Gary :)

ZhangMaza
Автор

Subbed. Just straight up information easily explained. Love it

BeansEnjoyer
Автор

I understood Intel was a memory maker initially however a Japanese company commissioned intel to develop its calculator chips that ultimately developed into microprocessors

johnmyviews
welcome to shbcf.ru