The AMD64 or x86-64 or x64 is a 64 bit processor architecture invented by AMD. It is a superset of the x86 architecture, which it natively supports. The AMD64 Instruction set is currently used in AMD's Athlon 64, Athlon 64 FX, Athlon 64 X2, Turion 64, Opteron and later Sempron processors.
Architecture Overview
AMD's x86-64 instruction set (later renamed AMD64) is a straightforward extension of the x86 architecture to 64 bits, motivated by the fact that the 4GB of memory directly addressable by a 32 bit CPU is no longer sufficient for all applications. Some of the changes:
- New registers. The number of general-purpose registers (GPRs) is increased from 8 in x86-32 to 16, and the size of these registers is increased from 32 bits to 64 bits. Additionally, the number of 128 bit XMM registers (used for Streaming SIMD instructions) is also increased from 8 to 16. The additional registers increase performance.
- Larger address space. Due to the 64 bit architecture, the AMD64 architecture can address up to 256 tebibytes (also known as terabytes) of memory in its current implementations. This is compared to just 4 GB for x86-32, only half of which is available to applications under the most common versions of Microsoft Windows. Future implementations of the AMD64 architecture may provide up to 2 exbibytes (also known as exabytes) of available memory. If paging is used properly, 32 bit operating systems can access some of the physical address extensions of the processor without having to execute in long mode. Virtual memory for all programs running in 32 bit mode is still limited to 4GB.
- RIP relative data access. Instructions can now reference data relative to the program counter, which makes code in shared libraries that are not compiled to a fixed address more efficient. It also allows shared libraries to be mapped anywhere in the virtual address space.
- SSE instructions. The AMD64 architecture includes Intel's SSE and SSE2 instructions, newer E-stepping CPU include SSE3 as well. The x87 and MMX instructions are supported.
- NX bit. The NX bit is a processor feature that allows the operating system to forbid code execution in data areas, improving security. This feature is available in both 32 bit and 64 bit modes, and is supported by Linux, Solaris, Windows XP SP2, Windows Server 2003 SP1 and newer. The NX bit (when coupled with an OS which takes advantage of it) is referred to in AMD's marketing literature as Enhanced Virus Protection (EVP). While it does indeed block a common attack vector for many types of malware (most notably buffer overflows), the NX bit (nor any single technological measure) is insufficient to prevent viruses from infecting a computer. Trade regulators in The Netherlands recently asked AMD to cease calling the NX bit "Enhanced Virus Protection" in advertisements in that country, stating that the NX capability was not a suitable substitute for other countermeasures, such as anti-virus software.
- It should be noted that the NX bit has long been available on 32-bit x86 processors in the PAE (Paged Addressing Environment) mode, originally introduced in the 80286 processor. However, PAE has long been considered an obsolete mode of operation by systems software vendors (no current PC OS uses it); and AMD was the first x86-family vendor to support it in linear addressing mode. Intel and other x86 CPU vendors are now supporting the NX bit in their product offerings as well.
Operating modes
Operating mode | Operating system required | Application recompile required | Default address size | Default operand size | Register extensions | Typical GPR width | |
---|---|---|---|---|---|---|---|
Long mode | 64 bit mode | New 64 bit OS | yes | 64 | 32 | yes | 64 |
Compatibility mode |
no | 32 | no | 32 | |||
16 | 16 | 16 | |||||
Legacy Mode |
Protected Mode | Legacy 32 bit OS | no | 32 | 32 | no | 32 |
16 | 16 | ||||||
Virtual 8086 mode | 16 | 16 | 16 | ||||
Real mode | Legacy 16 bit OS |
Operating mode explanation
There are two primary modes of operation for this architecture:
- Long Mode
- The intended primary mode of operation of the architecture; it is a combination of the processor's native 64 bit mode and a 32 bit compatibility mode. It also abandons some of the more half-baked or lesser-used features of the 80386. It is used by 64 bit Operating Systems; among those that support Long Mode are Linux, the various BSDs, Solaris 10 and Windows XP Professional x64 Edition.
- Since the basic instruction set is the same, there is no major performance penalty for executing x86 code. This is unlike Intel's IA-64, where differences in the underlying ISA means that running 32 bit code is like using an entirely different processor. However, on AMD64, 32 bit x86 applications may still benefit from a 64 bit recompile, due to the additional registers in 64 bit code, which a high-level compiler can use for optimization.
- Using Long Mode, a 64 bit OS can run 32 bit applications and 64 bit applications simultaneously. Also, x86-64 includes native support for running 16 bit x86 applications. Microsoft, however, has explicitly left out 16 bit program support in Windows XP Professional x64 Edition due to problems in getting 16 bit x86 code to run via their WoW64 Subsystem.
- Legacy Mode
- The mode used by 16 bit operating systems, like MS-DOS, and 32 bit operating systems, such as Windows XP. In this mode, only 16 bit or 32 bit code can be executed. 64 bit programs (such as the GUI setup program for Windows XP Professional x64 Edition and Windows Server 2003 x64 Edition) will not run.
Market analysis
AMD64 represents a break with AMD's past behavior of following Intel's standards, but follows Intel's earlier behavior of extending the x86 architecture, from the 16 bit 8086 to the 32 bit 80386 and beyond, without ever removing backwards compatibility. The AMD64 architecture extends the 32 bit x86 architecture (IA-32) by adding 64 bit registers, with full 32 bit and 16 bit compatibility modes for earlier software. Even the 64 bit mode is largely backwards compatible, allowing existing tools targeting x86 such as compilers to be retargeted to AMD64 with minimal effort. The AMD64 architecture also features the NX bit.
Implementations
The following processors implement the AMD64 architecture:
- AMD K8
- AMD Athlon 64
- AMD Athlon 64 X2
- AMD Athlon 64 FX
- AMD Opteron
- AMD Turion 64
- AMD Sempron (only 'Palermo' models using the E6 stepping)
- EM64T
- Intel Xeon (some models since 'Nocona')
- Intel Celeron D (some models since 'Prescott')
- Intel Pentium 4 (some models since 'Prescott')
- Intel Pentium D
- Intel Pentium Extreme Edition
- Intel Pentium M (some models starting with 'Merom')
- Intel Conroe (upcoming desktop core)
See also
External links
- AMD's free technical documentation for the AMD64 architecture
- AMD's AMD64 documentation on CD-ROM (US and Canada only) and downloadable PDF format
- PlanetAMD64 - Nice AMD64 Source site with 64bit database of Drivers & Software
- Tech Report article: 64-bit computing in theory and practice
- AMD’s “Enhanced Virus Protection” Radio Ads Banned in The Netherlands