Who is this for?
This is an advanced topic for developers interested in optimizing their C/C++ applications across Arm64 targets.
What will you learn?
After completing this Learning Path, you'll be able to perform the following tasks:
- Use hardware features to tune your applications at function level.
- Create multiple versions of C/C++ functions for the targets that you intend to run applications on.
- Assist the compiler in generating optimal code for the targets, or provide your own optimized versions at source level.
- Automatically select the most appropriate function version at runtime.
- Reuse your optimized application binaries across various targets.
Prerequisites
Before starting, you'll need the following prerequisites:
- Basic knowledge of GNU function attributes.
- Familiarity with indirect functions (ifuncs).
- Basic knowledge of loop vectorization.
- Familiarity with Arm assembly.
- A LLVM 20 compiler with runtime library support or GCC 16.
Summary
This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
target_version and target_clones attributes, so a single binary contains feature-specific implementations. You’ll create versions keyed to architectural features such as default, sve, sve2, simd, mops, and sme2 to enable runtime selection of the most suitable function. Through hands-on examples, you’ll compare code generation for a vectorized loop, write an SVE-based dot product with Arm C Language Extensions (ACLE), and mix SVE2 inline assembly with library calls where the compiler can emit FEAT_MOPS for memcpy. You’ll also cover streaming mode compatibility by keeping calling conventions consistent across function versions.Frequently asked questions
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
default, sve, sve2, simd, mops, or sme2. You can also combine multiple features using a + separator in the attribute string.target_clones doesn’t affect which version is chosen at runtime.target_version (for example, sve or sve2). Keep a generic default version so the binary runs on Armv8 targets without those features.__arm_streaming (and related attributes) with target_version or target_clones to keep versions compatible.