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_2x_hifi3(struct fir_state_32x16 *fir, ae_int32 x0, ae_int32 x1,
			ae_int32 *y0, ae_int32 *y1, int shift)
{
	ae_f64 a;
	ae_f64 b;
	ae_valign u;
	ae_f32x2 d0;
	ae_f32x2 d1;
	ae_f16x4 coefs;
	int i;
	ae_f32x2 *dp;
	ae_f16x4 *coefp = fir->coef;
	const int taps_div_4 = fir->taps >> 2;
	const int inc = 2 * sizeof(int32_t);
	if (!taps_div_4) {
		*y0 = x0;
		*y1 = x1;
		return;
	}
	AE_S32_L_XC(x0, fir->rwp, -sizeof(int32_t));
	dp = (ae_f32x2 *)fir->rwp;
	AE_S32_L_XC(x1, fir->rwp, -sizeof(int32_t));
	a = AE_ZERO64();
	b = AE_ZERO64();
	u = AE_LA64_PP(coefp);
	AE_L32X2_XC(d0, dp, inc);
	for (i = 0; i < taps_div_4; i++) {
		AE_LA16X4_IP(coefs, u, coefp);
		AE_L32X2_XC(d1, dp, inc);
		AE_MULAFD32X16X2_FIR_HH(b, a, d0, d1, coefs);
		d0 = d1;
		AE_L32X2_XC(d1, dp, inc);
		AE_MULAFD32X16X2_FIR_HL(b, a, d0, d1, coefs);
		d0 = d1;
	}
	b = AE_SLAA64S(b, shift);
	a = AE_SLAA64S(a, shift);
	AE_S32_L_I(AE_ROUND32F48SSYM(b), (ae_int32 *)y1, 0);
	AE_S32_L_I(AE_ROUND32F48SSYM(a), (ae_int32 *)y0, 0);
}
void fir_32x16_2x_hifi3 ( struct fir_state_32x16 * fir , ae_int32 x0 , ae_int32 x1 , ae_int32 * y0 , ae_int32 * y1 , int shift ) { ae_f64 a ; ae_f64 b ; ae_valign u ; ae_f32x2 d0 ; ae_f32x2 d1 ; ae_f16x4 coefs ; int i ; ae_f32x2 * dp ; ae_f16x4 * coefp = fir -> coef ; const int taps_div_4 = fir -> taps >> 2 ; const int inc = 2 * sizeof ( int32_t ) ; if ( ! taps_div_4 ) { * y0 = x0 ; * y1 = x1 ; return ; } AE_S32_L_XC ( x0 , fir -> rwp , - sizeof ( int32_t ) ) ; dp = ( ae_f32x2 * ) fir -> rwp ; AE_S32_L_XC ( x1 , fir -> rwp , - sizeof ( int32_t ) ) ; a = AE_ZERO64 ( ) ; b = AE_ZERO64 ( ) ; u = AE_LA64_PP ( coefp ) ; AE_L32X2_XC ( d0 , dp , inc ) ; for ( i = 0 ; i < taps_div_4 ; i ++ ) { AE_LA16X4_IP ( coefs , u , coefp ) ; AE_L32X2_XC ( d1 , dp , inc ) ; AE_MULAFD32X16X2_FIR_HH ( b , a , d0 , d1 , coefs ) ; d0 = d1 ; AE_L32X2_XC ( d1 , dp , inc ) ; AE_MULAFD32X16X2_FIR_HL ( b , a , d0 , d1 , coefs ) ; d0 = d1 ; } b = AE_SLAA64S ( b , shift ) ; a = AE_SLAA64S ( a , shift ) ; AE_S32_L_I ( AE_ROUND32F48SSYM ( b ) , ( ae_int32 * ) y1 , 0 ) ; AE_S32_L_I ( AE_ROUND32F48SSYM ( a ) , ( ae_int32 * ) y0 , 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
	 * 2x 56 bit registers Q,
	 * 4x 48 bit registers P
	 * 3x integers
	 * 2x address pointers,
	 */ /* Bypass samples if taps count is zero. */ /* Write samples to delay */ /* 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));
	 */ /* Prime the coefficients stream */ /* Load two data samples and pack to d0 to data2_h and
	 * d1 to data2_l.
	 */ /* 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. Upper part d1_h is x[n+1] and
		 * lower part d1_l is x[n].
		 */ /* Quad MAC (HH)
		 * b += d0_h * coefs_3 + d0_l * coefs_2
		 * a += d0_l * coefs_3 + d1_h * coefs_2
		 */ /* Repeat the same for next two taps and increase coefp. */ /* Quad MAC (HL)
		 * b += d0_h * coefs_1 + d0_l * coefs_0
		 * a += d0_l * coefs_1 + d1_h * coefs_0
		 */ /* Do scaling shifts and store sample. */