# 可扩展向量扩展

可扩展向量扩展（Scalable Vector Extension，SVE）是 Arm 架构 64 位 AArch64 执行状态下的单指令多数据（SIMD）向量指令集扩展，其中每个处理器实现可以在 128 位到 2,048 位之间选择自己的向量寄存器长度，而编译后的代码可在所有这些长度上不加修改地运行。它于 2016 年 8 月 22 日在 Hot Chips 大会上由 Arm 首席 ISA 架构师兼院士奈杰尔·斯蒂芬斯 宣布，作为 Armv8.2-A 起的可选扩展，其第二版 SVE2 是首批 Armv9 Cortex CPU 的强制组成部分。<sup>[1](https://developer.arm.com/community/arm-community-blogs/b/servers-and-cloud-computing-blog/posts/technology-update-the-scalable-vector-extension-sve-for-the-armv8-a-architecture)</sup><sup> • </sup><sup>[2](https://arxiv.org/abs/1803.06185)</sup><sup> • </sup><sup>[3](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/sve2)</sup><sup> • </sup><sup>[4](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/first-armv9-cpu-cores)</sup>

| 关键事实 | 详情 |
|---|---|
| 是什么 | AArch64 的 SIMD 扩展，向量寄存器长度由实现定义，必须为 2 的幂，从 128 位到 2048 位<sup>[5](https://support.arm.com/documentation/109246/0100/Introduction?lang=en)</sup> |
| 首次出现 | 2016 年 8 月 22 日在 Hot Chips 宣布；自 Armv8.2-A 起为可选<sup>[1](https://developer.arm.com/community/arm-community-blogs/b/servers-and-cloud-computing-blog/posts/technology-update-the-scalable-vector-extension-sve-for-the-armv8-a-architecture)</sup><sup> • </sup><sup>[3](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/sve2)</sup> |
| 编程模型 | 向量长度无关（VLA）：一个编译好的二进制文件可在任何向量长度上运行，无需重新编译<sup>[5](https://support.arm.com/documentation/109246/0100/Introduction?lang=en)</sup> |
| 寄存器堆 | 32 个可扩展向量寄存器 Z0–Z31（扩展 Neon 的 V0–V31）和 16 个谓词寄存器 P0–P15，后者大小为向量寄存器的八分之一<sup>[6](https://learn.arm.com/learning-paths/servers-and-cloud-computing/sve/sve_basics/)</sup> |
| SVE2 | 随 Armv9-A 引入的 SVE 超集，将覆盖范围扩展到 DSP、媒体、机器学习以及 HPC 之外的其他领域<sup>[5](https://support.arm.com/documentation/109246/0100/Introduction?lang=en)</sup> |
| 旗舰实现 | 富士通 A64FX，Armv8.2-A 配 512 位 SVE，富岳超级计算机的处理器<sup>[7](https://global.fujitsu/en-global/technology/research/fugaku/specifications)</sup> |
| Linux 支持 | `prctl(PR_SVE_SET_VL)` 调用在 arm64 上设置线程的向量长度，自 Linux 4.15 起可用<sup>[8](https://man7.org/linux/man-pages/man2/PR_SVE_SET_VL.2const.html)</sup> |

## 设计目标与可扩展向量长度

经典 SIMD 指令集——包括 Arm 自家的 Neon——在指令集定义中固定了向量宽度。为一个宽度编译的程序无法在不重新编译的情况下利用后来更宽的实现，而适合一个市场的宽度未必适合另一个市场。SVE 消除了这一约束：它不规定向量长度，而是让 CPU 设计者为其应用和市场选择最合适的长度，每个向量寄存器从 128 位到 2048 位，并支持向量长度无关的编程模型，以适应硬件提供的任何长度。<sup>[1](https://developer.arm.com/community/arm-community-blogs/b/servers-and-cloud-computing-blog/posts/technology-update-the-scalable-vector-extension-sve-for-the-armv8-a-architecture)</sup>

斯蒂芬斯及其同事在 IEEE Micro 论文中陈述的目标是：扩展 AArch64 向量处理以服务于高性能计算、数据分析、计算机视觉和机器学习；让 CPU 设计者选择符合其功耗、性能和面积目标的向量长度；以及避免因向量长度变化而强加软件开发成本，部分途径是扩大编译器自动向量化的覆盖范围。<sup>[2](https://arxiv.org/abs/1803.06185)</sup> 为 SVE 编译一次的程序可在不同的实现性能点上运行，并在未来硬件出现更长向量时自动受益，从而降低架构生命周期内的部署成本。<sup>[1](https://developer.arm.com/community/arm-community-blogs/b/servers-and-cloud-computing-blog/posts/technology-update-the-scalable-vector-extension-sve-for-the-armv8-a-architecture)</sup>

## 寄存器与谓词化

SVE 是一种以谓词为中心的架构。它增加了 32 个可扩展向量寄存器 Z0–Z31，扩展了 Neon 的 128 位 V0–V31 寄存器，可容纳打包的双精度、单精度和半精度浮点元素以及打包的 64 位、32 位、16 位和 8 位整数。与之并列的是 16 个可扩展谓词寄存器 P0–P15，每个大小为向量寄存器的八分之一（每字节一位），用于循环和算术控制，另有一个首故障寄存器（FFR），支持对故障加载的软件推测。<sup>[6](https://learn.arm.com/learning-paths/servers-and-cloud-computing/sve/sve_basics/)</sup>

**按通道谓词化**是设计的核心。一个布尔值向量——每个数据元素对应一个——启用或禁用应用于每个元素的操作。这处理了困扰固定宽度 SIMD 的常见情况：元素数量不是向量宽度倍数的数据，以及必须对某些元素有条件地操作的算法。SVE 还增加了聚集加载和分散存储（访问非连续内存位置），以及使用向量基址和偏移的灵活寻址。<sup>[1](https://developer.arm.com/community/arm-community-blogs/b/servers-and-cloud-computing-blog/posts/technology-update-the-scalable-vector-extension-sve-for-the-armv8-a-architecture)</sup><sup> • </sup><sup>[9](https://documentation-service.arm.com/static/660e6e38aec7154a17ee1f25)</sup> 这些特性旨在消除自动向量化的障碍，使编译器能从普通 C、C++ 和 Fortran 代码中提取更细粒度的并行性。<sup>[1](https://developer.arm.com/community/arm-community-blogs/b/servers-and-cloud-computing-blog/posts/technology-update-the-scalable-vector-extension-sve-for-the-armv8-a-architecture)</sup>

## SVE2

SVE2 作为 2021 年 3 月宣布的 Armv9-A 的一部分引入，是 SVE 的超集，将指令集从高性能计算扩展到数字信号处理、媒体和通用软件。Arm 为 Armv9 开发 SVE2，以在更广泛的应用中实现增强的机器学习和 DSP 能力，其基础是与富士通为富岳超级计算机所做的 SVE 工作。<sup>[5](https://support.arm.com/documentation/109246/0100/Introduction?lang=en)</sup><sup> • </sup><sup>[10](https://newsroom.arm.com/news/arms-solution-to-the-future-needs-of-ai-security-and-specialized-computing-is-v9)</sup>

为 SVE2 指定的应用领域包括多媒体、LTE 基带处理、基因组学、内存数据库、Web 服务和通用软件。新指令映射到这些领域：UDOT 用于机器学习，TBL 和 TBX 用于计算机视觉，CADD 和 CMLA 用于基带网络，BDEP 和 BEXT 用于基因组学，MATCH 和 NMATCH 用于服务器工作负载，SM4E 用于密码学，以及多精度进位传播算术。<sup>[9](https://documentation-service.arm.com/static/660e6e38aec7154a17ee1f25)</sup> SVE2 并不取代 Neon；Neon 和 VFP 仍为向后兼容所必需，SVE2 与它们在同一芯片上共存。<sup>[9](https://documentation-service.arm.com/static/660e6e38aec7154a17ee1f25)</sup> SVE2 是首批 Armv9 Cortex CPU 的强制组成部分，因此开发者可以依赖其在 Armv9 消费设备中的存在。<sup>[4](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/first-armv9-cpu-cores)</sup>

## 实现

首个重要实现是富士通与 Arm 合作开发的 A64FX。富士通作为制定 SVE 规范的主要合作伙伴，致力于实现 HPC 应用的高速执行。A64FX 符合 Armv8.2-A 配 512 位 SVE，为富岳超级计算机提供动力，其节点架构列为 Armv8.2-A SVE 512 位，每节点 48 个计算核心，正常模式下双精度峰值性能为每秒 488 千万亿次浮点运算。<sup>[7](https://global.fujitsu/en-global/technology/research/fugaku/specifications)</sup> 富士通在注意到其早期 K 计算机的 128 位 SIMD 短于 HPC CPU 的 256 位和 512 位趋势且不适合提升每核心性能后，选择了 512 位长度。<sup>[11](https://www.fujitsu.com/downloads/SUPER/topics/isc21/applications-for-primehpc.pdf)</sup>

Arm 自家的服务器核心在长度尺度上选择了不同点。Neoverse V1 以 2x256 位向量单元执行 SVE，而 Neoverse V2 转向四个 128 位管道实现 SVE2，这一配置用于亚马逊的 Graviton4 和 NVIDIA 的 Grace 超级芯片（144 个 Neoverse V2 核心配 4x128 位 SVE2）。<sup>[12](https://developer.arm.com/community/arm-community-blogs/b/servers-and-cloud-computing-blog/posts/arm-neoverse-v2-platform-best-in-class-cloud-and-ai-ml-performance)</sup><sup> • </sup><sup>[13](https://www.pnnl.gov/publications/studying-cpu-and-memory-utilization-applications-fujitsu-a64fx-and-nvidia-grace)</sup> 同一个二进制文件可在所有这些长度上运行，这就是 VLA 模型的实际收益：一个 SVE 二进制文件可不加修改地在 128 位的 Graviton4 或未来具有更宽向量的芯片上运行。<sup>[14](https://learn.arm.com/learning-paths/servers-and-cloud-computing/adler32-kiro/3-sve-concepts/)</sup>

## 软件支持

2016 年宣布后，编译器迅速获得了 SVE 支持。GNU 工具从 8.0 版起支持 SVE；LLVM（Clang）自第 5 版起支持 SVE，自第 9 版起支持 SVE2；Arm Compiler for Linux 自 18.0 版起支持 SVE，自 20.0 版起支持 SVE2。提供优化 BLAS 和 LAPACK 例程的 Arm Performance Libraries 自 19.3 版起支持 SVE，Arm 指令仿真器可在缺少该扩展的硬件上运行 SVE 和 SVE2 二进制文件。<sup>[9](https://documentation-service.arm.com/static/660e6e38aec7154a17ee1f25)</sup>

程序员可以通过汇编、通过 `arm_sve.h` 头文件在 C 和 C++ 中使用内建函数、使用 `-march=armv8-a+sve2` 等标志的编译器自动向量化，或使用 Arm Compute Library 等优化库来编写 SVE2 代码。<sup>[3](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/sve2)</sup> 在 Linux 上，向量长度是每线程属性：`prctl(PR_SVE_SET_VL)` 以字节为单位将其设为上限，内核选择不超过该上限的最大可用长度，系统默认值可通过 `/proc/sys/abi/sve_default_vector_length` 配置。<sup>[8](https://man7.org/linux/man-pages/man2/PR_SVE_SET_VL.2const.html)</sup>

## 与其他向量 ISA 的比较

SVE 与 x86 AVX-512 的区别，与所有可扩展向量 ISA 同固定宽度 ISA 的区别在根本上是相同的：AVX-512 在指令集中固定了 512 位寄存器，而 SVE 将向量长度视为微架构参数。SVE 和 RISC-V 向量扩展（RVV）等可变长度扩展要求程序应对硬件提供的任何长度，要么编写长度无关的代码，要么为可能的长度提供一系列实现。<sup>[15](https://onlinelibrary.wiley.com/doi/full/10.1002/cpe.70435)</sup> 一项 2025 年对零知识证明工作负载的研究发现，ARM SVE/SVE2 作为指令集至少与 AVX/AVX512 一样强大但更灵活，然而实测当前云 ARM CPU 在实践中较慢：在构建超过四百万叶子的 Merkle 树时，AWS Graviton4 和 [Google Axion](https://www.edgepedia.org/zh/google-axion) 比最新的 AMD EPYC 和 Intel Xeon 服务器慢 1.6 倍和 1.4 倍，作者将其归因于较小的向量尺寸（128 位对 512 位）和较低的时钟频率，并估计 512 位 SVE 实现将扭转比较结果，同时保持 ARM 的价格优势。<sup>[16](https://arxiv.org/abs/2506.09505)</sup>

对于某些算法，SVE 相对于 Neon 也存在差距。在 SVE 上尝试的按位位置置位计数实现被推迟，因为 SVE 缺少快速全加器电路所需的 bsl/bit/bif 指令族，以及一些零扩展 DSP 算术和重排指令，导致即使向量长度翻倍，预计性能也差于 ASIMD。<sup>[15](https://onlinelibrary.wiley.com/doi/full/10.1002/cpe.70435)</sup> 对包括 A64FX 在内的高端 ARM 系统的更广泛基准测试发现，性能通常与当前 x86 对应产品相当，往往领先于前几代 x86，且在大多数测试情况下比 x86 处理器更节能。<sup>[17](https://researchconnect.stonybrook.edu/en/publications/are-we-ready-for-broader-adoption-of-arm-in-the-hpc-community-per/)</sup> SPC5 稀疏矩阵-向量乘法框架等移植研究——从 AVX512 内核转换为 A64FX 上的 SVE——展示了将现有 x86 向量代码迁移到该架构的实际路径。<sup>[18](https://arxiv.org/abs/2307.14774)</sup>

## References

1. [Nigel Stephens (2016). Technology Update: Scalable Vector Extension (SVE) for Armv8-A. Arm Community.](https://developer.arm.com/community/arm-community-blogs/b/servers-and-cloud-computing-blog/posts/technology-update-the-scalable-vector-extension-sve-for-the-armv8-a-architecture)
2. [Nigel Stephens and colleagues (2017/2018). The ARM Scalable Vector Extension. IEEE Micro 37(2); arXiv:1803.06185.](https://arxiv.org/abs/1803.06185)
3. [Koki Mitsunami (2021). Evolution of SIMD architecture with SVE2. Arm Community.](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/sve2)
4. [First Armv9 CPU cores. Arm Community.](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/first-armv9-cpu-cores)
5. [SME Programmer's Guide, Introduction. Arm documentation.](https://support.arm.com/documentation/109246/0100/Introduction?lang=en)
6. [From Arm Neon to SVE. Arm Learning Paths.](https://learn.arm.com/learning-paths/servers-and-cloud-computing/sve/sve_basics/)
7. [Specifications - Supercomputer Fugaku. Fujitsu Global.](https://global.fujitsu/en-global/technology/research/fugaku/specifications)
8. [PR_SVE_SET_VL(2const). Linux man-pages project.](https://man7.org/linux/man-pages/man2/PR_SVE_SET_VL.2const.html)
9. [Learn the architecture - Introducing SVE2, version 1.0. Arm documentation.](https://documentation-service.arm.com/static/660e6e38aec7154a17ee1f25)
10. [Arm's Solution to the Future Needs of AI, Security and Specialized Computing is v9. Arm Newsroom, March 30, 2021.](https://newsroom.arm.com/news/arms-solution-to-the-future-needs-of-ai-security-and-specialized-computing-is-v9)
11. [Applications for PRIMEHPC. Fujitsu.](https://www.fujitsu.com/downloads/SUPER/topics/isc21/applications-for-primehpc.pdf)
12. [Arm Neoverse V2 platform: best-in-class cloud and AI/ML performance. Arm Community.](https://developer.arm.com/community/arm-community-blogs/b/servers-and-cloud-computing-blog/posts/arm-neoverse-v2-platform-best-in-class-cloud-and-ai-ml-performance)
13. [Studying CPU and memory utilization of applications on Fujitsu A64FX and Nvidia Grace Superchip. PNNL/MEMSYS 2024.](https://www.pnnl.gov/publications/studying-cpu-and-memory-utilization-applications-fujitsu-a64fx-and-nvidia-grace)
14. [Understand core SVE concepts for vectorization. Arm Learning Paths.](https://learn.arm.com/learning-paths/servers-and-cloud-computing/adler32-kiro/3-sve-concepts/)
15. [Clausecker (2025). Faster Positional-Population Counts for AVX2, AVX-512, and ASIMD. Concurrency and Computation: Practice and Experience.](https://onlinelibrary.wiley.com/doi/full/10.1002/cpe.70435)
16. [On the Performance of Cloud-based ARM SVE for Zero-Knowledge Proving Systems. arXiv:2506.09505.](https://arxiv.org/abs/2506.09505)
17. [Simakov and colleagues (2023). Are we ready for broader adoption of ARM in the HPC community. HPC Asia 2023 Workshops.](https://researchconnect.stonybrook.edu/en/publications/are-we-ready-for-broader-adoption-of-arm-in-the-hpc-community-per/)
18. [Regnault and Bramas (2023). SPC5: an efficient SpMV framework vectorized using ARM SVE and x86 AVX-512. arXiv:2307.14774.](https://arxiv.org/abs/2307.14774)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Processors & processor engineering › Instruction set architectures › Vector and SIMD instruction sets (cross-family)

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/scalable-vector-extension

English original: https://www.edgepedia.org/scalable-vector-extension
