← All compilation units

Flyology_SIMD.Algorithms.AVX2

Description

Baseline-safe entry points for optional AVX2 complete-array and complete-buffer algorithms.

Add_Saturate

procedure Add_Saturate (Data : in out Byte_Array; Value : U8)

Add one byte to every element with unsigned saturation using the optional AVX2 algorithm after checking CPU and OS support.

Parameters
Data

The complete byte buffer to transform in place.

Value

The unsigned byte addend broadcast to every element.

AXPY

procedure AXPY (Y : in out F32_Array; A : F32; X : F32_Array)

Apply Y := A * X + Y with the optional AVX2 algorithm after checking CPU and OS support. Multiplication and addition are separate.

Parameters
Y

The complete destination and addend array.

A

The scalar multiplier applied to X.

X

The complete source array with bounds matching Y.

AXPY

procedure AXPY (Y : in out F64_Array; A : F64; X : F64_Array)

Apply Y := A * X + Y with the optional AVX2 algorithm after checking CPU and OS support. Multiplication and addition are separate.

Parameters
Y

The complete destination and addend array.

A

The scalar multiplier applied to X.

X

The complete source array with bounds matching Y.

Clamp

procedure Clamp (Data : in out F32_Array; Low, High : F32)

Clamp every binary32 element in place with the optional AVX2 route, after checking CPU and OS support.

Parameters
Data

The complete array to transform in place.

Low

The lower operand supplied to Max_Number.

High

The upper operand supplied to Min_Number.

Clamp

procedure Clamp (Data : in out F64_Array; Low, High : F64)

Clamp every binary64 element in place with the optional AVX2 route, after checking CPU and OS support.

Parameters
Data

The complete array to transform in place.

Low

The lower operand supplied to Max_Number.

High

The upper operand supplied to Min_Number.

Count

function Count (Data : Byte_Array; Needle : U8) return Natural

Count one byte with the optional AVX2 algorithm.

Parameters
Data

The complete byte array to scan.

Needle

The byte to count.

Return value

The number of matching elements.

Count_In_Range

function Count_In_Range (Data : Byte_Array; Low, High : U8) return Natural

Count bytes in an inclusive unsigned interval with the optional AVX2 algorithm after checking CPU and OS support. An inverted interval is empty.

Parameters
Data

The complete byte array to scan.

Low

The inclusive lower byte bound.

High

The inclusive upper byte bound.

Return value

The number of elements in the interval.

Dot_Product

function Dot_Product (Left, Right : F32_Array) return F32

Return the four-group binary32 dot product with the optional AVX2 algorithm after checking CPU and OS support.

Parameters
Left

The left complete array.

Right

The right complete array with matching bounds.

Return value

The lane-grouped sum of corresponding products.

Dot_Product

function Dot_Product (Left, Right : F64_Array) return F64

Return the two-group binary64 dot product with the optional AVX2 algorithm after checking CPU and OS support.

Parameters
Left

The left complete array.

Right

The right complete array with matching bounds.

Return value

The lane-grouped sum of corresponding products.

Equal

function Equal (Left, Right : Byte_Array) return Boolean

Compare two complete byte buffers with the optional AVX2 algorithm after checking CPU and OS support.

Parameters
Left

The left complete byte array.

Right

The right complete byte array with matching bounds.

Return value

True when every corresponding byte is equal.

Find_First

function Find_First (Data : Byte_Array; Needle : U8) return Search_Result

Return the first matching Ada index with the optional AVX2 algorithm.

Parameters
Data

The complete byte array to search.

Needle

The byte to find.

Return value

A found flag and the first matching Ada index.

Find_First_Difference

function Find_First_Difference (Left, Right : Byte_Array) return Search_Result

Return the first differing Ada index with the optional AVX2 algorithm after checking CPU and OS support.

Parameters
Left

The left complete byte array.

Right

The right complete byte array with matching bounds.

Return value

A found flag and the first differing Ada index.

Find_First_Of

function Find_First_Of (Data : Byte_Array; Needles : Byte_Array) return Search_Result

Return the first byte equal to any member of a small set with the optional AVX2 algorithm. Empty inputs have no match and duplicates have no effect.

Parameters
Data

The complete byte array to search.

Needles

The byte values that constitute the small set.

Return value

A found flag and the first matching Ada index.

Is_ASCII

function Is_ASCII (Data : Byte_Array) return Boolean

Validate ASCII with the optional AVX2 algorithm.

Parameters
Data

The complete byte array to validate.

Return value

True when every byte is less than 128.

Max_Number

function Max_Number (Data : F32_Array) return F32

Return the binary32 number maximum with the optional AVX2 route after checking CPU and OS support.

Parameters
Data

The nonempty complete array to reduce.

Return value

The maximum-number result.

Max_Number

function Max_Number (Data : F64_Array) return F64

Return the binary64 number maximum with the optional AVX2 route after checking CPU and OS support.

Parameters
Data

The nonempty complete array to reduce.

Return value

The maximum-number result.

Min_Number

function Min_Number (Data : F32_Array) return F32

Return the binary32 number minimum with the optional AVX2 route after checking CPU and OS support.

Parameters
Data

The nonempty complete array to reduce.

Return value

The minimum-number result.

Min_Number

function Min_Number (Data : F64_Array) return F64

Return the binary64 number minimum with the optional AVX2 route after checking CPU and OS support.

Parameters
Data

The nonempty complete array to reduce.

Return value

The minimum-number result.

Scale

procedure Scale (Data : in out F32_Array; Factor : F32)

Multiply every binary32 element by Factor with the optional AVX2 algorithm after checking CPU and OS support.

Parameters
Data

The complete array to transform in place.

Factor

The scalar multiplier applied once to every element.

Scale

procedure Scale (Data : in out F64_Array; Factor : F64)

Multiply every binary64 element by Factor with the optional AVX2 algorithm after checking CPU and OS support.

Parameters
Data

The complete array to transform in place.

Factor

The scalar multiplier applied once to every element.

Sum

function Sum (Data : F32_Array) return F32

Return the four-group binary32 sum with the optional AVX2 algorithm after checking CPU and OS support.

Parameters
Data

The complete array to sum.

Return value

The lane-grouped sum of all elements.

Sum

function Sum (Data : F64_Array) return F64

Return the two-group binary64 sum with the optional AVX2 algorithm after checking CPU and OS support.

Parameters
Data

The complete array to sum.

Return value

The lane-grouped sum of all elements.