From a8bf0b23736f18850ae92b4e3cbc68997881fe6d Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Thu, 10 Oct 2019 18:39:41 +0200 Subject: [PATCH] andmask for both optimized encoder routines. Minor changes in ldpctest --- openair1/PHY/CODING/TESTBENCH/ldpctest.c | 4 ++-- openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c index 6db9548dbe..5c036023db 100644 --- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c +++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c @@ -362,7 +362,7 @@ int test_ldpc(short No_iteration, printf("\ne %d..%d: ",i,i+15); #endif - if (channel_input[j][i-2*Zc]==0) + if (channel_input_optim[j][i-2*Zc]==0) modulated_input[j][i]=1.0;///sqrt(2); //QPSK else modulated_input[j][i]=-1.0;///sqrt(2); @@ -386,7 +386,7 @@ int test_ldpc(short No_iteration, else channel_output_uncoded[j][i]=0; - if (channel_output_uncoded[j][i] != channel_input[j][i-2*Zc]) + if (channel_output_uncoded[j][i] != channel_input_optim[j][i-2*Zc]) *errors_bit_uncoded = (*errors_bit_uncoded) + 1; } diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c index a7ebe14693..4c50df2636 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c @@ -273,7 +273,7 @@ int ldpc_encoder_optim(unsigned char *test_input,unsigned char *channel_input,sh if(tinput != NULL) start_meas(tinput); for (i=0; i>(i&7)))>>(i&7); + c[i] = (test_input[i/8]&(128>>(i&7)))>>(7-(i&7)); //printf("c(%d,%d)=%d\n",j,i,temp); } @@ -330,7 +330,7 @@ int ldpc_encoder_optim_8seg(unsigned char **test_input,unsigned char **channel_i #ifdef __AVX2__ __m256i shufmask = _mm256_set_epi64x(0x0303030303030303, 0x0202020202020202,0x0101010101010101, 0x0000000000000000); - __m256i andmask = _mm256_set1_epi64x(0x8040201008040201); // every 8 bits -> 8 bytes, pattern repeats. + __m256i andmask = _mm256_set1_epi64x(0x0102040810204080); // every 8 bits -> 8 bytes, pattern repeats. __m256i zero256 = _mm256_setzero_si256(); __m256i masks[8]; register __m256i c256; @@ -413,7 +413,7 @@ int ldpc_encoder_optim_8seg(unsigned char **test_input,unsigned char **channel_i for (i=0; i>(i&7); + temp = (test_input[j][i/8]&(128>>(i&7)))>>(7-(i&7)); //printf("c(%d,%d)=%d\n",j,i,temp); c[i] |= (temp << j); } @@ -431,7 +431,7 @@ int ldpc_encoder_optim_8seg(unsigned char **test_input,unsigned char **channel_i for (i=(block_length>>5)<<5;i>(i&7)))>>(i&7); + temp = (test_input[j][i/8]&(128>>(i&7)))>>(7-(i&7)); //printf("c(%d,%d)=%d\n",j,i,temp); c[i] |= (temp << j); } @@ -639,7 +639,7 @@ int ldpc_encoder_optim_8seg_multi(unsigned char **test_input,unsigned char **cha //for (j=0; j>(i&7)))>>(i&7); + temp = (test_input[j][i/8]&(128>>(i&7)))>>(7-(i&7)); //printf("c(%d,%d)=%d\n",j,i,temp); c[i] |= (temp << (j-macro_segment)); }