PULP DSP  Version 1.0
Digital Signal Processing library for PULP processors (pulp-platform.org)
 All Classes Files Functions Groups Pages
Classes | Macros | Typedefs | Functions
plp_math.h File Reference

Public header file for PULP DSP Library. More...

#include "rt/rt_api.h"
#include "math.h"

Go to the source code of this file.

Classes

struct  plp_dot_prod_instance_i32
 Instance structure for integer parallel dot product. More...
 
struct  plp_dot_prod_instance_q32
 Instance structure for fixed point parallel dot product. More...
 
struct  plp_conv_instance_i32
 Instance structure for basic integer convolution. More...
 
struct  plp_conv_instance_i16
 Instance structure for basic integer convolution. More...
 
struct  plp_conv_instance_i8
 Instance structure for basic integer convolution. More...
 
struct  plp_conv_tree_add_instance
 Instance structure for basic integer convolution. More...
 
struct  plp_rfft_instance_f32
 Instance structure for floating-point FFT. More...
 
struct  plp_rfft_parallel_arg_f32
 
struct  Complex_type_f32
 
struct  plp_mat_mult_instance_i8
 Instance structure for integer parallel matrix multiplication. More...
 
struct  plp_mat_mult_instance_i16
 Instance structure for integer parallel matrix multiplication. More...
 
struct  plp_mat_mult_instance_i32
 Instance structure for integer parallel matrix multiplication. More...
 

Typedefs

typedef float float32_t
 

Functions

void plp_dot_prod_i32_parallel (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t blockSize, uint32_t nPE, int32_t *__restrict__ pRes)
 Glue code for parallel dot product of 32-bit integer vectors. More...
 
void plp_dot_prod_q32_parallel (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t blockSize, uint32_t deciPoint, uint32_t nPE, int32_t *__restrict__ pRes)
 Glue code for parallel dot product of 32-bit fixed point vectors. More...
 
void plp_dot_prod_i32p_xpulpv2 (void *S)
 Scalar dot product with interleaved access of 32-bit integer vectors kernel for XPULPV2 extension. More...
 
void plp_dot_prod_q32p_xpulpv2 (void *S)
 Scalar dot product with interleaved access of 32-bit fixed point vectors kernel for XPULPV2 extension. More...
 
void plp_dot_prod_i32 (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t blockSize, int32_t *__restrict__ pRes)
 Glue code for dot product of 32-bit integer vectors. More...
 
void plp_dot_prod_i32s_rv32im (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t blockSize, int32_t *__restrict__ pRes)
 Scalar dot product of 32-bit integer vectors kernel for RV32IM extension. More...
 
void plp_dot_prod_i32s_xpulpv2 (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t blockSize, int32_t *__restrict__ pRes)
 Scalar dot product of 32-bit integer vectors kernel for XPULPV2 extension. More...
 
void plp_dot_prod_q32 (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t blockSize, uint32_t deciPoint, int32_t *__restrict__ pRes)
 Glue code for dot product of 32-bit fixed point vectors. More...
 
void plp_dot_prod_q32s_rv32im (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t blockSize, uint32_t deciPoint, int32_t *__restrict__ pRes)
 Scalar dot product of 32-bit fixed point vectors kernel for RV32IM extension. More...
 
void plp_dot_prod_q32s_xpulpv2 (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t blockSize, uint32_t deciPoint, int32_t *__restrict__ pRes)
 Scalar dot product of 32-bit fixed point vectors kernel for XPULPV2 extension. More...
 
void plp_dot_prod_i16 (const int16_t *pSrcA, const int16_t *pSrcB, uint32_t blockSize, int32_t *__restrict__ pRes)
 Glue code for dot product of 16-bit integer vectors. More...
 
void plp_dot_prod_i16s_rv32im (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t blockSize, int32_t *__restrict__ pRes)
 Vectorized dot product of 16-bit integer vectors kernel for RV32IM extension. More...
 
void plp_dot_prod_i16v_xpulpv2 (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t blockSize, int32_t *__restrict__ pRes)
 Vectorized dot product of 16-bit integer vectors kernel for XPULPV2 extension. More...
 
void plp_dot_prod_q16 (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t blockSize, uint32_t deciPoint, int32_t *__restrict__ pRes)
 Glue code for dot product of 16-bit fixed point vectors. More...
 
void plp_dot_prod_q16s_rv32im (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t blockSize, uint32_t deciPoint, int32_t *__restrict__ pRes)
 Scalar dot product of 16-bit fixed point vectors kernel for RV32IM extension. More...
 
void plp_dot_prod_q16v_xpulpv2 (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t blockSize, uint32_t deciPoint, int32_t *__restrict__ pRes)
 Vectorized dot product of 16-bit fixed point vectors kernel for XPULPV2 extension. More...
 
void plp_dot_prod_i8 (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t blockSize, int32_t *__restrict__ pRes)
 Glue code for dot product of 8-bit integer vectors. More...
 
void plp_dot_prod_i8s_rv32im (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t blockSize, int32_t *__restrict__ pRes)
 Vectorized dot product of 8-bit integer vectors kernel for RV32IM extension. More...
 
void plp_dot_prod_i8v_xpulpv2 (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t blockSize, int32_t *__restrict__ pRes)
 Vectorized dot product of 8-bit integer vectors kernel for XPULPV2 extension. More...
 
void plp_dot_prod_q8 (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t blockSize, uint32_t deciPoint, int32_t *__restrict__ pRes)
 Glue code for dot product of 8-bit fixed point vectors. More...
 
void plp_dot_prod_q8s_rv32im (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t blockSize, uint32_t deciPoint, int32_t *__restrict__ pRes)
 Scalar dot product of 8-bit fixed point vectors kernel for RV32IM extension. More...
 
void plp_dot_prod_q8v_xpulpv2 (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t blockSize, uint32_t deciPoint, int32_t *__restrict__ pRes)
 Scalar dot product of 8-bit fixed point vectors kernel for XPULPV2 extension. More...
 
void plp_fill_i32 (int32_t value, int32_t *__restrict__ pDst, uint32_t blockSize)
 Glue code for filling a constant value into a 32-bit integer vector. More...
 
void plp_fill_i32s_rv32im (int32_t value, int32_t *__restrict__ pDst, uint32_t blockSize)
 Fills a constant value into a 32-bit integer vector for RV32IM extension. More...
 
void plp_fill_i32s_xpulpv2 (int32_t value, int32_t *__restrict__ pDst, uint32_t blockSize)
 Fills a constant value into a 32-bit integer vector for XPULPV2 extension. More...
 
void plp_copy_i32 (int32_t *__restrict__ pSrc, int32_t *__restrict__ pDst, uint32_t blockSize)
 Glue code for copying the elements of a 32-bit integer vector. More...
 
void plp_copy_i32s_rv32im (int32_t *__restrict__ pSrc, int32_t *__restrict__ pDst, uint32_t blockSize)
 Copies the elements of a 32-bit integer vector for RV32IM extension. More...
 
void plp_copy_i32s_xpulpv2 (int32_t *__restrict__ pSrc, int32_t *__restrict__ pDst, uint32_t blockSize)
 Copies the elements of a 32-bit integer vector for XPULPV2 extension. More...
 
void plp_mean_i32 (const int32_t *__restrict__ pSrc, uint32_t blockSize, int32_t *__restrict__ pRes)
 Glue code for mean value of a 32-bit integer vector. More...
 
void plp_mean_i32s_rv32im (const int32_t *__restrict__ pSrc, uint32_t blockSize, int32_t *__restrict__ pRes)
 Mean value of a 32-bit integer vector for RV32IM extension. More...
 
void plp_mean_i32s_xpulpv2 (const int32_t *__restrict__ pSrc, uint32_t blockSize, int32_t *__restrict__ pRes)
 Mean value of a 32-bit integer vector for XPULPV2 extension. More...
 
void plp_conv_i32 (const int32_t *pSrcA, const uint32_t srcALen, const int32_t *pSrcB, const uint32_t srcBLen, int32_t *pRes)
 Glue code for convolution of 32-bit integer vectors. More...
 
void plp_conv_i32s_rv32im (const int32_t *pSrcA, const uint32_t srcALen, const int32_t *pSrcB, const uint32_t srcBLen, int32_t *pRes)
 Convolution of 32-bit integer vectors kernel for RV32IM extension. More...
 
void plp_conv_i32s_xpulpv2 (const int32_t *__restrict__ pSrcA, const uint32_t srcALen, const int32_t *__restrict__ pSrcB, const uint32_t srcBLen, int32_t *__restrict__ pRes)
 Convolution of 32-bit integer vectors kernel for XPULPV2 extension. More...
 
void plp_conv_i16 (const int16_t *pSrcA, const uint32_t srcALen, const int16_t *pSrcB, const uint32_t srcBLen, int32_t *pRes)
 Glue code for convolution of 16-bit integer vectors. More...
 
void plp_conv_i16s_xpulpv2 (const int16_t *pSrcA, const uint32_t srcALen, const int16_t *pSrcB, const uint32_t srcBLen, int32_t *pRes)
 Convolution of 16-bit integer vectors kernel for XPULPV2 extension. More...
 
void plp_conv_i16s_rv32im (const int16_t *pSrcA, const uint32_t srcALen, const int16_t *pSrcB, const uint32_t srcBLen, int32_t *pRes)
 Convolution of 16-bit integer vectors kernel for RV32IM extension. More...
 
void plp_conv_i8 (const int8_t *pSrcA, const uint32_t srcALen, const int8_t *pSrcB, const uint32_t srcBLen, int32_t *pRes)
 Glue code for convolution of 8-bit integer vectors. More...
 
void plp_conv_i8s_xpulpv2 (const int8_t *pSrcA, const uint32_t srcALen, const int8_t *pSrcB, const uint32_t srcBLen, int32_t *pRes)
 Convolution of 8-bit integer vectors kernel for XPULPV2 extension. More...
 
void plp_conv_i8s_rv32im (const int8_t *pSrcA, const uint32_t srcALen, const int8_t *pSrcB, const uint32_t srcBLen, int32_t *pRes)
 Convolution of 8-bit integer vectors kernel for RV32IM extension. More...
 
void plp_conv_i32_parallel (const int32_t *pSrcA, const uint32_t srcALen, const int32_t *pSrcB, const uint32_t srcBLen, const uint8_t nPE, int32_t *pRes)
 Glue code for parallel convolution of 32-bit integer vectors. More...
 
void plp_conv_i32p_xpulpv2 (void *task_args)
 Setup code for parallel convolution of 32-bit integer vectors. More...
 
void plp_conv_i16_parallel (const int16_t *pSrcA, const uint32_t srcALen, const int16_t *pSrcB, const uint32_t srcBLen, const uint8_t nPE, int32_t *pRes)
 Glue code for parallel convolution of 16-bit integer vectors. More...
 
void plp_conv_i16p_xpulpv2 (void *task_args)
 Setup code for parallel convolution of 16-bit integer vectors. More...
 
void plp_conv_i8_parallel (const int8_t *pSrcA, const uint32_t srcALen, const int8_t *pSrcB, const uint32_t srcBLen, const uint8_t nPE, int32_t *pRes)
 Glue code for parallel convolution of 8-bit integer vectors. More...
 
void plp_conv_i8p_xpulpv2 (void *task_args)
 Setup code for parallel convolution of 8-bit integer vectors. More...
 
void plp_conv_parallel_OLA (uint32_t nPE, uint32_t srcALen, uint32_t srcBLen, int32_t *resultsBuffer)
 Helper function for parallelized overlap-adding of partial convolution results. More...
 
void plp_conv_parallel_OLA_kernel (void *task_args)
 Helper function for parallelized overlap-adding of partial convolution results. More...
 
void plp_mat_mult_i32 (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Glue code for matrix matrix multiplication of a 32-bit integer matrices. More...
 
void plp_mat_mult_i32s_rv32im (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Matrix matrix multiplication of a 32-bit integer matrices for RV32IM extension. More...
 
void plp_mat_mult_i32s_xpulpv2 (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Matrix matrix multiplication of a 32-bit integer matrices for XPULPV2 extension. More...
 
void plp_mat_mult_i16 (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Glue code for matrix matrix multiplication of a 16-bit integer matrices. More...
 
void plp_mat_mult_i16s_rv32im (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Matrix matrix multiplication of a 16-bit integer matrices for RV32IM extension. More...
 
void plp_mat_mult_i16v_xpulpv2 (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Matrix matrix multiplication of a 16-bit integer matrices for XPULPV2 extension. More...
 
void plp_mat_mult_i8 (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Glue code for matrix matrix multiplication of a 8-bit integer matrices. More...
 
void plp_mat_mult_i8s_rv32im (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Matrix matrix multiplication of a 8-bit integer matrices for RV32IM extension. More...
 
void plp_mat_mult_i8v_xpulpv2 (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Matrix matrix multiplication of a 8-bit integer matrices for XPULPV2 extension. More...
 
void plp_mat_mult_i32_parallel (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t nPE, int32_t *__restrict__ pDstC)
 Glue code for parallel matrix matrix multiplication of a 32-bit integer matrices. More...
 
void plp_mat_mult_i32p_xpulpv2 (void *args)
 Parallel matrix matrix multiplication of a 32-bit integer matrices for XPULPV2 extension. More...
 
void plp_mat_mult_i16_parallel (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t nPE, int32_t *__restrict__ pDstC)
 Glue code for parallel matrix matrix multiplication of a 16-bit integer matrices. More...
 
void plp_mat_mult_i16vp_xpulpv2 (void *args)
 Parallel matrix multiplication of 16-bit integer matrices kernel for XPULPV2 extension. More...
 
void plp_mat_mult_i8_parallel (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t nPE, int32_t *__restrict__ pDstC)
 Glue code for parallel matrix matrix multiplication of a 8-bit integer matrices. More...
 
void plp_mat_mult_i8vp_xpulpv2 (void *args)
 Parallel matrix multiplication of 8-bit integer matrices kernel for XPULPV2 extension. More...
 
void plp_mat_mult_trans_i32 (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Glue code for matrix transposed matrix multiplication of a 32-bit integer matrices. More...
 
void plp_mat_mult_trans_i32s_rv32im (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Matrix transposed matrix multiplication of a 32-bit integer matrices for RV32IM extension. More...
 
void plp_mat_mult_trans_i32s_xpulpv2 (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Matrix transposed matrix multiplication of a 32-bit integer matrices for XPULPV2 extension. More...
 
void plp_mat_mult_trans_i16 (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Glue code for matrix transposed matrix multiplication of a 16-bit integer matrices. More...
 
void plp_mat_mult_trans_i16s_rv32im (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Matrix transposed matrix multiplication of a 16-bit integer matrices for RV32IM extension. More...
 
void plp_mat_mult_trans_i16v_xpulpv2 (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Matrix transposed matrix multiplication of a 16-bit integer matrices for XPULPV2 extension. More...
 
void plp_mat_mult_trans_i8 (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Glue code for matrix transposed matrix multiplication of a 8-bit integer matrices. More...
 
void plp_mat_mult_trans_i8s_rv32im (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Matrix transposed matrix multiplication of a 8-bit integer matrices for RV32IM extension. More...
 
void plp_mat_mult_trans_i8v_xpulpv2 (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, int32_t *__restrict__ pDstC)
 Matrix transposed matrix multiplication of a 8-bit integer matrices for XPULPV2 extension. More...
 
void plp_mat_mult_trans_i32_parallel (const int32_t *__restrict__ pSrcA, const int32_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t nPE, int32_t *__restrict__ pDstC)
 Glue code for parallel matrix matrix multiplication of a 32-bit integer matrices. More...
 
void plp_mat_mult_trans_i32p_xpulpv2 (void *args)
 Parallel matrix transposed matrix multiplication of a 32-bit integer matrices for RV32IM extension. More...
 
void plp_mat_mult_trans_i16_parallel (const int16_t *__restrict__ pSrcA, const int16_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t nPE, int32_t *__restrict__ pDstC)
 Glue code for parallel matrix transposed matrix multiplication of a 16-bit integer matrices. More...
 
void plp_mat_mult_trans_i16vp_xpulpv2 (void *args)
 Parallel matrix transposed matrix multiplication of a 16-bit integer matrices for XPULPV2 extension. More...
 
void plp_mat_mult_trans_i8_parallel (const int8_t *__restrict__ pSrcA, const int8_t *__restrict__ pSrcB, uint32_t M, uint32_t N, uint32_t O, uint32_t nPE, int32_t *__restrict__ pDstC)
 Glue code for parallel matrix transposed matrix multiplication of a 8-bit integer matrices. More...
 
void plp_mat_mult_trans_i8vp_xpulpv2 (void *args)
 Parallel matrix transposed matrix multiplication of a 8-bit integer matrices for XPULPV2 extension. More...
 
void plp_rfft_f32 (const plp_rfft_instance_f32 *S, const float32_t *__restrict__ pSrc, float32_t *__restrict__ pDst)
 Floating-point FFT on real input data. More...
 
void plp_rfft_f32_parallel (const plp_rfft_instance_f32 *S, const float32_t *__restrict__ pSrc, const uint32_t nPE, float32_t *__restrict__ pDst)
 Floating-point FFT on real input data (parallel version). More...
 
void plp_rfft_f32_xpulpv2 (const plp_rfft_instance_f32 *S, const float32_t *__restrict__ pSrc, float32_t *__restrict__ pDst)
 Floating-point FFT on real input data for XPULPV2 extension. More...
 
void plp_rfft_f32_xpulpv2_parallel (plp_rfft_parallel_arg_f32 *arg)
 Floating-point FFT on real input data for XPULPV2 extension (parallel version). More...
 

Detailed Description

Public header file for PULP DSP Library.

==========================================================================

Version
V0

16. May 2019

Function Documentation

void plp_conv_i32 ( const int32_t *  pSrcA,
const uint32_t  srcALen,
const int32_t *  pSrcB,
const uint32_t  srcBLen,
int32_t *  pRes 
)

Glue code for convolution of 32-bit integer vectors.


Parameters
[in]pSrcApoints to the first input vector
[in]srcALenLength of the first input vector
[in]pSrcBpoints to the second input vector
[in]srcBLenLength of the second input vector
[out]pResoutput result returned here
Returns
none
void plp_conv_i32s_xpulpv2 ( const int32_t *__restrict__  pSrcA,
const uint32_t  srcALen,
const int32_t *__restrict__  pSrcB,
const uint32_t  srcBLen,
int32_t *__restrict__  pRes 
)

Convolution of 32-bit integer vectors kernel for XPULPV2 extension.


Parameters
[in]pSrcApoints to the first input vector
[in]srcALenLength of the first input vector
[in]pSrcBpoints to the second input vector
[in]srcBLenLength of the second input vector
[out]pResoutput result returned here
Returns
none
void plp_dot_prod_i16 ( const int16_t *  pSrcA,
const int16_t *  pSrcB,
uint32_t  blockSize,
int32_t *__restrict__  pRes 
)

Glue code for dot product of 16-bit integer vectors.


Parameters
[in]pSrcApoints to the first input vector [16 bit]
[in]pSrcBpoints to the second input vector [16 bit]
[in]blockSizenumber of samples in each vector
[out]pResoutput result returned here [32 bit]
Exploiting SIMD instructions
When the ISA supports, the 16 bit values are packed two by two into 32 bit vectors and then the two dot products are performed simultaneously on 32 bit vectors, with 32 bit accumulator.