src/math/fir_hifi3.c
/* HiFi EP has the follow number of reqisters that should not be exceeded
 * 4x 56 bit registers in register file Q
 * 8x 48 bit registers in register file P
 */
HiFi EP has the follow number of reqisters that should not be exceeded
4x 56 bit registers in register file Q
8x 48 bit registers in register file P
HiFi EP has the follow number of reqisters that should not be exceeded 4x 56 bit registers in register file Q 8x 48 bit registers in register file P
void fir_32x16_hifi3(struct fir_state_32x16 *fir, ae_int32 x, ae_int32 *y,
		     int shift)
{
	ae_f64 a;
	ae_valign u;
	ae_f32x2 data2;
	ae_f16x4 coefs;
	ae_f32x2 d0;
	ae_f32x2 d1;
	int i;
	ae_int32 *dp = fir->rwp;
	ae_int16x4 *coefp = (ae_int16x4 *)fir->coef;
	const int taps_div_4 = fir->taps >> 2;
	const int inc = sizeof(int32_t);
	if (!taps_div_4) {
		*y = x;
		return;
	}
	AE_S32_L_XC(x, fir->rwp, -sizeof(int32_t));
	u = AE_LA64_PP(coefp);
	a = AE_ZEROQ56();
	for (i = 0; i < taps_div_4; i++) {
		AE_LA16X4_IP(coefs, u, coefp);
		AE_L32_XC(d0, dp, inc);
		AE_L32_XC(d1, dp, inc);
		data2 = AE_SEL32_LL(d0, d1);
		AE_MULAAFD32X16_H3_L2(a, data2, coefs);
		AE_L32_XC(d0, dp, inc);
		AE_L32_XC(d1, dp, inc);
		data2 = AE_SEL32_LL(d0, d1);
		AE_MULAAFD32X16_H1_L0(a, data2, coefs);
	}
	a = AE_SLAA64S(a, shift);
	AE_S32_L_I(AE_ROUND32F48SSYM(a), (ae_int32 *)y, 0);
}
void fir_32x16_hifi3 ( struct fir_state_32x16 * fir , ae_int32 x , ae_int32 * y , int shift ) { ae_f64 a ; ae_valign u ; ae_f32x2 data2 ; ae_f16x4 coefs ; ae_f32x2 d0 ; ae_f32x2 d1 ; int i ; ae_int32 * dp = fir -> rwp ; ae_int16x4 * coefp = ( ae_int16x4 * ) fir -> coef ; const int taps_div_4 = fir -> taps >> 2 ; const int inc = sizeof ( int32_t ) ; if ( ! taps_div_4 ) { * y = x ; return ; } AE_S32_L_XC ( x , fir -> rwp , - sizeof ( int32_t ) ) ; u = AE_LA64_PP ( coefp ) ; a = AE_ZEROQ56 ( ) ; for ( i = 0 ; i < taps_div_4 ; i ++ ) { AE_LA16X4_IP ( coefs , u , coefp ) ; AE_L32_XC ( d0 , dp , inc ) ; AE_L32_XC ( d1 , dp , inc ) ; data2 = AE_SEL32_LL ( d0 , d1 ) ; AE_MULAAFD32X16_H3_L2 ( a , data2 , coefs ) ; AE_L32_XC ( d0 , dp , inc ) ; AE_L32_XC ( d1 , dp , inc ) ; data2 = AE_SEL32_LL ( d0 , d1 ) ; AE_MULAAFD32X16_H1_L0 ( a , data2 , coefs ) ; } a = AE_SLAA64S ( a , shift ) ; AE_S32_L_I ( AE_ROUND32F48SSYM ( a ) , ( ae_int32 * ) y , 0 ) ; }
HiFi EP has the follow number of reqisters that should not be exceeded
 4x 56 bit registers in register file Q
 8x 48 bit registers in register file P
HiFi EP has the follow number of reqisters that should not be exceeded 4x 56 bit registers in register file Q 8x 48 bit registers in register file P
/* This function uses
	 * 1x 56 bit registers Q,
	 * 4x 48 bit registers P
	 * 3x integers
	 * 2x address pointers,
	 */ /* Bypass samples if taps count is zero. */ /* Write sample to delay */ /* Prime the coefficients stream */ /* Note: If the next function is converted to handle two samples
	 * per call the data load can be done with single instruction
	 * AE_LP24X2F_C(data2, dp, sizeof(ae_p24x2f));
	 */ /* Load four coefficients. Coef_3 contains tap h[n],
		 * coef_2 contains h[n+1], coef_1 contains h[n+2], and
		 * coef_0 contains h[n+3];
		 */ /* Load two data samples and pack to d0 to data2_h and
		 * d1 to data2_l.
		 */ /* Accumulate
		 * a += data2_h * coefs_3 + data2_l * coefs_2. The Q1.31
		 * data and Q1.15 coefficients are used as 24 bits as
		 * Q1.23 values.
		 */ /* Repeat the same for next two taps and increase coefp.
		 * a += data2_h * coefs_1 + data2_l * coefs_0.
		 */ /* Do scaling shifts and store sample. */