From d4fbc3a14d352900fbf92f2163f7358e52393b52 Mon Sep 17 00:00:00 2001 From: Martino Date: Mon, 18 Jun 2018 09:40:29 +0200 Subject: [PATCH] Final version of kernal function, now we save 320 us with the intrinsics --- .../nrPolar_tools/nr_polar_kernal_operation.c | 72 +++++++++---------- 1 file changed, 34 insertions(+), 38 deletions(-) diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_kernal_operation.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_kernal_operation.c index 2bd76e488c..5985130eee 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_kernal_operation.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_kernal_operation.c @@ -10,70 +10,66 @@ void nr_polar_kernal_operation(uint8_t *u, uint8_t *d, uint16_t N) // Martino's algorithm to avoid multiplication for the generating matrix of polar codes uint32_t i,j; - - for(i=0; i If zero, then XOR with the u(j) + D=_mm256_cmpeq_epi32(C, zerosOnly); // compare with zero and use the result as mask + + E=_mm256_maskload_epi32((int const*)uArray, D); // load only some u(j)s for the XOR OUT=_mm256_xor_si256(OUT, E); //32 bit x 8 } _mm256_storeu_si256((__m256i*)dTest, OUT); - for(k=0; k<8; k++) + for(k=0; k<8; k++) // Conversion from 32 bits to 8 bits { - d[i+k]=(uint8_t)dTest[k]; //Conv from 32 to 8 + d[i+k]=(uint8_t)dTest[k]; // With AVX512 there is an intrinsic to do it } } -*/ + + #else + + for(i=0; i