apytypes_simd.h¶
-
namespace simd¶
This file contains declarations of vectorized arithmetic function that make a best-effort attempt in parallelizing operations using SIMD intrinsics.
Functions
-
std::string get_simd_version_str()¶
Return a string with active runtime SIMD information. Example: “APyTypes SIMD: { ‘SIMD Runtime Target’: ‘AVX2’, ‘Runtime Parallel-Limb Support’: “ “4 x 64-bit’ }”
-
void vector_shift_add(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, APyBuffer<apy_limb_t>::vector_type::const_iterator src2_begin, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, unsigned src1_shift_amount, unsigned src2_shift_amount, std::size_t size)¶
For each element in the iterator regions [
*_begin,*_begin + size):Shift element in
src1_beginleft bysrc1_shift_amountShift element in
src2_beginleft bysrc2_shift_amountAdd shifted values and store in
dst_begin
-
void vector_shift_add_const(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, apy_limb_t constant, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, unsigned src1_shift_amount, std::size_t size)¶
For each element in the iterator regions [
*_begin,*_begin + size):Shift element in
src1_beginleft bysrc1_shift_amountAdd shifted element to
constantand store the result indst_begin
-
void vector_shift_sub(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, APyBuffer<apy_limb_t>::vector_type::const_iterator src2_begin, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, unsigned src1_shift_amount, unsigned src2_shift_amount, std::size_t size)¶
For each element in the iterator regions [
*_begin,*_begin + size):Shift element in
src1_beginleft bysrc1_shift_amountShift element in
src2_beginleft bysrc2_shift_amountSubtract shifted values and store in
dst_begin
-
void vector_shift_sub_const(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, apy_limb_t constant, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, unsigned src1_shift_amount, std::size_t size)¶
For each element in the iterator regions [
*_begin,*_begin + size):Shift element in
src1_beginleft bysrc1_shift_amountSubtract
constantfrom shifted element and store the result indst_begin
-
void vector_shift_div_signed(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, APyBuffer<apy_limb_t>::vector_type::const_iterator src2_begin, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, unsigned src1_shift_amount, std::size_t size)¶
For each element in the iterator regions [
*_begin,*_begin + size):Shift element in
src1_beginleft bysrc1_shift_amountDivide shifted element (numerator) by
src2_begin(denominator) and store the result indst_begin
-
void vector_shift_div_const_signed(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, apy_limb_t constant, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, unsigned src1_shift_amount, std::size_t size)¶
For each element in the iterator regions [
*_begin,*_begin + size):Shift element in
src1_beginleft bysrc1_shift_amountDivide shifted element (numerator) by
constant(denominator) and store the result indst_begin
-
void vector_mul(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, APyBuffer<apy_limb_t>::vector_type::const_iterator src2_begin, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, std::size_t size)¶
Perform signed multiplication of the elements in
src1_beginwithsrc2_beginand store the result indst_begin, forsizenumber of elements.
-
void vector_add(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, APyBuffer<apy_limb_t>::vector_type::const_iterator src2_begin, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, std::size_t size)¶
Perform addition of the elements in
src1_beginwithsrc2_beginand store the result indst_begin, forsizenumber of elements.
-
void vector_sub(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, APyBuffer<apy_limb_t>::vector_type::const_iterator src2_begin, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, std::size_t size)¶
Perform subtraction of the elements in
src1_beginwithsrc2_beginand store the result indst_begin, forsizenumber of elements.
-
void vector_add_const(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, apy_limb_t constant, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, std::size_t size)¶
Perform addition of the elements in
src1_beginwith a constantconstantand store the result indst_begin, forsizenumber of elements.
-
void vector_sub_const(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, apy_limb_t constant, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, std::size_t size)¶
Perform subtraction of the elements in
src1_beginwith a constantconstantand store the result indst_begin, forsizenumber of elements.
-
void vector_neg(APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, APyBuffer<apy_limb_t>::vector_type::const_iterator src_begin, std::size_t size)¶
Perform negation of the elements in
src_begin, forsizenumber of elements.
-
void vector_not(APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, APyBuffer<apy_limb_t>::vector_type::const_iterator src_begin, std::size_t size)¶
Perform logic not of the elements in
src_begin, forsizenumber of elements.
-
void vector_abs(APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, APyBuffer<apy_limb_t>::vector_type::const_iterator src_begin, std::size_t size)¶
Perform absolute computation of the elements in
src_begin, forsizenumber of elements.
-
void vector_mul_const(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, apy_limb_t constant, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, std::size_t size)¶
Perform signed multiplication of the elements in
src1_beginwith a constantconstantand store the result indst_begin, forsizenumber of elements.
-
void vector_rsub_const(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, apy_limb_t constant, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, std::size_t size)¶
Perform subtraction of the constant in
constantwith the elements insrc1_beginand store the result indst_begin, forsizenumber of elements.
-
void vector_rdiv_const_signed(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, apy_limb_t constant, APyBuffer<apy_limb_t>::vector_type::iterator dst_begin, std::size_t size)¶
For each element in the iterator regions [
*_begin,*_begin + size):Divide
constant(numerator) by the element insrc1_begin(signed)Store the result in
dst_begin
-
apy_limb_t vector_multiply_accumulate(APyBuffer<apy_limb_t>::vector_type::const_iterator src1_begin, APyBuffer<apy_limb_t>::vector_type::const_iterator src2_begin, std::size_t size)¶
Multiply (signed) and accumulate all elements from
src1_beginwithsrc2_beginforsizenumber of elements. Return accumulated value.
-
CREATE_FUNCTOR_FROM_FUNC(add_functor, vector_add)¶
-
CREATE_FUNCTOR_FROM_FUNC(sub_functor, vector_sub)¶
-
CREATE_FUNCTOR_FROM_FUNC(add_const_functor, vector_add_const)¶
-
CREATE_FUNCTOR_FROM_FUNC(sub_const_functor, vector_sub_const)¶
-
CREATE_FUNCTOR_FROM_FUNC(shift_add_functor, vector_shift_add)¶
-
CREATE_FUNCTOR_FROM_FUNC(shift_sub_functor, vector_shift_sub)¶
-
CREATE_FUNCTOR_FROM_FUNC(shift_add_const_functor, vector_shift_add_const)¶
-
CREATE_FUNCTOR_FROM_FUNC(shift_sub_const_functor, vector_shift_sub_const)¶
-
std::string get_simd_version_str()¶