# X86-64

**x86-64**是x86指令集架构的64位扩展，它在32位x86架构的基础上增加了64位运行模式，同时保持与现有16位和32位软件的二进制兼容性。该架构由AMD设计，AMD于2000年发布了规范，并于2003年4月推出了首款实现该架构的处理器皓龙（Opteron）；Intel于2004年采用了几乎相同的扩展。该架构在AMD的文档中称为**AMD64**，在Intel的文档中称为**Intel 64**，而**x64**作为涵盖两者的厂商中立术语被广泛使用。<sup>[1](https://www.dranirbanchakraborty.com/learn/computer-architecture/x86-64)</sup><sup> • </sup><sup>[2](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/x64-architecture)</sup>

| 关键事实 | 详情 |
|---|---|
| 起源 | AMD于2000年发布AMD64规范；首款AMD64处理器皓龙于2003年4月出货，随后Athlon 64处理器于2003年9月推出<sup>[1](https://www.dranirbanchakraborty.com/learn/computer-architecture/x86-64)</sup><sup> • </sup><sup>[3](https://www.annualreports.com/HostedData/AnnualReportArchive/a/NYSE_AMD_2002.pdf)</sup> |
| Intel的采用 | Intel于2004年推出EM64T（扩展内存64技术），这是IA-32的64位扩展，基于x86-64/AMD64并与之几乎完全相同<sup>[4](https://ptgmedia.pearsoncmg.com/imprint_downloads/que/bookreg/9780789750006/upgradingandrepairingpcs_20thedition.pdf)</sup> |
| 寄存器 | 八个x86通用寄存器扩展至64位，并新增八个寄存器（R8–R15），以及八个额外的XMM/YMM寄存器<sup>[5](https://docs.amd.com/api/khub/documents/sD1_QL~h4Afq2_tvzxqqSQ/content)</sup> |
| 寻址 | 64位虚拟地址传递给长模式分页机制，可产生最高52位的物理地址；具体实现可能支持更小的位宽<sup>[6](https://docs.amd.com/api/khub/documents/68GKiN0gMEd6bMddsmhPwg/content)</sup> |
| 兼容性 | 兼容模式是长模式的一个子模式，无需重新编译即可运行现有16位和32位x86应用程序，但仅限于前4 GB虚拟地址空间<sup>[5](https://docs.amd.com/api/khub/documents/sD1_QL~h4Afq2_tvzxqqSQ/content)</sup> |
| Windows ABI | 前四个整数或指针参数通过rcx、rdx、r8、r9传递；前四个浮点参数通过xmm0–xmm3传递；rax、rcx、rdx和r8–r11为易失寄存器<sup>[2](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/x64-architecture)</sup> |
| System V ABI | 整数参数通过rdi、rsi、rdx、rcx、r8、r9传递；系统调用使用rdi、rsi、rdx、r10、r8、r9，调用号放在rax中，参数上限为六个<sup>[7](https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/kernel.tex?ref_type=heads)</sup> |

## 背景与设计决策

当AMD将x86带入64位计算时，Intel自己对64位问题的答案是[IA-64](https://www.edgepedia.org/zh/ia-64)（安腾，Itanium），这是一个全新的64位VLIW架构，打破了与x86的向后兼容性。<sup>[1](https://www.dranirbanchakraborty.com/learn/computer-architecture/x86-64)</sup> AMD则选择扩展现有的x86指令集，在其K7（Athlon）架构的基础上构建，而非从零开始。<sup>[8](https://arstechnica.com/features/2005/02/amd-hammer-1/)</sup>

市场环境有利于兼容性。根据IDC分析师马克·梅拉诺夫斯基（Mark Melanovsky）的数据，2003年全球出货的约530万台服务器中，有467万台（87%）使用32位x86架构。<sup>[9](https://www.computerworld.com/article/1704794/64-bit-cpus.html)</sup> 64位x86扩展让买家能够迈向64位计算，而无需放弃这一软件基础。

## 发布与采用

AMD于2003年4月推出了皓龙，这是首款兼容x86架构的64位处理器，并于2003年9月出货[Athlon 64](https://www.edgepedia.org/zh/athlon-64)桌面处理器，旨在为服务器、桌面和移动PC中的32位和64位应用程序提供高性能。<sup>[3](https://www.annualreports.com/HostedData/AnnualReportArchive/a/NYSE_AMD_2002.pdf)</sup> 首批皓龙系统支持两颗处理器，随后推出了支持多达八颗处理器的系统。<sup>[10](https://www.heise.de/hintergrund/20-Jahre-64-Bit-CPUs-von-AMD-Der-Sledgehammer-Opteron-zuendete-x86-64-8974232.html)</sup> AMD64皓龙处理器在首发之年售出约15万颗。<sup>[11](https://courses.cs.washington.edu/courses/csep590/06au/projects/history-64-bit.pdf)</sup>

**软件和行业支持紧随其后。** 苹果于2005年夏季转用Intel的x86-64芯片。<sup>[10](https://www.heise.de/hintergrund/20-Jahre-64-Bit-CPUs-von-AMD-Der-Sledgehammer-Opteron-zuendete-x86-64-8974232.html)</sup> 曾押注于不兼容的安腾的Intel采用了AMD的设计：它于2004年推出EM64T，这是IA-32的64位扩展，基于AMD首次发布的x86-64（AMD64）技术并与之几乎完全相同。<sup>[4](https://ptgmedia.pearsoncmg.com/imprint_downloads/que/bookreg/9780789750006/upgradingandrepairingpcs_20thedition.pdf)</sup> 《Microprocessor Report》分析师汤姆·哈尔希尔（Tom Halfhill）声称，Intel是通过“阅读AMD的预发布文档”来开发其64位扩展的。<sup>[12](https://www.theregister.com/on-prem/2004/04/07/intel-cribbed-x86-64-tech-from-amd-documents/1266650)</sup> 两家厂商的指令集几乎完全相同，“x64”一词涵盖AMD64和Intel 64两者。<sup>[2](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/x64-architecture)</sup>

## 64位模式

长模式是该架构的64位运行状态，有两个子模式。**64位模式**为64位系统软件和应用程序提供支持，具有以下特性：<sup>[5](https://docs.amd.com/api/khub/documents/sD1_QL~h4Afq2_tvzxqqSQ/content)</sup>

- 64位虚拟地址，尽管处理器实现可以支持更少的位数。
- 可访问通用寄存器的第63:32位。
- 通过REX、VEX和XOP指令前缀访问额外寄存器：八个额外的通用寄存器（R8–R15）和八个额外的SSE寄存器（YMM/XMM8–15）。
- 64位指令指针（RIP）和新的RIP相对数据寻址模式。
- 平坦段地址空间，具有单一的代码、数据和栈空间。

该模式由系统软件基于单个代码段启用，尽管代码段可以启用和禁用它，但传统的分段机制在很大程度上被禁用；内存管理需要页转换。<sup>[5](https://docs.amd.com/api/khub/documents/sD1_QL~h4Afq2_tvzxqqSQ/content)</sup> 在64位模式下，默认地址大小为64位，默认操作数大小为32位，可通过前缀按指令覆盖。新的REX前缀指定64位操作数大小和新寄存器；其W位选择64位操作数大小，而R、X和B位将ModRM和SIB寄存器字段扩展为四位，允许访问16个寄存器。<sup>[13](https://docs.amd.com/api/khub/documents/j44LvPXzuuXgM0WyHKQfeQ/content)</sup> 当32位操作写入通用寄存器目标时，处理器将32位结果零扩展至完整的64位寄存器。<sup>[5](https://docs.amd.com/api/khub/documents/sD1_QL~h4Afq2_tvzxqqSQ/content)</sup>

**兼容模式**是长模式的另一个子模式。它允许现有的16位和32位x86应用程序在64位系统软件下无需重新编译即可运行，但只能访问前4 GB虚拟地址空间。从应用程序的角度看，它就像一个传统的保护模式环境，而系统软件则使用长模式机制进行地址转换、中断和异常处理以及系统数据结构的管理。<sup>[5](https://docs.amd.com/api/khub/documents/sD1_QL~h4Afq2_tvzxqqSQ/content)</sup>

**寻址变化**也出现在指令层面。任何引用64位寄存器的指令都以64位精度执行操作，mov指令有一个专用变体处理64位立即数常量或常量地址，而其他所有指令仍然只接受32位的立即数和常量地址。新的RIP相对模式将引用单一常量地址的指令编码为相对于rip的偏移量。jmp、call、push和pop等隐式引用指令指针和栈指针的指令将它们视为64位寄存器。<sup>[2](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/x64-architecture)</sup>

## 调用约定与系统调用

更宽的寄存器组改变了函数传递参数的方式。在Windows上，x64应用二进制接口默认使用四寄存器快速调用约定：前四个整数或指针参数通过rcx、rdx、r8和r9传递，前四个浮点参数通过xmm0至xmm3传递，其余参数放在栈上。调用方保留栈空间（影子存储），以便被调用方将寄存器参数暂存到栈中。整数或指针返回值放在rax中，浮点返回值放在xmm0中。寄存器rax、rcx、rdx和r8–r11为易失寄存器；rbx、rbp、rdi、rsi和r12–r15为非易失寄存器。在Windows上，C/C++编译器在x64上默认支持此调用约定，GCC在32位和64位x86目标上都支持Microsoft和System V ABI属性。<sup>[2](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/x64-architecture)</sup><sup> • </sup><sup>[14](https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170)</sup><sup> • </sup><sup>[16](https://gcc.gnu.org/onlinedocs/gcc-7.5.0/gcc/x86-Function-Attributes.html)</sup>

类Unix系统遵循System V AMD64 ABI，前六个整数参数通过rdi、rsi、rdx、rcx、r8和r9传递。<sup>[15](https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/low-level-sys-info.tex)</sup> 对于Linux系统调用，顺序略有不同：内核接口使用rdi、rsi、rdx、r10、r8和r9，syscall指令破坏rcx和r11，但保留除rax以外的其他寄存器，系统调用号放在rax中，调用限制为六个参数且不通过栈传递任何参数，返回值在-4095到-1之间表示错误（-errno）。<sup>[7](https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/kernel.tex?ref_type=heads)</sup>

## 命名

该架构有多个名称，反映了它的历史。

## References

1. [x86-64: Intel and AMD's Shared Legacy, Dr. Anirban Chakraborty](https://www.dranirbanchakraborty.com/learn/computer-architecture/x86-64)
2. [x64 Architecture Overview and Registers, Microsoft Learn (Windows drivers)](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/x64-architecture)
3. [AMD 2002 Annual Report](https://www.annualreports.com/HostedData/AnnualReportArchive/a/NYSE_AMD_2002.pdf)
4. [Upgrading and Repairing PCs, 20th Edition (Que Publishing)](https://ptgmedia.pearsoncmg.com/imprint_downloads/que/bookreg/9780789750006/upgradingandrepairingpcs_20thedition.pdf)
5. [AMD64 Architecture Programmer's Manual, Volume 2: System Programming](https://docs.amd.com/api/khub/documents/sD1_QL~h4Afq2_tvzxqqSQ/content)
6. [AMD64 Architecture Programmer's Manual, Volumes 1-5](https://docs.amd.com/api/khub/documents/68GKiN0gMEd6bMddsmhPwg/content)
7. [x86-64 psABI, kernel.tex (Linux kernel conventions), x86 psABIs GitLab](https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/kernel.tex?ref_type=heads)
8. [Inside AMD's Hammer, Ars Technica](https://arstechnica.com/features/2005/02/amd-hammer-1/)
9. [64-Bit CPUs, Computerworld](https://www.computerworld.com/article/1704794/64-bit-cpus.html)
10. [20 Jahre 64-Bit-CPUs von AMD: Der "Sledgehammer"-Opteron zündete x86-64, heise online](https://www.heise.de/hintergrund/20-Jahre-64-Bit-CPUs-von-AMD-Der-Sledgehammer-Opteron-zuendete-x86-64-8974232.html)
11. [A History of Modern 64-bit Computing, University of Washington CSEP590](https://courses.cs.washington.edu/courses/csep590/06au/projects/history-64-bit.pdf)
12. [Intel cribbed x86-64 tech 'from AMD documents', The Register](https://www.theregister.com/on-prem/2004/04/07/intel-cribbed-x86-64-tech-from-amd-documents/1266650)
13. [AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions](https://docs.amd.com/api/khub/documents/j44LvPXzuuXgM0WyHKQfeQ/content)
14. [x64 Calling Convention, Microsoft Learn](https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170)
15. [x86-64 psABI, low-level-sys-info.tex, x86 psABIs GitLab](https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/low-level-sys-info.tex)
16. [Using the GNU Compiler Collection (GCC): x86 Function Attributes](https://gcc.gnu.org/onlinedocs/gcc-7.5.0/gcc/x86-Function-Attributes.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Processors & processor engineering › Instruction set architectures › x86 and x86-64

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/x86-64

English original: https://www.edgepedia.org/x86-64
