You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/cross-platform/vectorization-comparison/1-vectorization.md
+25-15Lines changed: 25 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: "Migrating SIMD code to the Arm architecture"
2
+
title: "Migrate SIMD code to the Arm architecture"
3
3
weight: 3
4
4
5
5
# FIXED, DO NOT MODIFY
@@ -8,18 +8,20 @@ layout: "learningpathall"
8
8
9
9
## Vectorization on x86 and Arm
10
10
11
-
Migrating SIMD (Single Instruction, Multiple Data) code from x86 extensions to Arm extensions is an important task for software developers aiming to optimize performance on Arm platforms.
11
+
Migrating SIMD (Single Instruction, Multiple Data) code from x86 extensions to Arm extensions is a key task for software developers aiming to optimize performance on Arm platforms.
12
12
13
-
Understanding the mapping from x86 instruction sets such as SSE, AVX, and AMX to Arm’s NEON, SVE, and SME extensions is essential for achieving portability and high performance. This Learning Path provides an overview to help you design a migration plan, leveraging Arm features such as scalable vector lengths and advanced matrix operations to adapt your code effectively.
13
+
Understanding the mapping from x86 instruction sets such as SSE, AVX, and AMX to Arm’s NEON, SVE, and SME extensions is essential for achieving portability and high performance. This Learning Path provides an overview to help you design a migration plan in which you can leverage Arm features such as scalable vector lengths and advanced matrix operations to adapt your code effectively.
14
14
15
15
Vectorization is a key optimization strategy where one instruction processes multiple data elements simultaneously. It drives performance in High-Performance Computing (HPC), AI and ML, signal processing, and data analytics.
16
16
17
17
Both x86 and Arm processors offer rich SIMD capabilities, but they differ in philosophy and design. The x86 architecture provides fixed-width vector units of 128, 256, and 512 bits. The Arm architecture offers fixed-width vectors for NEON and scalable vectors for SVE and SME, ranging from 128 to 2048 bits.
18
18
19
-
If you are migrating SIMD software to Arm, understanding these differences helps you write portable, high-performance code.
19
+
If you are migrating SIMD software to Arm, understanding these differences will help you write portable, high-performance code.
20
20
21
21
## Arm vector and matrix extensions
22
22
23
+
This section provides some more information about the Arm vector and matrix extensions and shows you when to use each, how they map from SSE/AVX/AMX, and what changes in your programming model (predication, gather/scatter, tiles, streaming mode).
24
+
23
25
### NEON
24
26
25
27
NEON is a 128-bit SIMD extension available across Armv8-A cores, including Neoverse and mobile. It is well suited to multimedia, DSP, and packet processing. Conceptually, NEON is closest to x86 SSE and AVX used in 128-bit mode, making it the primary target when migrating many SSE workloads. Compiler auto-vectorization to NEON is mature, reducing the need for manual intrinsics.
@@ -34,6 +36,8 @@ SME accelerates matrix multiplication and is similar in intent to AMX. Unlike AM
34
36
35
37
## x86 vector and matrix extensions
36
38
39
+
Here is a brief overview of the x86 families you’ll likely port from: SSE (128-bit), AVX/AVX-512 (256/512-bit with masking), and AMX (tile-based matrix compute). Use this to identify feature equivalents before mapping kernels to NEON, SVE/SVE2, or SME on Arm.
40
+
37
41
### Streaming SIMD Extensions (SSE)
38
42
39
43
The SSE instruction set provides 128-bit XMM registers and supports both integer and floating-point SIMD operations. Despite being an older technology, SSE remains a baseline for many libraries due to its widespread adoption.
@@ -50,21 +54,23 @@ AMX accelerates matrix operations with tile registers configured using a tile pa
50
54
51
55
## Comparison tables
52
56
53
-
### SSE vs. NEON
57
+
Use these side-by-side tables to pick the right Arm target and plan refactors. They compare register width, predication/masking, gather/scatter, key operations, typical workloads, and limitations for SSE ↔ NEON, AVX/AVX-512 ↔ SVE/SVE2, and AMX ↔ SME.
|**Extensibility**| Extended by AVX, AVX2, and AVX-512 | Fixed at 128-bit; scalable vectors provided by SVE as a separate extension |
65
-
|**Programming model**| Intrinsics in C or C plus plus; assembly for hotspots | Intrinsics widely used; inline assembly less common |
71
+
|**Programming model**| Intrinsics in C/C++; assembly for hotspots | Intrinsics widely used; inline assembly less common |
66
72
67
-
### AVX vs. SVE (SVE2)
73
+
### A comparison of AVX and SVE (SVE2)
68
74
69
75
| Feature | x86: AVX or AVX-512 | Arm: SVE or SVE2 |
70
76
|---|---|---|
@@ -80,7 +86,7 @@ AMX accelerates matrix operations with tile registers configured using a tile pa
80
86
SVE2 extends SVE with richer integer and DSP capabilities for general-purpose and media workloads.
81
87
{{% /notice %}}
82
88
83
-
### AMX vs. SME
89
+
### A comparison of AMX and SME
84
90
85
91
| Feature | x86: AMX | Arm: SME |
86
92
|---|---|---|
@@ -92,7 +98,9 @@ SVE2 extends SVE with richer integer and DSP capabilities for general-purpose an
92
98
|**Best suited for**| AI and ML training and inference, GEMM and convolution kernels | AI and ML training and inference, scientific and HPC dense linear algebra |
93
99
|**Limitations**| Hardware and software availability limited to specific CPUs | Emerging hardware support; compiler and library support evolving |
94
100
95
-
## Key differences for developers
101
+
## The key differences for developers
102
+
103
+
The most significant changes when porting include moving from fixed-width SIMD to vector-length-agnostic loop structures, replacing mask-register control with predicate-driven control, and adjusting memory access patterns and compiler flags. Review this section first to minimize rework and preserve portable performance.
96
104
97
105
### Vector length model
98
106
@@ -106,16 +114,18 @@ x86 intrinsics are extensive, and AVX-512 adds masks and lane controls that incr
106
114
107
115
AMX provides fixed-geometry tile compute optimized for dot products. SME extends Arm’s scalable model with outer-product math, scalable tiles, and streaming mode. Both AMX and SME are currently available on a limited set of platforms.
108
116
109
-
### Overall summary
117
+
##Summary
110
118
111
119
Migrating from x86 SIMD to Arm entails adopting Arm’s scalable and predicated programming model with SVE and SME for forward-portable performance, while continuing to use NEON for fixed-width SIMD similar to SSE.
112
120
113
121
## Migration tools
114
122
115
123
Several libraries help translate or abstract SIMD intrinsics to speed up migration. Coverage varies, and some features have no direct analogue.
116
124
117
-
-**sse2neon:** open-source header that maps many SSE2 intrinsics to NEON equivalents. Good for getting code building quickly. Review generated code for performance. <https://github.com/DLTcollab/sse2neon>
118
-
-**SIMD Everywhere (SIMDe):** header-only portability layer that implements many x86 and Arm intrinsics across ISAs, with scalar fallbacks when SIMD is unavailable. <https://github.com/simd-everywhere/simde>
119
-
-**Google Highway (hwy):** portable SIMD library and APIs that target multiple ISAs, including NEON, SVE where supported, and AVX, without per-ISA code paths. <https://github.com/google/highway>
125
+
Here are some of the tools available and their key features:
126
+
127
+
- Sse2neon: an open-source header that maps many SSE2 intrinsics to NEON equivalents. Good for getting code building quickly. Review generated code for performance. See the [sse2neon GitHub repository](https://github.com/DLTcollab/sse2neon).
128
+
- SIMD Everywhere (SIMDe): a header-only portability layer that implements many x86 and Arm intrinsics across ISAs, with scalar fallbacks when SIMD is unavailable. See the [simde-everywhere GitHub repository](https://github.com/simd-everywhere/simde).
129
+
- Google Highway (hwy): a portable SIMD library and APIs that target multiple ISAs, including NEON, SVE where supported, and AVX, without per-ISA code paths. See the [Google highway GitHub repository](https://github.com/google/highway).
120
130
121
-
For more on cross-platform intrinsics, see [Porting architecture-specific intrinsics](/learning-paths/cross-platform/intrinsics/).
131
+
For more on cross-platform intrinsics, see the Learning Path [Porting architecture-specific intrinsics](/learning-paths/cross-platform/intrinsics/).
Copy file name to clipboardExpand all lines: content/learning-paths/cross-platform/vectorization-comparison/2-code-examples.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: "Vector extension code examples"
2
+
title: "Explore vector extension code examples"
3
3
weight: 4
4
4
5
5
# FIXED, DO NOT MODIFY
@@ -13,11 +13,11 @@ This page walks you through a SAXPY (Single-Precision A·X Plus Y) kernel implem
13
13
SAXPY computes `y[i] = a * x[i] + y[i]` across arrays `x` and `y`. It is widely used in numerical computing and is an accessible way to compare SIMD behavior across ISAs.
14
14
15
15
{{% notice Tip %}}
16
-
If a library already provides a tuned SAXPY (for example, BLAS), prefer that over hand-written kernels. These examples are for learning and porting.
16
+
If a library already provides a tuned SAXPY (for example, BLAS), use that over hand-written kernels. These examples are for learning and porting.
17
17
{{% /notice %}}
18
18
19
19
20
-
###Reference C version (no SIMD intrinsics)
20
+
## Reference C version (no SIMD intrinsics)
21
21
22
22
Below is a plain C implementation of SAXPY without any vector extensions which serves as a reference baseline for the optimized examples provided later:
23
23
@@ -57,7 +57,7 @@ int main() {
57
57
}
58
58
```
59
59
60
-
Use a text editor to copy the code to a file `saxpy_plain.c` and build and run the code using:
60
+
Use a text editor to copy the code to a file called `saxpy_plain.c` and build and run the code using:
###Arm SVE (hardware dependent: 4 to 16+ floats per operation)
211
+
## Arm SVE (hardware dependent: 4 to 16+ floats per operation)
212
212
213
213
Arm SVE lets the hardware determine the register width, which can range from 128 up to 2048 bits. This means each operation can process from 4 to 64 single-precision floats at a time, depending on the implementation.
Copy file name to clipboardExpand all lines: content/learning-paths/cross-platform/vectorization-comparison/_index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: "Migrate x86-64 SIMD to Arm64"
3
3
4
4
minutes_to_complete: 30
5
5
6
-
who_is_this_for: Advanced software developers migrating vectorized (SIMD) code from x86-64 to Arm64.
6
+
who_is_this_for: This is an advanced topic for developers migrating vectorized (SIMD) code from x86-64 to Arm64.
7
7
8
8
learning_objectives:
9
9
- Identify how Arm vector extensions including NEON, Scalable Vector Extension (SVE), and Scalable Matrix Extension (SME) map to vector extensions from other architectures
0 commit comments