AArch64 streaming SVE exponential instruction gating receives an update.
GCC's AArch64 support for the streaming SVE FEXPA intrinsic now correctly gates its availability based on hardware support.
This update refines the availability gating of the svexpa intrinsic for AArch64 streaming SVE, ensuring it is enabled only when the ssve-fexpa feature is supported. This change aligns the compiler’s behavior with the underlying hardware capabilities, preventing incorrect code generation or feature exposure when ssve-fexpa is not present. Additionally, the __ARM_FEATURE_SSVE_FEXPA macro is now implemented, allowing developers to conditionally compile code based on this specific architecture feature.
In Details
This commit addresses the gating logic for the SVE exponential approximation intrinsic, svexpa, to ensure it is only available in "streaming mode" when the FEAT_SSVE_FEXPA architectural feature is present. This involves updates to aarch64-c.cc for C++ builtins, aarch64-sve-builtins-base.def for intrinsic definitions, aarch64-sve.md for instruction patterns, and aarch64.h for the new TARGET_SVE_FEXPA macro. Correct gating is critical to avoid generating instructions that are not supported by the target hardware, which could lead to runtime errors. The __ARM_FEATURE_SSVE_FEXPA m…
For Context
Modern AArch64 processors have advanced features like Scalable Vector Extension (SVE) for performing operations on many data elements simultaneously, which is great for performance. "Streaming mode" is a variant of SVE that changes how certain operations behave. This update concerns a specific SVE instruction called FEXPA, which helps in calculating exponential functions. The change ensures that the compiler, GCC, only allows programs to use this FEXPA instruction in streaming mode if the processor it's targeting actually supports the ssve-fexpa feature. This prevents programs from trying to use a feature that isn't there, which would cause them to crash. Additionally, a new predefined macro __ARM_FEATURE_SSVE_FEXPA is introduced, which acts like a signal to programmers that this specific streaming SVE exponential feature is available, allowing them to write code that adapts to the processor's capabilities.