X86 Instruction Set Architecture Tom Shanley

The five-volume set of the x86-64 Architecture Programmer's Guide, as published and distributed by AMD in 2002x86-64 (also known as x64, x8664, AMD64 and Intel 64 ) is the version of the. It introduces two new modes of operation, 64-bit mode and compatibility mode, along with a new 4-level mode. With 64-bit mode and the new paging mode, it supports vastly larger amounts of and than is possible on its 32-bit predecessors, allowing programs to store larger amounts of data in memory. X86-64 also expands to 64-bit, as well extends the number of them from 8 (some of which had limited or fixed functionality, e.g. For stack management) to 16 (fully general), and provides numerous other enhancements. Floating point operations are supported via mandatory SSE2-like instructions, and x87/MMX style registers are generally not used (but still available even in 64-bit mode); instead, a set of 32 vector registers, 128 bits each, is used.

(Each can store one or two double-precision numbers or one to four single precision numbers, or various integer formats.) In 64-bit mode, instructions are modified to support 64-bit operands and 64-bit addressing mode. The compatibility mode allows 16- and 32-bit to run unmodified coexisting with 64-bit applications if the 64-bit operating system supports them. As the full x86 16-bit and 32-bit instruction sets remain implemented in hardware without any intervening emulation, these older can run with little or no performance penalty,while newer or modified applications can take advantage of new features of the processor design to achieve performance improvements. Also, a processor supporting x86-64 still powers on in for full, as x86 processors have done since the.The original specification, created by and released in 2000, has been implemented by AMD,. The, in the and processors, was the first to implement it.

This was the first significant addition to the architecture designed by a company other than Intel. Intel was forced to follow suit and introduced a modified family which was software-compatible with AMD's specification. Introduced x86-64 in their VIA Isaiah architecture, with the.The x86-64 architecture is distinct from the Intel architecture (formerly ), which is not compatible on the native instruction set level with the x86 architecture.

Operating systems and applications written for one cannot be run on the other. AMD64 logo History AMD64 was created as an alternative to the radically different architecture, which was designed by Intel. 64-bit implementationAlthough virtual addresses are 64 bits wide in 64-bit mode, current implementations (and all chips that are known to be in the planning stages) do not allow the entire virtual address space of 2 64 bytes (16 EB) to be used.This would be approximately four billion times the size of the virtual address space on 32-bit machines. Most operating systems and applications will not need such a large address space for the foreseeable future, so implementing such wide virtual addresses would simply increase the complexity and cost of address translation with no real benefit. AMD, therefore, decided that, in the first implementations of the architecture, only the least significant 48 bits of a virtual address would actually be used in address translation ( lookup).

( p120)In addition, the AMD specification requires that the most significant 16 bits of any virtual address, bits 48 through 63, must be copies of bit 47 (in a manner akin to ). If this requirement is not met, the processor will raise an exception. ( p131) Addresses complying with this rule are referred to as 'canonical form.' ( p130) Canonical form addresses run from 0 through 00007FFF'FFFFFFFF, and from FFFF800 through FFFFFFFF'FFFFFFFF, for a total of 256 TB of usable virtual address space.

This is still 65,536 times larger than the virtual 4 GB address space of 32-bit machines.This feature eases later scalability to true 64-bit addressing. Many operating systems (including, but not limited to, the family) take the higher-addressed half of the address space (named ) for themselves and leave the lower-addressed half for application code, user mode stacks, heaps, and other data regions. The 'canonical address' design ensures that every AMD64 compliant implementation has, in effect, two memory halves: the lower half starts at 0000000 and 'grows upwards' as more virtual address bits become available, while the higher half is 'docked' to the top of the address space and grows downwards.

Also, enforcing the 'canonical form' of addresses by checking the unused address bits prevents their use by the operating system in as flags, privilege markers, etc., as such use could become problematic when the architecture is extended to implement more virtual address bits.The first versions of Windows for x64 did not even use the full 256 TB; they were restricted to just 8 TB of user space and 8 TB of kernel space. Windows did not support the entire 48-bit address space until, which was released in October 2013. Page table structure The 64-bit addressing mode (') is a superset of (PAE); because of this, sizes may be 4 (2 12 bytes) or 2 (2 21 bytes). ( p120) Long mode also supports page sizes of 1 (2 30 bytes). ( p120) Rather than the three-level system used by systems in PAE mode, systems running in use four levels of page table: PAE's Page-Directory Pointer Table is extended from four entries to 512, and an additional Page-Map Level 4 (PML4) Table is added, containing 512 entries in 48-bit implementations. ( p131) A full mapping hierarchy of 4 KB pages for the whole 48-bit space would take a bit more than 512 GB of memory (about 0.195% of the 256 TB virtual space).Intel has proposed a scheme with a.

If implemented, this would allow Intel 64 processors to support a 57-bit virtual address space. Operating system limits The operating system can also limit the virtual address space. Details, where applicable, are given in the ' section.Physical address space details Current AMD64 processors support a physical address space of up to 2 48 bytes of RAM, or 256 TB. However, as of June 2010, there were no known x86-64 that support 256 TB of RAM. The operating system may place additional limits on the amount of RAM that is usable or supported. Details on this point are given in the ' section of this article.Operating modes The architecture has two primary modes of operation, long mode and legacy mode.OperatingrequiredType of codebeing runsizemodesub-modeaddress (default)operand (default)operand (typ.

Supported)64-bit mode64-bit64 bits32 bits8, 16, 32, or 64 bits16 registers per fileCompatibility mode32 bits32 bits8, 16, or 32 bits8 registers per file16 bits16 bits8, 16, or 32 bits8 registers per fileLegacymode32-bit32 bits32 bits8, 16, or 32 bits8 registers per file16-bit protected mode16 bits16 bits8, 16, or 32 bits8 registers per file16-bit or 32-bit protected modesome of16 bits16 bits8, 16, or 32 bits8 registers per file16-bit real mode16 bits16 bits8, 16, or 32 bits8 registers per file. Main article:Long mode is the architecture's intended primary mode of operation; it is a combination of the processor's native 64-bit mode and a combined 32-bit and 16-bit compatibility mode. It is used by 64-bit operating systems. Under a 64-bit operating system, 64-bit programs run under 64-bit mode, and 32-bit and 16-bit protected mode applications (that do not need to use either real mode or virtual 8086 mode in order to execute at any time) run under compatibility mode. Real-mode programs and programs that use virtual 8086 mode at any time cannot be run in long mode unless those modes are emulated in software.: 11 However, such programs may be started from an operating system running in long mode on processors supporting or by creating a virtual processor running in the desired mode.Since the basic is the same, there is almost no performance penalty for executing protected mode x86 code. This is unlike Intel's, where differences in the underlying instruction set mean that running 32-bit code must be done either in emulation of x86 (making the process slower) or with a dedicated x86 coprocessor.

However, on the x86-64 platform, many x86 applications could benefit from a 64-bit, due to the additional registers in 64-bit code and guaranteed SSE2-based FPU support, which a can use for optimization. However, applications that regularly handle integers wider than 32 bits, such as cryptographic algorithms, will need a rewrite of the code handling the huge integers in order to take advantage of the 64-bit registers.Legacy mode Legacy mode is the mode used by 32-bit or 16-bit 'protected mode' operating systems. In this mode, the processor acts like an older x86 processor, and only 16-bit and 32-bit code can be executed. Legacy mode allows for a maximum of 32 bit virtual addressing which limits the virtual address space to 4 GB.

( p14) ( p24) ( p118) 64-bit programs cannot be run from legacy mode.Intel 64 Intel 64 is Intel's implementation of x86-64, used and implemented in various processors made by Intel.History Historically, AMD has developed and produced processors with instruction sets patterned after Intel's original designs, but with x86-64, roles were reversed: Intel found itself in the position of adopting the which AMD had created as an extension to Intel's own x86 processor line.Intel's project was originally Yamhill (after the in Oregon's Willamette Valley). After several years of denying its existence, Intel announced at the February 2004 that the project was indeed underway. Intel's chairman at the time, admitted that this was one of their worst-kept secrets.Intel's name for this instruction set has changed several times.

The name used at the IDF was CT (presumably for Clackamas Technology, another codename from an ); within weeks they began referring to it as IA-32e (for extensions) and in March 2004 unveiled the 'official' name EM64T (Extended Memory 64 Technology). In late 2006 Intel began instead using the name Intel 64 for its implementation, paralleling AMD's use of the name AMD64.The first processor to implement Intel 64 was the multi-socket processor code-named in June 2004. In contrast, the initial Prescott chips (February 2004) did not enable this feature.

Intel subsequently began selling Intel 64-enabled Pentium 4s using the E0 revision of the Prescott core, being sold on the OEM market as the Pentium 4, model F. The E0 revision also adds eXecute Disable (XD) (Intel's name for the ) to Intel 64, and has been included in then current Xeon code-named Irwindale. Intel's official launch of Intel 64 (under the name EM64T at that time) in mainstream desktop processors was the N0 stepping Prescott-2M.The first Intel implementing Intel 64 is the version of the processor, which was released on July 27, 2006. See also:was the first operating system kernel to run the x86-64 architecture in, starting with the 2.4 version in 2001 (preceding the hardware's availability).

Linux also provides backward compatibility for running 32-bit executables. This permits programs to be recompiled into long mode while retaining the use of 32-bit programs. Several Linux distributions currently ship with x86-64-native kernels.

Some, such as, and allow users to install a set of 32-bit components and libraries when installing off a 64-bit DVD, thus allowing most existing 32-bit applications to run alongside the 64-bit OS. Other distributions, such as, and, are available in one version compiled for a 32-bit architecture and another compiled for a 64-bit architecture.

See also:10 and later releases support the x86-64 architecture.For Solaris 10, just as with the architecture, there is only one operating system image, which contains a 32-bit kernel and a 64-bit kernel; this is labeled as the 'x64/x86' DVD-ROM image. The default behavior is to boot a 64-bit kernel, allowing both 64-bit and existing or new 32-bit executables to be run. A 32-bit kernel can also be manually selected, in which case only 32-bit executables will run. The isainfo command can be used to determine if a system is running a 64-bit kernel.For Solaris 11, only the 64-bit kernel is provided.

However, the 64-bit kernel supports both 32- and 64-bit executables, libraries, and system calls.Windows x64 editions of Microsoft Windows client and server— and x64 Edition—were released in March 2005. Internally they are actually the same build (5.2.3790.1830 SP1), as they share the same source base and operating system binaries, so even system updates are released in unified packages, much in the manner as Windows 2000 Professional and Server editions for x86., which also has many different editions, was released in January 2007. Was released in July 2009. Was sold in only x64 and Itanium editions; later versions of Windows Server only offer an x64 edition.Versions of Windows for x64 prior to Windows 8.1 and Windows Server 2012 R2 offer the following:. 8 TB of virtual address space per process, accessible from both user mode and kernel mode, referred to as the user mode address space. An x64 program can use all of this, subject to backing store limits on the system, and provided it is linked with the 'large address aware' option.

This is a 4096-fold increase over the default 2 GB user-mode virtual address space offered by 32-bit Windows. 8 TB of kernel mode virtual address space for the operating system. As with the user mode address space, this is a 4096-fold increase over 32-bit Windows versions. The increased space primarily benefits the file system cache and kernel mode 'heaps' (non-paged pool and paged pool). Windows only uses a total of 16 TB out of the 256 TB implemented by the processors because early AMD64 processors lacked a CMPXCHG16B instruction.Under Windows 8.1 and Windows Server 2012 R2, both user mode and kernel mode virtual address spaces have been extended to 128 TB. These versions of Windows will not install on processors that lack the CMPXCHG16B instruction.The following additional characteristics apply to all x64 versions of Windows:. Ability to run existing 32-bit applications (.exe programs) and dynamic link libraries (.dlls) using if WoW64 is supported on that version.

Furthermore, a 32-bit program, if it was linked with the 'large address aware' option, can use up to 4 GB of virtual address space in 64-bit Windows, instead of the default 2 GB (optional 3 GB with /3GB boot option and 'large address aware' link option) offered by 32-bit Windows. Unlike the use of the /3GB boot option on x86, this does not reduce the kernel mode virtual address space available to the operating system. Various names are used for the instruction set. Prior to the launch, x86-64 and x8664 were used, while upon the release AMD named it AMD64.Intel initially used the names IA-32e and EM64T before finally settling on 'Intel 64' for its implementation. Some in the industry, including, use x86-64 and x8664, while others, notably(now ) and,use x64. The family of OSs and severaluse AMD64, as does Microsoft Windows internally. In practice, 64-bit operating systems generally do not support 16-bit applications, although modern versions of Microsoft Windows contain a limited workaround that effectively supports 16-bit and Microsoft ACME installers by silently substituting them with 32-bit code.References.

Retrieved May 3, 2012. ^. Retrieved November 23, 2012. ^ – and General Commands. ^ Kevin Van Vechten (August 9, 2006).

Darwin-dev mailing list. Retrieved October 5, 2006. The kernel and developer tools have standardized on 'x8664' for the name of the Mach-O architecture. ^. Retrieved December 9, 2010.

^. Archived from on December 12, 2010. Retrieved December 9, 2010. Retrieved November 23, 2012. Gentoo Project.

Retrieved May 27, 2013. ^ AMD Corporation (December 2016). AMD64 Architecture Programmer's Manual. AMD Corporation. Retrieved March 25, 2017. Raymond Chen (October 31, 2013).

IBM Corporation (September 6, 2007). Retrieved April 9, 2010. Figures 5, 6 and 7 also show the 32-bit version of WAS runs applications at full native hardware performance on the POWER and x86-64 platforms. Unlike some 64-bit processor architectures, the POWER and x86-64 hardware does not emulate 32-bit mode.

Therefore applications that do not benefit from 64-bit features can run with full performance on the 32-bit version of WebSphere running on the above mentioned 64-bit platforms. (Press release). October 5, 1999. Archived from on March 8, 2012. Retrieved November 9, 2010. (Press release).

August 10, 2000. Archived from on March 8, 2012. Retrieved November 9, 2010. (PDF).

Retrieved July 10, 2019. ^ (PDF).

Retrieved February 27, 2016. Physical address space increased to 48 bits. (PDF).

March 2, 2008. Archived from (PDF) on October 10, 2010. Retrieved May 30, 2010. Physical address space increased to 48 bits. Shanley, Tom (1998).

PC System Architecture Series (Second ed.). P. Microsoft Corporation. Retrieved March 19, 2013. ^.

X86 Instruction Set Architecture Tom Shanley

November 16, 2013. Retrieved January 20, 2014.

(PDF). Retrieved June 17, 2017. Supermicro Corporation. Retrieved June 22, 2010. Supermicro Corporation. Retrieved June 20, 2010.

Supermicro Corporation. Retrieved June 20, 2010. MiTEC International Corporation. Retrieved June 21, 2010. Charney, Mark.

Instruction Set

Intel Corporation. Retrieved June 16, 2019. The Inquirer.

February 17, 2004. Retrieved June 29, 2007. (subscription required).

Retrieved July 25, 2007. Stokes, Jon (January 23, 2008). Ars Technica. Retrieved January 24, 2008. (Press release).

May 29, 2008. Retrieved May 25, 2017. (PDF). January 23, 2008. Archived from (PDF) on September 7, 2008. Retrieved July 31, 2013.

Wasson, Scott. The Tech Report. The Tech Report. Retrieved March 22, 2011.

(PDF). September 2013. Retrieved January 21, 2014. (PDF).

September 2013. Retrieved January 21, 2014. November 9, 2006. Retrieved May 2, 2010. (PDF).

Retrieved September 8, 2010. (PDF). Retrieved August 2, 2018. (PDF).

September 2014. Retrieved December 28, 2014.

Maged M. Retrieved January 21, 2014.

darwou (August 20, 2004). The Old New Thing. Microsoft. ^.

Retrieved April 27, 2014. To install a 64-bit OS on a 64-bit PC, your processor needs to support CMPXCHG16b, PrefetchW, and LAHF/SAHF. 'Intel 64 architecture increases the linear address space for software to 64 bits and supports physical address space up to 46 bits.' Retrieved March 22, 2014. Retrieved December 6, 2018. (PDF). September 7, 2012.

Section B.2 Intel Xeon Phi coprocessor 64 bit Mode Limitations. Retrieved June 21, 2013. Retrieved May 3, 2009. Retrieved May 3, 2009. Retrieved May 3, 2009.

Retrieved May 3, 2009. Retrieved May 3, 2009. Archived from on February 22, 2017. Retrieved July 6, 2008. Andi Kleen (June 26, 2001). Archived from on September 10, 2010.

Status: The kernel, compiler, tool chain work. The kernel boots and work on simulator and is used for porting of userland and running programs. Andi Kleen. This was the original paper describing the Linux x86-64 kernel port back when x86-64 was only available on simulators. April 23, 2012.

You can either use the multilib packages or a i686 chroot. ^ Thorsten Leemhuis (September 13, 2011). Archived from on October 28, 2011.

Retrieved November 1, 2011. ^.

Retrieved November 1, 2011. ^. Google Sites. Retrieved November 1, 2011.

Retrieved October 29, 2011. April 11, 2007. Archived from on April 22, 2009.

Retrieved November 19, 2012. Archived from on January 12, 2009. Retrieved November 19, 2012. Retrieved November 29, 2012. John Siracusa. Ars Technica LLC. Retrieved June 20, 2010.

Archived from on March 28, 2011. Retrieved November 19, 2012. Retrieved August 14, 2016. Microsoft Support. Retrieved August 14, 2016.

Microsoft Download Center. Archived from on August 27, 2016. Retrieved August 14, 2016. ^. Visual Studio 2005 Documentation – Visual C – Linker Options. Retrieved June 19, 2010.

The /LARGEADDRESSAWARE option tells the linker that the application can handle addresses larger than 2 gigabytes. ^ (May 2006). Retrieved May 24, 2010.

Chris St. Amand (January 2006). Retrieved May 24, 2010. Retrieved July 2, 2009. ^. Retrieved August 21, 2013. Retrieved February 20, 2013.

Anand Lal Shimpi (May 21, 2013). Retrieved May 22, 2013. Game Informer. May 21, 2013. Retrieved May 22, 2013. Archived from on September 23, 2005. Retrieved February 17, 2013.

January 1, 2001. Archived from on June 21, 2007. Retrieved August 23, 2009. Stephen Shankland and Jonathan E. Skillings (November 12, 2009). Retrieved April 24, 2012. Smith, Ryan (November 12, 2009).

Archived from on May 13, 2010.External links. – technical talk by the architect of AMD64 , and., by Andreas Jaeger from 2003.

An excellent paper explaining almost all practical aspects for a transition from 32-bit to 64-bit.

Posted :