Select a known backend at build time
Flyology_SIMD.Algorithms.Generic_Bytes is the compile-time composition contract for representative byte algorithms. The repository instantiates it as Algorithms.Scalar and Algorithms.Native.
Result :=
Flyology_SIMD.Algorithms.Native.Find_First (Data, Needle);The selected native backend is AArch64 NEON, x86-64 SSE2, or scalar according to the GPR scenario. The generic receives primitive operations as formal subprograms so GNAT can inline through the complete loop.
Select once for a complete buffer
Flyology_SIMD.Algorithms.Runtime accepts an optional backend for Find_First, Count, and Is_ASCII. The default is the best safe backend available to the process.
Matches :=
Flyology_SIMD.Algorithms.Runtime.Count
(Data => Data,
Needle => Flyology_SIMD.U8 (16#2C#),
Backend => Flyology_SIMD.Features.Best_Available);The runtime package performs one case selection for the array operation. It does not probe features or call an indirect target for every vector primitive.
Inspect and require availability
Flyology_SIMD.Features distinguishes a backend that was compiled from one that can execute safely on the current processor and operating system. Available performs the complete availability test. Require raises Backend_Unavailable instead of entering unsupported code.
Best_Available returns NEON on AArch64, AVX2 when the complete x86 gate succeeds, SSE2 on the x86-64 baseline, or scalar elsewhere.
Keep optional instructions out of baseline objects
On x86-64, AVX2 detection checks CPU feature bits and operating-system extended-state support. The AVX2 implementation is a separate object configuration. Linking it does not execute an AVX2 instruction during elaboration.
The feature detector, scalar backend, and SSE2 backend compile with AVX disabled. Focused code-generation checks reject AVX instructions outside the optional object and reject primitive calls inside the representative vector loop.
Advanced SIMD is part of the AArch64 architecture baseline. The runtime facility therefore does not add a redundant NEON probe.