Install the crate
Add Flyology_SIMD through Alire. The library has no runtime dependency on Flyology or any other Flyology crate.
alr with flyology_simd
alr buildThe GPR project detects the host architecture. Use a project scenario override only for scalar testing or cross-compilation.
alr build -- -XFLYOLOGY_SIMD_ARCH=scalarThe crate defines the top-level package Flyology_SIMD. It does not supply a Flyology parent unit.
Run the first search
Flyology_SIMD.Algorithms.Runtime selects a backend once for the complete array. Its Find_First operation returns the Ada array index of the first matching byte.
with Ada.Text_IO;
with Flyology_SIMD;
with Flyology_SIMD.Algorithms.Runtime;
procedure Find_Byte is
Data : Flyology_SIMD.Byte_Array (1 .. 6) :=
[83, 73, 77, 68, 33, 10];
Result : constant Flyology_SIMD.Algorithms.Search_Result :=
Flyology_SIMD.Algorithms.Runtime.Find_First
(Data, Flyology_SIMD.U8 (Character'Pos ('!')));
begin
if Result.Found then
Ada.Text_IO.Put_Line ("Found at" & Result.Index'Image);
end if;
end Find_Byte;The repository includes this program in examples/find_byte.adb. Build it from the examples directory with alr build.
Choose the lane family
All stabilized value types are private 128-bit vectors. The family includes U8x16, I8x16, U16x8, I16x8, U32x4, I32x4, U64x2, I64x2, F32x4, and F64x2.
Lane zero is the first logical element loaded from memory. Do not infer a portable machine ABI, register layout, or representation from that rule.
Name the intended semantics
Integer arithmetic names wrapping and saturating behavior explicitly. Logical and arithmetic shifts define oversized counts. Comparisons return private mask values, and callers inspect mask truth through mask operations.
The v0.1 API provides no implicit conversions. Explicit numeric conversion, bit casts, widening, narrowing, and the portable 256-bit family remain later milestones. Floating-point operations preserve strict language semantics and do not enable fast-math switches.
- Use
Add_Wrapwhen the result wraps modulo the lane width. - Use
Add_Saturatewhen the result clamps to the lane range. - Use
Min_NumberandMax_Numberfor the documented NaN and signed-zero behavior. - Use
Load_PartialandStore_Partialwhen fewer than one vector of elements remain.