Arm Working On Function Multi-Versioning For GCC

Written by Michael Larabel in Arm on 19 July 2022 at 05:51 AM EDT. 7 Comments
A feature supported by the GNU Compiler Collection (GCC) that sadly isn't used more often is function multi-versioning (FMV) for supporting multiple versions of a function with the given function selected based upon the target processor in use. GCC FMV on x86_64 allows for different functions to be used whether supporting SSE4.2, AVX, or even a particular CPU micro-architecture. Arm is finally working on GCC function multi-versioning support for AArch64.

GCC function multi-versioning on x86_64 makes it easy for developers to create optimized functions for hot code paths that at run-time will be used by a compatible/relevant processor. Function Multi-Versioning allows for the run-time handling of the most appropriate code path for a given function without having to resort to shipping multiple binaries or raising the base requirements for your software. But currently GCC FMV only works for x86/x86_64 and POWER. As well, this currently only works with GCC's C++ front-end.

The FMV syntax example from the GCC documentation on function multi-versioning.

Arm is looking at supporting GCC Function Multi-versioning for their CPU architecture and have recently published a beta specification around it.

Arm announced their beta work on FMV support and is currently seeking feedback from developers on their proposed handling of it. With FMV on Arm they are looking to be able to let developers use a target Arm version as one of the planned changes. On Arm's GitHub is their proposed specification for Arm FMV.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week