6 #include "xs3_math_conf.h"
7 #include "xs3_math_types.h"
32 #define XS3_VECT_SQRT_S32_MAX_DEPTH (31)
69 const unsigned length);
106 const unsigned length);
156 const unsigned length);
213 const unsigned length,
369 const unsigned length,
385 #define xs3_vect_s32_add_scalar_prepare xs3_vect_s32_add_prepare
409 unsigned xs3_vect_s32_argmax(
411 const unsigned length);
439 const unsigned length);
492 const unsigned length,
493 const int32_t lower_bound,
494 const int32_t upper_bound,
536 int32_t* lower_bound,
537 int32_t* upper_bound,
617 const unsigned length,
687 const unsigned length);
752 const unsigned length,
809 const unsigned length,
849 const unsigned length);
893 const unsigned length,
894 const unsigned scale);
937 const unsigned length);
972 const unsigned length);
1031 const unsigned length,
1066 const unsigned length);
1125 const unsigned length,
1179 const unsigned length,
1248 const unsigned length,
1318 const unsigned length,
1428 #define xs3_vect_s32_nmacc_prepare xs3_vect_s32_macc_prepare
1543 const unsigned length);
1595 const unsigned length,
1613 #define xs3_vect_s32_scale_prepare xs3_vect_s32_mul_prepare
1648 const unsigned length);
1689 const unsigned length,
1731 const unsigned length,
1785 const unsigned length,
1787 const unsigned depth);
1907 const unsigned length,
1924 #define xs3_vect_s32_sub_prepare xs3_vect_s32_add_prepare
1976 const unsigned length);
2033 const unsigned length,
2077 const unsigned length);
2137 const int32_t b_q30[],
2138 const unsigned x_length,
2139 const unsigned b_length);
2278 const int32_t b_q30[],
2279 const unsigned x_length,
2280 const unsigned b_length,
2310 const unsigned length);
2338 const unsigned length);
int exponent_t
An exponent.
Definition: xs3_math_types.h:76
int left_shift_t
A leftwards arithmetic bit-shift.
Definition: xs3_math_types.h:110
int right_shift_t
A rightwards arithmetic bit-shift.
Definition: xs3_math_types.h:98
unsigned headroom_t
Headroom of some integer or integer array.
Definition: xs3_math_types.h:86
void xs3_vect_s32_unzip(int32_t a[], int32_t b[], const complex_s32_t c[], const unsigned length)
Deinterleave the real and imaginary parts of a complex 32-bit vector into two separate vectors.
Definition: xs3_vect_zip.c:30
void xs3_vect_s32_zip(complex_s32_t a[], const int32_t b[], const int32_t c[], const unsigned length, const right_shift_t b_shr, const right_shift_t c_shr)
Interleave the elements of two vectors into a single vector.
Definition: xs3_vect_zip.c:13
headroom_t xs3_vect_s32_shl(int32_t a[], const int32_t b[], const unsigned length, const left_shift_t b_shl)
Left-shift the elements of a 32-bit vector by a specified number of bits.
Definition: xs3_vect_shl.c:28
headroom_t xs3_vect_s32_macc(int32_t acc[], const int32_t b[], const int32_t c[], const unsigned length, const right_shift_t acc_shr, const right_shift_t b_shr, const right_shift_t c_shr)
[xs3_vect_s32_mul]
Definition: xs3_vect_macc.c:54
headroom_t xs3_vect_s32_clip(int32_t a[], const int32_t b[], const unsigned length, const int32_t lower_bound, const int32_t upper_bound, const right_shift_t b_shr)
Clamp the elements of a 32-bit vector to a specified range.
Definition: xs3_vect_abs_clip_rect.c:60
headroom_t xs3_vect_s32_scale(int32_t a[], const int32_t b[], const unsigned length, const int32_t c, const right_shift_t b_shr, const right_shift_t c_shr)
Multiply a 32-bit vector by a scalar.
Definition: xs3_vect_mul.c:71
void xs3_vect_s32_split_accs(xs3_split_acc_s32_t a[], const int32_t b[], const unsigned length)
Split a vector of int32_t's into a vector of xs3_split_acc_s32_t.
Definition: xs3_misc.c:41
headroom_t xs3_vect_s32_nmacc(int32_t acc[], const int32_t b[], const int32_t c[], const unsigned length, const right_shift_t acc_shr, const right_shift_t b_shr, const right_shift_t c_shr)
Multiply one 32-bit vector element-wise by another, and subtract the result from an accumulator.
Definition: xs3_vect_macc.c:75
headroom_t xs3_vect_s32_headroom(const int32_t x[], const unsigned length)
Calculate the headroom of a 32-bit vector.
Definition: xs3_vect_headroom.c:54
headroom_t xs3_vect_s32_inverse(int32_t a[], const int32_t b[], const unsigned length, const unsigned scale)
Compute the inverse of elements of a 32-bit vector.
Definition: xs3_vect_inverse.c:32
headroom_t xs3_vect_s32_add_scalar(int32_t a[], const int32_t b[], const int32_t c, const unsigned length, const right_shift_t b_shr)
Add a scalar to a 32-bit vector.
Definition: xs3_vect.c:206
headroom_t xs3_vect_s32_mul(int32_t a[], const int32_t b[], const int32_t c[], const unsigned length, const right_shift_t b_shr, const right_shift_t c_shr)
Multiply one 32-bit vector element-wise by another.
Definition: xs3_vect_mul.c:34
int32_t xs3_vect_s32_max(const int32_t b[], const unsigned length)
Find the maximum value in a 32-bit vector.
Definition: xs3_vect_stats.c:42
headroom_t xs3_vect_s32_rect(int32_t a[], const int32_t b[], const unsigned length)
Rectify the elements of a 32-bit vector.
Definition: xs3_vect_abs_clip_rect.c:91
int64_t xs3_vect_s32_abs_sum(const int32_t b[], const unsigned length)
Compute the sum of the absolute values of elements of a 32-bit vector.
Definition: xs3_vect_stats.c:196
headroom_t xs3_vect_s32_shr(int32_t a[], const int32_t b[], const unsigned length, const right_shift_t b_shr)
Right-shift the elements of a 32-bit vector by a specified number of bits.
Definition: xs3_vect.c:194
int64_t xs3_vect_s32_dot(const int32_t b[], const int32_t c[], const unsigned length, const right_shift_t b_shr, const right_shift_t c_shr)
Compute the inner product between two 32-bit vectors.
Definition: xs3_vect_dot.c:35
headroom_t xs3_vect_s32_sqrt(int32_t a[], const int32_t b[], const unsigned length, const right_shift_t b_shr, const unsigned depth)
Compute the square root of elements of a 32-bit vector.
Definition: xs3_vect_sqrt.c:53
headroom_t xs3_vect_s32_abs(int32_t a[], const int32_t b[], const unsigned length)
Compute the element-wise absolute value of a 32-bit vector.
Definition: xs3_vect_abs_clip_rect.c:27
headroom_t xs3_vect_s32_sub(int32_t a[], const int32_t b[], const int32_t c[], const unsigned length, const right_shift_t b_shr, const right_shift_t c_shr)
Subtract one 32-bit vector from another.
Definition: xs3_vect_add_sub.c:74
unsigned xs3_vect_s32_argmin(const int32_t b[], const unsigned length)
Obtain the array index of the minimum element of a 32-bit vector.
Definition: xs3_vect_stats.c:161
headroom_t xs3_vect_s32_convolve_same(int32_t y[], const int32_t x[], const int32_t b_q30[], const unsigned x_length, const unsigned b_length, const pad_mode_e padding_mode)
Convolve a 32-bit vector with a short kernel.
Definition: xs3_convolve.c:39
int64_t xs3_vect_s32_energy(const int32_t b[], const unsigned length, const right_shift_t b_shr)
Calculate the energy (sum of squares of elements) of a 32-bit vector.
Definition: xs3_vect_stats.c:237
void xs3_vect_s32_set(int32_t a[], const int32_t b, const unsigned length)
Set all elements of a 32-bit vector to the specified value.
Definition: xs3_vect_set.c:24
int32_t xs3_vect_s32_min(const int32_t b[], const unsigned length)
Find the minimum value in a 32-bit vector.
Definition: xs3_vect_stats.c:97
headroom_t xs3_vect_s32_copy(int32_t a[], const int32_t b[], const unsigned length)
Copy one 32-bit vector to another.
Definition: xs3_vect_copy.c:24
headroom_t xs3_vect_s32_max_elementwise(int32_t a[], const int32_t b[], const int32_t c[], const unsigned length, const right_shift_t b_shr, const right_shift_t c_shr)
Get the element-wise maximum of two 32-bit vectors.
Definition: xs3_vect_stats.c:54
headroom_t xs3_vect_s32_min_elementwise(int32_t a[], const int32_t b[], const int32_t c[], const unsigned length, const right_shift_t b_shr, const right_shift_t c_shr)
Get the element-wise minimum of two 32-bit vectors.
Definition: xs3_vect_stats.c:109
headroom_t xs3_vect_s32_add(int32_t a[], const int32_t b[], const int32_t c[], const unsigned length, const right_shift_t b_shr, const right_shift_t c_shr)
Add together two 32-bit vectors.
Definition: xs3_vect_add_sub.c:32
headroom_t xs3_vect_s32_convolve_valid(int32_t y[], const int32_t x[], const int32_t b_q30[], const unsigned x_length, const unsigned b_length)
Convolve a 32-bit vector with a short kernel.
Definition: xs3_vect_convolve.c:14
void xs3_vect_s32_merge_accs(int32_t a[], const xs3_split_acc_s32_t b[], const unsigned length)
Merge a vector of split 32-bit accumulators into a vector of int32_t's.
Definition: xs3_misc.c:15
pad_mode_e
Supported padding modes for convolutions in "same" mode.
Definition: xs3_vect_s32.h:2149
int64_t xs3_vect_s32_sum(const int32_t b[], const unsigned length)
Sum the elements of a 32-bit vector.
Definition: xs3_vect_sum.c:29
@ PAD_MODE_REFLECT
Definition: xs3_vect_s32.h:2169
@ PAD_MODE_ZERO
Definition: xs3_vect_s32.h:2211
@ PAD_MODE_EXTEND
Definition: xs3_vect_s32.h:2190
void xs3_vect_s32_energy_prepare(exponent_t *a_exp, right_shift_t *b_shr, const unsigned length, const exponent_t b_exp, const headroom_t b_hr)
Obtain the output exponent and input shift used by xs3_vect_s32_energy().
Definition: xs3_prepare.c:587
void xs3_vect_s32_add_prepare(exponent_t *a_exp, right_shift_t *b_shr, right_shift_t *c_shr, const exponent_t b_exp, const exponent_t c_exp, const headroom_t b_hr, const headroom_t c_hr)
Obtain the output exponent and input shifts to add or subtract two 16- or 32-bit BFP vectors.
Definition: xs3_prepare.c:415
void xs3_vect_s32_dot_prepare(exponent_t *a_exp, right_shift_t *b_shr, right_shift_t *c_shr, const exponent_t b_exp, const exponent_t c_exp, const headroom_t b_hr, const headroom_t c_hr, const unsigned length)
Obtain the output exponent and input shift used by xs3_vect_s32_dot().
Definition: xs3_prepare.c:439
void xs3_vect_s32_mul_prepare(exponent_t *a_exp, right_shift_t *b_shr, right_shift_t *c_shr, const exponent_t b_exp, const exponent_t c_exp, const headroom_t b_hr, const headroom_t c_hr)
Obtain the output exponent and input shifts used by xs3_vect_s32_mul().
Definition: xs3_prepare.c:205
void xs3_vect_s32_inverse_prepare(exponent_t *a_exp, unsigned *scale, const int32_t b[], const exponent_t b_exp, const unsigned length)
Obtain the output exponent and scale used by xs3_vect_s32_inverse().
Definition: xs3_prepare.c:536
void xs3_vect_s32_macc_prepare(exponent_t *new_acc_exp, right_shift_t *acc_shr, right_shift_t *b_shr, right_shift_t *c_shr, const exponent_t acc_exp, const exponent_t b_exp, const exponent_t c_exp, const headroom_t acc_hr, const headroom_t b_hr, const headroom_t c_hr)
Obtain the output exponent and shifts needed by xs3_vect_s32_macc().
Definition: xs3_prepare.c:152
void xs3_vect_s32_sqrt_prepare(exponent_t *a_exp, right_shift_t *b_shr, const exponent_t b_exp, const right_shift_t b_hr)
Obtain the output exponent and shift parameter used by xs3_vect_s32_sqrt().
Definition: xs3_prepare.c:512
void xs3_vect_2vec_prepare(exponent_t *a_exp, right_shift_t *b_shr, right_shift_t *c_shr, const exponent_t b_exp, const exponent_t c_exp, const headroom_t b_hr, const headroom_t c_hr, const headroom_t extra_operand_hr)
Obtain the output exponent and input shifts required to perform a binary add-like operation.
Definition: xs3_prepare.c:709
void xs3_vect_s32_clip_prepare(exponent_t *a_exp, right_shift_t *b_shr, int32_t *lower_bound, int32_t *upper_bound, const exponent_t b_exp, const exponent_t bound_exp, const headroom_t b_hr)
Obtain the output exponent, input shift and modified bounds used by xs3_vect_s32_clip().
Definition: xs3_prepare.c:651
A complex number with a 32-bit real part and 32-bit imaginary part.
Definition: xs3_math_types.h:49
Holds a set of sixteen 32-bit accumulators in the XS3 VPU's internal format.
Definition: xs3_math_types.h:429