XCORE SDK
XCORE Software Development Kit
xs3_mixed.h
1 // Copyright 2020-2021 XMOS LIMITED.
2 // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3 
4 #pragma once
5 
6 #include <stdint.h>
7 
8 #include "xs3_math_conf.h"
9 #include "xs3_math_types.h"
10 #include "xs3_util.h"
11 
12 #ifdef __XC__
13 extern "C" {
14 #endif
15 
16 
82 C_API
84  int16_t a[],
85  const int32_t b[],
86  const unsigned length,
87  const right_shift_t b_shr);
88 
89 
131 C_API
133  int32_t a[],
134  const int16_t b[],
135  const unsigned length);
136 
137 
193 C_API
195  int16_t a_real[],
196  int16_t a_imag[],
197  const complex_s32_t b[],
198  const unsigned length,
199  const right_shift_t b_shr);
200 
201 
244 C_API
246  complex_s32_t a[],
247  const int16_t b_real[],
248  const int16_t b_imag[],
249  const unsigned length);
250 
251 
269 C_API
271  int8_t a[],
272  const int16_t b[],
273  const unsigned len);
274 
275 
293 C_API
295  int8_t a[],
296  const int16_t b[],
297  const unsigned len);
298 
299 
334 C_API
336  xs3_split_acc_s32_t accumulators[],
337  const int8_t matrix[],
338  const int8_t input_vect[],
339  const unsigned M_rows,
340  const unsigned N_cols);
341 
342 
379 C_API
381  int32_t output[],
382  const int8_t matrix[],
383  const int16_t input_vect[],
384  const unsigned M_rows,
385  const unsigned N_cols,
386  int8_t scratch[]);
387 
388 
410 C_API
411 unsigned xs3_vect_sXX_add_scalar(
412  int32_t a[],
413  const int32_t b[],
414  const unsigned length_bytes,
415  const int32_t c,
416  const int32_t d,
417  const right_shift_t b_shr,
418  const unsigned mode_bits);
419 
420 #ifdef __XC__
421 } //extern "C"
422 #endif
423 
int right_shift_t
A rightwards arithmetic bit-shift.
Definition: xs3_math_types.h:98
void xs3_vect_complex_s32_to_complex_s16(int16_t a_real[], int16_t a_imag[], const complex_s32_t b[], const unsigned length, const right_shift_t b_shr)
Convert a complex 32-bit vector into a complex 16-bit vector.
Definition: xs3_vect_complex_depth_convert.c:32
void xs3_mat_mul_s8_x_s16_yield_s32(int32_t output[], const int8_t matrix[], const int16_t input_vect[], const unsigned M_rows, const unsigned N_cols, int8_t scratch[])
Multiply an 8-bit matrix by a 16-bit vetor for a 32-bit result vector.
Definition: xs3_mat_mul.c:54
void xs3_vect_complex_s16_to_complex_s32(complex_s32_t a[], const int16_t b_real[], const int16_t b_imag[], const unsigned length)
Convert a complex 16-bit vector into a complex 32-bit vector.
Definition: xs3_vect_complex_depth_convert.c:13
void xs3_vect_s16_extract_high_byte(int8_t a[], const int16_t b[], const unsigned len)
Extract an 8-bit vector containing the most significant byte of a 16-bit vector.
Definition: xs3_vect_s16_extract.c:16
void xs3_vect_s16_to_s32(int32_t a[], const int16_t b[], const unsigned length)
Convert a 16-bit vector to a 32-bit vector.
Definition: xs3_vect_depth_convert.c:34
void xs3_vect_s16_extract_low_byte(int8_t a[], const int16_t b[], const unsigned len)
Extract an 8-bit vector containing the least significant byte of a 16-bit vector.
Definition: xs3_vect_s16_extract.c:26
void xs3_mat_mul_s8_x_s8_yield_s32(xs3_split_acc_s32_t accumulators[], const int8_t matrix[], const int8_t input_vect[], const unsigned M_rows, const unsigned N_cols)
Multiply-accumulate an 8-bit matrix by an 8-bit vector into 32-bit accumulators.
Definition: xs3_mat_mul_s8_x_s8_yield_s32.c:24
void xs3_vect_s32_to_s16(int16_t a[], const int32_t b[], const unsigned length, const right_shift_t b_shr)
Convert a 32-bit vector to a 16-bit vector.
Definition: xs3_vect_depth_convert.c:15
unsigned xs3_vect_sXX_add_scalar(int32_t a[], const int32_t b[], const unsigned length_bytes, const int32_t c, const int32_t d, const right_shift_t b_shr, const unsigned mode_bits)
Add a scalar to a vector.
Definition: xs3_vect_sXX.c:59
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