From f054ce9dad41febee3dd4b4842a60e7d35445093 Mon Sep 17 00:00:00 2001 From: pabr Date: Sat, 25 Mar 2017 10:34:11 +0100 Subject: [PATCH] fir_sampler dot product: Even simpler form that triggers NEON vectorization with gcc-4.9.2 --- src/leansdr/sdr.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/leansdr/sdr.h b/src/leansdr/sdr.h index 47361d1..8e0bcba 100644 --- a/src/leansdr/sdr.h +++ b/src/leansdr/sdr.h @@ -485,14 +485,15 @@ namespace leansdr { if ( subsampling == 1 ) { // Special case for heavily oversampled signals, // where filtering is expensive. - while ( pc+16 < pcend ) { - // gcc-4.9.2 can vectorize this form with NEON on ARM - for ( int i=0; i<16; ++i) - acc += (*pc++)*(*pin++); - } + // gcc-4.9.2 can vectorize this form with NEON on ARM. + while ( pc < pcend ) + acc += (*pc++)*(*pin++); + } else { + // Not vectorized because the coefficients are not + // guaranteed to be contiguous in memory. + for ( ; pc