x86: the history of naming
The x86 architecture processors had been around since seventies, and since that time a lot of history happened, now making this architecture one of the most complicated processor architectures. History and backwards compatibility made various weird parts persist throughout time and even show up in today's processors.
Among many other things that make this architecture complicated, it's is the fact that there are so many different ways to refer to different parts of the architecture, that most people end up being confused. If you are unaware of the history behind and around this architecture, the other explanations might be a little bit confusing.
x86, 80x86, i386, Intel386, AMD64, EM64T, IA-32e, IA-32, IA-64, Intel 64, Long mode, Protected mode, x86-64, x86_64, x64 - are all terms that name parts of this architecture. Some of them look similar, and others don't, but here the likeness doesn't necessarily imply sameness.
So today I want to make my attempt at slowly chewing through all these terms and what they mean, and explaining parts of the x86 architecture as I proceed.
The material presented in this article may not be entirely correct. If you notice it's not, please let me know in the comments, I'll edit the article to fix this mistake.
Even though this is an article that's supposed to introduce new terminology, the way I introduce it may seem a little bit weird. The way I'm doing it is that I first establish the concepts using the set of familiar terminology, chosen arbitrarily and then I show equivalence and differences between other terms.
For this it was necessary to decide which terms to pick, so please be aware that here I do have my own preferences. But it shouldn't matter because at the end I do show which terms are equivalent, i.e. they can be mutually-substituted for each other, or their usage is a flame war topic.
What is x86?
The very first x86 processor was released in 1978. Their name is 8086. The processors that were released next introduced changes to the instruction set and features, but all of them had stayed backwards compatible with 8086. The names of the other processors go like this:
80186, 80286, 80386, 80486, ...
I don't remember what is the last one, but in any case this should be enough for you to see the pattern. So did the other people, which is why these processors are collectively called 80x86, or simply x86.
Thus the name x86 comes from the last two digits of the names of the processors that came after 8086.
The way x86 ISA does backwards compatibility is by introducing new processor modes. The idea is the following: the new functionality and new rules by which the processor works are implemented in a newly-implemented mode, but on startup the processor would run in the older mode.
That way the programs that worked in the distant path, for example a 16-bit OS would run the same way even on newer 64-bit processors. If the OS then wishes to use the new fancy processor registers and such it would switch to a different mode.
At first there was only the Real Mode. This is the mode that original 8086 processors ran in, and this is the mode that every single one of x86 processors starts in. It is a 16-bit mode which was used to run programs in the original IBM PC, such as MS-DOS.
At some point Intel decided that they want to have more bits to play around with and having all programs in the same address space kinda sucks so they added what's called a Protected Mode. The basic property of this mode is that it makes Paging, Multitasking and Segmentation possible, meaning the Operating systems now can be faster and safer, and your PC won't crash or stall because of a single application malfunctioning!
Protected mode is NOT a synonym for 32-bit mode. Rather, the Protected Mode has two sub-modes:
- Virtual 8086 mode - this is a 16-bit mode that can be used by the operating system to securely run 16-bit applications.
- 32-bit sub-mode - this is the default way to use protected mode.
The processor can switch from Real Mode to Protected mode by playing with bits in the Control Registers.
Then AMD took the lead and introduced x86-compatible mode that supports 64-bit. The new mode is called "Long mode". Again, Long mode is NOT the same as 64-bit mode. Rather, it is a mode that has two sub-modes:
- Compatibility sub-mode - this is a mode that is capable of running 32-bit and 16-bit applications without re-compilation under a 64-bit OS.
- 64-bit sub-mode - the new 64-bit sub-mode.
The processor can switch from the protected mode to the long mode by playing around with the control registers and such.
Why like that?
As you have noticed, Intel and AMD didn't simply introduce a new mode for each bit-ness, like 16-bit → 32-bit → 64-bit. What's the reason?
Well, the reason is that the new modes introduce new semantics that aren't present for the earlier mode. In Real Mode all logical addresses directly correspond to physical addresses. The processor does not do any Page Table look-ups etc., to translate the addresses. But in virtual 8086 mode, the presence of the operating system is assumed, so the resulting logical address can be translated to physical addresses via the paging mechanism. That difference in address translation (as well as other CPU mechanisms, like whether privilege levels are checked, &c.) is what makes the difference in modes.
So for the application programmer it's no different, which 16-bit mode you're in, but the processor does different things in these modes so the processor treats them as different modes in which it's ought to do different things.
By similar logic the 32-bit mode appears in the Long Mode. In it the processor does different thing from the 32-bit Protected Mode.
Intel & AMD
During 1982, the same year 80186 and 80186 were released, Intel and AMD signed contract by which AMD would become second-source manufacturer for the 8086, 80186 and 80182 processors.
But when Intel wanted to release 80386, the first 32-bit x86 processor it started suing AMD for breaking the contract. Apparently Intel didn't want AMD to manufacture 32-bit processors. At the end Intel lost the case, so AMD could proceed making their Intel processor equivalents.
Intel was also the first one to try to force 64-bit transition with their Itanium project. But they failed. AMD basically won by making the first x86-compatible 64-bit ISA, which got widespread usage, and now the 64-bit extensions pioneered by AMD are used in all 64-bit x86 processors.
Now Intel and AMD swapped places -- if before AMD was following Intel, making the compatible processors, starting from the 64-bit transition Intel was following AMD in that.
The processor names
The Intel-manufactured processors have the equivalent names: Intel 286, Intel 386, Intel 586, ...
The Amd-manufactured processors have the Am in their name: Am286, Am386, Am5x86, ...
The Intel 386 was the first 32-bit x86 processor. This processor was later renamed to i386, which is now a common way to refer to x86 processors that support 32-bit mode (which also includes the 64-bit processors). It's also common to refer to i386 architecture as just "386" or "80386".
The ISA for i386 processors is called IA-32 in the Intel terminology. IA stands for Intel Architecture.
AMD seems to be calling the same thing "x86".
IA-64 is the name Intel used for Itanium. Itanium is dead so you're unlikely to meet this term.
x86-64 was the term AMD used to call the new 64-bit ISA. The term x86_64 was used by programmers that couldn't use dash within a variable name. The term x64 is due to Microsoft, they tried to short the term "x86-64", due to filename and other limitations. After 3 years the AMD changed the name of the ISA to AMD 64 though.
When AMD released x86-64, Intel was working on their "secret project". They couldn't keep in in secret so basically everyone knew that they were busy cloning the x86-64 ISA. In 4 years after x86-64 release, Intel released their version of the 64-bit ISA.
At first Intel used the term "IA-32e" (IA32 extensions). Then the supposedly official naming was "EM64T" (Extended Memory 64 Technology). But then they saw how AMD snuck the company name into the ISA name and went like "whoa cool! I want like that too!" and named their ISA "Intel 64".
Remember the processor modes? Well actually the term Long Mode is only due to AMD. Intel SDM uses the term "IA-32e" to refer to the Long Mode.
Gathering it all together
Now we got all the necessary context to get it all together. I won't tell you now what are the intricacies of the terms, but rather I will tell you what the terms precisely mean, and which of the terms are equivalent. Then you'll be able to decide for yourself e.g. whether x86-64 should be named AMD64 or x64.
- Real mode - the mode x86 processors start in
- Protected mode - the cool kids mode with 32-bit support, paging and multitasking. Supports 16-bit and 32-bit sub-modes.
- Long mode - the even-cooler kids mode with 64-bit support. Supports 16-bit, 32-bit and 64-bit sub-modes.
- 80x86, x86 - the line of 8086-compatible processors. Sometimes means the same thing as IA-32.
- i386 - the line of 80386-compatible processors. Sometimes means the same thing as IA-32.
- IA-32, i386, 386, x86 - 80386-compatible 32-bit ISA
- IA-64 - forget that shit :kekw:
- x86-64, x86_64, x64, AMD64, Intel 64, IA-32e, EM64T - 64-bit x86 ISA.
Pro tip: If you really don't want to care about all this terminology stuff I suggest simply using x86 to mean 32-bit ISA and x86-64 or x64 to mean the 64-bit ISA.