# SSE2

**SSE2**（流式 SIMD 扩展 2，Streaming SIMD Extensions 2）是英特尔（Intel）在奔腾 4（Pentium 4）和英特尔至强（Intel Xeon）处理器中引入的 x86 指令集扩展。它由一组指令组成，这些指令对 XMM 和 MXCSR 寄存器进行运算，并对双精度浮点值和整数值执行单指令多数据（SIMD）操作，其中若干指令也在 MMX 寄存器中运算。<sup>[1](https://www.intel.com/content/dam/support/us/en/documents/processors/pentium4/sb/25366821.pdf)</sup> 英特尔在宣布 NetBurst 微架构时，将 SSE2 描述为新增 144 条指令，包括 128 位 SIMD 整数运算和 128 位 SIMD 双精度浮点指令。<sup>[2](https://www.intel.com/pressroom/archive/releases/2000/dp082200.htm)</sup>

| 关键事实 | 详情 |
|---|---|
| 随何者引入 | 奔腾 4 和英特尔至强处理器（IA-32 架构）<sup>[1](https://www.intel.com/content/dam/support/us/en/documents/processors/pentium4/sb/25366821.pdf)</sup> |
| 指令数量 | 144 条新指令，包括 128 位 SIMD 整数运算和 128 位 SIMD 双精度浮点运算<sup>[2](https://www.intel.com/pressroom/archive/releases/2000/dp082200.htm)</sup> |
| 使用的寄存器 | XMM 寄存器和 MXCSR 控制/状态寄存器；若干指令也在 MMX 寄存器中运算<sup>[1](https://www.intel.com/content/dam/support/us/en/documents/processors/pentium4/sb/25366821.pdf)</sup> |
| 新增数据类型 | 打包双精度浮点值和 128 位打包整数<sup>[3](https://www.intel.com/content/www/us/en/support/articles/000005779/processors.html)</sup> |
| CPUID 检测 | CPUID.01H:EDX.SSE2[第 26 位]<sup>[4](https://www.intel.com/content/www/us/en/developer/articles/technical/trusted-cpu-feature-detection-library-for-intel-software-guard-extensions-intel-sgx.html)</sup> |
| 值得注意的指令 | CLFLUSH（缓存行刷新）、MOVQ2DQ、MOVDQ2Q、MOVNTI 以及 MOVD 的 XMM 变体<sup>[5](https://www.intel.com/content/dam/support/us/en/documents/processors/pentium4/sb/25366521.pdf)</sup><sup> • </sup><sup>[6](https://docs.amd.com/api/khub/documents/j44LvPXzuuXgM0WyHKQfeQ/content)</sup> |
| 基线地位 | 包含在 x64 指令集中；安装 64 位 Windows 10 所必需<sup>[7](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/x64-instructions)</sup><sup> • </sup><sup>[8](https://learn.microsoft.com/en-ie/answers/questions/bb1b471b-4575-4a52-ae91-10f124b69795/win-10-update?forum=windows-all)</sup> |

## 在 SIMD 谱系中的位置

英特尔的 IA-32 SIMD 支持分阶段发展。MMX 技术通过 64 位 MMX 寄存器和 64 位打包整数数据类型引入了 SIMD 能力。最初的[流式 SIMD 扩展](https://www.edgepedia.org/zh/streaming-simd-extensions)（Streaming SIMD Extensions，SSE）随奔腾 III 处理器系列引入，以保存在 128 位寄存器中的打包和标量单精度浮点值扩展了这一模型。SSE2 通过支持打包双精度浮点值和 128 位打包整数，扩展了同一执行模型。<sup>[3](https://www.intel.com/content/www/us/en/support/articles/000005779/processors.html)</sup> AMD（超威半导体）的架构手册将 SSE2 与 SSE1、SSE3、SSSE3、SSE4.1、SSE4.2 和 SSE4A 一同归入*传统* SSE 子集，这些子集都支持 128 位向量操作数；*扩展*子集（AVX、AVX2、AVX512 等）则增加更宽的操作数和三操作数或四操作数形式。<sup>[9](https://docs.amd.com/api/khub/documents/sfvvekC9mDflu6vd3R0NXA/content)</sup>

## 指令的作用

SSE2 指令对 XMM 和 MXCSR 寄存器中的双精度浮点值和整数值执行 SIMD 操作。<sup>[1](https://www.intel.com/content/dam/support/us/en/documents/processors/pentium4/sb/25366821.pdf)</sup> 整数方面是早先指令集的拓宽：MMX 技术和 SSE 扩展引入的所有 64 位 SIMD 整数指令（PSHUFW 除外）都由 SSE2 扩展为对位于 XMM 寄存器中的 128 位打包整数操作数进行运算。128 位版本遵循与 64 位版本相同的打包操作数约定；64 位 PADDB 对 8 个打包字节运算，128 位版本则对 16 个打包字节运算。<sup>[5](https://www.intel.com/content/dam/support/us/en/documents/processors/pentium4/sb/25366521.pdf)</sup>

两条 SSE2 指令在 MMX 与 XMM 寄存器文件之间架起桥梁：MOVQ2DQ 将一个四字整数从 MMX 源寄存器移到 XMM 目标寄存器，MOVDQ2Q 将低四字从 XMM 源寄存器移到 MMX 目标寄存器。<sup>[5](https://www.intel.com/content/dam/support/us/en/documents/processors/pentium4/sb/25366521.pdf)</sup> AMD 的指令参考将 MOVD 的 XMM 寄存器变体和非临时存储 MOVNTI 列为 SSE2 子集成员，由 CPUID 功能号 0000_0001h 的 EDX[26] 位指示。<sup>[6](https://docs.amd.com/api/khub/documents/j44LvPXzuuXgM0WyHKQfeQ/content)</sup>

SSE2 还增加了可缓存性控制。随 SSE2 扩展引入的 CLFLUSH（刷新缓存行）指令写回并使与指定线性地址关联的缓存行失效；这种失效作用于处理器缓存层级的所有级别，并在整个缓存一致性域中广播。<sup>[5](https://www.intel.com/content/dam/support/us/en/documents/processors/pentium4/sb/25366521.pdf)</sup>

## 检测与操作系统支持

软件通过 CPUID 指令检测 SSE2。程序在确认处理器实现 CPUID 后，以 EAX = 1 执行 CPUID，并检测返回的 EDX 特性标志的第 26 位；英特尔的优化手册给出该位的测试值为 00400000h。<sup>[10](https://www.intel.com/content/dam/doc/manual/64-ia-32-architectures-optimization-manual.pdf)</sup> 标准 CPUID 记法为 CPUID.01H:EDX.SSE2[第 26 位]。<sup>[4](https://www.intel.com/content/www/us/en/developer/articles/technical/trusted-cpu-feature-detection-library-for-intel-software-guard-extensions-intel-sgx.html)</sup>

SSE2 支持的操作系统要求与 SSE 相同：操作系统必须支持在上下文切换时保存和恢复 SSE 状态，以便使用这些指令的应用程序行为一致。<sup>[10](https://www.intel.com/content/dam/doc/manual/64-ia-32-architectures-optimization-manual.pdf)</sup> 在 Windows 上，IsProcessorFeaturePresent 函数通过 PF_XMMI64_INSTRUCTIONS_AVAILABLE 常量（值为 10）报告 SSE2 可用性，而 [Windows 2000](https://www.edgepedia.org/zh/windows-2000) 不支持该常量。<sup>[11](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent)</sup>

## 在现代软件中的基线地位

SSE2 已成为 64 位软件的下限。微软（Microsoft）的调试器文档指出，x64 指令集包含对 x86 的增补，例如 SSE2，并且为 x64 编译的程序可以自由使用这些指令。<sup>[7](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/x64-instructions)</sup> 安装 64 位版本的 [Windows 10](https://www.edgepedia.org/zh/windows-10) 要求处理器支持 SSE2，以及物理地址扩展（PAE）、不执行（NX）和 CMPXCHG16b；安装向导会检查这些特性，缺少它们便不会继续。<sup>[8](https://learn.microsoft.com/en-ie/answers/questions/bb1b471b-4575-4a52-ae91-10f124b69795/win-10-update?forum=windows-all)</sup> 与此一致，微软 C 运行时的 `_set_SSE2_enable` 函数在 32 位 x86 上切换 `atan`、`ceil`、`exp`、`floor`、`log` 和 `log10` 等数学例程的 SSE2 实现，但该函数在 x64 架构上不可用，因为在那里 SSE2 默认启用。<sup>[12](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/set-sse2-enable?view=msvc-170)</sup>

编译器和库工具链将 SSE2 视为可选择的基线代码路径。例如，AMD 的 AOCL 库允许将环境变量 `AOCL_ENABLE_INSTRUCTIONS` 设为 `SSE2`、`AVX`、`AVX2` 或 `AVX512`，以分派到特定 ISA 的代码路径，其中 SSE2 是高于通用参考路径的最低优化层级。<sup>[13](https://docs.amd.com/r/en-US/57404-AOCL-user-guide/Instruction-Set-Selection)</sup>

## 预期应用

英特尔将 SSE2 描述为提升处理器在高级三维图形、视频解码与编码、语音识别、[电子商务](https://www.edgepedia.org/zh/e-commerce)、互联网、科学和工程应用中的性能。<sup>[3](https://www.intel.com/content/www/us/en/support/articles/000005779/processors.html)</sup> AMD 关于 SSE 家族（包括 SSE2）的应用编程讨论指出，能够并行处理双精度浮点向量元素的能力适用于稠密线性方程组、实数和复数的矩阵与向量空间运算，以及专业 CAD 应用中模拟传热或流体动力学的物理建模算法等计算。<sup>[9](https://docs.amd.com/api/khub/documents/sfvvekC9mDflu6vd3R0NXA/content)</sup>

## 后继者

SSE3 紧随 SSE2 之后，随支持超线程技术（Hyper-Threading Technology）、基于 90 纳米制程的奔腾 4 处理器引入；它提供 13 条指令，可提升 SSE、SSE2 和 x87-FP 的数学运算性能。<sup>[3](https://www.intel.com/content/www/us/en/support/articles/000005779/processors.html)</sup> 后来的传统子集（SSSE3、SSE4.1 和 SSE4.2）以及扩展的 AVX 家族子集在 SSE2 所确立的模型上进一步发展，其中 AVX512 支持 512 位向量操作数。<sup>[9](https://docs.amd.com/api/khub/documents/sfvvekC9mDflu6vd3R0NXA/content)</sup>

## References

1. [Intel® 64 and IA-32 Architectures Software Developer's Manual, Section 17.7: Streaming SIMD Extensions 2 (SSE2)](https://www.intel.com/content/dam/support/us/en/documents/processors/pentium4/sb/25366821.pdf)
2. [Intel Announces New NetBurst® Micro-Architecture For Pentium® 4 Processor (press release, 2000)](https://www.intel.com/pressroom/archive/releases/2000/dp082200.htm)
3. [Intel® Instruction Set Extensions Technology](https://www.intel.com/content/www/us/en/support/articles/000005779/processors.html)
4. [Trusted CPU Feature Detection Library for Intel® Software Guard Extensions (Intel® SGX)](https://www.intel.com/content/www/us/en/developer/articles/technical/trusted-cpu-feature-detection-library-for-intel-software-guard-extensions-intel-sgx.html)
5. [Intel® 64 and IA-32 Architectures Software Developer's Manual, Volume 1, Chapter 11: Programming with Streaming SIMD Extensions 2 (SSE2)](https://www.intel.com/content/dam/support/us/en/documents/processors/pentium4/sb/25366521.pdf)
6. [AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions](https://docs.amd.com/api/khub/documents/j44LvPXzuuXgM0WyHKQfeQ/content)
7. [x64 Instructions, Windows drivers, Microsoft Learn](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/x64-instructions)
8. [Win 10 update, Microsoft Q&A (SSE2 among 64-bit Windows 10 CPU requirements)](https://learn.microsoft.com/en-ie/answers/questions/bb1b471b-4575-4a52-ae91-10f124b69795/win-10-update?forum=windows-all)
9. [AMD64 Architecture Programmer's Manual, Volume 1: Application Programming](https://docs.amd.com/api/khub/documents/sfvvekC9mDflu6vd3R0NXA/content)
10. [Intel® 64 and IA-32 Architectures Optimization Reference Manual, Chapter 4: Checking for SSE2 Support](https://www.intel.com/content/dam/doc/manual/64-ia-32-architectures-optimization-manual.pdf)
11. [IsProcessorFeaturePresent function (processthreadsapi.h), Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent)
12. [_set_SSE2_enable, Microsoft Learn](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/set-sse2-enable?view=msvc-170)
13. [Instruction Set Selection, AOCL User Guide (57404)](https://docs.amd.com/r/en-US/57404-AOCL-user-guide/Instruction-Set-Selection)

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

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/sse2

English original: https://www.edgepedia.org/sse2
