Commit f8fbd26b authored by Raymond Knopp's avatar Raymond Knopp

more cleanup and testing

parent fa3a637b
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
#include <immintrin.h> #include <immintrin.h>
#include "../nrLDPCdecoder_defs.h" #include "../nrLDPCdecoder_defs.h"
#include "../nrLDPC_types.h" #include "../nrLDPC_types.h"
#include "../nrLDPC_init.h" //#include "../nrLDPC_init.h"
#include "../nrLDPC_mPass.h" //#include "../nrLDPC_mPass.h"
//#include "nrLDPC_cnProc.h" //#include "nrLDPC_cnProc.h"
#include "../nrLDPC_bnProc.h" #include "../nrLDPC_bnProc.h"
#include "cnProc_gen.h" #include "cnProc_gen.h"
void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) void nrLDPC_cnProc_BG1_generator(uint16_t Z,int R)
{ {
const char *ratestr[3]={"13","23","89"}; const char *ratestr[3]={"13","23","89"};
...@@ -23,7 +23,9 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -23,7 +23,9 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
FILE *fd=fopen(fname,"w"); FILE *fd=fopen(fname,"w");
if (fd == NULL) {printf("Cannot create %s\n");abort();} if (fd == NULL) {printf("Cannot create %s\n");abort();}
fprintf(fd,"void nrLDPC_cnProc_BG1_Z%d_%s(t_nrLDPC_procBuf* p_procBuf) {\n",Z,ratestr[R]); fprintf(fd,"#include <stdint.h>\n");
fprintf(fd,"#include <immintrin.h>\n");
fprintf(fd,"void nrLDPC_cnProc_BG1_Z%d_%s(int8_t* cnProcBuf,int8_t* cnProcBufRes) {\n",Z,ratestr[R]);
const uint8_t* lut_numCnInCnGroups; const uint8_t* lut_numCnInCnGroups;
const uint32_t* lut_startAddrCnGroups = lut_startAddrCnGroups_BG1; const uint32_t* lut_startAddrCnGroups = lut_startAddrCnGroups_BG1;
...@@ -33,9 +35,6 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -33,9 +35,6 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
else if (R==2) lut_numCnInCnGroups = lut_numCnInCnGroups_BG1_R89; else if (R==2) lut_numCnInCnGroups = lut_numCnInCnGroups_BG1_R89;
else { printf("aborting, illegal R %d\n",R); fclose(fd);abort();} else { printf("aborting, illegal R %d\n",R); fclose(fd);abort();}
int8_t* cnProcBuf = p_procBuf->cnProcBuf;
int8_t* cnProcBufRes = p_procBuf->cnProcBufRes;
//__m256i* p_cnProcBuf; //__m256i* p_cnProcBuf;
//__m256i* p_cnProcBufRes; //__m256i* p_cnProcBufRes;
...@@ -66,9 +65,9 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -66,9 +65,9 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
// Offsets are in units of bitOffsetInGroup (1*384/32) // Offsets are in units of bitOffsetInGroup (1*384/32)
const uint8_t lut_idxCnProcG3[3][2] = {{12,24}, {0,24}, {0,12}}; const uint8_t lut_idxCnProcG3[3][2] = {{12,24}, {0,24}, {0,12}};
fprintf(fd," __m256i ymm0, min, sgn;\n"); fprintf(fd," __m256i ymm0, min, sgn,ones,maxLLR;\n");
fprintf(fd," const __m256i* p_ones = (__m256i*) ones256_epi8;\n"); fprintf(fd," ones = _mm256_set1_epi8((char)1);\n");
fprintf(fd," const __m256i* p_maxLLR = (__m256i*) maxLLR256_epi8;\n"); fprintf(fd," maxLLR = _mm256_set1_epi8((char)127);\n");
if (lut_numCnInCnGroups[0] > 0) if (lut_numCnInCnGroups[0] > 0)
{ {
...@@ -97,8 +96,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -97,8 +96,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
// Abs and sign of 32 CNs (first BN) // Abs and sign of 32 CNs (first BN)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i]; // ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[0]+lut_idxCnProcG3[j][0] + i); fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[0]+lut_idxCnProcG3[j][0] + i);
// sgn = _mm256_sign_epi8(*p_ones, ymm0); // sgn = _mm256_sign_epi8(ones, ymm0);
fprintf(fd," sgn = _mm256_sign_epi8(*p_ones, ymm0);\n"); fprintf(fd," sgn = _mm256_sign_epi8(ones, ymm0);\n");
// min = _mm256_abs_epi8(ymm0); // min = _mm256_abs_epi8(ymm0);
fprintf(fd," min = _mm256_abs_epi8(ymm0);\n"); fprintf(fd," min = _mm256_abs_epi8(ymm0);\n");
...@@ -113,11 +112,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -113,11 +112,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
fprintf(fd," sgn = _mm256_sign_epi8(sgn, ymm0);\n"); fprintf(fd," sgn = _mm256_sign_epi8(sgn, ymm0);\n");
// Store result // Store result
// min = _mm256_min_epu8(min, *p_maxLLR); // 128 in epi8 is -127 // min = _mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
fprintf(fd," min = _mm256_min_epu8(min, *p_maxLLR);\n"); fprintf(fd," min = _mm256_min_epu8(min, maxLLR);\n");
// *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn); // *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++; // p_cnProcBufResBit++;
fprintf(fd," ((__m256i*)cnProcB ufRestBit)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[0]+(j*bitOffsetInGroup)+i); fprintf(fd," ((__m256i*)cnProcBufRes)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[0]+(j*bitOffsetInGroup)+i);
} }
} }
} }
...@@ -155,8 +154,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -155,8 +154,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
// Abs and sign of 32 CNs (first BN) // Abs and sign of 32 CNs (first BN)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i]; // ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[1]+lut_idxCnProcG4[j][0] + i); fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[1]+lut_idxCnProcG4[j][0] + i);
// sgn = _mm256_sign_epi8(*p_ones, ymm0); // sgn = _mm256_sign_epi8(ones, ymm0);
fprintf(fd," sgn = _mm256_sign_epi8(*p_ones, ymm0);\n"); fprintf(fd," sgn = _mm256_sign_epi8(ones, ymm0);\n");
// min = _mm256_abs_epi8(ymm0); // min = _mm256_abs_epi8(ymm0);
fprintf(fd," min = _mm256_abs_epi8(ymm0);\n"); fprintf(fd," min = _mm256_abs_epi8(ymm0);\n");
...@@ -174,11 +173,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -174,11 +173,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
} }
// Store result // Store result
// min = _mm256_min_epu8(min, *p_maxLLR); // 128 in epi8 is -127 // min = _mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
fprintf(fd," min = _mm256_min_epu8(min, *p_maxLLR);\n"); fprintf(fd," min = _mm256_min_epu8(min, maxLLR);\n");
// *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn); // *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++; // p_cnProcBufResBit++;
fprintf(fd," ((__m256i*)cnProcBufRestBit)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[1]+(j*bitOffsetInGroup)+i); fprintf(fd," ((__m256i*)cnProcBufRes)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[1]+(j*bitOffsetInGroup)+i);
} }
} }
} }
...@@ -219,8 +218,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -219,8 +218,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
// Abs and sign of 32 CNs (first BN) // Abs and sign of 32 CNs (first BN)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i]; // ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[2]+lut_idxCnProcG5[j][0] + i); fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[2]+lut_idxCnProcG5[j][0] + i);
// sgn = _mm256_sign_epi8(*p_ones, ymm0); // sgn = _mm256_sign_epi8(ones, ymm0);
fprintf(fd," sgn = _mm256_sign_epi8(*p_ones, ymm0);\n"); fprintf(fd," sgn = _mm256_sign_epi8(ones, ymm0);\n");
// min = _mm256_abs_epi8(ymm0); // min = _mm256_abs_epi8(ymm0);
fprintf(fd," min = _mm256_abs_epi8(ymm0);\n"); fprintf(fd," min = _mm256_abs_epi8(ymm0);\n");
...@@ -238,11 +237,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -238,11 +237,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
} }
// Store result // Store result
// min = _mm256_min_epu8(min, *p_maxLLR); // 128 in epi8 is -127 // min = _mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
fprintf(fd," min = _mm256_min_epu8(min, *p_maxLLR);\n"); fprintf(fd," min = _mm256_min_epu8(min, maxLLR);\n");
// *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn); // *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++; // p_cnProcBufResBit++;
fprintf(fd," ((__m256i*)cnProcBufRestBit)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[2]+(j*bitOffsetInGroup)+i); fprintf(fd," ((__m256i*)cnProcBufRes)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[2]+(j*bitOffsetInGroup)+i);
} }
} }
} }
...@@ -283,8 +282,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -283,8 +282,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
// Abs and sign of 32 CNs (first BN) // Abs and sign of 32 CNs (first BN)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i]; // ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[3]+lut_idxCnProcG6[j][0] + i); fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[3]+lut_idxCnProcG6[j][0] + i);
// sgn = _mm256_sign_epi8(*p_ones, ymm0); // sgn = _mm256_sign_epi8(ones, ymm0);
fprintf(fd," sgn = _mm256_sign_epi8(*p_ones, ymm0);\n"); fprintf(fd," sgn = _mm256_sign_epi8(ones, ymm0);\n");
// min = _mm256_abs_epi8(ymm0); // min = _mm256_abs_epi8(ymm0);
fprintf(fd," min = _mm256_abs_epi8(ymm0);\n"); fprintf(fd," min = _mm256_abs_epi8(ymm0);\n");
...@@ -302,11 +301,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -302,11 +301,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
} }
// Store result // Store result
// min = _mm256_min_epu8(min, *p_maxLLR); // 128 in epi8 is -127 // min = _mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
fprintf(fd," min = _mm256_min_epu8(min, *p_maxLLR);\n"); fprintf(fd," min = _mm256_min_epu8(min, maxLLR);\n");
// *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn); // *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++; // p_cnProcBufResBit++;
fprintf(fd," ((__m256i*)cnProcBufRestBit)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[3]+(j*bitOffsetInGroup)+i); fprintf(fd," ((__m256i*)cnProcBufRes)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[3]+(j*bitOffsetInGroup)+i);
} }
} }
} }
...@@ -350,8 +349,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -350,8 +349,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
// Abs and sign of 32 CNs (first BN) // Abs and sign of 32 CNs (first BN)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i]; // ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[4]+lut_idxCnProcG7[j][0] + i); fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[4]+lut_idxCnProcG7[j][0] + i);
// sgn = _mm256_sign_epi8(*p_ones, ymm0); // sgn = _mm256_sign_epi8(ones, ymm0);
fprintf(fd," sgn = _mm256_sign_epi8(*p_ones, ymm0);\n"); fprintf(fd," sgn = _mm256_sign_epi8(ones, ymm0);\n");
// min = _mm256_abs_epi8(ymm0); // min = _mm256_abs_epi8(ymm0);
fprintf(fd," min = _mm256_abs_epi8(ymm0);\n"); fprintf(fd," min = _mm256_abs_epi8(ymm0);\n");
...@@ -369,11 +368,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -369,11 +368,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
} }
// Store result // Store result
// min = _mm256_min_epu8(min, *p_maxLLR); // 128 in epi8 is -127 // min = _mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
fprintf(fd," min = _mm256_min_epu8(min, *p_maxLLR);\n"); fprintf(fd," min = _mm256_min_epu8(min, maxLLR);\n");
// *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn); // *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++; // p_cnProcBufResBit++;
fprintf(fd," ((__m256i*)cnProcBufRestBit)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[4]+(j*bitOffsetInGroup)+i); fprintf(fd," ((__m256i*)cnProcBufRes)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[4]+(j*bitOffsetInGroup)+i);
} }
} }
} }
...@@ -418,8 +417,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -418,8 +417,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
// Abs and sign of 32 CNs (first BN) // Abs and sign of 32 CNs (first BN)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i]; // ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[5]+lut_idxCnProcG8[j][0] + i); fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[5]+lut_idxCnProcG8[j][0] + i);
// sgn = _mm256_sign_epi8(*p_ones, ymm0); // sgn = _mm256_sign_epi8(ones, ymm0);
fprintf(fd," sgn = _mm256_sign_epi8(*p_ones, ymm0);\n"); fprintf(fd," sgn = _mm256_sign_epi8(ones, ymm0);\n");
// min = _mm256_abs_epi8(ymm0); // min = _mm256_abs_epi8(ymm0);
fprintf(fd," min = _mm256_abs_epi8(ymm0);\n"); fprintf(fd," min = _mm256_abs_epi8(ymm0);\n");
...@@ -437,11 +436,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -437,11 +436,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
} }
// Store result // Store result
// min = _mm256_min_epu8(min, *p_maxLLR); // 128 in epi8 is -127 // min = _mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
fprintf(fd," min = _mm256_min_epu8(min, *p_maxLLR);\n"); fprintf(fd," min = _mm256_min_epu8(min, maxLLR);\n");
// *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn); // *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++; // p_cnProcBufResBit++;
fprintf(fd," ((__m256i*)cnProcBufRestBit)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[5]+(j*bitOffsetInGroup)+i); fprintf(fd," ((__m256i*)cnProcBufRes)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[5]+(j*bitOffsetInGroup)+i);
} }
} }
} }
...@@ -487,8 +486,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -487,8 +486,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
// Abs and sign of 32 CNs (first BN) // Abs and sign of 32 CNs (first BN)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i]; // ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[6]+lut_idxCnProcG9[j][0] + i); fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[6]+lut_idxCnProcG9[j][0] + i);
// sgn = _mm256_sign_epi8(*p_ones, ymm0); // sgn = _mm256_sign_epi8(ones, ymm0);
fprintf(fd," sgn = _mm256_sign_epi8(*p_ones, ymm0);\n"); fprintf(fd," sgn = _mm256_sign_epi8(ones, ymm0);\n");
// min = _mm256_abs_epi8(ymm0); // min = _mm256_abs_epi8(ymm0);
fprintf(fd," min = _mm256_abs_epi8(ymm0);\n"); fprintf(fd," min = _mm256_abs_epi8(ymm0);\n");
...@@ -506,11 +505,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -506,11 +505,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
} }
// Store result // Store result
// min = _mm256_min_epu8(min, *p_maxLLR); // 128 in epi8 is -127 // min = _mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
fprintf(fd," min = _mm256_min_epu8(min, *p_maxLLR);\n"); fprintf(fd," min = _mm256_min_epu8(min, maxLLR);\n");
// *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn); // *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++; // p_cnProcBufResBit++;
fprintf(fd," ((__m256i*)cnProcBufRestBit)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[6]+(j*bitOffsetInGroup)+i); fprintf(fd," ((__m256i*)cnProcBufRes)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[6]+(j*bitOffsetInGroup)+i);
} }
} }
} }
...@@ -556,8 +555,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -556,8 +555,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
// Abs and sign of 32 CNs (first BN) // Abs and sign of 32 CNs (first BN)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i]; // ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[7]+lut_idxCnProcG10[j][0] + i); fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[7]+lut_idxCnProcG10[j][0] + i);
// sgn = _mm256_sign_epi8(*p_ones, ymm0); // sgn = _mm256_sign_epi8(ones, ymm0);
fprintf(fd," sgn = _mm256_sign_epi8(*p_ones, ymm0);\n"); fprintf(fd," sgn = _mm256_sign_epi8(ones, ymm0);\n");
// min = _mm256_abs_epi8(ymm0); // min = _mm256_abs_epi8(ymm0);
fprintf(fd," min = _mm256_abs_epi8(ymm0);\n"); fprintf(fd," min = _mm256_abs_epi8(ymm0);\n");
...@@ -575,11 +574,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -575,11 +574,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
} }
// Store result // Store result
// min = _mm256_min_epu8(min, *p_maxLLR); // 128 in epi8 is -127 // min = _mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
fprintf(fd," min = _mm256_min_epu8(min, *p_maxLLR);\n"); fprintf(fd," min = _mm256_min_epu8(min, maxLLR);\n");
// *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn); // *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++; // p_cnProcBufResBit++;
fprintf(fd," ((__m256i*)cnProcBufRestBit)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[7]+(j*bitOffsetInGroup)+i); fprintf(fd," ((__m256i*)cnProcBufRes)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[7]+(j*bitOffsetInGroup)+i);
} }
} }
} }
...@@ -627,8 +626,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -627,8 +626,8 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
// Abs and sign of 32 CNs (first BN) // Abs and sign of 32 CNs (first BN)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i]; // ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[8]+lut_idxCnProcG19[j][0] + i); fprintf(fd," ymm0 = ((__m256i*)&cnProcBuf)[%d];\n",lut_startAddrCnGroups[8]+lut_idxCnProcG19[j][0] + i);
// sgn = _mm256_sign_epi8(*p_ones, ymm0); // sgn = _mm256_sign_epi8(ones, ymm0);
fprintf(fd," sgn = _mm256_sign_epi8(*p_ones, ymm0);\n"); fprintf(fd," sgn = _mm256_sign_epi8(ones, ymm0);\n");
// min = _mm256_abs_epi8(ymm0); // min = _mm256_abs_epi8(ymm0);
fprintf(fd," min = _mm256_abs_epi8(ymm0);\n"); fprintf(fd," min = _mm256_abs_epi8(ymm0);\n");
...@@ -646,11 +645,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R) ...@@ -646,11 +645,11 @@ void nrLDPC_cnProc_BG1_generator(t_nrLDPC_procBuf* p_procBuf, uint16_t Z,int R)
} }
// Store result // Store result
// min = _mm256_min_epu8(min, *p_maxLLR); // 128 in epi8 is -127 // min = _mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
fprintf(fd," min = _mm256_min_epu8(min, *p_maxLLR);\n"); fprintf(fd," min = _mm256_min_epu8(min, maxLLR);\n");
// *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn); // *p_cnProcBufResBit = _mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++; // p_cnProcBufResBit++;
fprintf(fd," ((__m256i*)cnProcBufRestBit)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[8]+(j*bitOffsetInGroup)+i); fprintf(fd," ((__m256i*)cnProcBufRes)[%d] = _mm256_sign_epi8(min, sgn);\n",lut_numCnInCnGroups[8]+(j*bitOffsetInGroup)+i);
} }
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
//#include "../nrLDPCdecoder_defs.h" //#include "../nrLDPCdecoder_defs.h"
#include "../nrLDPC_types.h" #include "../nrLDPC_types.h"
#include "../nrLDPC_init.h" #include "../nrLDPC_init.h"
#include "../nrLDPC_mPass.h" //#include "../nrLDPC_mPass.h"
//#include "../nrLDPC_cnProc.h" //#include "../nrLDPC_cnProc.h"
#include "../nrLDPC_bnProc.h" #include "../nrLDPC_bnProc.h"
#include "cnProc_gen.h" #include "cnProc_gen.h"
...@@ -55,8 +55,6 @@ int main(int argc, char *argv[]) ...@@ -55,8 +55,6 @@ int main(int argc, char *argv[])
}*/ }*/
// Allocate LDPC decoder buffers // Allocate LDPC decoder buffers
// p_nrLDPC_procBuf = nrLDPC_init_mem(); // p_nrLDPC_procBuf = nrLDPC_init_mem();
t_nrLDPC_procBuf cnProcBuf;
t_nrLDPC_procBuf* p_procBuf = &cnProcBuf;
// load_nrLDPClib(); // load_nrLDPClib();
...@@ -64,7 +62,7 @@ int main(int argc, char *argv[]) ...@@ -64,7 +62,7 @@ int main(int argc, char *argv[])
// load_nrLDPClib_ref("_orig", &encoder_orig); // load_nrLDPClib_ref("_orig", &encoder_orig);
// Z=384, R=1/3 // Z=384, R=1/3
nrLDPC_cnProc_BG1_generator(p_procBuf,384,0); nrLDPC_cnProc_BG1_generator(384,0);
//nrLDPC_cnProc_BG1(&lut_numCnInCnGroups, &cnProcBuf, 380); //nrLDPC_cnProc_BG1(&lut_numCnInCnGroups, &cnProcBuf, 380);
//for (block_length=8;block_length<=MAX_BLOCK_LENGTH;block_length+=8) //for (block_length=8;block_length<=MAX_BLOCK_LENGTH;block_length+=8)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment