mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
Merge branch 'feature/cnproc-twopass' into 'develop'
Two-pass min1/min2 cnProc for BG1 and BG2. See merge request oai/openairinterface5g!4154
This commit is contained in:
@@ -1668,7 +1668,7 @@ include_directories("${NFAPI_DIR}/pnf_sim/inc")
|
||||
|
||||
add_library(oai_iqplayer MODULE ${OPENAIR_DIR}/radio/iqplayer/iqplayer_lib.c)
|
||||
target_link_libraries(oai_iqplayer PRIVATE log_headers)
|
||||
|
||||
|
||||
#################################
|
||||
# add executables for operation
|
||||
#################################
|
||||
|
||||
14
doc/Doxyfile
14
doc/Doxyfile
@@ -2160,20 +2160,6 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrLDPC_encoder/ldpc_BG2_Zc208_byte.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrLDPC_encoder/ldpc240_byte.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrLDPC_encoder/ldpc_BG2_Zc352_byte_128.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_polar_interleaving_pattern.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_bitwise_operations.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_polar_kernal_operation.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_polar_dci_defs.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_polar_sequence_pattern.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/nrPolar_tools/nr_polar_matrix_and_array.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/defs_NB_IoT.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/lte_segmentation.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/CODING/3gpplte.c \
|
||||
|
||||
@@ -62,9 +62,9 @@ versions of gcc defined in the cmake cross-compilation file (`cross-arm.cmake`).
|
||||
|
||||
### Build code generation tools for host
|
||||
|
||||
Use the x86 compiler to build the `ldpc_generators` and generate the header
|
||||
file in the `ran_build/build` folder. They are necessary during a build for
|
||||
code generation, and therefore need to be created for the x86 architecture.
|
||||
Use the x86 compiler to generate the T header file in the `ran_build/build`
|
||||
folder. This is necessary during a build for code generation, and therefore
|
||||
need to be created for the x86 architecture.
|
||||
|
||||
```shell
|
||||
rm -r ran_build
|
||||
@@ -74,7 +74,7 @@ mkdir ran_build/build-cross
|
||||
|
||||
cd ran_build/build
|
||||
cmake ../../..
|
||||
make -j`nproc` ldpc_generators generate_T
|
||||
make -j`nproc` generate_T
|
||||
```
|
||||
|
||||
### Build executables for ARM64
|
||||
|
||||
@@ -19,7 +19,7 @@ RUN /bin/sh oaienv && \
|
||||
mkdir -p log ran_build/build ran_build/build-cross && \
|
||||
cd ran_build/build && \
|
||||
cmake ../../.. -GNinja && \
|
||||
ninja ldpc_generators generate_T && \
|
||||
ninja generate_T && \
|
||||
cd ../build-cross/ && \
|
||||
# install missing libyaml-cpp-dev for arm64
|
||||
apt install -y libyaml-cpp-dev:arm64 && \
|
||||
|
||||
@@ -16,14 +16,14 @@ add_library(ldpc_orig MODULE
|
||||
nrLDPC_encoder/ldpc_encoder.c
|
||||
)
|
||||
set_target_properties(ldpc_orig PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
target_link_libraries(ldpc_orig PRIVATE ldpc_segment ldpc_gen_HEADERS)
|
||||
target_link_libraries(ldpc_orig PRIVATE ldpc_segment)
|
||||
|
||||
add_library(ldpc MODULE
|
||||
nrLDPC_decoder/nrLDPC_decoder.c
|
||||
nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
|
||||
)
|
||||
set_target_properties(ldpc PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
target_link_libraries(ldpc PRIVATE ldpc_segment ldpc_gen_HEADERS)
|
||||
target_link_libraries(ldpc PRIVATE ldpc_segment)
|
||||
|
||||
add_dependencies(ldpctest ldpc ldpc_orig)
|
||||
add_dependencies(nr-softmodem ldpc ldpc_orig)
|
||||
@@ -36,6 +36,5 @@ add_dependencies(nr_dlschsim ldpc ldpc_orig)
|
||||
add_library(crc_byte OBJECT crc_byte.c)
|
||||
|
||||
add_subdirectory(nrLDPC_coding)
|
||||
add_subdirectory(nrLDPC_decoder)
|
||||
add_subdirectory(nrPolar_tools)
|
||||
add_subdirectory(nrSmallBlock)
|
||||
|
||||
@@ -23,7 +23,7 @@ if (ENABLE_LDPC_AAL)
|
||||
set_target_properties(ldpc_aal PROPERTIES COMPILE_FLAGS "-DALLOW_EXPERIMENTAL_API")
|
||||
set_target_properties(ldpc_aal PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
target_include_directories(ldpc_aal PRIVATE ${LIBDPDK_AAL_INCLUDE_DIRS})
|
||||
target_link_libraries(ldpc_aal PRIVATE log_headers ldpc_gen_HEADERS ${LIBDPDK_AAL_LDFLAGS})
|
||||
target_link_libraries(ldpc_aal PRIVATE log_headers ${LIBDPDK_AAL_LDFLAGS})
|
||||
if (PMD_T2)
|
||||
target_link_libraries(ldpc_aal PRIVATE ${PMD_T2})
|
||||
endif()
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
add_subdirectory(nrLDPC_tools)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
@@ -854,7 +853,293 @@ static inline void nrLDPC_cnProc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBuf, int
|
||||
|
||||
}
|
||||
|
||||
#endif /* !__AVX512BW__ — end of generic BG1/BG2 256-bit block */
|
||||
|
||||
// =============================================================================
|
||||
// Two-pass min1/min2 CN processing
|
||||
//
|
||||
// Available on ALL targets (AVX512, AVX2, aarch64/NEON, SSE2 fallback).
|
||||
// On AVX2 / AVX512: uses 256-bit vectors (32 CNs per iteration).
|
||||
// On aarch64 / SSE2: uses 128-bit vectors (16 CNs per iteration) so that
|
||||
// each SIMD operation maps to a single NEON or SSE instruction rather than
|
||||
// an emulated pair.
|
||||
//
|
||||
// Replaces the LUT-exclude-self approach with a two-pass algorithm:
|
||||
//
|
||||
// Pass 1: read all numBN inputs once to collect:
|
||||
// vmin1 — minimum |vk| across all k
|
||||
// vmin2 — second minimum |vk|
|
||||
// vsgn_xor — XOR of all input bytes; bit 7 = sign parity
|
||||
// (XOR with 0 is identity, so zero-LLR inputs are safe)
|
||||
//
|
||||
// Pass 2: read all numBN inputs a second time; for each k:
|
||||
// other_xor = vsgn_xor XOR vk (removes self via XOR self-inverse)
|
||||
// sign_mask = 0xFF where bit 7 of other_xor = 1, else 0x00
|
||||
// out_mag = (|vk| == vmin1) ? vmin2 : vmin1
|
||||
// result = (out_mag XOR sign_mask) - sign_mask (±out_mag)
|
||||
//
|
||||
// Memory reads per CN group: 2 × numBN vs numBN × (numBN-1) for LUT approach:
|
||||
//
|
||||
// numBN= 3: 6 vs 6 (break-even)
|
||||
// numBN= 4: 8 vs 12 (1.5× fewer)
|
||||
// numBN= 7: 14 vs 42 (3.0× fewer)
|
||||
// numBN=10: 20 vs 90 (4.5× fewer)
|
||||
// numBN=19: 38 vs 342 (9.0× fewer)
|
||||
//
|
||||
// Tie approximation: when two or more BNs share min1, all receive min2 in pass 2.
|
||||
// This is the standard min-sum tie approximation; effect on convergence is negligible.
|
||||
// =============================================================================
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
* 512-bit two-pass group kernel — AVX512BW (64 CNs per iteration).
|
||||
* Uses mask-register comparisons and predicated blend for single-cycle
|
||||
* select. Only compiled when __AVX512BW__ is defined.
|
||||
* ------------------------------------------------------------------------- */
|
||||
#if defined(__AVX512BW__)
|
||||
/**
|
||||
* \brief Two-pass min-sum CN processor, 512-bit — one degree group.
|
||||
*
|
||||
* \param cnProcBuf Start of this group in the CN proc buffer (64-byte aligned).
|
||||
* \param cnProcBufRes Start of this group in the CN proc result buffer.
|
||||
* \param numBN Number of BNs per CN in this degree group.
|
||||
* \param M Number of 64-CN chunks: ceil(numCN × Z / 64).
|
||||
* \param off BN-to-BN stride in units of sizeof(simde__m512i) = 64 bytes.
|
||||
*/
|
||||
static inline void nrLDPC_cnProc_group_2pass_512(simde__m512i *cnProcBuf,
|
||||
simde__m512i *cnProcBufRes,
|
||||
uint32_t numBN,
|
||||
uint32_t M,
|
||||
uint32_t off)
|
||||
{
|
||||
const simde__m512i maxLLR = simde_mm512_set1_epi8(127);
|
||||
const simde__m512i zeros = simde_mm512_setzero_si512();
|
||||
|
||||
for (uint32_t i = 0; i < M; i++) {
|
||||
simde__m512i vmin1 = maxLLR;
|
||||
simde__m512i vmin2 = maxLLR;
|
||||
simde__m512i vsgn_xor = zeros;
|
||||
|
||||
for (uint32_t k = 0; k < numBN; k++) {
|
||||
simde__m512i vk = cnProcBuf[k * off + i];
|
||||
simde__m512i vak = simde_mm512_abs_epi8(vk);
|
||||
vsgn_xor = simde_mm512_xor_si512(vsgn_xor, vk);
|
||||
simde__m512i new_min1 = simde_mm512_min_epu8(vmin1, vak);
|
||||
simde__m512i new_min2 = simde_mm512_min_epu8(vmin2,
|
||||
simde_mm512_max_epu8(vmin1, vak));
|
||||
vmin1 = new_min1;
|
||||
vmin2 = new_min2;
|
||||
}
|
||||
for (uint32_t k = 0; k < numBN; k++) {
|
||||
simde__m512i vk = cnProcBuf[k * off + i];
|
||||
simde__m512i vak = simde_mm512_abs_epi8(vk);
|
||||
simde__mmask64 eq_mask = simde_mm512_cmpeq_epi8_mask(vak, vmin1);
|
||||
simde__m512i out_mag = simde_mm512_min_epu8(
|
||||
simde_mm512_mask_blend_epi8(eq_mask, vmin1, vmin2),
|
||||
maxLLR);
|
||||
simde__m512i other_xor = simde_mm512_xor_si512(vsgn_xor, vk);
|
||||
simde__mmask64 neg_mask = simde_mm512_cmpgt_epi8_mask(zeros, other_xor);
|
||||
simde__m512i neg_out = simde_mm512_sub_epi8(zeros, out_mag);
|
||||
cnProcBufRes[k * off + i] = simde_mm512_mask_blend_epi8(neg_mask, out_mag, neg_out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
* 256-bit two-pass group kernel — AVX2 only (32 CNs per iteration).
|
||||
* Not compiled on AVX512 targets (512-bit kernel above is used instead)
|
||||
* or on pure 128-bit targets (aarch64 NEON, SSE2-only x86).
|
||||
* ------------------------------------------------------------------------- */
|
||||
#elif defined(__AVX2__)
|
||||
/**
|
||||
* \brief Two-pass min-sum CN processor, 256-bit — one degree group.
|
||||
*
|
||||
* \param cnProcBuf Start of this group in the CN proc buffer (32-byte aligned).
|
||||
* \param cnProcBufRes Start of this group in the CN proc result buffer.
|
||||
* \param numBN Number of BNs per CN in this degree group.
|
||||
* \param M Number of 32-CN chunks: ceil(numCN × Z / 32).
|
||||
* \param off BN-to-BN stride in units of sizeof(simde__m256i) = 32 bytes.
|
||||
*/
|
||||
static inline void nrLDPC_cnProc_group_2pass(simde__m256i *cnProcBuf,
|
||||
simde__m256i *cnProcBufRes,
|
||||
uint32_t numBN,
|
||||
uint32_t M,
|
||||
uint32_t off)
|
||||
{
|
||||
const simde__m256i maxLLR = *(const simde__m256i *)maxLLR256_epi8;
|
||||
const simde__m256i zeros = simde_mm256_setzero_si256();
|
||||
|
||||
for (uint32_t i = 0; i < M; i++) {
|
||||
simde__m256i vmin1 = maxLLR;
|
||||
simde__m256i vmin2 = maxLLR;
|
||||
simde__m256i vsgn_xor = zeros;
|
||||
|
||||
for (uint32_t k = 0; k < numBN; k++) {
|
||||
simde__m256i vk = cnProcBuf[k * off + i];
|
||||
simde__m256i vak = simde_mm256_abs_epi8(vk);
|
||||
vsgn_xor = simde_mm256_xor_si256(vsgn_xor, vk);
|
||||
simde__m256i new_min1 = simde_mm256_min_epu8(vmin1, vak);
|
||||
simde__m256i new_min2 = simde_mm256_min_epu8(vmin2,
|
||||
simde_mm256_max_epu8(vmin1, vak));
|
||||
vmin1 = new_min1;
|
||||
vmin2 = new_min2;
|
||||
}
|
||||
for (uint32_t k = 0; k < numBN; k++) {
|
||||
simde__m256i vk = cnProcBuf[k * off + i];
|
||||
simde__m256i vak = simde_mm256_abs_epi8(vk);
|
||||
simde__m256i mask = simde_mm256_cmpeq_epi8(vak, vmin1);
|
||||
simde__m256i out_mag = simde_mm256_min_epu8(
|
||||
simde_mm256_blendv_epi8(vmin1, vmin2, mask),
|
||||
maxLLR);
|
||||
simde__m256i other_xor = simde_mm256_xor_si256(vsgn_xor, vk);
|
||||
simde__m256i sign_mask = simde_mm256_cmpgt_epi8(zeros, other_xor);
|
||||
cnProcBufRes[k * off + i] = simde_mm256_sub_epi8(
|
||||
simde_mm256_xor_si256(out_mag, sign_mask),
|
||||
sign_mask);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* __AVX512BW__ / __AVX2__ */
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
* 128-bit two-pass group kernel — aarch64 NEON and SSE2/SSSE3 fallback
|
||||
* (16 CNs per iteration; each simde__m128i op = one NEON or SSE instruction).
|
||||
* Always compiled so it is available on every target.
|
||||
* ------------------------------------------------------------------------- */
|
||||
/**
|
||||
* \brief Two-pass min-sum CN processor, 128-bit — one degree group.
|
||||
*
|
||||
* \param cnProcBuf Start of this group in the CN proc buffer (128-bit aligned).
|
||||
* \param cnProcBufRes Start of this group in the CN proc result buffer.
|
||||
* \param numBN Number of BNs per CN in this degree group.
|
||||
* \param M Number of 16-CN chunks: ceil(numCN × Z / 16).
|
||||
* \param off BN-to-BN stride in units of sizeof(simde__m128i) = 16 bytes.
|
||||
*/
|
||||
static inline void nrLDPC_cnProc_group_2pass_128(simde__m128i *cnProcBuf,
|
||||
simde__m128i *cnProcBufRes,
|
||||
uint32_t numBN,
|
||||
uint32_t M,
|
||||
uint32_t off)
|
||||
{
|
||||
const simde__m128i maxLLR = *(const simde__m128i *)maxLLR256_epi8;
|
||||
const simde__m128i zeros = simde_mm_setzero_si128();
|
||||
|
||||
for (uint32_t i = 0; i < M; i++) {
|
||||
simde__m128i vmin1 = maxLLR;
|
||||
simde__m128i vmin2 = maxLLR;
|
||||
simde__m128i vsgn_xor = zeros;
|
||||
|
||||
for (uint32_t k = 0; k < numBN; k++) {
|
||||
simde__m128i vk = cnProcBuf[k * off + i];
|
||||
simde__m128i vak = simde_mm_abs_epi8(vk);
|
||||
vsgn_xor = simde_mm_xor_si128(vsgn_xor, vk);
|
||||
simde__m128i new_min1 = simde_mm_min_epu8(vmin1, vak);
|
||||
simde__m128i new_min2 = simde_mm_min_epu8(vmin2,
|
||||
simde_mm_max_epu8(vmin1, vak));
|
||||
vmin1 = new_min1;
|
||||
vmin2 = new_min2;
|
||||
}
|
||||
for (uint32_t k = 0; k < numBN; k++) {
|
||||
simde__m128i vk = cnProcBuf[k * off + i];
|
||||
simde__m128i vak = simde_mm_abs_epi8(vk);
|
||||
simde__m128i mask = simde_mm_cmpeq_epi8(vak, vmin1);
|
||||
simde__m128i out_mag = simde_mm_min_epu8(
|
||||
simde_mm_blendv_epi8(vmin1, vmin2, mask),
|
||||
maxLLR);
|
||||
simde__m128i other_xor = simde_mm_xor_si128(vsgn_xor, vk);
|
||||
simde__m128i sign_mask = simde_mm_cmpgt_epi8(zeros, other_xor);
|
||||
cnProcBufRes[k * off + i] = simde_mm_sub_epi8(
|
||||
simde_mm_xor_si128(out_mag, sign_mask),
|
||||
sign_mask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
* BG1 / BG2 two-pass wrappers — dispatch to 512-bit (AVX512BW), 256-bit
|
||||
* (AVX2), or 128-bit (aarch64/SSE2) based on compile-time target.
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* \brief Two-pass min-sum CN processing for BG1.
|
||||
* Drop-in replacement for nrLDPC_cnProc_BG1; no rate-specific LUT needed.
|
||||
*/
|
||||
static inline void nrLDPC_cnProc_BG1_2pass(t_nrLDPC_lut *p_lut,
|
||||
int8_t *cnProcBuf,
|
||||
int8_t *cnProcBufRes,
|
||||
uint16_t Z)
|
||||
{
|
||||
const uint8_t *lut_numCnInCnGroups = p_lut->numCnInCnGroups;
|
||||
const uint32_t *lut_startAddrCnGroups = p_lut->startAddrCnGroups;
|
||||
static const uint8_t numBN_per_group[9] = {3, 4, 5, 6, 7, 8, 9, 10, 19};
|
||||
|
||||
for (int grp = 0; grp < 9; grp++) {
|
||||
if (lut_numCnInCnGroups[grp] == 0)
|
||||
continue;
|
||||
#if defined(__AVX512BW__)
|
||||
uint32_t M = ((uint32_t)lut_numCnInCnGroups[grp] * Z + 63) >> 6;
|
||||
uint32_t off = (lut_numCnInCnGroups_BG1_R13[grp] * NR_LDPC_ZMAX) >> 6;
|
||||
nrLDPC_cnProc_group_2pass_512(
|
||||
(simde__m512i *)&cnProcBuf [lut_startAddrCnGroups[grp]],
|
||||
(simde__m512i *)&cnProcBufRes[lut_startAddrCnGroups[grp]],
|
||||
numBN_per_group[grp], M, off);
|
||||
#elif defined(__AVX2__)
|
||||
uint32_t M = ((uint32_t)lut_numCnInCnGroups[grp] * Z + 31) >> 5;
|
||||
uint32_t off = (lut_numCnInCnGroups_BG1_R13[grp] * NR_LDPC_ZMAX) >> 5;
|
||||
nrLDPC_cnProc_group_2pass(
|
||||
(simde__m256i *)&cnProcBuf [lut_startAddrCnGroups[grp]],
|
||||
(simde__m256i *)&cnProcBufRes[lut_startAddrCnGroups[grp]],
|
||||
numBN_per_group[grp], M, off);
|
||||
#else
|
||||
uint32_t M = ((uint32_t)lut_numCnInCnGroups[grp] * Z + 15) >> 4;
|
||||
uint32_t off = (lut_numCnInCnGroups_BG1_R13[grp] * NR_LDPC_ZMAX) >> 4;
|
||||
nrLDPC_cnProc_group_2pass_128(
|
||||
(simde__m128i *)&cnProcBuf [lut_startAddrCnGroups[grp]],
|
||||
(simde__m128i *)&cnProcBufRes[lut_startAddrCnGroups[grp]],
|
||||
numBN_per_group[grp], M, off);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Two-pass min-sum CN processing for BG2.
|
||||
* Drop-in replacement for nrLDPC_cnProc_BG2; no rate-specific LUT needed.
|
||||
*/
|
||||
static inline void nrLDPC_cnProc_BG2_2pass(t_nrLDPC_lut *p_lut,
|
||||
int8_t *cnProcBuf,
|
||||
int8_t *cnProcBufRes,
|
||||
uint16_t Z)
|
||||
{
|
||||
const uint8_t *lut_numCnInCnGroups = p_lut->numCnInCnGroups;
|
||||
const uint32_t *lut_startAddrCnGroups = p_lut->startAddrCnGroups;
|
||||
static const uint8_t numBN_per_group[6] = {3, 4, 5, 6, 8, 10};
|
||||
|
||||
for (int grp = 0; grp < 6; grp++) {
|
||||
if (lut_numCnInCnGroups[grp] == 0)
|
||||
continue;
|
||||
#if defined(__AVX512BW__)
|
||||
uint32_t M = ((uint32_t)lut_numCnInCnGroups[grp] * Z + 63) >> 6;
|
||||
uint32_t off = (lut_numCnInCnGroups_BG2_R15[grp] * NR_LDPC_ZMAX) >> 6;
|
||||
nrLDPC_cnProc_group_2pass_512(
|
||||
(simde__m512i *)&cnProcBuf [lut_startAddrCnGroups[grp]],
|
||||
(simde__m512i *)&cnProcBufRes[lut_startAddrCnGroups[grp]],
|
||||
numBN_per_group[grp], M, off);
|
||||
#elif defined(__AVX2__)
|
||||
uint32_t M = ((uint32_t)lut_numCnInCnGroups[grp] * Z + 31) >> 5;
|
||||
uint32_t off = (lut_numCnInCnGroups_BG2_R15[grp] * NR_LDPC_ZMAX) >> 5;
|
||||
nrLDPC_cnProc_group_2pass(
|
||||
(simde__m256i *)&cnProcBuf [lut_startAddrCnGroups[grp]],
|
||||
(simde__m256i *)&cnProcBufRes[lut_startAddrCnGroups[grp]],
|
||||
numBN_per_group[grp], M, off);
|
||||
#else
|
||||
uint32_t M = ((uint32_t)lut_numCnInCnGroups[grp] * Z + 15) >> 4;
|
||||
uint32_t off = (lut_numCnInCnGroups_BG2_R15[grp] * NR_LDPC_ZMAX) >> 4;
|
||||
nrLDPC_cnProc_group_2pass_128(
|
||||
(simde__m128i *)&cnProcBuf [lut_startAddrCnGroups[grp]],
|
||||
(simde__m128i *)&cnProcBufRes[lut_startAddrCnGroups[grp]],
|
||||
numBN_per_group[grp], M, off);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Performs parity check for BG1 on the CN processing buffer. Stops as soon as error is detected.
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
@@ -18,104 +16,6 @@
|
||||
#include "nrLDPC_bnProc.h"
|
||||
#include "openair1/PHY/CODING/coding_defs.h"
|
||||
#include "log.h"
|
||||
#define UNROLL_CN_PROC 1
|
||||
#define UNROLL_BN_PROC 1
|
||||
#define UNROLL_BN_PROC_PC 1
|
||||
#define UNROLL_BN2CN_PROC 1
|
||||
/*----------------------------------------------------------------------
|
||||
| cn processing files -->AVX512
|
||||
/----------------------------------------------------------------------*/
|
||||
|
||||
//BG1-------------------------------------------------------------------
|
||||
#if defined(__AVX512BW__)
|
||||
|
||||
#include "cnProc_avx512/nrLDPC_cnProc_BG1_R13_AVX512.h"
|
||||
#include "cnProc_avx512/nrLDPC_cnProc_BG1_R23_AVX512.h"
|
||||
#include "cnProc_avx512/nrLDPC_cnProc_BG1_R89_AVX512.h"
|
||||
//BG2-------------------------------------------------------------------
|
||||
#include "cnProc_avx512/nrLDPC_cnProc_BG2_R15_AVX512.h"
|
||||
#include "cnProc_avx512/nrLDPC_cnProc_BG2_R13_AVX512.h"
|
||||
#include "cnProc_avx512/nrLDPC_cnProc_BG2_R23_AVX512.h"
|
||||
|
||||
#elif defined(__AVX2__)
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
| cn Processing files -->AVX2
|
||||
/----------------------------------------------------------------------*/
|
||||
|
||||
//BG1------------------------------------------------------------------
|
||||
#include "cnProc/nrLDPC_cnProc_BG1_R13_AVX2.h"
|
||||
#include "cnProc/nrLDPC_cnProc_BG1_R23_AVX2.h"
|
||||
#include "cnProc/nrLDPC_cnProc_BG1_R89_AVX2.h"
|
||||
//BG2 --------------------------------------------------------------------
|
||||
#include "cnProc/nrLDPC_cnProc_BG2_R15_AVX2.h"
|
||||
#include "cnProc/nrLDPC_cnProc_BG2_R13_AVX2.h"
|
||||
#include "cnProc/nrLDPC_cnProc_BG2_R23_AVX2.h"
|
||||
|
||||
#else
|
||||
|
||||
//BG1------------------------------------------------------------------
|
||||
#include "cnProc128/nrLDPC_cnProc_BG1_R13_128.h"
|
||||
#include "cnProc128/nrLDPC_cnProc_BG1_R23_128.h"
|
||||
#include "cnProc128/nrLDPC_cnProc_BG1_R89_128.h"
|
||||
//BG2 --------------------------------------------------------------------
|
||||
#include "cnProc128/nrLDPC_cnProc_BG2_R15_128.h"
|
||||
#include "cnProc128/nrLDPC_cnProc_BG2_R13_128.h"
|
||||
#include "cnProc128/nrLDPC_cnProc_BG2_R23_128.h"
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
| bn Processing files -->AVX2
|
||||
/----------------------------------------------------------------------*/
|
||||
|
||||
//bnProcPc-------------------------------------------------------------
|
||||
#ifdef __AVX2__
|
||||
//BG1------------------------------------------------------------------
|
||||
#include "bnProcPc/nrLDPC_bnProcPc_BG1_R13_AVX2.h"
|
||||
#include "bnProcPc/nrLDPC_bnProcPc_BG1_R23_AVX2.h"
|
||||
#include "bnProcPc/nrLDPC_bnProcPc_BG1_R89_AVX2.h"
|
||||
//BG2 --------------------------------------------------------------------
|
||||
#include "bnProcPc/nrLDPC_bnProcPc_BG2_R15_AVX2.h"
|
||||
#include "bnProcPc/nrLDPC_bnProcPc_BG2_R13_AVX2.h"
|
||||
#include "bnProcPc/nrLDPC_bnProcPc_BG2_R23_AVX2.h"
|
||||
#else
|
||||
#include "bnProcPc128/nrLDPC_bnProcPc_BG1_R13_128.h"
|
||||
#include "bnProcPc128/nrLDPC_bnProcPc_BG1_R23_128.h"
|
||||
#include "bnProcPc128/nrLDPC_bnProcPc_BG1_R89_128.h"
|
||||
#include "bnProcPc128/nrLDPC_bnProcPc_BG2_R15_128.h"
|
||||
#include "bnProcPc128/nrLDPC_bnProcPc_BG2_R13_128.h"
|
||||
#include "bnProcPc128/nrLDPC_bnProcPc_BG2_R23_128.h"
|
||||
#endif
|
||||
|
||||
//bnProc----------------------------------------------------------------
|
||||
|
||||
#if defined(__AVX512BW__)
|
||||
//BG1-------------------------------------------------------------------
|
||||
#include "bnProc_avx512/nrLDPC_bnProc_BG1_R13_AVX512.h"
|
||||
#include "bnProc_avx512/nrLDPC_bnProc_BG1_R23_AVX512.h"
|
||||
#include "bnProc_avx512/nrLDPC_bnProc_BG1_R89_AVX512.h"
|
||||
//BG2 --------------------------------------------------------------------
|
||||
#include "bnProc_avx512/nrLDPC_bnProc_BG2_R15_AVX512.h"
|
||||
#include "bnProc_avx512/nrLDPC_bnProc_BG2_R13_AVX512.h"
|
||||
#include "bnProc_avx512/nrLDPC_bnProc_BG2_R23_AVX512.h"
|
||||
|
||||
#elif defined(__AVX2__)
|
||||
#include "bnProc/nrLDPC_bnProc_BG1_R13_AVX2.h"
|
||||
#include "bnProc/nrLDPC_bnProc_BG1_R23_AVX2.h"
|
||||
#include "bnProc/nrLDPC_bnProc_BG1_R89_AVX2.h"
|
||||
//BG2 --------------------------------------------------------------------
|
||||
#include "bnProc/nrLDPC_bnProc_BG2_R15_AVX2.h"
|
||||
#include "bnProc/nrLDPC_bnProc_BG2_R13_AVX2.h"
|
||||
#include "bnProc/nrLDPC_bnProc_BG2_R23_AVX2.h"
|
||||
#else
|
||||
#include "bnProc128/nrLDPC_bnProc_BG1_R13_128.h"
|
||||
#include "bnProc128/nrLDPC_bnProc_BG1_R23_128.h"
|
||||
#include "bnProc128/nrLDPC_bnProc_BG1_R89_128.h"
|
||||
//BG2 --------------------------------------------------------------------
|
||||
#include "bnProc128/nrLDPC_bnProc_BG2_R15_128.h"
|
||||
#include "bnProc128/nrLDPC_bnProc_BG2_R13_128.h"
|
||||
#include "bnProc128/nrLDPC_bnProc_BG2_R23_128.h"
|
||||
#endif
|
||||
|
||||
//#define NR_LDPC_PROFILER_DETAIL(a) a
|
||||
#define NR_LDPC_PROFILER_DETAIL(a)
|
||||
@@ -194,18 +94,17 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr,
|
||||
{
|
||||
uint16_t Z = p_decParams->Z;
|
||||
uint8_t BG = p_decParams->BG;
|
||||
uint8_t R = p_decParams->R; //Decoding rate: Format 15,13,... for code rates 1/5, 1/3,... */
|
||||
uint8_t numMaxIter = p_decParams->numMaxIter;
|
||||
e_nrLDPC_outMode outMode = p_decParams->outMode;
|
||||
// int8_t* cnProcBuf= cnProcBuf;
|
||||
// int8_t* cnProcBufRes= cnProcBufRes;
|
||||
|
||||
int8_t cnProcBuf[NR_LDPC_SIZE_CN_PROC_BUF] __attribute__ ((aligned(64))) = {0};
|
||||
int8_t cnProcBufRes[NR_LDPC_SIZE_CN_PROC_BUF] __attribute__ ((aligned(64))) = {0};
|
||||
int8_t bnProcBuf[NR_LDPC_SIZE_BN_PROC_BUF] __attribute__ ((aligned(64))) = {0};
|
||||
int8_t bnProcBufRes[NR_LDPC_SIZE_BN_PROC_BUF] __attribute__ ((aligned(64))) = {0};
|
||||
int8_t llrRes[NR_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(64))) = {0};
|
||||
int8_t llrProcBuf[NR_LDPC_MAX_NUM_LLR] __attribute__((aligned(64))) = {0};
|
||||
int8_t cnProcBuf[NR_LDPC_SIZE_CN_PROC_BUF] __attribute__ ((aligned(64)));
|
||||
int8_t cnProcBufRes[NR_LDPC_SIZE_CN_PROC_BUF] __attribute__ ((aligned(64)));
|
||||
int8_t bnProcBuf[NR_LDPC_SIZE_BN_PROC_BUF] __attribute__ ((aligned(64)));
|
||||
int8_t bnProcBufRes[NR_LDPC_SIZE_BN_PROC_BUF] __attribute__ ((aligned(64)));
|
||||
int8_t llrRes[NR_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(64)));
|
||||
int8_t llrProcBuf[NR_LDPC_MAX_NUM_LLR] __attribute__((aligned(64)));
|
||||
// Minimum number of iterations is 1
|
||||
// 0 iterations means hard-decision on input LLRs
|
||||
// Initialize with parity check fail != 0
|
||||
@@ -236,90 +135,9 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr,
|
||||
// CN processing
|
||||
NR_LDPC_PROFILER_DETAIL(start_meas(&p_profiler->cnProc));
|
||||
if (BG==1) {
|
||||
#ifndef UNROLL_CN_PROC
|
||||
nrLDPC_cnProc_BG1(p_lut, cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
switch (R)
|
||||
{
|
||||
case 13:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_cnProc_BG1_R13_AVX512(cnProcBuf, cnProcBufRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_cnProc_BG1_R13_AVX2(cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
nrLDPC_cnProc_BG1_R13_128(cnProcBuf, cnProcBufRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
case 23:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_cnProc_BG1_R23_AVX512(cnProcBuf,cnProcBufRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_cnProc_BG1_R23_AVX2(cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
nrLDPC_cnProc_BG1_R23_128(cnProcBuf, cnProcBufRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
case 89:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_cnProc_BG1_R89_AVX512(cnProcBuf, cnProcBufRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_cnProc_BG1_R89_AVX2(cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
nrLDPC_cnProc_BG1_R89_128(cnProcBuf, cnProcBufRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
nrLDPC_cnProc_BG1_2pass(p_lut, cnProcBuf, cnProcBufRes, Z);
|
||||
} else {
|
||||
#ifndef UNROLL_CN_PROC
|
||||
nrLDPC_cnProc_BG2(p_lut, cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
switch (R) {
|
||||
case 15:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_cnProc_BG2_R15_AVX512(cnProcBuf, cnProcBufRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_cnProc_BG2_R15_AVX2(cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
nrLDPC_cnProc_BG2_R15_128(cnProcBuf, cnProcBufRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_cnProc_BG2_R13_AVX512(cnProcBuf, cnProcBufRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_cnProc_BG2_R13_AVX2(cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
nrLDPC_cnProc_BG2_R13_128(cnProcBuf, cnProcBufRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_cnProc_BG2_R23_AVX512(cnProcBuf, cnProcBufRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_cnProc_BG2_R23_AVX2(cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
nrLDPC_cnProc_BG2_R23_128(cnProcBuf, cnProcBufRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
nrLDPC_cnProc_BG2_2pass(p_lut, cnProcBuf, cnProcBufRes, Z);
|
||||
}
|
||||
NR_LDPC_PROFILER_DETAIL(stop_meas(&p_profiler->cnProc));
|
||||
|
||||
@@ -342,74 +160,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr,
|
||||
|
||||
// BN processing
|
||||
NR_LDPC_PROFILER_DETAIL(start_meas(&p_profiler->bnProcPc));
|
||||
|
||||
#ifndef UNROLL_BN_PROC_PC
|
||||
nrLDPC_bnProcPc(p_lut, bnProcBuf, bnProcBufRes, llrProcBuf, llrRes, Z);
|
||||
#else
|
||||
if (BG==1) {
|
||||
switch (R) {
|
||||
case 13:
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
nrLDPC_bnProcPc_BG1_R13_AVX2(bnProcBuf,bnProcBufRes,llrRes, llrProcBuf, Z);
|
||||
#else
|
||||
nrLDPC_bnProcPc_BG1_R13_128(bnProcBuf,bnProcBufRes,llrRes, llrProcBuf, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
nrLDPC_bnProcPc_BG1_R23_AVX2(bnProcBuf,bnProcBufRes, llrRes, llrProcBuf, Z);
|
||||
#else
|
||||
nrLDPC_bnProcPc_BG1_R23_128(bnProcBuf,bnProcBufRes, llrRes, llrProcBuf, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 89:
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
nrLDPC_bnProcPc_BG1_R89_AVX2(bnProcBuf,bnProcBufRes, llrRes, llrProcBuf, Z);
|
||||
#else
|
||||
nrLDPC_bnProcPc_BG1_R89_128(bnProcBuf,bnProcBufRes, llrRes, llrProcBuf, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch (R) {
|
||||
case 15:
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
nrLDPC_bnProcPc_BG2_R15_AVX2(bnProcBuf,bnProcBufRes, llrRes, llrProcBuf, Z);
|
||||
#else
|
||||
nrLDPC_bnProcPc_BG2_R15_128(bnProcBuf,bnProcBufRes, llrRes, llrProcBuf, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
nrLDPC_bnProcPc_BG2_R13_AVX2(bnProcBuf,bnProcBufRes,llrRes,llrProcBuf, Z);
|
||||
#else
|
||||
nrLDPC_bnProcPc_BG2_R13_128(bnProcBuf,bnProcBufRes,llrRes,llrProcBuf, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
case 23:
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
nrLDPC_bnProcPc_BG2_R23_AVX2(bnProcBuf,bnProcBufRes,llrRes, llrProcBuf, Z);
|
||||
#else
|
||||
nrLDPC_bnProcPc_BG2_R23_128(bnProcBuf,bnProcBufRes,llrRes, llrProcBuf, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
NR_LDPC_PROFILER_DETAIL(stop_meas(&p_profiler->bnProcPc));
|
||||
|
||||
#ifdef NR_LDPC_DEBUG_MODE
|
||||
@@ -418,93 +169,8 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr,
|
||||
#endif
|
||||
|
||||
NR_LDPC_PROFILER_DETAIL(start_meas(&p_profiler->bnProc));
|
||||
|
||||
if (BG==1) {
|
||||
#ifndef UNROLL_BN_PROC
|
||||
nrLDPC_bnProc(p_lut, bnProcBuf, bnProcBufRes, llrRes, Z);
|
||||
#else
|
||||
switch (R) {
|
||||
case 13:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_bnProc_BG1_R13_AVX512(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#elif defined (__AVX2__)
|
||||
nrLDPC_bnProc_BG1_R13_AVX2(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#else
|
||||
nrLDPC_bnProc_BG1_R13_128(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_bnProc_BG1_R23_AVX512(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_bnProc_BG1_R23_AVX2(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#else
|
||||
nrLDPC_bnProc_BG1_R23_128(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 89:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_bnProc_BG1_R89_AVX512(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_bnProc_BG1_R89_AVX2(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#else
|
||||
nrLDPC_bnProc_BG1_R89_128(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
#ifndef UNROLL_BN2CN_PROC
|
||||
nrLDPC_bn2cnProcBuf_BG2(p_lut, bnProcBufRes, cnProcBuf, Z);
|
||||
#else
|
||||
switch (R) {
|
||||
case 15:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_bnProc_BG2_R15_AVX512(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_bnProc_BG2_R15_AVX2(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#else
|
||||
nrLDPC_bnProc_BG2_R15_128(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_bnProc_BG2_R13_AVX512(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_bnProc_BG2_R13_AVX2(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#else
|
||||
nrLDPC_bnProc_BG2_R13_128(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
case 23:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_bnProc_BG2_R23_AVX512(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_bnProc_BG2_R23_AVX2(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#else
|
||||
nrLDPC_bnProc_BG2_R23_128(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NR_LDPC_PROFILER_DETAIL
|
||||
stop_meas(&p_profiler->bnProc);
|
||||
#endif
|
||||
nrLDPC_bnProc(p_lut, bnProcBuf, bnProcBufRes, llrRes, Z);
|
||||
NR_LDPC_PROFILER_DETAIL(stop_meas(&p_profiler->bnProc));
|
||||
|
||||
#ifdef NR_LDPC_DEBUG_MODE
|
||||
nrLDPC_debug_initBuffer2File(nrLDPC_buffers_BN_PROC_RES);
|
||||
@@ -542,85 +208,9 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr,
|
||||
start_meas(&p_profiler->cnProc);
|
||||
#endif
|
||||
if (BG==1) {
|
||||
#ifndef UNROLL_CN_PROC
|
||||
nrLDPC_cnProc_BG1(p_lut, cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
switch (R) {
|
||||
case 13:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_cnProc_BG1_R13_AVX512(cnProcBuf, cnProcBufRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_cnProc_BG1_R13_AVX2(cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
nrLDPC_cnProc_BG1_R13_128(cnProcBuf, cnProcBufRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_cnProc_BG1_R23_AVX512(cnProcBuf, cnProcBufRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_cnProc_BG1_R23_AVX2(cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
nrLDPC_cnProc_BG1_R23_128(cnProcBuf, cnProcBufRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 89:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_cnProc_BG1_R89_AVX512(cnProcBuf, cnProcBufRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_cnProc_BG1_R89_AVX2(cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
nrLDPC_cnProc_BG1_R89_128(cnProcBuf, cnProcBufRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
nrLDPC_cnProc_BG1_2pass(p_lut, cnProcBuf, cnProcBufRes, Z);
|
||||
} else {
|
||||
#ifndef UNROLL_CN_PROC
|
||||
nrLDPC_cnProc_BG2(p_lut, cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
switch (R) {
|
||||
case 15:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_cnProc_BG2_R15_AVX512(cnProcBuf,cnProcBufRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_cnProc_BG2_R15_AVX2(cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
nrLDPC_cnProc_BG2_R15_128(cnProcBuf, cnProcBufRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_cnProc_BG2_R13_AVX512(cnProcBuf, cnProcBufRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_cnProc_BG2_R13_AVX2(cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
nrLDPC_cnProc_BG2_R13_128(cnProcBuf, cnProcBufRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_cnProc_BG2_R23_AVX512(cnProcBuf, cnProcBufRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_cnProc_BG2_R23_AVX2(cnProcBuf, cnProcBufRes, Z);
|
||||
#else
|
||||
nrLDPC_cnProc_BG2_R23_128(cnProcBuf, cnProcBufRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
nrLDPC_cnProc_BG2_2pass(p_lut, cnProcBuf, cnProcBufRes, Z);
|
||||
}
|
||||
#ifdef NR_LDPC_PROFILER_DETAIL
|
||||
stop_meas(&p_profiler->cnProc);
|
||||
@@ -646,73 +236,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr,
|
||||
|
||||
// BN Processing
|
||||
NR_LDPC_PROFILER_DETAIL(start_meas(&p_profiler->bnProcPc));
|
||||
|
||||
#ifndef UNROLL_BN_PROC_PC
|
||||
nrLDPC_bnProcPc(p_lut, bnProcBuf, bnProcBufRes, llrProcBuf, llrRes, Z);
|
||||
#else
|
||||
if (BG==1) {
|
||||
switch (R) {
|
||||
case 13:
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
nrLDPC_bnProcPc_BG1_R13_AVX2(bnProcBuf,bnProcBufRes,llrRes, llrProcBuf, Z);
|
||||
#else
|
||||
nrLDPC_bnProcPc_BG1_R13_128(bnProcBuf,bnProcBufRes,llrRes, llrProcBuf, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
nrLDPC_bnProcPc_BG1_R23_AVX2(bnProcBuf,bnProcBufRes, llrRes, llrProcBuf, Z);
|
||||
#else
|
||||
nrLDPC_bnProcPc_BG1_R23_128(bnProcBuf,bnProcBufRes, llrRes, llrProcBuf, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 89:
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
nrLDPC_bnProcPc_BG1_R89_AVX2(bnProcBuf,bnProcBufRes, llrRes, llrProcBuf, Z);
|
||||
#else
|
||||
nrLDPC_bnProcPc_BG1_R89_128(bnProcBuf,bnProcBufRes, llrRes, llrProcBuf, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch (R)
|
||||
{
|
||||
case 15:
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
nrLDPC_bnProcPc_BG2_R15_AVX2(bnProcBuf,bnProcBufRes,llrRes, llrProcBuf, Z);
|
||||
#else
|
||||
nrLDPC_bnProcPc_BG2_R15_128(bnProcBuf,bnProcBufRes,llrRes, llrProcBuf, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
nrLDPC_bnProcPc_BG2_R13_AVX2(bnProcBuf,bnProcBufRes,llrRes, llrProcBuf, Z);
|
||||
#else
|
||||
nrLDPC_bnProcPc_BG2_R13_128(bnProcBuf,bnProcBufRes,llrRes, llrProcBuf, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
nrLDPC_bnProcPc_BG2_R23_AVX2(bnProcBuf,bnProcBufRes,llrRes, llrProcBuf, Z);
|
||||
#else
|
||||
nrLDPC_bnProcPc_BG2_R23_128(bnProcBuf,bnProcBufRes,llrRes, llrProcBuf, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
NR_LDPC_PROFILER_DETAIL(stop_meas(&p_profiler->bnProcPc));
|
||||
|
||||
#ifdef NR_LDPC_DEBUG_MODE
|
||||
@@ -720,85 +244,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr,
|
||||
#endif
|
||||
|
||||
NR_LDPC_PROFILER_DETAIL(start_meas(&p_profiler->bnProc));
|
||||
#ifndef UNROLL_BN_PROC
|
||||
nrLDPC_bnProc(p_lut, bnProcBuf, bnProcBufRes, llrRes, Z);
|
||||
#else
|
||||
if (BG==1) {
|
||||
switch (R) {
|
||||
case 13:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_bnProc_BG1_R13_AVX512(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_bnProc_BG1_R13_AVX2(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#else
|
||||
nrLDPC_bnProc_BG1_R13_128(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_bnProc_BG1_R23_AVX512(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_bnProc_BG1_R23_AVX2(bnProcBuf,bnProcBufRes,llrRes, Z);
|
||||
#else
|
||||
nrLDPC_bnProc_BG1_R23_128(bnProcBuf,bnProcBufRes,llrRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 89:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_bnProc_BG1_R89_AVX512(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_bnProc_BG1_R89_AVX2(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#else
|
||||
nrLDPC_bnProc_BG1_R89_128(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch (R)
|
||||
{
|
||||
case 15:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_bnProc_BG2_R15_AVX512(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_bnProc_BG2_R15_AVX2(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#else
|
||||
nrLDPC_bnProc_BG2_R15_128(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_bnProc_BG2_R13_AVX512(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_bnProc_BG2_R13_AVX2(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#else
|
||||
nrLDPC_bnProc_BG2_R13_128(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
{
|
||||
#if defined(__AVX512BW__)
|
||||
nrLDPC_bnProc_BG2_R23_AVX512(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#elif defined(__AVX2__)
|
||||
nrLDPC_bnProc_BG2_R23_AVX2(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#else
|
||||
nrLDPC_bnProc_BG2_R23_128(bnProcBuf, bnProcBufRes,llrRes, Z);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
NR_LDPC_PROFILER_DETAIL(stop_meas(&p_profiler->bnProc));
|
||||
|
||||
#ifdef NR_LDPC_DEBUG_MODE
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
add_subdirectory(generator_bnProc ldpc/generator_bnProc)
|
||||
add_subdirectory(generator_bnProc_avx512 ldpc/generator_bnProc_avx512)
|
||||
add_subdirectory(generator_cnProc ldpc/generator_cnProc)
|
||||
add_subdirectory(generator_cnProc_avx512 ldpc/generator_cnProc_avx512)
|
||||
|
||||
# custom target to build all generators
|
||||
add_custom_target(ldpc_generators)
|
||||
|
||||
# if (CROSS_COMPILE)
|
||||
# find_package(bnProc_gen_avx2)
|
||||
# find_package(bnProc_gen_128)
|
||||
# find_package(bnProc_gen_avx512)
|
||||
# find_package(cnProc_gen_avx2)
|
||||
# find_package(cnProc_gen_128)
|
||||
# find_package(cnProc_gen_avx512)
|
||||
# endif()
|
||||
|
||||
add_dependencies(ldpc_generators
|
||||
bnProc_gen_avx2_files
|
||||
bnProc_gen_128_files
|
||||
bnProc_gen_avx512_files
|
||||
cnProc_gen_avx2_files
|
||||
cnProc_gen_128_files
|
||||
cnProc_gen_avx512_files)
|
||||
|
||||
add_library(ldpc_gen_HEADERS INTERFACE)
|
||||
target_link_libraries(ldpc_gen_HEADERS INTERFACE
|
||||
bnProc_gen_avx2_HEADERS
|
||||
bnProc_gen_128_HEADERS
|
||||
bnProc_gen_avx512_HEADERS
|
||||
cnProc_gen_avx2_HEADERS
|
||||
cnProc_gen_128_HEADERS
|
||||
cnProc_gen_avx512_HEADERS)
|
||||
@@ -1,91 +0,0 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
if (CROSS_COMPILE)
|
||||
find_package(bnProc_gen_128)
|
||||
find_package(bnProc_gen_avx2)
|
||||
else()
|
||||
add_executable(bnProc_gen_avx2
|
||||
bnProc_gen_BG1_avx2.c
|
||||
bnProc_gen_BG2_avx2.c
|
||||
bnProcPc_gen_BG1_avx2.c
|
||||
bnProcPc_gen_BG2_avx2.c
|
||||
main.c)
|
||||
add_executable(bnProc_gen_128
|
||||
bnProc_gen_BG1_128.c
|
||||
bnProc_gen_BG2_128.c
|
||||
bnProcPc_gen_BG1_128.c
|
||||
bnProcPc_gen_BG2_128.c
|
||||
main128.c)
|
||||
|
||||
target_compile_options(bnProc_gen_avx2 PRIVATE -W -Wall )
|
||||
|
||||
target_compile_options(bnProc_gen_128 PRIVATE -W -Wall )
|
||||
export(TARGETS bnProc_gen_avx2 FILE
|
||||
"${CMAKE_BINARY_DIR}/bnProc_gen_avx2Config.cmake")
|
||||
export(TARGETS bnProc_gen_128 FILE
|
||||
"${CMAKE_BINARY_DIR}/bnProc_gen_128Config.cmake")
|
||||
endif ()
|
||||
|
||||
set(bnProc_headers
|
||||
bnProc/nrLDPC_bnProc_BG1_R13_AVX2.h
|
||||
bnProc/nrLDPC_bnProc_BG1_R23_AVX2.h
|
||||
bnProc/nrLDPC_bnProc_BG1_R89_AVX2.h
|
||||
bnProc/nrLDPC_bnProc_BG2_R13_AVX2.h
|
||||
bnProc/nrLDPC_bnProc_BG2_R15_AVX2.h
|
||||
bnProc/nrLDPC_bnProc_BG2_R23_AVX2.h)
|
||||
|
||||
set(bnProcPc_headers
|
||||
bnProcPc/nrLDPC_bnProcPc_BG1_R13_AVX2.h
|
||||
bnProcPc/nrLDPC_bnProcPc_BG1_R23_AVX2.h
|
||||
bnProcPc/nrLDPC_bnProcPc_BG1_R89_AVX2.h
|
||||
bnProcPc/nrLDPC_bnProcPc_BG2_R13_AVX2.h
|
||||
bnProcPc/nrLDPC_bnProcPc_BG2_R15_AVX2.h
|
||||
bnProcPc/nrLDPC_bnProcPc_BG2_R23_AVX2.h)
|
||||
|
||||
set(bnProc128_headers
|
||||
bnProc/nrLDPC_bnProc_BG1_R13_128.h
|
||||
bnProc/nrLDPC_bnProc_BG1_R23_128.h
|
||||
bnProc/nrLDPC_bnProc_BG1_R89_128.h
|
||||
bnProc/nrLDPC_bnProc_BG2_R13_128.h
|
||||
bnProc/nrLDPC_bnProc_BG2_R15_128.h
|
||||
bnProc/nrLDPC_bnProc_BG2_R23_128.h)
|
||||
|
||||
set(bnProcPc128_headers
|
||||
bnProcPc/nrLDPC_bnProcPc_BG1_R13_128.h
|
||||
bnProcPc/nrLDPC_bnProcPc_BG1_R23_128.h
|
||||
bnProcPc/nrLDPC_bnProcPc_BG1_R89_128.h
|
||||
bnProcPc/nrLDPC_bnProcPc_BG2_R13_128.h
|
||||
bnProcPc/nrLDPC_bnProcPc_BG2_R15_128.h
|
||||
bnProcPc/nrLDPC_bnProcPc_BG2_R23_128.h)
|
||||
|
||||
|
||||
add_custom_command(
|
||||
# TARGET bnProc_gen_avx2 POST_BUILD
|
||||
OUTPUT ${bnProc_headers} ${bnProcPc_headers}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory bnProc
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory bnProcPc
|
||||
COMMAND bnProc_gen_avx2 .
|
||||
DEPENDS bnProc_gen_avx2
|
||||
COMMENT "Generating LDPC bnProc header files for AVX2"
|
||||
)
|
||||
add_custom_target(bnProc_gen_avx2_files DEPENDS ${bnProc_headers} ${bnProcPc_headers})
|
||||
|
||||
add_custom_command(
|
||||
# TARGET bnProc_gen_128 POST_BUILD
|
||||
OUTPUT ${bnProc128_headers} ${bnProcPc128_headers}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory bnProc128
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory bnProcPc128
|
||||
COMMAND bnProc_gen_128 .
|
||||
DEPENDS bnProc_gen_128
|
||||
COMMENT "Generating LDPC bnProc header files for 128-bit SIMD"
|
||||
)
|
||||
add_custom_target(bnProc_gen_128_files DEPENDS ${bnProc128_headers} ${bnProcPc128_headers})
|
||||
|
||||
add_library(bnProc_gen_avx2_HEADERS INTERFACE)
|
||||
target_include_directories(bnProc_gen_avx2_HEADERS INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_dependencies(bnProc_gen_avx2_HEADERS bnProc_gen_avx2_files)
|
||||
|
||||
add_library(bnProc_gen_128_HEADERS INTERFACE)
|
||||
target_include_directories(bnProc_gen_128_HEADERS INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_dependencies(bnProc_gen_128_HEADERS bnProc_gen_128_files)
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "../../nrLDPCdecoder_defs.h"
|
||||
#include "../../nrLDPC_types.h"
|
||||
|
||||
|
||||
void nrLDPC_bnProcPc_BG1_generator_128(const char *dir, int R)
|
||||
{
|
||||
const char *ratestr[3]={"13","23","89"};
|
||||
|
||||
if (R<0 || R>2) {printf("Illegal R %d\n",R); abort();}
|
||||
|
||||
|
||||
// system("mkdir -p ../ldpc_gen_files");
|
||||
|
||||
char fname[FILENAME_MAX+1];
|
||||
snprintf(fname, sizeof(fname), "%s/bnProcPc128/nrLDPC_bnProcPc_BG1_R%s_128.h", dir, ratestr[R]);
|
||||
FILE *fd=fopen(fname,"w");
|
||||
if (fd == NULL) {
|
||||
printf("Cannot create file %s\n", fname);
|
||||
abort();
|
||||
}
|
||||
|
||||
fprintf(fd,"#include <stdint.h>\n");
|
||||
fprintf(fd,"#include \"PHY/sse_intrin.h\"\n");
|
||||
|
||||
fprintf(fd,"static inline void nrLDPC_bnProcPc_BG1_R%s_128(int8_t* bnProcBuf,int8_t* bnProcBufRes,int8_t* llrRes , int8_t* llrProcBuf, uint16_t Z ) {\n",ratestr[R]);
|
||||
const uint8_t* lut_numBnInBnGroups;
|
||||
const uint32_t* lut_startAddrBnGroups;
|
||||
const uint16_t* lut_startAddrBnGroupsLlr;
|
||||
if (R==0) {
|
||||
|
||||
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG1_R13;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG1_R13;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG1_R13;
|
||||
|
||||
}
|
||||
else if (R==1){
|
||||
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG1_R23;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG1_R23;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG1_R23;
|
||||
}
|
||||
else if (R==2) {
|
||||
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG1_R89;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG1_R89;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG1_R89;
|
||||
}
|
||||
else { printf("aborting, illegal R %d\n",R); fclose(fd);abort();}
|
||||
// Number of BNs in Groups
|
||||
uint32_t k;
|
||||
// Offset to each bit within a group in terms of 32 Byte
|
||||
uint32_t cnOffsetInGroup;
|
||||
uint8_t idxBnGroup = 0;
|
||||
|
||||
fprintf(fd," // Process group with 1 CN\n");
|
||||
fprintf(fd," uint32_t M = (%d*Z + 15)>>4;\n",lut_numBnInBnGroups[0]);
|
||||
|
||||
fprintf(fd," simde__m128i* p_bnProcBuf = (simde__m128i*) &bnProcBuf [%u];\n", lut_startAddrBnGroups[idxBnGroup]);
|
||||
fprintf(fd," simde__m128i* p_bnProcBufRes = (simde__m128i*) &bnProcBufRes [%u];\n", lut_startAddrBnGroups[idxBnGroup]);
|
||||
fprintf(fd," simde__m128i* p_llrProcBuf = (simde__m128i*) &llrProcBuf [%d];\n", lut_startAddrBnGroupsLlr[idxBnGroup]);
|
||||
fprintf(fd," simde__m128i* p_llrRes = (simde__m128i*) &llrRes [%d];\n", lut_startAddrBnGroupsLlr[idxBnGroup]);
|
||||
fprintf(fd," simde__m128i ymm0, ymm1, ymmRes0, ymmRes1;\n");
|
||||
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
fprintf(fd," p_bnProcBufRes[i] = p_llrProcBuf[i];\n");
|
||||
fprintf(fd," ymm0 = simde_mm_cvtepi8_epi16(p_bnProcBuf [i]);\n");
|
||||
fprintf(fd," ymm1 = simde_mm_cvtepi8_epi16(p_llrProcBuf[i]);\n");
|
||||
fprintf(fd," ymmRes0 = simde_mm_adds_epi16(ymm0, ymm1);\n");
|
||||
fprintf(fd," ymm0 = simde_mm_cvtepi8_epi16(simde_mm_srli_si128(p_bnProcBuf [i],8));\n");
|
||||
fprintf(fd," ymm1 = simde_mm_cvtepi8_epi16(simde_mm_srli_si128(p_llrProcBuf[i],8));\n");
|
||||
fprintf(fd," ymmRes1 = simde_mm_adds_epi16(ymm0, ymm1);\n");
|
||||
fprintf(fd," *p_llrRes = simde_mm_packs_epi16(ymmRes0, ymmRes1);\n");
|
||||
fprintf(fd," p_llrRes++;\n");
|
||||
fprintf(fd," }\n");
|
||||
|
||||
|
||||
for (uint32_t cnidx=1;cnidx<30;cnidx++) {
|
||||
// Process group with 4 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[cnidx] > 0)
|
||||
{
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
fprintf(fd," M = (%d*Z + 15)>>4;\n",lut_numBnInBnGroups[cnidx]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[cnidx]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
fprintf(fd," p_bnProcBuf = (simde__m128i*) &bnProcBuf [%u];\n", lut_startAddrBnGroups[idxBnGroup]);
|
||||
fprintf(fd," p_llrProcBuf = (simde__m128i*) &llrProcBuf [%d];\n", lut_startAddrBnGroupsLlr[idxBnGroup]);
|
||||
fprintf(fd," p_llrRes = (simde__m128i*) &llrRes [%d];\n", lut_startAddrBnGroupsLlr[idxBnGroup]);
|
||||
|
||||
// Loop over BNs
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// First 16 LLRs of first CN
|
||||
fprintf(fd," ymmRes0 = simde_mm_cvtepi8_epi16(p_bnProcBuf [i]);\n");
|
||||
fprintf(fd," ymmRes1 = simde_mm_cvtepi8_epi16(simde_mm_srli_si128(p_bnProcBuf [i],8));\n");
|
||||
|
||||
// Loop over CNs
|
||||
for (k=1; k<=cnidx; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = simde_mm_cvtepi8_epi16(p_bnProcBuf[%u + i]);\n", k * cnOffsetInGroup);
|
||||
fprintf(fd," ymmRes0 = simde_mm_adds_epi16(ymmRes0, ymm0);\n");
|
||||
|
||||
fprintf(fd," ymm1 = simde_mm_cvtepi8_epi16(simde_mm_srli_si128(p_bnProcBuf[%u + i],8));\n", k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, " ymmRes1 = simde_mm_adds_epi16(ymmRes1, ymm1); \n");
|
||||
}
|
||||
|
||||
// Add LLR from receiver input
|
||||
fprintf(fd," ymm0 = simde_mm_cvtepi8_epi16(p_llrProcBuf[i]);\n");
|
||||
fprintf(fd," ymmRes0 = simde_mm_adds_epi16(ymmRes0, ymm0);\n");
|
||||
|
||||
fprintf(fd," ymm1 = simde_mm_cvtepi8_epi16(simde_mm_srli_si128(p_llrProcBuf[i],8));\n");
|
||||
fprintf(fd," ymmRes1 = simde_mm_adds_epi16(ymmRes1, ymm1);\n");
|
||||
|
||||
// Pack results back to epi8
|
||||
fprintf(fd," *p_llrRes = simde_mm_packs_epi16(ymmRes0, ymmRes1);\n");
|
||||
fprintf(fd," p_llrRes++;\n");
|
||||
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fprintf(fd,"}\n");
|
||||
fclose(fd);
|
||||
}//end of the function nrLDPC_bnProcPc_BG1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,149 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "../../nrLDPCdecoder_defs.h"
|
||||
#include "../../nrLDPC_types.h"
|
||||
|
||||
|
||||
void nrLDPC_bnProcPc_BG2_generator_128(const char *dir, int R)
|
||||
{
|
||||
const char *ratestr[3]={"15","13","23"};
|
||||
|
||||
if (R<0 || R>2) {printf("Illegal R %d\n",R); abort();}
|
||||
|
||||
|
||||
// system("mkdir -p ../ldpc_gen_files");
|
||||
|
||||
char fname[FILENAME_MAX+1];
|
||||
snprintf(fname, sizeof(fname), "%s/bnProcPc128/nrLDPC_bnProcPc_BG2_R%s_128.h", dir, ratestr[R]);
|
||||
FILE *fd=fopen(fname,"w");
|
||||
if (fd == NULL) {
|
||||
printf("Cannot create file %s\n", fname);
|
||||
abort();
|
||||
}
|
||||
|
||||
fprintf(fd,"#include <stdint.h>\n");
|
||||
fprintf(fd,"#include \"PHY/sse_intrin.h\"\n");
|
||||
|
||||
fprintf(fd,"static inline void nrLDPC_bnProcPc_BG2_R%s_128(int8_t* bnProcBuf,int8_t* bnProcBufRes,int8_t* llrRes , int8_t* llrProcBuf, uint16_t Z ) {\n",ratestr[R]);
|
||||
const uint8_t* lut_numBnInBnGroups;
|
||||
const uint32_t* lut_startAddrBnGroups;
|
||||
const uint16_t* lut_startAddrBnGroupsLlr;
|
||||
if (R==0) {
|
||||
|
||||
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG2_R15;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG2_R15;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R15;
|
||||
|
||||
}
|
||||
else if (R==1){
|
||||
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG2_R13;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG2_R13;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R13;
|
||||
}
|
||||
else if (R==2) {
|
||||
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG2_R23;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG2_R23;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R23;
|
||||
}
|
||||
else { printf("aborting, illegal R %d\n",R); fclose(fd);abort();}
|
||||
|
||||
// Number of BNs in Groups
|
||||
uint32_t k;
|
||||
// Offset to each bit within a group in terms of 32 Byte
|
||||
uint32_t cnOffsetInGroup;
|
||||
uint8_t idxBnGroup = 0;
|
||||
|
||||
fprintf(fd," // Process group with 1 CN\n");
|
||||
fprintf(fd," uint32_t M = (%d*Z + 15)>>4;\n",lut_numBnInBnGroups[0]);
|
||||
|
||||
fprintf(fd," simde__m128i* p_bnProcBuf = (simde__m128i*) &bnProcBuf [%u];\n", lut_startAddrBnGroups[idxBnGroup]);
|
||||
fprintf(fd," simde__m128i* p_bnProcBufRes = (simde__m128i*) &bnProcBufRes [%u];\n", lut_startAddrBnGroups[idxBnGroup]);
|
||||
fprintf(fd," simde__m128i* p_llrProcBuf = (simde__m128i*) &llrProcBuf [%d];\n", lut_startAddrBnGroupsLlr[idxBnGroup]);
|
||||
fprintf(fd," simde__m128i* p_llrRes = (simde__m128i*) &llrRes [%d];\n", lut_startAddrBnGroupsLlr[idxBnGroup]);
|
||||
fprintf(fd," simde__m128i ymm0, ymm1, ymmRes0, ymmRes1;\n");
|
||||
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
fprintf(fd," p_bnProcBufRes[i] = p_llrProcBuf[i];\n");
|
||||
fprintf(fd," ymm0 = simde_mm_cvtepi8_epi16(p_bnProcBuf [i]);\n");
|
||||
fprintf(fd," ymm1 = simde_mm_cvtepi8_epi16(p_llrProcBuf[i]);\n");
|
||||
fprintf(fd," ymmRes0 = simde_mm_adds_epi16(ymm0, ymm1);\n");
|
||||
fprintf(fd," ymm0 = simde_mm_cvtepi8_epi16(simde_mm_srli_si128(p_bnProcBuf [i],8));\n");
|
||||
fprintf(fd," ymm1 = simde_mm_cvtepi8_epi16(simde_mm_srli_si128(p_llrProcBuf[i],8));\n");
|
||||
fprintf(fd," ymmRes1 = simde_mm_adds_epi16(ymm0, ymm1);\n");
|
||||
fprintf(fd," *p_llrRes = simde_mm_packs_epi16(ymmRes0, ymmRes1);\n");
|
||||
fprintf(fd," p_llrRes++;\n");
|
||||
fprintf(fd," }\n");
|
||||
|
||||
|
||||
for (uint32_t cnidx=1;cnidx<30;cnidx++) {
|
||||
// Process group with 4 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[cnidx] > 0)
|
||||
{
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
fprintf(fd," M = (%d*Z + 15)>>4;\n",lut_numBnInBnGroups[cnidx]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[cnidx]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
fprintf(fd," p_bnProcBuf = (simde__m128i*) &bnProcBuf [%u];\n", lut_startAddrBnGroups[idxBnGroup]);
|
||||
fprintf(fd," p_llrProcBuf = (simde__m128i*) &llrProcBuf [%d];\n", lut_startAddrBnGroupsLlr[idxBnGroup]);
|
||||
fprintf(fd," p_llrRes = (simde__m128i*) &llrRes [%d];\n", lut_startAddrBnGroupsLlr[idxBnGroup]);
|
||||
|
||||
// Loop over BNs
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// First 16 LLRs of first CN
|
||||
fprintf(fd," ymmRes0 = simde_mm_cvtepi8_epi16(p_bnProcBuf [i]);\n");
|
||||
fprintf(fd," ymmRes1 = simde_mm_cvtepi8_epi16(simde_mm_srli_si128(p_bnProcBuf [i],8));\n");
|
||||
|
||||
// Loop over CNs
|
||||
for (k=1; k<=cnidx; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = simde_mm_cvtepi8_epi16(p_bnProcBuf[%u + i]);\n", k * cnOffsetInGroup);
|
||||
fprintf(fd," ymmRes0 = simde_mm_adds_epi16(ymmRes0, ymm0);\n");
|
||||
|
||||
fprintf(fd," ymm1 = simde_mm_cvtepi8_epi16(simde_mm_srli_si128(p_bnProcBuf[%u + i],8));\n", k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, " ymmRes1 = simde_mm_adds_epi16(ymmRes1, ymm1); \n");
|
||||
}
|
||||
|
||||
// Add LLR from receiver input
|
||||
fprintf(fd," ymm0 = simde_mm_cvtepi8_epi16(p_llrProcBuf[i]);\n");
|
||||
fprintf(fd," ymmRes0 = simde_mm_adds_epi16(ymmRes0, ymm0);\n");
|
||||
|
||||
fprintf(fd," ymm1 = simde_mm_cvtepi8_epi16(simde_mm_srli_si128(p_llrProcBuf[i],8));\n");
|
||||
fprintf(fd," ymmRes1 = simde_mm_adds_epi16(ymmRes1, ymm1);\n");
|
||||
|
||||
// Pack results back to epi8
|
||||
fprintf(fd," *p_llrRes = simde_mm_packs_epi16(ymmRes0, ymmRes1);\n");
|
||||
fprintf(fd," p_llrRes++;\n");
|
||||
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
fprintf(fd,"}\n");
|
||||
fclose(fd);
|
||||
}//end of the function nrLDPC_bnProcPc_BG2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,985 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "../../nrLDPCdecoder_defs.h"
|
||||
#include "../../nrLDPC_types.h"
|
||||
|
||||
void nrLDPC_bnProc_BG1_generator_128(const char* dir, int R)
|
||||
{
|
||||
const char* ratestr[3] = {"13", "23", "89"};
|
||||
|
||||
if (R < 0 || R > 2) {
|
||||
printf("Illegal R %d\n", R);
|
||||
abort();
|
||||
}
|
||||
|
||||
// system("mkdir -p ../ldpc_gen_files");
|
||||
|
||||
char fname[FILENAME_MAX + 1];
|
||||
snprintf(fname, sizeof(fname), "%s/bnProc128/nrLDPC_bnProc_BG1_R%s_128.h", dir, ratestr[R]);
|
||||
FILE* fd = fopen(fname, "w");
|
||||
if (fd == NULL) {
|
||||
printf("Cannot create file %s\n", fname);
|
||||
abort();
|
||||
}
|
||||
|
||||
// fprintf(fd,"#include <stdint.h>\n");
|
||||
// fprintf(fd,"#include \"PHY/sse_intrin.h\"\n");
|
||||
|
||||
fprintf(fd, "static inline void nrLDPC_bnProc_BG1_R%s_128(int8_t* bnProcBuf,int8_t* bnProcBufRes, int8_t* llrRes, uint16_t Z ) {\n", ratestr[R]);
|
||||
|
||||
const uint8_t* lut_numBnInBnGroups;
|
||||
const uint32_t* lut_startAddrBnGroups;
|
||||
const uint16_t* lut_startAddrBnGroupsLlr;
|
||||
if (R == 0) {
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG1_R13;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG1_R13;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG1_R13;
|
||||
|
||||
} else if (R == 1) {
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG1_R23;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG1_R23;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG1_R23;
|
||||
} else if (R == 2) {
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG1_R89;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG1_R89;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG1_R89;
|
||||
} else {
|
||||
printf("aborting, illegal R %d\n", R);
|
||||
fclose(fd);
|
||||
abort();
|
||||
}
|
||||
|
||||
// uint32_t M;
|
||||
// uint32_t M32rem;
|
||||
// uint32_t i;
|
||||
uint32_t k;
|
||||
// Offset to each bit within a group in terms of 32 Byte
|
||||
uint32_t cnOffsetInGroup;
|
||||
uint8_t idxBnGroup = 0;
|
||||
fprintf(fd, " uint32_t M, i; \n");
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 1 CN
|
||||
// Already done in bnProcBufPc
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 2 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[1] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs or parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[1]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[1] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 2; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 3 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[2] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[2]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[2] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
// fprintf(fd," ((simde__m128i*) bnProcBuf) = ((simde__m128i*) &bnProcBuf) [%d];\n",lut_startAddrBnGroups[idxBnGroup]);
|
||||
|
||||
for (k = 0; k < 3; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 4 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[3] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[3]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[3] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
for (k = 0; k < 4; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
((lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup),
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
((lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup));
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 5 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[4] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[4]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[4] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 5; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 6 CNs \n");
|
||||
|
||||
// Process group with 6 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[5] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[5]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[5] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 6; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 7 CNs \n");
|
||||
|
||||
// Process group with 7 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[6] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[6]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[6] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 7; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 8 CNs \n");
|
||||
|
||||
// Process group with 8 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[7] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[7]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[7] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 8; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 9 CNs \n");
|
||||
|
||||
// Process group with 9 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[8] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[8]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[8] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 9; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 10 CNs \n");
|
||||
|
||||
// Process group with 10 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[9] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[9]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[9] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 10; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 11 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[10] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[10]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[10] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 11; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 12 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[11] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[11]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[11] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 12; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 13 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[12] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[12]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[12] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 13; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 14 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[13] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[13]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[13] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 14; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 15 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[14] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[14]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[14] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 15; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 16 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[15] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[15]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[15] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 16; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 17 CNs
|
||||
|
||||
fprintf(fd, "// Process group with 17 CNs \n");
|
||||
|
||||
// Process group with 17 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[16] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[16]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[16] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 17; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 18 CNs \n");
|
||||
|
||||
// Process group with 8 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[17] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[17]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[17] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 18; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 19 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[18] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[18]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[18] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 19; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 20 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[19] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[19]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[19] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 20; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 21 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[20] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[20]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[20] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 21; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 22 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[21] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[21]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[21] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 22; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with <23 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[22] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[22]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[22] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 23; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 24 CNs \n");
|
||||
|
||||
// Process group with 4 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[23] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[23]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[23] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 24; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 25 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[24] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[24]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[24] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 25; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 26 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[25] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[25]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[25] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 26; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 27 CNs \n");
|
||||
|
||||
// Process group with 17 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[26] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[26]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[26] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 27; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 28 CNs \n");
|
||||
|
||||
// Process group with 8 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[27] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[27]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[27] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 28; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 29 CNs \n");
|
||||
|
||||
// Process group with 9 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[28] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[28]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[28] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 29; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 30 CNs \n");
|
||||
|
||||
// Process group with 20 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[29] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[29]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[29] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 30; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
fclose(fd);
|
||||
} // end of the function nrLDPC_bnProc_BG1
|
||||
@@ -1,985 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "../../nrLDPCdecoder_defs.h"
|
||||
#include "../../nrLDPC_types.h"
|
||||
|
||||
void nrLDPC_bnProc_BG1_generator_AVX2(const char* dir, int R)
|
||||
{
|
||||
const char* ratestr[3] = {"13", "23", "89"};
|
||||
|
||||
if (R < 0 || R > 2) {
|
||||
printf("Illegal R %d\n", R);
|
||||
abort();
|
||||
}
|
||||
|
||||
// system("mkdir -p ../ldpc_gen_files");
|
||||
|
||||
char fname[FILENAME_MAX + 1];
|
||||
snprintf(fname, sizeof(fname), "%s/bnProc/nrLDPC_bnProc_BG1_R%s_AVX2.h", dir, ratestr[R]);
|
||||
FILE* fd = fopen(fname, "w");
|
||||
if (fd == NULL) {
|
||||
printf("Cannot create file %s\n", fname);
|
||||
abort();
|
||||
}
|
||||
|
||||
// fprintf(fd,"#include <stdint.h>\n");
|
||||
// fprintf(fd,"#include \"PHY/sse_intrin.h\"\n");
|
||||
|
||||
fprintf(fd, "static inline void nrLDPC_bnProc_BG1_R%s_AVX2(int8_t* bnProcBuf,int8_t* bnProcBufRes, int8_t* llrRes, uint16_t Z ) {\n", ratestr[R]);
|
||||
|
||||
const uint8_t* lut_numBnInBnGroups;
|
||||
const uint32_t* lut_startAddrBnGroups;
|
||||
const uint16_t* lut_startAddrBnGroupsLlr;
|
||||
if (R == 0) {
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG1_R13;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG1_R13;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG1_R13;
|
||||
|
||||
} else if (R == 1) {
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG1_R23;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG1_R23;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG1_R23;
|
||||
} else if (R == 2) {
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG1_R89;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG1_R89;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG1_R89;
|
||||
} else {
|
||||
printf("aborting, illegal R %d\n", R);
|
||||
fclose(fd);
|
||||
abort();
|
||||
}
|
||||
|
||||
// uint32_t M;
|
||||
// uint32_t M32rem;
|
||||
// uint32_t i;
|
||||
uint32_t k;
|
||||
// Offset to each bit within a group in terms of 32 Byte
|
||||
uint32_t cnOffsetInGroup;
|
||||
uint8_t idxBnGroup = 0;
|
||||
fprintf(fd, " uint32_t M, i; \n");
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 1 CN
|
||||
// Already done in bnProcBufPc
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 2 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[1] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs or parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[1]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[1] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 2; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 3 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[2] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[2]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[2] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
// fprintf(fd," ((simde__m256i*) bnProcBuf) = ((simde__m256i*) &bnProcBuf) [%d];\n",lut_startAddrBnGroups[idxBnGroup]);
|
||||
|
||||
for (k = 0; k < 3; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 4 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[3] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[3]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[3] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
for (k = 0; k < 4; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
((lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup),
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
((lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup));
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 5 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[4] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[4]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[4] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 5; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 6 CNs \n");
|
||||
|
||||
// Process group with 6 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[5] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[5]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[5] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 6; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 7 CNs \n");
|
||||
|
||||
// Process group with 7 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[6] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[6]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[6] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 7; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 8 CNs \n");
|
||||
|
||||
// Process group with 8 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[7] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[7]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[7] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 8; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 9 CNs \n");
|
||||
|
||||
// Process group with 9 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[8] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[8]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[8] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 9; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 10 CNs \n");
|
||||
|
||||
// Process group with 10 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[9] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[9]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[9] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 10; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 11 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[10] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[10]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[10] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 11; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 12 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[11] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[11]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[11] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 12; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 13 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[12] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[12]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[12] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 13; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 14 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[13] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[13]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[13] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 14; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 15 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[14] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[14]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[14] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 15; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 16 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[15] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[15]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[15] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 16; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 17 CNs
|
||||
|
||||
fprintf(fd, "// Process group with 17 CNs \n");
|
||||
|
||||
// Process group with 17 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[16] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[16]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[16] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 17; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 18 CNs \n");
|
||||
|
||||
// Process group with 8 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[17] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[17]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[17] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 18; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 19 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[18] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[18]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[18] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 19; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 20 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[19] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[19]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[19] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 20; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 21 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[20] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[20]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[20] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 21; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 22 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[21] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[21]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[21] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 22; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with <23 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[22] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[22]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[22] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 23; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 24 CNs \n");
|
||||
|
||||
// Process group with 4 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[23] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[23]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[23] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 24; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 25 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[24] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[24]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[24] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 25; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 26 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[25] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[25]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[25] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 26; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 27 CNs \n");
|
||||
|
||||
// Process group with 17 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[26] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[26]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[26] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 27; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 28 CNs \n");
|
||||
|
||||
// Process group with 8 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[27] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[27]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[27] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 28; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 29 CNs \n");
|
||||
|
||||
// Process group with 9 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[28] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[28]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[28] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 29; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 30 CNs \n");
|
||||
|
||||
// Process group with 20 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[29] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[29]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[29] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 30; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
fclose(fd);
|
||||
} // end of the function nrLDPC_bnProc_BG1
|
||||
@@ -1,981 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "../../nrLDPCdecoder_defs.h"
|
||||
#include "../../nrLDPC_types.h"
|
||||
|
||||
void nrLDPC_bnProc_BG2_generator_128(const char* dir, int R)
|
||||
{
|
||||
const char* ratestr[3] = {"15", "13", "23"};
|
||||
|
||||
if (R < 0 || R > 2) {
|
||||
printf("Illegal R %d\n", R);
|
||||
abort();
|
||||
}
|
||||
|
||||
// system("mkdir -p ../ldpc_gen_files");
|
||||
|
||||
char fname[FILENAME_MAX + 1];
|
||||
snprintf(fname, sizeof(fname), "%s/bnProc128/nrLDPC_bnProc_BG2_R%s_128.h", dir, ratestr[R]);
|
||||
FILE* fd = fopen(fname, "w");
|
||||
if (fd == NULL) {
|
||||
printf("Cannot create file %s\n", fname);
|
||||
abort();
|
||||
}
|
||||
|
||||
fprintf(fd, "static inline void nrLDPC_bnProc_BG2_R%s_128(int8_t* bnProcBuf,int8_t* bnProcBufRes, int8_t* llrRes, uint16_t Z ) {\n", ratestr[R]);
|
||||
const uint8_t* lut_numBnInBnGroups;
|
||||
const uint32_t* lut_startAddrBnGroups;
|
||||
const uint16_t* lut_startAddrBnGroupsLlr;
|
||||
if (R == 0) {
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG2_R15;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG2_R15;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R15;
|
||||
|
||||
} else if (R == 1) {
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG2_R13;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG2_R13;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R13;
|
||||
} else if (R == 2) {
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG2_R23;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG2_R23;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R23;
|
||||
} else {
|
||||
printf("aborting, illegal R %d\n", R);
|
||||
fclose(fd);
|
||||
abort();
|
||||
}
|
||||
|
||||
// uint32_t M;
|
||||
// uint32_t M32rem;
|
||||
// uint32_t i;
|
||||
uint32_t k;
|
||||
// Offset to each bit within a group in terms of 32 Byte
|
||||
uint32_t cnOffsetInGroup;
|
||||
uint8_t idxBnGroup = 0;
|
||||
|
||||
fprintf(fd, " uint32_t M, i; \n");
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 1 CN
|
||||
// Already done in bnProcBufPc
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 2 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[1] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs or parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[1]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[1] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 2; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 3 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[2] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[2]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[2] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
// fprintf(fd," ((simde__m128i*) bnProcBuf) = ((simde__m128i*) &bnProcBuf) [%d];\n",lut_startAddrBnGroups[idxBnGroup]);
|
||||
|
||||
for (k = 0; k < 3; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 4 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[3] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[3]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[3] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
for (k = 0; k < 4; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
((lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup),
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
((lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup));
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 5 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[4] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[4]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[4] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 5; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 6 CNs \n");
|
||||
|
||||
// Process group with 6 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[5] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[5]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[5] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 6; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 7 CNs \n");
|
||||
|
||||
// Process group with 7 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[6] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[6]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[6] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 7; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 8 CNs \n");
|
||||
|
||||
// Process group with 8 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[7] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[7]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[7] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 8; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 9 CNs \n");
|
||||
|
||||
// Process group with 9 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[8] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[8]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[8] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 9; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 10 CNs \n");
|
||||
|
||||
// Process group with 10 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[9] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[9]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[9] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 10; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 11 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[10] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[10]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[10] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 11; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 12 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[11] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[11]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[11] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 12; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 13 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[12] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[12]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[12] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 13; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 14 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[13] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[13]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[13] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 14; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 15 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[14] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[14]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[14] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 15; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 16 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[15] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[15]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[15] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 16; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 17 CNs
|
||||
|
||||
fprintf(fd, "// Process group with 17 CNs \n");
|
||||
|
||||
// Process group with 17 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[16] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[16]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[16] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 17; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 18 CNs \n");
|
||||
|
||||
// Process group with 8 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[17] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[17]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[17] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 18; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 19 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[18] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[18]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[18] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 19; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 20 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[19] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[19]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[19] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 20; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 21 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[20] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[20]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[20] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 21; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 22 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[21] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[21]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[21] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 22; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with <23 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[22] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[22]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[22] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 23; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 24 CNs \n");
|
||||
|
||||
// Process group with 4 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[23] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[23]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[23] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 24; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 25 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[24] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[24]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[24] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 25; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 26 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[25] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[25]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[25] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 26; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 27 CNs \n");
|
||||
|
||||
// Process group with 17 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[26] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[26]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[26] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 27; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 28 CNs \n");
|
||||
|
||||
// Process group with 8 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[27] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[27]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[27] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 28; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 29 CNs \n");
|
||||
|
||||
// Process group with 9 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[28] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[28]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[28] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 29; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 30 CNs \n");
|
||||
|
||||
// Process group with 20 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[29] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n", lut_numBnInBnGroups[29]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[29] * NR_LDPC_ZMAX) >> 4;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 30; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m128i*)bnProcBufRes)[%d + i ] = simde_mm_subs_epi8(((simde__m128i*)llrRes)[%d + i ], ((simde__m128i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 4),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 4) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
fclose(fd);
|
||||
} // end of the function nrLDPC_bnProc_BG2
|
||||
@@ -1,981 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "../../nrLDPCdecoder_defs.h"
|
||||
#include "../../nrLDPC_types.h"
|
||||
|
||||
void nrLDPC_bnProc_BG2_generator_AVX2(const char* dir, int R)
|
||||
{
|
||||
const char* ratestr[3] = {"15", "13", "23"};
|
||||
|
||||
if (R < 0 || R > 2) {
|
||||
printf("Illegal R %d\n", R);
|
||||
abort();
|
||||
}
|
||||
|
||||
// system("mkdir -p ../ldpc_gen_files");
|
||||
|
||||
char fname[FILENAME_MAX + 1];
|
||||
snprintf(fname, sizeof(fname), "%s/bnProc/nrLDPC_bnProc_BG2_R%s_AVX2.h", dir, ratestr[R]);
|
||||
FILE* fd = fopen(fname, "w");
|
||||
if (fd == NULL) {
|
||||
printf("Cannot create file %s\n", fname);
|
||||
abort();
|
||||
}
|
||||
|
||||
fprintf(fd, "static inline void nrLDPC_bnProc_BG2_R%s_AVX2(int8_t* bnProcBuf,int8_t* bnProcBufRes, int8_t* llrRes, uint16_t Z ) {\n", ratestr[R]);
|
||||
const uint8_t* lut_numBnInBnGroups;
|
||||
const uint32_t* lut_startAddrBnGroups;
|
||||
const uint16_t* lut_startAddrBnGroupsLlr;
|
||||
if (R == 0) {
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG2_R15;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG2_R15;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R15;
|
||||
|
||||
} else if (R == 1) {
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG2_R13;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG2_R13;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R13;
|
||||
} else if (R == 2) {
|
||||
lut_numBnInBnGroups = lut_numBnInBnGroups_BG2_R23;
|
||||
lut_startAddrBnGroups = lut_startAddrBnGroups_BG2_R23;
|
||||
lut_startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R23;
|
||||
} else {
|
||||
printf("aborting, illegal R %d\n", R);
|
||||
fclose(fd);
|
||||
abort();
|
||||
}
|
||||
|
||||
// uint32_t M;
|
||||
// uint32_t M32rem;
|
||||
// uint32_t i;
|
||||
uint32_t k;
|
||||
// Offset to each bit within a group in terms of 32 Byte
|
||||
uint32_t cnOffsetInGroup;
|
||||
uint8_t idxBnGroup = 0;
|
||||
|
||||
fprintf(fd, " uint32_t M, i; \n");
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 1 CN
|
||||
// Already done in bnProcBufPc
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 2 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[1] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs or parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[1]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[1] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 2; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 3 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[2] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[2]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[2] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
// fprintf(fd," ((simde__m256i*) bnProcBuf) = ((simde__m256i*) &bnProcBuf) [%d];\n",lut_startAddrBnGroups[idxBnGroup]);
|
||||
|
||||
for (k = 0; k < 3; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 4 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[3] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[3]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[3] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
for (k = 0; k < 4; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
((lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup),
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
((lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup));
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 5 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[4] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[4]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[4] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 5; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 6 CNs \n");
|
||||
|
||||
// Process group with 6 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[5] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[5]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[5] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 6; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 7 CNs \n");
|
||||
|
||||
// Process group with 7 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[6] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[6]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[6] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 7; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 8 CNs \n");
|
||||
|
||||
// Process group with 8 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[7] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[7]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[7] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 8; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 9 CNs \n");
|
||||
|
||||
// Process group with 9 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[8] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[8]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[8] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 9; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 10 CNs \n");
|
||||
|
||||
// Process group with 10 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[9] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[9]);
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[9] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 10; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 11 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[10] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[10]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[10] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 11; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 12 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[11] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[11]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[11] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 12; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 13 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[12] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[12]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[12] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 13; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 14 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[13] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[13]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[13] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 14; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 15 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[14] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[14]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[14] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 15; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 16 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[15] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[15]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[15] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 16; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 17 CNs
|
||||
|
||||
fprintf(fd, "// Process group with 17 CNs \n");
|
||||
|
||||
// Process group with 17 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[16] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[16]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[16] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 17; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 18 CNs \n");
|
||||
|
||||
// Process group with 8 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[17] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[17]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[17] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 18; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 19 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[18] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[18]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[18] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 19; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 20 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[19] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[19]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[19] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 20; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 21 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[20] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[20]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[20] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 21; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 22 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[21] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[21]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[21] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 22; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with <23 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[22] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[22]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[22] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 23; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 24 CNs \n");
|
||||
|
||||
// Process group with 4 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[23] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[23]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[23] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 24; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 25 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[24] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[24]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[24] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 25; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 26 CNs \n");
|
||||
|
||||
if (lut_numBnInBnGroups[25] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[25]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[25] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 26; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 27 CNs \n");
|
||||
|
||||
// Process group with 17 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[26] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[26]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[26] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 27; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 28 CNs \n");
|
||||
|
||||
// Process group with 8 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[27] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[27]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[27] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 28; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 29 CNs \n");
|
||||
|
||||
// Process group with 9 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[28] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[28]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[28] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 29; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
||||
fprintf(fd, "// Process group with 30 CNs \n");
|
||||
|
||||
// Process group with 20 CNs
|
||||
|
||||
if (lut_numBnInBnGroups[29] > 0) {
|
||||
// If elements in group move to next address
|
||||
idxBnGroup++;
|
||||
|
||||
// Number of groups of 32 BNs for parallel processing
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n", lut_numBnInBnGroups[29]);
|
||||
;
|
||||
|
||||
// Set the offset to each CN within a group in terms of 16 Byte
|
||||
cnOffsetInGroup = (lut_numBnInBnGroups[29] * NR_LDPC_ZMAX) >> 5;
|
||||
|
||||
// Set pointers to start of group 2
|
||||
|
||||
// Loop over CNs
|
||||
for (k = 0; k < 30; k++) {
|
||||
// Loop over BNs
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
fprintf(fd,
|
||||
" ((simde__m256i*)bnProcBufRes)[%d + i ] = simde_mm256_subs_epi8(((simde__m256i*)llrRes)[%d + i ], ((simde__m256i*) bnProcBuf)[%d + i]);\n",
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup,
|
||||
(lut_startAddrBnGroupsLlr[idxBnGroup] >> 5),
|
||||
(lut_startAddrBnGroups[idxBnGroup] >> 5) + k * cnOffsetInGroup);
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
fclose(fd);
|
||||
} // end of the function nrLDPC_bnProc_BG2
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#define NB_R 3
|
||||
void nrLDPC_bnProc_BG1_generator_AVX2(const char*, int);
|
||||
void nrLDPC_bnProc_BG2_generator_AVX2(const char*, int);
|
||||
void nrLDPC_bnProcPc_BG1_generator_AVX2(const char*, int);
|
||||
void nrLDPC_bnProcPc_BG2_generator_AVX2(const char*, int);
|
||||
|
||||
const char *__asan_default_options()
|
||||
{
|
||||
/* don't do leak checking in nr_ulsim, creates problems in the CI */
|
||||
return "detect_leaks=0";
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s <output-dir>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
const char *dir = argv[1];
|
||||
|
||||
int R[NB_R]={0,1,2};
|
||||
for(int i=0; i<NB_R;i++){
|
||||
nrLDPC_bnProc_BG1_generator_AVX2(dir, R[i]);
|
||||
nrLDPC_bnProc_BG2_generator_AVX2(dir, R[i]);
|
||||
|
||||
nrLDPC_bnProcPc_BG1_generator_AVX2(dir, R[i]);
|
||||
nrLDPC_bnProcPc_BG2_generator_AVX2(dir, R[i]);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#define NB_R 3
|
||||
void nrLDPC_bnProc_BG1_generator_128(const char*, int);
|
||||
void nrLDPC_bnProc_BG2_generator_128(const char*, int);
|
||||
void nrLDPC_bnProcPc_BG1_generator_128(const char*, int);
|
||||
void nrLDPC_bnProcPc_BG2_generator_128(const char*, int);
|
||||
|
||||
const char *__asan_default_options()
|
||||
{
|
||||
/* don't do leak checking in nr_ulsim, creates problems in the CI */
|
||||
return "detect_leaks=0";
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s <output-dir>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
const char *dir = argv[1];
|
||||
|
||||
int R[NB_R]={0,1,2};
|
||||
for(int i=0; i<NB_R;i++){
|
||||
nrLDPC_bnProc_BG1_generator_128(dir, R[i]);
|
||||
nrLDPC_bnProc_BG2_generator_128(dir, R[i]);
|
||||
|
||||
nrLDPC_bnProcPc_BG1_generator_128(dir, R[i]);
|
||||
nrLDPC_bnProcPc_BG2_generator_128(dir, R[i]);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
if (CROSS_COMPILE)
|
||||
find_package(bnProc_gen_avx512)
|
||||
else()
|
||||
add_executable(bnProc_gen_avx512
|
||||
bnProc_gen_BG1_avx512.c
|
||||
bnProc_gen_BG2_avx512.c
|
||||
bnProcPc_gen_BG1_avx512.c
|
||||
bnProcPc_gen_BG2_avx512.c
|
||||
main.c)
|
||||
target_compile_options(bnProc_gen_avx512 PRIVATE -W -Wall )
|
||||
export(TARGETS bnProc_gen_avx512 FILE
|
||||
"${CMAKE_BINARY_DIR}/bnProc_gen_avx512Config.cmake")
|
||||
endif ()
|
||||
|
||||
set(bnProc_avx512_headers
|
||||
bnProc_avx512/nrLDPC_bnProc_BG1_R13_AVX512.h
|
||||
bnProc_avx512/nrLDPC_bnProc_BG1_R23_AVX512.h
|
||||
bnProc_avx512/nrLDPC_bnProc_BG1_R89_AVX512.h
|
||||
bnProc_avx512/nrLDPC_bnProc_BG2_R13_AVX512.h
|
||||
bnProc_avx512/nrLDPC_bnProc_BG2_R15_AVX512.h
|
||||
bnProc_avx512/nrLDPC_bnProc_BG2_R23_AVX512.h)
|
||||
|
||||
set(bnProcPc_avx512_headers
|
||||
bnProcPc_avx512/nrLDPC_bnProcPc_BG1_R13_AVX512.h
|
||||
bnProcPc_avx512/nrLDPC_bnProcPc_BG1_R23_AVX512.h
|
||||
bnProcPc_avx512/nrLDPC_bnProcPc_BG1_R89_AVX512.h
|
||||
bnProcPc_avx512/nrLDPC_bnProcPc_BG2_R13_AVX512.h
|
||||
bnProcPc_avx512/nrLDPC_bnProcPc_BG2_R15_AVX512.h
|
||||
bnProcPc_avx512/nrLDPC_bnProcPc_BG2_R23_AVX512.h)
|
||||
|
||||
add_custom_command(
|
||||
# TARGET bnProc_gen_avx512 POST_BUILD
|
||||
OUTPUT ${bnProc_avx512_headers} ${bnProcPc_avx512_headers}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory bnProc_avx512
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory bnProcPc_avx512
|
||||
COMMAND bnProc_gen_avx512 .
|
||||
DEPENDS bnProc_gen_avx512
|
||||
COMMENT "Generating LDPC bnProc header files for AVX512"
|
||||
)
|
||||
add_custom_target(bnProc_gen_avx512_files DEPENDS ${bnProc_avx512_headers} ${bnProcPc_avx512_headers})
|
||||
|
||||
add_library(bnProc_gen_avx512_HEADERS INTERFACE)
|
||||
target_include_directories(bnProc_gen_avx512_HEADERS INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_dependencies(bnProc_gen_avx512_HEADERS bnProc_gen_avx512_files)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#define NB_R 3
|
||||
void nrLDPC_bnProc_BG1_generator_AVX512(const char *, int);
|
||||
void nrLDPC_bnProc_BG2_generator_AVX512(const char *, int);
|
||||
void nrLDPC_bnProcPc_BG1_generator_AVX512(const char *, int);
|
||||
void nrLDPC_bnProcPc_BG2_generator_AVX512(const char *, int);
|
||||
|
||||
const char *__asan_default_options()
|
||||
{
|
||||
/* don't do leak checking in nr_ulsim, creates problems in the CI */
|
||||
return "detect_leaks=0";
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s <output-dir>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
const char *dir = argv[1];
|
||||
|
||||
int R[NB_R]={0,1,2};
|
||||
for(int i=0; i<NB_R;i++){
|
||||
nrLDPC_bnProc_BG1_generator_AVX512(dir, R[i]);
|
||||
nrLDPC_bnProc_BG2_generator_AVX512(dir, R[i]);
|
||||
|
||||
nrLDPC_bnProcPc_BG1_generator_AVX512(dir, R[i]);
|
||||
nrLDPC_bnProcPc_BG2_generator_AVX512(dir, R[i]);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
if (CROSS_COMPILE)
|
||||
find_package(cnProc_gen_128)
|
||||
find_package(cnProc_gen_avx2)
|
||||
else()
|
||||
add_executable(cnProc_gen_avx2
|
||||
cnProc_gen_BG1_avx2.c
|
||||
cnProc_gen_BG2_avx2.c
|
||||
main.c)
|
||||
add_executable(cnProc_gen_128
|
||||
cnProc_gen_BG1_128.c
|
||||
cnProc_gen_BG2_128.c
|
||||
main128.c)
|
||||
target_compile_options(cnProc_gen_avx2 PRIVATE -W -Wall )
|
||||
target_compile_options(cnProc_gen_128 PRIVATE -W -Wall )
|
||||
export(TARGETS cnProc_gen_avx2 FILE
|
||||
"${CMAKE_BINARY_DIR}/cnProc_gen_avx2Config.cmake")
|
||||
export(TARGETS cnProc_gen_128 FILE
|
||||
"${CMAKE_BINARY_DIR}/cnProc_gen_128Config.cmake")
|
||||
endif()
|
||||
|
||||
set(cnProc_headers
|
||||
cnProc/nrLDPC_cnProc_BG1_R13_AVX2.h
|
||||
cnProc/nrLDPC_cnProc_BG1_R23_AVX2.h
|
||||
cnProc/nrLDPC_cnProc_BG1_R89_AVX2.h
|
||||
cnProc/nrLDPC_cnProc_BG2_R13_AVX2.h
|
||||
cnProc/nrLDPC_cnProc_BG2_R15_AVX2.h
|
||||
cnProc/nrLDPC_cnProc_BG2_R23_AVX2.h)
|
||||
|
||||
set(cnProc128_headers
|
||||
cnProc/nrLDPC_cnProc_BG1_R13_128.h
|
||||
cnProc/nrLDPC_cnProc_BG1_R23_128.h
|
||||
cnProc/nrLDPC_cnProc_BG1_R89_128.h
|
||||
cnProc/nrLDPC_cnProc_BG2_R13_128.h
|
||||
cnProc/nrLDPC_cnProc_BG2_R15_128.h
|
||||
cnProc/nrLDPC_cnProc_BG2_R23_128.h)
|
||||
|
||||
add_custom_command(
|
||||
# TARGET cnProc_gen_avx2 POST_BUILD
|
||||
OUTPUT ${cnProc_headers}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory cnProc
|
||||
COMMAND cnProc_gen_avx2 .
|
||||
DEPENDS cnProc_gen_avx2
|
||||
COMMENT "Generating LDPC cnProc header files for AVX2"
|
||||
)
|
||||
add_custom_target(cnProc_gen_avx2_files DEPENDS ${cnProc_headers})
|
||||
|
||||
add_custom_command(
|
||||
# TARGET cnProc_gen_128 POST_BUILD
|
||||
OUTPUT ${cnProc128_headers}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory cnProc128
|
||||
COMMAND cnProc_gen_128 .
|
||||
DEPENDS cnProc_gen_128
|
||||
COMMENT "Generating LDPC cnProc header files for 128-bit SIMD"
|
||||
)
|
||||
add_custom_target(cnProc_gen_128_files DEPENDS ${cnProc128_headers})
|
||||
|
||||
add_library(cnProc_gen_avx2_HEADERS INTERFACE)
|
||||
target_include_directories(cnProc_gen_avx2_HEADERS INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_dependencies(cnProc_gen_avx2_HEADERS cnProc_gen_avx2_files)
|
||||
|
||||
add_library(cnProc_gen_128_HEADERS INTERFACE)
|
||||
target_include_directories(cnProc_gen_128_HEADERS INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_dependencies(cnProc_gen_128_HEADERS cnProc_gen_128_files)
|
||||
|
||||
@@ -1,770 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include "../../nrLDPCdecoder_defs.h"
|
||||
|
||||
#ifdef __aarch64__
|
||||
#define AVOID_SIGN 1
|
||||
#endif
|
||||
#define DROP_MAXLLR 1
|
||||
void nrLDPC_cnProc_BG1_generator_128(const char* dir, int R)
|
||||
{
|
||||
const char *ratestr[3]={"13","23","89"};
|
||||
|
||||
if (R<0 || R>2) {printf("Illegal R %d\n",R); abort();}
|
||||
|
||||
|
||||
// system("mkdir -p ../ldpc_gen_files");
|
||||
|
||||
char fname[FILENAME_MAX+1];
|
||||
snprintf(fname, sizeof(fname), "%s/cnProc128/nrLDPC_cnProc_BG1_R%s_128.h", dir, ratestr[R]);
|
||||
FILE *fd=fopen(fname,"w");
|
||||
if (fd == NULL) {
|
||||
printf("Cannot create file %s\n", fname);
|
||||
abort();
|
||||
}
|
||||
|
||||
fprintf(fd,"#include <stdint.h>\n");
|
||||
fprintf(fd,"#include \"PHY/sse_intrin.h\"\n");
|
||||
|
||||
|
||||
fprintf(fd,"static inline void nrLDPC_cnProc_BG1_R%s_128(int8_t* cnProcBuf, int8_t* cnProcBufRes, uint16_t Z) {\n",ratestr[R]);
|
||||
|
||||
const uint8_t* lut_numCnInCnGroups;
|
||||
const uint32_t* lut_startAddrCnGroups = lut_startAddrCnGroups_BG1;
|
||||
|
||||
if (R==0) lut_numCnInCnGroups = lut_numCnInCnGroups_BG1_R13;
|
||||
else if (R==1) lut_numCnInCnGroups = lut_numCnInCnGroups_BG1_R23;
|
||||
else if (R==2) lut_numCnInCnGroups = lut_numCnInCnGroups_BG1_R89;
|
||||
else { printf("aborting, illegal R %d\n",R); fclose(fd);abort();}
|
||||
|
||||
|
||||
|
||||
//simde__m128i* p_cnProcBuf;
|
||||
//simde__m128i* p_cnProcBufRes;
|
||||
|
||||
// Number of CNs in Groups
|
||||
//uint32_t M;
|
||||
uint32_t j;
|
||||
uint32_t k;
|
||||
// Offset to each bit within a group in terms of 16 Byte
|
||||
uint32_t bitOffsetInGroup;
|
||||
|
||||
//simde__m128i ymm0, min, sgn;
|
||||
//simde__m128i* p_cnProcBufResBit;
|
||||
|
||||
// const simde__m128i* p_ones = (simde__m128i*) ones256_epi8;
|
||||
// const simde__m128i* p_maxLLR = (simde__m128i*) maxLLR256_epi8;
|
||||
|
||||
// LUT with offsets for bits that need to be processed
|
||||
// 1. bit proc requires LLRs of 2. and 3. bit, 2.bits of 1. and 3. etc.
|
||||
// Offsets are in units of bitOffsetInGroup (1*384/32)
|
||||
// const uint8_t lut_idxCnProcG3[3][2] = {{12,24}, {0,24}, {0,12}};
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 3 BNs
|
||||
fprintf(fd,"//Process group with 3 BNs\n");
|
||||
// LUT with offsets for bits that need to be processed
|
||||
// 1. bit proc requires LLRs of 2. and 3. bit, 2.bits of 1. and 3. etc.
|
||||
// Offsets are in units of bitOffsetInGroup (1*384/32)
|
||||
const uint8_t lut_idxCnProcG3[3][2] = {{12,24}, {0,24}, {0,12}};
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," simde__m128i ymm0, min, sgn,ones,maxLLR;\n");
|
||||
#else
|
||||
fprintf(fd," simde__m128i ymm0, min, sgn,ones;\n");
|
||||
#endif
|
||||
fprintf(fd," ones = simde_mm_set1_epi8((int8_t)1);\n");
|
||||
|
||||
fprintf(fd," uint32_t M;\n");
|
||||
|
||||
if (lut_numCnInCnGroups[0] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 16
|
||||
fprintf(fd," M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[0] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 16 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[0]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
|
||||
// Set pointers to start of group 3
|
||||
//p_cnProcBuf = (simde__m128i*) &cnProcBuf [lut_startAddrCnGroups[0]];
|
||||
//p_cnProcBufRes = (simde__m128i*) &cnProcBufRes[lut_startAddrCnGroups[0]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<3; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[0]>>4)+lut_idxCnProcG3[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(ones, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
#endif
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
// 16 CNs of second BN
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][1] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[0]>>4)+lut_idxCnProcG3[j][1]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(sgn, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
#endif
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[0]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
// =====================================================================
|
||||
// Process group with 4 BNs
|
||||
fprintf(fd,"//Process group with 4 BNs\n");
|
||||
// Offset is 5*384/32 = 60
|
||||
const uint8_t lut_idxCnProcG4[4][3] = {{60,120,180}, {0,120,180}, {0,60,180}, {0,60,120}};
|
||||
|
||||
if (lut_numCnInCnGroups[1] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 16
|
||||
fprintf(fd," M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[1] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 16 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[1]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
|
||||
// Set pointers to start of group 4
|
||||
//p_cnProcBuf = (simde__m128i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m128i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<4; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[1]>>4)+lut_idxCnProcG4[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(ones, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
#endif
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<3; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[1]>>4)+lut_idxCnProcG4[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(sgn, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[1]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 5 BNs
|
||||
fprintf(fd,"//Process group with 5 BNs\n");
|
||||
// Offset is 18*384/32 = 216
|
||||
const uint16_t lut_idxCnProcG5[5][4] = {{216,432,648,864}, {0,432,648,864},
|
||||
{0,216,648,864}, {0,216,432,864}, {0,216,432,648}};
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[2] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 16
|
||||
fprintf(fd," M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[2] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 16 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[2]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
|
||||
// Set pointers to start of group 4
|
||||
//p_cnProcBuf = (simde__m128i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m128i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<5; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[2]>>4)+lut_idxCnProcG5[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(ones, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
#endif
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<4; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[2]>>4)+lut_idxCnProcG5[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(sgn, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[2]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 6 BNs
|
||||
fprintf(fd,"//Process group with 6 BNs\n");
|
||||
// Offset is 8*384/32 = 96
|
||||
const uint16_t lut_idxCnProcG6[6][5] = {{96,192,288,384,480}, {0,192,288,384,480},
|
||||
{0,96,288,384,480}, {0,96,192,384,480},
|
||||
{0,96,192,288,480}, {0,96,192,288,384}};
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[3] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 16
|
||||
fprintf(fd, "M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[3] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 16 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[3]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
|
||||
// Set pointers to start of group 4
|
||||
//p_cnProcBuf = (simde__m128i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m128i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<6; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[3]>>4)+lut_idxCnProcG6[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(ones, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
#endif
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<5; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[3]>>4)+lut_idxCnProcG6[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(sgn, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[3]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 7 BNs
|
||||
fprintf(fd,"//Process group with 7 BNs\n");
|
||||
// Offset is 5*384/32 = 60
|
||||
const uint16_t lut_idxCnProcG7[7][6] = {{60,120,180,240,300,360}, {0,120,180,240,300,360},
|
||||
{0,60,180,240,300,360}, {0,60,120,240,300,360},
|
||||
{0,60,120,180,300,360}, {0,60,120,180,240,360},
|
||||
{0,60,120,180,240,300}};
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[4] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 16
|
||||
fprintf(fd, "M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[4] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 16 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[4]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
|
||||
// Set pointers to start of group 4
|
||||
//p_cnProcBuf = (simde__m128i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m128i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<7; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[4]>>4)+lut_idxCnProcG7[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(ones, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
#endif
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<6; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[4]>>4)+lut_idxCnProcG7[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(sgn, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[4]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 8 BNs
|
||||
fprintf(fd,"//Process group with 8 BNs\n");
|
||||
// Offset is 2*384/32 = 24
|
||||
const uint8_t lut_idxCnProcG8[8][7] = {{24,48,72,96,120,144,168}, {0,48,72,96,120,144,168},
|
||||
{0,24,72,96,120,144,168}, {0,24,48,96,120,144,168},
|
||||
{0,24,48,72,120,144,168}, {0,24,48,72,96,144,168},
|
||||
{0,24,48,72,96,120,168}, {0,24,48,72,96,120,144}};
|
||||
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[5] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 16
|
||||
fprintf(fd, "M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[5] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 16 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[5]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
|
||||
// Set pointers to start of group 4
|
||||
//p_cnProcBuf = (simde__m128i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m128i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<8; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[5]>>4)+lut_idxCnProcG8[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(ones, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
#endif
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<7; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[5]>>4)+lut_idxCnProcG8[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(sgn, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[5]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 9 BNs
|
||||
fprintf(fd,"//Process group with 9 BNs\n");
|
||||
// Offset is 2*384/32 = 24
|
||||
const uint8_t lut_idxCnProcG9[9][8] = {{24,48,72,96,120,144,168,192}, {0,48,72,96,120,144,168,192},
|
||||
{0,24,72,96,120,144,168,192}, {0,24,48,96,120,144,168,192},
|
||||
{0,24,48,72,120,144,168,192}, {0,24,48,72,96,144,168,192},
|
||||
{0,24,48,72,96,120,168,192}, {0,24,48,72,96,120,144,192},
|
||||
{0,24,48,72,96,120,144,168}};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[6] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 16
|
||||
fprintf(fd, "M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[6] );
|
||||
// Set the offset to each bit within a group in terms of 16 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[6]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
|
||||
// Set pointers to start of group 9
|
||||
//p_cnProcBuf = (simde__m128i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m128i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<9; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[6]>>4)+lut_idxCnProcG9[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(ones, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
#endif
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<8; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[6]>>4)+lut_idxCnProcG9[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(sgn, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[6]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 10 BNs
|
||||
fprintf(fd,"//Process group with 10 BNs\n");
|
||||
// Offset is 1*384/32 = 12
|
||||
const uint8_t lut_idxCnProcG10[10][9] = {{12,24,36,48,60,72,84,96,108}, {0,24,36,48,60,72,84,96,108},
|
||||
{0,12,36,48,60,72,84,96,108}, {0,12,24,48,60,72,84,96,108},
|
||||
{0,12,24,36,60,72,84,96,108}, {0,12,24,36,48,72,84,96,108},
|
||||
{0,12,24,36,48,60,84,96,108}, {0,12,24,36,48,60,72,96,108},
|
||||
{0,12,24,36,48,60,72,84,108}, {0,12,24,36,48,60,72,84,96}};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[7] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 16
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[7] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 16 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[7]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
|
||||
// Set pointers to start of group 10
|
||||
//p_cnProcBuf = (simde__m128i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m128i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<10; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[7]>>4)+lut_idxCnProcG10[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(ones, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
#endif
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<9; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[7]>>4)+lut_idxCnProcG10[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(sgn, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[7]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 19 BNs
|
||||
fprintf(fd,"//Process group with 19 BNs\n");
|
||||
// Offset is 4*384/32 = 12
|
||||
const uint16_t lut_idxCnProcG19[19][18] = {{48,96,144,192,240,288,336,384,432,480,528,576,624,672,720,768,816,864}, {0,96,144,192,240,288,336,384,432,480,528,576,624,672,720,768,816,864},
|
||||
{0,48,144,192,240,288,336,384,432,480,528,576,624,672,720,768,816,864}, {0,48,96,192,240,288,336,384,432,480,528,576,624,672,720,768,816,864},
|
||||
{0,48,96,144,240,288,336,384,432,480,528,576,624,672,720,768,816,864}, {0,48,96,144,192,288,336,384,432,480,528,576,624,672,720,768,816,864},
|
||||
{0,48,96,144,192,240,336,384,432,480,528,576,624,672,720,768,816,864}, {0,48,96,144,192,240,288,384,432,480,528,576,624,672,720,768,816,864},
|
||||
{0,48,96,144,192,240,288,336,432,480,528,576,624,672,720,768,816,864}, {0,48,96,144,192,240,288,336,384,480,528,576,624,672,720,768,816,864},
|
||||
{0,48,96,144,192,240,288,336,384,432,528,576,624,672,720,768,816,864}, {0,48,96,144,192,240,288,336,384,432,480,576,624,672,720,768,816,864},
|
||||
{0,48,96,144,192,240,288,336,384,432,480,528,624,672,720,768,816,864}, {0,48,96,144,192,240,288,336,384,432,480,528,576,672,720,768,816,864},
|
||||
{0,48,96,144,192,240,288,336,384,432,480,528,576,624,720,768,816,864}, {0,48,96,144,192,240,288,336,384,432,480,528,576,624,672,768,816,864},
|
||||
{0,48,96,144,192,240,288,336,384,432,480,528,576,624,672,720,816,864}, {0,48,96,144,192,240,288,336,384,432,480,528,576,624,672,720,768,864},
|
||||
{0,48,96,144,192,240,288,336,384,432,480,528,576,624,672,720,768,816}};
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[8] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 16
|
||||
fprintf(fd, " M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[8] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 16 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[8]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
|
||||
// Set pointers to start of group 19
|
||||
//p_cnProcBuf = (simde__m128i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m128i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<19; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[8]>>4)+lut_idxCnProcG19[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(ones, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
#endif
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<18; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[8]>>4)+lut_idxCnProcG19[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
#ifdef AVOID_SIGN
|
||||
fprintf(fd," sgn = simde_mm_xor_si128(sgn, ymm0);\n");
|
||||
#else
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[8]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fd,"}\n");
|
||||
fclose(fd);
|
||||
}//end of the function nrLDPC_cnProc_BG1
|
||||
|
||||
@@ -1,698 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include "../../nrLDPCdecoder_defs.h"
|
||||
|
||||
//#define AVOID_MM256_SIGN 1
|
||||
//#define DROP_MAXLLR 1
|
||||
void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
|
||||
{
|
||||
const char *ratestr[3]={"13","23","89"};
|
||||
|
||||
if (R<0 || R>2) {printf("Illegal R %d\n",R); abort();}
|
||||
|
||||
|
||||
// system("mkdir -p ../ldpc_gen_files");
|
||||
|
||||
char fname[FILENAME_MAX+1];
|
||||
snprintf(fname, sizeof(fname), "%s/cnProc/nrLDPC_cnProc_BG1_R%s_AVX2.h", dir, ratestr[R]);
|
||||
FILE *fd=fopen(fname,"w");
|
||||
if (fd == NULL) {
|
||||
printf("Cannot create file %s\n", fname);
|
||||
abort();
|
||||
}
|
||||
|
||||
fprintf(fd,"#include <stdint.h>\n");
|
||||
fprintf(fd,"#include \"PHY/sse_intrin.h\"\n");
|
||||
|
||||
|
||||
fprintf(fd,"static inline void nrLDPC_cnProc_BG1_R%s_AVX2(int8_t* cnProcBuf, int8_t* cnProcBufRes, uint16_t Z) {\n",ratestr[R]);
|
||||
|
||||
const uint8_t* lut_numCnInCnGroups;
|
||||
const uint32_t* lut_startAddrCnGroups = lut_startAddrCnGroups_BG1;
|
||||
|
||||
if (R==0) lut_numCnInCnGroups = lut_numCnInCnGroups_BG1_R13;
|
||||
else if (R==1) lut_numCnInCnGroups = lut_numCnInCnGroups_BG1_R23;
|
||||
else if (R==2) lut_numCnInCnGroups = lut_numCnInCnGroups_BG1_R89;
|
||||
else { printf("aborting, illegal R %d\n",R); fclose(fd);abort();}
|
||||
|
||||
|
||||
|
||||
//simde__m256i* p_cnProcBuf;
|
||||
//simde__m256i* p_cnProcBufRes;
|
||||
|
||||
// Number of CNs in Groups
|
||||
//uint32_t M;
|
||||
uint32_t j;
|
||||
uint32_t k;
|
||||
// Offset to each bit within a group in terms of 32 Byte
|
||||
uint32_t bitOffsetInGroup;
|
||||
|
||||
//simde__m256i ymm0, min, sgn;
|
||||
//simde__m256i* p_cnProcBufResBit;
|
||||
|
||||
// const simde__m256i* p_ones = (simde__m256i*) ones256_epi8;
|
||||
// const simde__m256i* p_maxLLR = (simde__m256i*) maxLLR256_epi8;
|
||||
|
||||
// LUT with offsets for bits that need to be processed
|
||||
// 1. bit proc requires LLRs of 2. and 3. bit, 2.bits of 1. and 3. etc.
|
||||
// Offsets are in units of bitOffsetInGroup (1*384/32)
|
||||
// const uint8_t lut_idxCnProcG3[3][2] = {{12,24}, {0,24}, {0,12}};
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 3 BNs
|
||||
fprintf(fd,"//Process group with 3 BNs\n");
|
||||
// LUT with offsets for bits that need to be processed
|
||||
// 1. bit proc requires LLRs of 2. and 3. bit, 2.bits of 1. and 3. etc.
|
||||
// Offsets are in units of bitOffsetInGroup (1*384/32)
|
||||
const uint8_t lut_idxCnProcG3[3][2] = {{12,24}, {0,24}, {0,12}};
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," simde__m256i ymm0, min, sgn,ones,maxLLR;\n");
|
||||
#else
|
||||
fprintf(fd," simde__m256i ymm0, min, sgn,ones;\n");
|
||||
#endif
|
||||
fprintf(fd," ones = simde_mm256_set1_epi8((int8_t)1);\n");
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," maxLLR = simde_mm256_set1_epi8((int8_t)127);\n");
|
||||
#endif
|
||||
fprintf(fd," uint32_t M;\n");
|
||||
|
||||
if (lut_numCnInCnGroups[0] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd," M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[0] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[0]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
|
||||
// Set pointers to start of group 3
|
||||
//p_cnProcBuf = (simde__m256i*) &cnProcBuf [lut_startAddrCnGroups[0]];
|
||||
//p_cnProcBufRes = (simde__m256i*) &cnProcBufRes[lut_startAddrCnGroups[0]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<3; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[0]>>5)+lut_idxCnProcG3[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
// 32 CNs of second BN
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][1] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[0]>>5)+lut_idxCnProcG3[j][1]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[0]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
// =====================================================================
|
||||
// Process group with 4 BNs
|
||||
fprintf(fd,"//Process group with 4 BNs\n");
|
||||
// Offset is 5*384/32 = 60
|
||||
const uint8_t lut_idxCnProcG4[4][3] = {{60,120,180}, {0,120,180}, {0,60,180}, {0,60,120}};
|
||||
|
||||
if (lut_numCnInCnGroups[1] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd," M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[1] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[1]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
|
||||
// Set pointers to start of group 4
|
||||
//p_cnProcBuf = (simde__m256i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m256i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<4; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[1]>>5)+lut_idxCnProcG4[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<3; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[1]>>5)+lut_idxCnProcG4[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[1]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 5 BNs
|
||||
fprintf(fd,"//Process group with 5 BNs\n");
|
||||
// Offset is 18*384/32 = 216
|
||||
const uint16_t lut_idxCnProcG5[5][4] = {{216,432,648,864}, {0,432,648,864},
|
||||
{0,216,648,864}, {0,216,432,864}, {0,216,432,648}};
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[2] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd," M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[2] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[2]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
|
||||
// Set pointers to start of group 4
|
||||
//p_cnProcBuf = (simde__m256i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m256i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<5; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[2]>>5)+lut_idxCnProcG5[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<4; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[2]>>5)+lut_idxCnProcG5[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[2]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 6 BNs
|
||||
fprintf(fd,"//Process group with 6 BNs\n");
|
||||
// Offset is 8*384/32 = 96
|
||||
const uint16_t lut_idxCnProcG6[6][5] = {{96,192,288,384,480}, {0,192,288,384,480},
|
||||
{0,96,288,384,480}, {0,96,192,384,480},
|
||||
{0,96,192,288,480}, {0,96,192,288,384}};
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[3] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd, "M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[3] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[3]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
|
||||
// Set pointers to start of group 4
|
||||
//p_cnProcBuf = (simde__m256i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m256i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<6; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[3]>>5)+lut_idxCnProcG6[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<5; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[3]>>5)+lut_idxCnProcG6[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[3]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 7 BNs
|
||||
fprintf(fd,"//Process group with 7 BNs\n");
|
||||
// Offset is 5*384/32 = 60
|
||||
const uint16_t lut_idxCnProcG7[7][6] = {{60,120,180,240,300,360}, {0,120,180,240,300,360},
|
||||
{0,60,180,240,300,360}, {0,60,120,240,300,360},
|
||||
{0,60,120,180,300,360}, {0,60,120,180,240,360},
|
||||
{0,60,120,180,240,300}};
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[4] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd, "M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[4] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[4]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
|
||||
// Set pointers to start of group 4
|
||||
//p_cnProcBuf = (simde__m256i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m256i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<7; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[4]>>5)+lut_idxCnProcG7[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<6; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[4]>>5)+lut_idxCnProcG7[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[4]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 8 BNs
|
||||
fprintf(fd,"//Process group with 8 BNs\n");
|
||||
// Offset is 2*384/32 = 24
|
||||
const uint8_t lut_idxCnProcG8[8][7] = {{24,48,72,96,120,144,168}, {0,48,72,96,120,144,168},
|
||||
{0,24,72,96,120,144,168}, {0,24,48,96,120,144,168},
|
||||
{0,24,48,72,120,144,168}, {0,24,48,72,96,144,168},
|
||||
{0,24,48,72,96,120,168}, {0,24,48,72,96,120,144}};
|
||||
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[5] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd, "M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[5] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[5]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
|
||||
// Set pointers to start of group 4
|
||||
//p_cnProcBuf = (simde__m256i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m256i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<8; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[5]>>5)+lut_idxCnProcG8[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<7; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[5]>>5)+lut_idxCnProcG8[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[5]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 9 BNs
|
||||
fprintf(fd,"//Process group with 9 BNs\n");
|
||||
// Offset is 2*384/32 = 24
|
||||
const uint8_t lut_idxCnProcG9[9][8] = {{24,48,72,96,120,144,168,192}, {0,48,72,96,120,144,168,192},
|
||||
{0,24,72,96,120,144,168,192}, {0,24,48,96,120,144,168,192},
|
||||
{0,24,48,72,120,144,168,192}, {0,24,48,72,96,144,168,192},
|
||||
{0,24,48,72,96,120,168,192}, {0,24,48,72,96,120,144,192},
|
||||
{0,24,48,72,96,120,144,168}};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[6] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd, "M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[6] );
|
||||
// Set the offset to each bit within a group in terms of 32 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[6]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
|
||||
// Set pointers to start of group 9
|
||||
//p_cnProcBuf = (simde__m256i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m256i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<9; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[6]>>5)+lut_idxCnProcG9[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<8; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[6]>>5)+lut_idxCnProcG9[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[6]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 10 BNs
|
||||
fprintf(fd,"//Process group with 10 BNs\n");
|
||||
// Offset is 1*384/32 = 12
|
||||
const uint8_t lut_idxCnProcG10[10][9] = {{12,24,36,48,60,72,84,96,108}, {0,24,36,48,60,72,84,96,108},
|
||||
{0,12,36,48,60,72,84,96,108}, {0,12,24,48,60,72,84,96,108},
|
||||
{0,12,24,36,60,72,84,96,108}, {0,12,24,36,48,72,84,96,108},
|
||||
{0,12,24,36,48,60,84,96,108}, {0,12,24,36,48,60,72,96,108},
|
||||
{0,12,24,36,48,60,72,84,108}, {0,12,24,36,48,60,72,84,96}};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[7] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[7] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[7]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
|
||||
// Set pointers to start of group 10
|
||||
//p_cnProcBuf = (simde__m256i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m256i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<10; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[7]>>5)+lut_idxCnProcG10[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<9; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[7]>>5)+lut_idxCnProcG10[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[7]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 19 BNs
|
||||
fprintf(fd,"//Process group with 19 BNs\n");
|
||||
// Offset is 4*384/32 = 12
|
||||
const uint16_t lut_idxCnProcG19[19][18] = {{48,96,144,192,240,288,336,384,432,480,528,576,624,672,720,768,816,864}, {0,96,144,192,240,288,336,384,432,480,528,576,624,672,720,768,816,864},
|
||||
{0,48,144,192,240,288,336,384,432,480,528,576,624,672,720,768,816,864}, {0,48,96,192,240,288,336,384,432,480,528,576,624,672,720,768,816,864},
|
||||
{0,48,96,144,240,288,336,384,432,480,528,576,624,672,720,768,816,864}, {0,48,96,144,192,288,336,384,432,480,528,576,624,672,720,768,816,864},
|
||||
{0,48,96,144,192,240,336,384,432,480,528,576,624,672,720,768,816,864}, {0,48,96,144,192,240,288,384,432,480,528,576,624,672,720,768,816,864},
|
||||
{0,48,96,144,192,240,288,336,432,480,528,576,624,672,720,768,816,864}, {0,48,96,144,192,240,288,336,384,480,528,576,624,672,720,768,816,864},
|
||||
{0,48,96,144,192,240,288,336,384,432,528,576,624,672,720,768,816,864}, {0,48,96,144,192,240,288,336,384,432,480,576,624,672,720,768,816,864},
|
||||
{0,48,96,144,192,240,288,336,384,432,480,528,624,672,720,768,816,864}, {0,48,96,144,192,240,288,336,384,432,480,528,576,672,720,768,816,864},
|
||||
{0,48,96,144,192,240,288,336,384,432,480,528,576,624,720,768,816,864}, {0,48,96,144,192,240,288,336,384,432,480,528,576,624,672,768,816,864},
|
||||
{0,48,96,144,192,240,288,336,384,432,480,528,576,624,672,720,816,864}, {0,48,96,144,192,240,288,336,384,432,480,528,576,624,672,720,768,864},
|
||||
{0,48,96,144,192,240,288,336,384,432,480,528,576,624,672,720,768,816}};
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[8] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd, " M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[8] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[8]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
|
||||
// Set pointers to start of group 19
|
||||
//p_cnProcBuf = (simde__m256i*) &cnProcBuf [lut_startAddrCnGroups[1]];
|
||||
//p_cnProcBufRes = (simde__m256i*) &cnProcBufRes[lut_startAddrCnGroups[1]];
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<19; j++)
|
||||
{
|
||||
// Set of results pointer to correct BN address
|
||||
//p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup);
|
||||
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[8]>>5)+lut_idxCnProcG19[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<18; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[8]>>5)+lut_idxCnProcG19[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
#ifndef DROP_MAXLLR
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
#endif
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[8]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fd,"}\n");
|
||||
fclose(fd);
|
||||
}//end of the function nrLDPC_cnProc_BG1
|
||||
|
||||
@@ -1,419 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include "../../nrLDPCdecoder_defs.h"
|
||||
#include "../../nrLDPC_types.h"
|
||||
#include "../../nrLDPC_bnProc.h"
|
||||
|
||||
|
||||
void nrLDPC_cnProc_BG2_generator_128(const char* dir, int R)
|
||||
{
|
||||
const char *ratestr[3]={"15","13","23"};
|
||||
|
||||
if (R<0 || R>2) {printf("Illegal R %d\n",R); abort();}
|
||||
|
||||
|
||||
// system("mkdir -p ldpc_gen_files/avx2");
|
||||
|
||||
char fname[FILENAME_MAX+1];
|
||||
snprintf(fname, sizeof(fname), "%s/cnProc128/nrLDPC_cnProc_BG2_R%s_128.h", dir, ratestr[R]);
|
||||
FILE *fd=fopen(fname,"w");
|
||||
if (fd == NULL) {
|
||||
printf("Cannot create file %s\n", fname);
|
||||
abort();
|
||||
}
|
||||
|
||||
fprintf(fd,"#include <stdint.h>\n");
|
||||
fprintf(fd,"#include \"PHY/sse_intrin.h\"\n");
|
||||
fprintf(fd,"static inline void nrLDPC_cnProc_BG2_R%s_128(int8_t* cnProcBuf, int8_t* cnProcBufRes, uint16_t Z) {\n",ratestr[R]);
|
||||
|
||||
const uint8_t* lut_numCnInCnGroups;
|
||||
const uint32_t* lut_startAddrCnGroups = lut_startAddrCnGroups_BG2;
|
||||
|
||||
if (R==0) lut_numCnInCnGroups = lut_numCnInCnGroups_BG2_R15;
|
||||
else if (R==1) lut_numCnInCnGroups = lut_numCnInCnGroups_BG2_R13;
|
||||
else if (R==2) lut_numCnInCnGroups = lut_numCnInCnGroups_BG2_R23;
|
||||
else { printf("aborting, illegal R %d\n",R); fclose(fd);abort();}
|
||||
|
||||
|
||||
// Number of CNs in Groups
|
||||
//uint32_t M;
|
||||
uint32_t j;
|
||||
uint32_t k;
|
||||
// Offset to each bit within a group in terms of 32 byte
|
||||
uint32_t bitOffsetInGroup;
|
||||
|
||||
// Offsets are in units of bitOffsetInGroup (1*384/32)
|
||||
// const uint8_t lut_idxCnProcG3[3][2] = {{12,24}, {0,24}, {0,12}};
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 3 BNs
|
||||
fprintf(fd,"//Process group with 3 BNs\n");
|
||||
// LUT with offsets for bits that need to be processed
|
||||
// 1. bit proc requires LLRs of 2. and 3. bit, 2.bits of 1. and 3. etc.
|
||||
// Offsets are in units of bitOffsetInGroup
|
||||
const uint8_t lut_idxCnProcG3[3][2] = {{72,144}, {0,144}, {0,72}};
|
||||
|
||||
|
||||
fprintf(fd," simde__m128i ymm0, min, sgn,ones,maxLLR;\n");
|
||||
fprintf(fd," ones = simde_mm_set1_epi8((char)1);\n");
|
||||
fprintf(fd," maxLLR = simde_mm_set1_epi8((char)127);\n");
|
||||
fprintf(fd," uint32_t M;\n");
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[0] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd," M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[0] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[0]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<3; j++)
|
||||
{
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i+=2) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[0]>>4)+lut_idxCnProcG3[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
// 16 CNs of second BN
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][1] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[0]>>4)+lut_idxCnProcG3[j][1]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[0]>>4)+(j*bitOffsetInGroup));
|
||||
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[0]>>4)+lut_idxCnProcG3[j][0]*2+1);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 4 BNs
|
||||
fprintf(fd,"//Process group with 4 BNs\n");
|
||||
|
||||
// Offset is 20*384/32 = 240
|
||||
const uint16_t lut_idxCnProcG4[4][3] = {{240,480,720}, {0,480,720}, {0,240,720}, {0,240,480}};
|
||||
|
||||
if (lut_numCnInCnGroups[1] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd," M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[1] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[1]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<4; j++)
|
||||
{
|
||||
|
||||
// Loop over CNs
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[1]>>4)+lut_idxCnProcG4[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<3; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[1]>>4)+lut_idxCnProcG4[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[1]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 5 BNs
|
||||
fprintf(fd,"//Process group with 5 BNs\n");
|
||||
|
||||
// Offset is 9*384/32 = 108
|
||||
const uint16_t lut_idxCnProcG5[5][4] = {{108,216,324,432}, {0,216,324,432},
|
||||
{0,108,324,432}, {0,108,216,432}, {0,108,216,324}};
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[2] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd," M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[2] );
|
||||
// Set the offset to each bit within a group in terms of 32 byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[2]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<5; j++)
|
||||
{
|
||||
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[2]>>4)+lut_idxCnProcG5[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<4; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[2]>>4)+lut_idxCnProcG5[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[2]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 6 BNs
|
||||
fprintf(fd,"//Process group with 6 BNs\n");
|
||||
// Offset is 3*384/32 = 36
|
||||
const uint16_t lut_idxCnProcG6[6][5] = {{36,72,108,144,180}, {0,72,108,144,180},
|
||||
{0,36,108,144,180}, {0,36,72,144,180},
|
||||
{0,36,72,108,180}, {0,36,72,108,144}};
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[3] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd, "M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[3] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[3]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<6; j++)
|
||||
{
|
||||
|
||||
|
||||
// Loop over CNs
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[3]>>4)+lut_idxCnProcG6[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<5; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[3]>>4)+lut_idxCnProcG6[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[3]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 8 BNs
|
||||
fprintf(fd,"//Process group with 8 BNs\n");
|
||||
// Offset is 2*384/32 = 24
|
||||
const uint8_t lut_idxCnProcG8[8][7] = {{24,48,72,96,120,144,168}, {0,48,72,96,120,144,168},
|
||||
{0,24,72,96,120,144,168}, {0,24,48,96,120,144,168},
|
||||
{0,24,48,72,120,144,168}, {0,24,48,72,96,144,168},
|
||||
{0,24,48,72,96,120,168}, {0,24,48,72,96,120,144}};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[4] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd, "M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[4] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[4]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<8; j++)
|
||||
{
|
||||
|
||||
// Loop over CNs
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[4]>>4)+lut_idxCnProcG8[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<7; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[4]>>4)+lut_idxCnProcG8[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[4]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 10 BNs
|
||||
fprintf(fd,"//Process group with 10 BNs\n");
|
||||
|
||||
const uint8_t lut_idxCnProcG10[10][9] = {{24,48,72,96,120,144,168,192,216}, {0,48,72,96,120,144,168,192,216},
|
||||
{0,24,72,96,120,144,168,192,216}, {0,24,48,96,120,144,168,192,216},
|
||||
{0,24,48,72,120,144,168,192,216}, {0,24,48,72,96,144,168,192,216},
|
||||
{0,24,48,72,96,120,168,192,216}, {0,24,48,72,96,120,144,192,216},
|
||||
{0,24,48,72,96,120,144,168,216}, {0,24,48,72,96,120,144,168,192}};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[5] > 0)
|
||||
{
|
||||
// Number of groups of 16 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd, "M = (%d*Z + 15)>>4;\n",lut_numCnInCnGroups[5] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[5]*NR_LDPC_ZMAX)>>4;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<10; j++)
|
||||
{
|
||||
|
||||
// Loop over CNs
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 16 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[5]>>4)+lut_idxCnProcG10[j][0]*2);
|
||||
// sgn = simde_mm_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<9; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m128i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[5]>>4)+lut_idxCnProcG10[j][k]*2);
|
||||
|
||||
// min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, simde_mm_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd," min = simde_mm_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m128i*)cnProcBufRes)[%d+i] = simde_mm_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[5]>>4)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fprintf(fd,"}\n");
|
||||
fclose(fd);
|
||||
}//end of the function nrLDPC_cnProc_BG2
|
||||
|
||||
@@ -1,419 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include "../../nrLDPCdecoder_defs.h"
|
||||
#include "../../nrLDPC_types.h"
|
||||
#include "../../nrLDPC_bnProc.h"
|
||||
|
||||
|
||||
void nrLDPC_cnProc_BG2_generator_AVX2(const char* dir, int R)
|
||||
{
|
||||
const char *ratestr[3]={"15","13","23"};
|
||||
|
||||
if (R<0 || R>2) {printf("Illegal R %d\n",R); abort();}
|
||||
|
||||
|
||||
// system("mkdir -p ldpc_gen_files/avx2");
|
||||
|
||||
char fname[FILENAME_MAX+1];
|
||||
snprintf(fname, sizeof(fname), "%s/cnProc/nrLDPC_cnProc_BG2_R%s_AVX2.h", dir, ratestr[R]);
|
||||
FILE *fd=fopen(fname,"w");
|
||||
if (fd == NULL) {
|
||||
printf("Cannot create file %s\n", fname);
|
||||
abort();
|
||||
}
|
||||
|
||||
fprintf(fd,"#include <stdint.h>\n");
|
||||
fprintf(fd,"#include \"PHY/sse_intrin.h\"\n");
|
||||
fprintf(fd,"static inline void nrLDPC_cnProc_BG2_R%s_AVX2(int8_t* cnProcBuf, int8_t* cnProcBufRes, uint16_t Z) {\n",ratestr[R]);
|
||||
|
||||
const uint8_t* lut_numCnInCnGroups;
|
||||
const uint32_t* lut_startAddrCnGroups = lut_startAddrCnGroups_BG2;
|
||||
|
||||
if (R==0) lut_numCnInCnGroups = lut_numCnInCnGroups_BG2_R15;
|
||||
else if (R==1) lut_numCnInCnGroups = lut_numCnInCnGroups_BG2_R13;
|
||||
else if (R==2) lut_numCnInCnGroups = lut_numCnInCnGroups_BG2_R23;
|
||||
else { printf("aborting, illegal R %d\n",R); fclose(fd);abort();}
|
||||
|
||||
|
||||
// Number of CNs in Groups
|
||||
//uint32_t M;
|
||||
uint32_t j;
|
||||
uint32_t k;
|
||||
// Offset to each bit within a group in terms of 32 byte
|
||||
uint32_t bitOffsetInGroup;
|
||||
|
||||
// Offsets are in units of bitOffsetInGroup (1*384/32)
|
||||
// const uint8_t lut_idxCnProcG3[3][2] = {{12,24}, {0,24}, {0,12}};
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 3 BNs
|
||||
fprintf(fd,"//Process group with 3 BNs\n");
|
||||
// LUT with offsets for bits that need to be processed
|
||||
// 1. bit proc requires LLRs of 2. and 3. bit, 2.bits of 1. and 3. etc.
|
||||
// Offsets are in units of bitOffsetInGroup
|
||||
const uint8_t lut_idxCnProcG3[3][2] = {{72,144}, {0,144}, {0,72}};
|
||||
|
||||
|
||||
fprintf(fd," simde__m256i ymm0, min, sgn,ones,maxLLR;\n");
|
||||
fprintf(fd," ones = simde_mm256_set1_epi8((char)1);\n");
|
||||
fprintf(fd," maxLLR = simde_mm256_set1_epi8((char)127);\n");
|
||||
fprintf(fd," uint32_t M;\n");
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[0] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd," M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[0] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[0]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<3; j++)
|
||||
{
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i+=2) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[0]>>5)+lut_idxCnProcG3[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
// 32 CNs of second BN
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][1] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[0]>>5)+lut_idxCnProcG3[j][1]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[0]>>5)+(j*bitOffsetInGroup));
|
||||
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[0]>>5)+lut_idxCnProcG3[j][0]+1);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 4 BNs
|
||||
fprintf(fd,"//Process group with 4 BNs\n");
|
||||
|
||||
// Offset is 20*384/32 = 240
|
||||
const uint16_t lut_idxCnProcG4[4][3] = {{240,480,720}, {0,480,720}, {0,240,720}, {0,240,480}};
|
||||
|
||||
if (lut_numCnInCnGroups[1] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd," M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[1] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[1]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<4; j++)
|
||||
{
|
||||
|
||||
// Loop over CNs
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[1]>>5)+lut_idxCnProcG4[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<3; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[1]>>5)+lut_idxCnProcG4[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[1]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 5 BNs
|
||||
fprintf(fd,"//Process group with 5 BNs\n");
|
||||
|
||||
// Offset is 9*384/32 = 108
|
||||
const uint16_t lut_idxCnProcG5[5][4] = {{108,216,324,432}, {0,216,324,432},
|
||||
{0,108,324,432}, {0,108,216,432}, {0,108,216,324}};
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[2] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd," M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[2] );
|
||||
// Set the offset to each bit within a group in terms of 32 byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[2]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<5; j++)
|
||||
{
|
||||
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[2]>>5)+lut_idxCnProcG5[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<4; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[2]>>5)+lut_idxCnProcG5[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[2]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 6 BNs
|
||||
fprintf(fd,"//Process group with 6 BNs\n");
|
||||
// Offset is 3*384/32 = 36
|
||||
const uint16_t lut_idxCnProcG6[6][5] = {{36,72,108,144,180}, {0,72,108,144,180},
|
||||
{0,36,108,144,180}, {0,36,72,144,180},
|
||||
{0,36,72,108,180}, {0,36,72,108,144}};
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[3] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd, "M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[3] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[3]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<6; j++)
|
||||
{
|
||||
|
||||
|
||||
// Loop over CNs
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[3]>>5)+lut_idxCnProcG6[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<5; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[3]>>5)+lut_idxCnProcG6[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[3]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 8 BNs
|
||||
fprintf(fd,"//Process group with 8 BNs\n");
|
||||
// Offset is 2*384/32 = 24
|
||||
const uint8_t lut_idxCnProcG8[8][7] = {{24,48,72,96,120,144,168}, {0,48,72,96,120,144,168},
|
||||
{0,24,72,96,120,144,168}, {0,24,48,96,120,144,168},
|
||||
{0,24,48,72,120,144,168}, {0,24,48,72,96,144,168},
|
||||
{0,24,48,72,96,120,168}, {0,24,48,72,96,120,144}};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[4] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd, "M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[4] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[4]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<8; j++)
|
||||
{
|
||||
|
||||
// Loop over CNs
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[4]>>5)+lut_idxCnProcG8[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<7; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[4]>>5)+lut_idxCnProcG8[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[4]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 10 BNs
|
||||
fprintf(fd,"//Process group with 10 BNs\n");
|
||||
|
||||
const uint8_t lut_idxCnProcG10[10][9] = {{24,48,72,96,120,144,168,192,216}, {0,48,72,96,120,144,168,192,216},
|
||||
{0,24,72,96,120,144,168,192,216}, {0,24,48,96,120,144,168,192,216},
|
||||
{0,24,48,72,120,144,168,192,216}, {0,24,48,72,96,144,168,192,216},
|
||||
{0,24,48,72,96,120,168,192,216}, {0,24,48,72,96,120,144,192,216},
|
||||
{0,24,48,72,96,120,144,168,216}, {0,24,48,72,96,120,144,168,192}};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (lut_numCnInCnGroups[5] > 0)
|
||||
{
|
||||
// Number of groups of 32 CNs for parallel processing
|
||||
// Ceil for values not divisible by 32
|
||||
fprintf(fd, "M = (%d*Z + 31)>>5;\n",lut_numCnInCnGroups[5] );
|
||||
|
||||
// Set the offset to each bit within a group in terms of 32 byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[5]*NR_LDPC_ZMAX)>>5;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j=0; j<10; j++)
|
||||
{
|
||||
|
||||
// Loop over CNs
|
||||
|
||||
fprintf(fd," for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 32 CNs (first BN)
|
||||
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[5]>>5)+lut_idxCnProcG10[j][0]);
|
||||
// sgn = simde_mm256_sign_epi8(ones, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(ones, ymm0);\n");
|
||||
// min = simde_mm256_abs_epi8(ymm0);
|
||||
fprintf(fd," min = simde_mm256_abs_epi8(ymm0);\n");
|
||||
|
||||
|
||||
// Loop over BNs
|
||||
for (k=1; k<9; k++)
|
||||
{
|
||||
fprintf(fd," ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];\n",(lut_startAddrCnGroups[5]>>5)+lut_idxCnProcG10[j][k]);
|
||||
|
||||
// min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));\n");
|
||||
|
||||
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
|
||||
fprintf(fd," sgn = simde_mm256_sign_epi8(sgn, ymm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd," min = simde_mm256_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd," ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);\n",(lut_startAddrCnGroups[5]>>5)+(j*bitOffsetInGroup));
|
||||
fprintf(fd," }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fprintf(fd,"}\n");
|
||||
fclose(fd);
|
||||
}//end of the function nrLDPC_cnProc_BG2
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#define NB_R 3
|
||||
void nrLDPC_cnProc_BG1_generator_AVX2(const char*, int);
|
||||
void nrLDPC_cnProc_BG2_generator_AVX2(const char*, int);
|
||||
|
||||
const char *__asan_default_options()
|
||||
{
|
||||
/* don't do leak checking in nr_ulsim, creates problems in the CI */
|
||||
return "detect_leaks=0";
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s <output-dir>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
const char *dir = argv[1];
|
||||
|
||||
int R[NB_R]={0,1,2};
|
||||
for(int i=0; i<NB_R;i++) {
|
||||
nrLDPC_cnProc_BG1_generator_AVX2(dir, R[i]);
|
||||
nrLDPC_cnProc_BG2_generator_AVX2(dir, R[i]);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#define NB_R 3
|
||||
void nrLDPC_cnProc_BG1_generator_128(const char*, int);
|
||||
void nrLDPC_cnProc_BG2_generator_128(const char*, int);
|
||||
|
||||
const char *__asan_default_options()
|
||||
{
|
||||
/* don't do leak checking in nr_ulsim, creates problems in the CI */
|
||||
return "detect_leaks=0";
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s <output-dir>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
const char *dir = argv[1];
|
||||
|
||||
int R[NB_R]={0,1,2};
|
||||
for(int i=0; i<NB_R;i++) {
|
||||
nrLDPC_cnProc_BG1_generator_128(dir, R[i]);
|
||||
nrLDPC_cnProc_BG2_generator_128(dir, R[i]);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
if (CROSS_COMPILE)
|
||||
find_package(cnProc_gen_avx512)
|
||||
else()
|
||||
add_executable(cnProc_gen_avx512
|
||||
cnProc_gen_BG1_avx512.c
|
||||
cnProc_gen_BG2_avx512.c
|
||||
main.c)
|
||||
target_compile_options(cnProc_gen_avx512 PRIVATE -W -Wall )
|
||||
export(TARGETS cnProc_gen_avx512 FILE
|
||||
"${CMAKE_BINARY_DIR}/cnProc_gen_avx512Config.cmake")
|
||||
endif()
|
||||
|
||||
set(cnProc_avx512_headers
|
||||
cnProc_avx512/nrLDPC_cnProc_BG1_R13_AVX512.h
|
||||
cnProc_avx512/nrLDPC_cnProc_BG1_R23_AVX512.h
|
||||
cnProc_avx512/nrLDPC_cnProc_BG1_R89_AVX512.h
|
||||
cnProc_avx512/nrLDPC_cnProc_BG2_R13_AVX512.h
|
||||
cnProc_avx512/nrLDPC_cnProc_BG2_R15_AVX512.h
|
||||
cnProc_avx512/nrLDPC_cnProc_BG2_R23_AVX512.h)
|
||||
|
||||
add_custom_command(
|
||||
# TARGET cnProc_gen_avx512 POST_BUILD
|
||||
OUTPUT ${cnProc_avx512_headers}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory cnProc_avx512
|
||||
COMMAND cnProc_gen_avx512 .
|
||||
DEPENDS cnProc_gen_avx512
|
||||
COMMENT "Generating LDPC cnProc header files for AVX512"
|
||||
)
|
||||
add_custom_target(cnProc_gen_avx512_files DEPENDS ${cnProc_avx512_headers})
|
||||
add_library(cnProc_gen_avx512_HEADERS INTERFACE)
|
||||
target_include_directories(cnProc_gen_avx512_HEADERS INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_dependencies(cnProc_gen_avx512_HEADERS cnProc_gen_avx512_files)
|
||||
|
||||
@@ -1,597 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include "../../nrLDPCdecoder_defs.h"
|
||||
|
||||
void nrLDPC_cnProc_BG1_generator_AVX512(const char *dir, int R)
|
||||
{
|
||||
const char *ratestr[3] = {"13", "23", "89"};
|
||||
|
||||
if (R < 0 || R > 2) {
|
||||
printf("Illegal R %d\n", R);
|
||||
abort();
|
||||
}
|
||||
|
||||
// system("mkdir -p ../ldpc_gen_files");
|
||||
|
||||
char fname[FILENAME_MAX + 1];
|
||||
snprintf(fname, sizeof(fname), "%s/cnProc_avx512/nrLDPC_cnProc_BG1_R%s_AVX512.h", dir, ratestr[R]);
|
||||
FILE *fd = fopen(fname, "w");
|
||||
if (fd == NULL) {
|
||||
printf("Cannot create file %s\n", fname);
|
||||
abort();
|
||||
}
|
||||
|
||||
// fprintf(fd,"#include <stdint.h>\n");
|
||||
// fprintf(fd,"#include \"PHY/sse_intrin.h\"\n");
|
||||
|
||||
// fprintf(fd, "#define conditional_negate(a,b,z) simde_mm512_mask_sub_epi8(a,simde_mm512_movepi8_mask(b),z,a)\n");
|
||||
|
||||
fprintf(fd, "static inline void nrLDPC_cnProc_BG1_R%s_AVX512(int8_t* cnProcBuf, int8_t* cnProcBufRes, uint16_t Z) {\n", ratestr[R]);
|
||||
|
||||
const uint8_t *lut_numCnInCnGroups;
|
||||
const uint32_t *lut_startAddrCnGroups = lut_startAddrCnGroups_BG1;
|
||||
|
||||
if (R == 0)
|
||||
lut_numCnInCnGroups = lut_numCnInCnGroups_BG1_R13;
|
||||
else if (R == 1)
|
||||
lut_numCnInCnGroups = lut_numCnInCnGroups_BG1_R23;
|
||||
else if (R == 2)
|
||||
lut_numCnInCnGroups = lut_numCnInCnGroups_BG1_R89;
|
||||
else {
|
||||
printf("aborting, illegal R %d\n", R);
|
||||
fclose(fd);
|
||||
abort();
|
||||
}
|
||||
|
||||
uint32_t j;
|
||||
uint32_t k;
|
||||
// Offset to each bit within a group in terms of 64 Byte
|
||||
uint32_t bitOffsetInGroup;
|
||||
|
||||
fprintf(fd, " uint32_t M, i;\n");
|
||||
fprintf(fd, " simde__m512i zmm0, min, sgn,zeros,maxLLR, ones;\n");
|
||||
|
||||
fprintf(fd, " zeros = simde_mm512_setzero_si512();\n");
|
||||
fprintf(fd, " maxLLR = simde_mm512_set1_epi8((char)127);\n");
|
||||
fprintf(fd, " ones = simde_mm512_set1_epi8((char)1);\n");
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 3 BNs
|
||||
fprintf(fd, "//Process group with 3 BNs\n");
|
||||
// LUT with offsets for bits that need to be processed
|
||||
// 1. bit proc requires LLRs of 2. and 3. bit, 2.bits of 1. and 3. etc.
|
||||
// Offsets are in units of bitOffsetInGroup (1*384/32)12
|
||||
// Offsets are in units of bitOffsetInGroup (1*384/32)12
|
||||
|
||||
const uint8_t lut_idxCnProcG3[3][2] = {{12, 24}, {0, 24}, {0, 12}};
|
||||
|
||||
if (lut_numCnInCnGroups[0] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
// M = (lut_numCnInCnGroups[0]*Z + 63)>>6;
|
||||
|
||||
fprintf(fd, " M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[0]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[0] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 3; j++) {
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[0] >> 6) + lut_idxCnProcG3[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// for (k=1; k<2; k++)
|
||||
//{
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[0] >> 6) + lut_idxCnProcG3[j][1] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(*p_ones, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
// }
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, *maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm512_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[0] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 4 BNs
|
||||
fprintf(fd, "//Process group with 4 BNs\n");
|
||||
// Offset is 5*384/32 = 30
|
||||
const uint8_t lut_idxCnProcG4[4][3] = {{60, 120, 180}, {0, 120, 180}, {0, 60, 180}, {0, 60, 120}};
|
||||
|
||||
if (lut_numCnInCnGroups[1] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
// M = (lut_numCnInCnGroups[1]*Z + 63)>>6;
|
||||
fprintf(fd, " M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[1]);
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[1] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
for (j = 0; j < 4; j++) {
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[1] >> 6) + lut_idxCnProcG4[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 3; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[1] >> 6) + lut_idxCnProcG4[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(*p_ones, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm512_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[1] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 5 BNs
|
||||
fprintf(fd, "//Process group with 5 BNs\n");
|
||||
// Offset is 18*384/32 = 216
|
||||
const uint16_t lut_idxCnProcG5[5][4] = {{216, 432, 648, 864}, {0, 432, 648, 864}, {0, 216, 648, 864}, {0, 216, 432, 864}, {0, 216, 432, 648}};
|
||||
|
||||
if (lut_numCnInCnGroups[2] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
// M = (lut_numCnInCnGroups[2]*Z + 63)>>6;
|
||||
fprintf(fd, " M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[2]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[2] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 5; j++) {
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[2] >> 6) + lut_idxCnProcG5[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 4; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[2] >> 6) + lut_idxCnProcG5[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(*p_ones, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[2] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 6 BNs
|
||||
fprintf(fd, "//Process group with 6 BNs\n");
|
||||
// Offset is 8*384/32 = 48
|
||||
const uint16_t lut_idxCnProcG6[6][5] = {{96, 192, 288, 384, 480}, {0, 192, 288, 384, 480}, {0, 96, 288, 384, 480}, {0, 96, 192, 384, 480}, {0, 96, 192, 288, 480}, {0, 96, 192, 288, 384}};
|
||||
|
||||
if (lut_numCnInCnGroups[3] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
// M = (lut_numCnInCnGroups[3]*Z + 63)>>6;
|
||||
|
||||
fprintf(fd, "M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[3]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[3] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 6; j++) {
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[3] >> 6) + lut_idxCnProcG6[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 5; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[3] >> 6) + lut_idxCnProcG6[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(*p_ones, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[3] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 7 BNs
|
||||
fprintf(fd, "//Process group with 7 BNs\n");
|
||||
// Offset is 5*384/32 = 30
|
||||
const uint16_t lut_idxCnProcG7[7][6] = {{60, 120, 180, 240, 300, 360},
|
||||
{0, 120, 180, 240, 300, 360},
|
||||
{0, 60, 180, 240, 300, 360},
|
||||
{0, 60, 120, 240, 300, 360},
|
||||
{0, 60, 120, 180, 300, 360},
|
||||
{0, 60, 120, 180, 240, 360},
|
||||
{0, 60, 120, 180, 240, 300}};
|
||||
|
||||
if (lut_numCnInCnGroups[4] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
// M = (lut_numCnInCnGroups[4]*Z + 63)>>6;
|
||||
fprintf(fd, "M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[4]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[4] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 7; j++) {
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0= ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[4] >> 6) + lut_idxCnProcG7[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 6; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[4] >> 6) + lut_idxCnProcG7[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(*p_ones, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[4] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 8 BNs
|
||||
fprintf(fd, "//Process group with 8 BNs\n");
|
||||
// Offset is 2*384/32 = 24
|
||||
const uint8_t lut_idxCnProcG8[8][7] = {{24, 48, 72, 96, 120, 144, 168},
|
||||
{0, 48, 72, 96, 120, 144, 168},
|
||||
{0, 24, 72, 96, 120, 144, 168},
|
||||
{0, 24, 48, 96, 120, 144, 168},
|
||||
{0, 24, 48, 72, 120, 144, 168},
|
||||
{0, 24, 48, 72, 96, 144, 168},
|
||||
{0, 24, 48, 72, 96, 120, 168},
|
||||
{0, 24, 48, 72, 96, 120, 144}};
|
||||
|
||||
if (lut_numCnInCnGroups[5] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
// M = (lut_numCnInCnGroups[5]*Z + 63)>>6;
|
||||
fprintf(fd, "M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[5]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[5] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 8; j++) {
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[5] >> 6) + lut_idxCnProcG8[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 7; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[5] >> 6) + lut_idxCnProcG8[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(*p_ones, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[5] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 9 BNs
|
||||
|
||||
fprintf(fd, "//Process group with 9 BNs\n");
|
||||
// Offset is 2*384/32 = 12
|
||||
const uint8_t lut_idxCnProcG9[9][8] = {{24, 48, 72, 96, 120, 144, 168, 192},
|
||||
{0, 48, 72, 96, 120, 144, 168, 192},
|
||||
{0, 24, 72, 96, 120, 144, 168, 192},
|
||||
{0, 24, 48, 96, 120, 144, 168, 192},
|
||||
{0, 24, 48, 72, 120, 144, 168, 192},
|
||||
{0, 24, 48, 72, 96, 144, 168, 192},
|
||||
{0, 24, 48, 72, 96, 120, 168, 192},
|
||||
{0, 24, 48, 72, 96, 120, 144, 192},
|
||||
{0, 24, 48, 72, 96, 120, 144, 168}};
|
||||
|
||||
if (lut_numCnInCnGroups[6] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
// M = (lut_numCnInCnGroups[5]*Z + 63)>>6;
|
||||
fprintf(fd, "M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[6]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[6] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 9; j++) {
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[6] >> 6) + lut_idxCnProcG9[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 8; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[6] >> 6) + lut_idxCnProcG9[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(*p_ones, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[6] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 10 BNs
|
||||
fprintf(fd, "//Process group with 10 BNs\n");
|
||||
// Offset is 1*384/32 = 6
|
||||
const uint8_t lut_idxCnProcG10[10][9] = {{12, 24, 36, 48, 60, 72, 84, 96, 108},
|
||||
{0, 24, 36, 48, 60, 72, 84, 96, 108},
|
||||
{0, 12, 36, 48, 60, 72, 84, 96, 108},
|
||||
{0, 12, 24, 48, 60, 72, 84, 96, 108},
|
||||
{0, 12, 24, 36, 60, 72, 84, 96, 108},
|
||||
{0, 12, 24, 36, 48, 72, 84, 96, 108},
|
||||
{0, 12, 24, 36, 48, 60, 84, 96, 108},
|
||||
{0, 12, 24, 36, 48, 60, 72, 96, 108},
|
||||
{0, 12, 24, 36, 48, 60, 72, 84, 108},
|
||||
{0, 12, 24, 36, 48, 60, 72, 84, 96}};
|
||||
|
||||
if (lut_numCnInCnGroups[7] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
// M = (lut_numCnInCnGroups[7]*Z + 63)>>6;
|
||||
fprintf(fd, " M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[7]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[7] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 10; j++) {
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[7] >> 6) + lut_idxCnProcG10[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 9; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[7] >> 6) + lut_idxCnProcG10[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(*p_ones, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min,sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[7] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 19 BNs
|
||||
fprintf(fd, "//Process group with 19 BNs\n");
|
||||
// Offset is 4*384/32 = 24
|
||||
const uint16_t lut_idxCnProcG19[19][18] = {{48, 96, 144, 192, 240, 288, 336, 384, 432, 480, 528, 576, 624, 672, 720, 768, 816, 864},
|
||||
{0, 96, 144, 192, 240, 288, 336, 384, 432, 480, 528, 576, 624, 672, 720, 768, 816, 864},
|
||||
{0, 48, 144, 192, 240, 288, 336, 384, 432, 480, 528, 576, 624, 672, 720, 768, 816, 864},
|
||||
{0, 48, 96, 192, 240, 288, 336, 384, 432, 480, 528, 576, 624, 672, 720, 768, 816, 864},
|
||||
{0, 48, 96, 144, 240, 288, 336, 384, 432, 480, 528, 576, 624, 672, 720, 768, 816, 864},
|
||||
{0, 48, 96, 144, 192, 288, 336, 384, 432, 480, 528, 576, 624, 672, 720, 768, 816, 864},
|
||||
{0, 48, 96, 144, 192, 240, 336, 384, 432, 480, 528, 576, 624, 672, 720, 768, 816, 864},
|
||||
{0, 48, 96, 144, 192, 240, 288, 384, 432, 480, 528, 576, 624, 672, 720, 768, 816, 864},
|
||||
{0, 48, 96, 144, 192, 240, 288, 336, 432, 480, 528, 576, 624, 672, 720, 768, 816, 864},
|
||||
{0, 48, 96, 144, 192, 240, 288, 336, 384, 480, 528, 576, 624, 672, 720, 768, 816, 864},
|
||||
{0, 48, 96, 144, 192, 240, 288, 336, 384, 432, 528, 576, 624, 672, 720, 768, 816, 864},
|
||||
{0, 48, 96, 144, 192, 240, 288, 336, 384, 432, 480, 576, 624, 672, 720, 768, 816, 864},
|
||||
{0, 48, 96, 144, 192, 240, 288, 336, 384, 432, 480, 528, 624, 672, 720, 768, 816, 864},
|
||||
{0, 48, 96, 144, 192, 240, 288, 336, 384, 432, 480, 528, 576, 672, 720, 768, 816, 864},
|
||||
{0, 48, 96, 144, 192, 240, 288, 336, 384, 432, 480, 528, 576, 624, 720, 768, 816, 864},
|
||||
{0, 48, 96, 144, 192, 240, 288, 336, 384, 432, 480, 528, 576, 624, 672, 768, 816, 864},
|
||||
{0, 48, 96, 144, 192, 240, 288, 336, 384, 432, 480, 528, 576, 624, 672, 720, 816, 864},
|
||||
{0, 48, 96, 144, 192, 240, 288, 336, 384, 432, 480, 528, 576, 624, 672, 720, 768, 864},
|
||||
{0, 48, 96, 144, 192, 240, 288, 336, 384, 432, 480, 528, 576, 624, 672, 720, 768, 816}};
|
||||
|
||||
if (lut_numCnInCnGroups[8] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
// M = (lut_numCnInCnGroups[8]*Z + 63)>>6;
|
||||
fprintf(fd, " M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[8]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG1_R13[8] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 19; j++) {
|
||||
// Loop over CNs
|
||||
// for (i=0; i<M; i++,iprime++)
|
||||
// {
|
||||
fprintf(fd, " for (i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[8] >> 6) + lut_idxCnProcG19[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 18; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[8] >> 6) + lut_idxCnProcG19[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(*p_ones, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[8] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
fclose(fd);
|
||||
} // end of the function nrLDPC_cnProc_BG1
|
||||
@@ -1,380 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include "../../nrLDPCdecoder_defs.h"
|
||||
|
||||
void nrLDPC_cnProc_BG2_generator_AVX512(const char *dir, int R)
|
||||
{
|
||||
const char *ratestr[3] = {"15", "13", "23"};
|
||||
|
||||
if (R < 0 || R > 2) {
|
||||
printf("Illegal R %d\n", R);
|
||||
abort();
|
||||
}
|
||||
|
||||
// system("mkdir -p ../ldpc_gen_files");
|
||||
|
||||
char fname[FILENAME_MAX + 1];
|
||||
snprintf(fname, sizeof(fname), "%s/cnProc_avx512/nrLDPC_cnProc_BG2_R%s_AVX512.h", dir, ratestr[R]);
|
||||
FILE *fd = fopen(fname, "w");
|
||||
if (fd == NULL) {
|
||||
printf("Cannot create file %s\n", fname);
|
||||
abort();
|
||||
}
|
||||
|
||||
//fprintf(fd, "#define conditional_negate(a,b,z) simde_mm512_mask_sub_epi8(a,_mm512_movepi8_mask(b),z,a)\n");
|
||||
|
||||
fprintf(fd, "static inline void nrLDPC_cnProc_BG2_R%s_AVX512(int8_t* cnProcBuf, int8_t* cnProcBufRes, uint16_t Z) {\n", ratestr[R]);
|
||||
const uint8_t *lut_numCnInCnGroups;
|
||||
const uint32_t *lut_startAddrCnGroups = lut_startAddrCnGroups_BG2;
|
||||
|
||||
if (R == 0)
|
||||
lut_numCnInCnGroups = lut_numCnInCnGroups_BG2_R15;
|
||||
else if (R == 1)
|
||||
lut_numCnInCnGroups = lut_numCnInCnGroups_BG2_R13;
|
||||
else if (R == 2)
|
||||
lut_numCnInCnGroups = lut_numCnInCnGroups_BG2_R23;
|
||||
else {
|
||||
printf("aborting, illegal R %d\n", R);
|
||||
fclose(fd);
|
||||
abort();
|
||||
}
|
||||
|
||||
// Number of CNs in Groups
|
||||
// uint32_t M;
|
||||
uint32_t j;
|
||||
uint32_t k;
|
||||
// Offset to each bit within a group in terms of 64 Byte
|
||||
uint32_t bitOffsetInGroup;
|
||||
|
||||
fprintf(fd, " uint32_t M;\n");
|
||||
fprintf(fd, " simde__m512i zmm0, min, sgn,zeros,ones,maxLLR;\n");
|
||||
fprintf(fd, " zeros = simde_mm512_setzero_si512();\n");
|
||||
fprintf(fd, " maxLLR = simde_mm512_set1_epi8((char)127);\n");
|
||||
fprintf(fd, " ones = simde_mm512_set1_epi8((char)1);\n");
|
||||
// =====================================================================
|
||||
// Process group with 3 BNs
|
||||
fprintf(fd, "//Process group with 3 BNs\n");
|
||||
// LUT with offsets for bits that need to be processed
|
||||
// 1. bit proc requires LLRs of 2. and 3. bit, 2.bits of 1. and 3. etc.
|
||||
// Offsets are in units of bitOffsetInGroup
|
||||
const uint8_t lut_idxCnProcG3[3][2] = {{72, 144}, {0, 144}, {0, 72}};
|
||||
|
||||
if (lut_numCnInCnGroups[0] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
fprintf(fd, " M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[0]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[0] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 3; j++) {
|
||||
fprintf(fd, " for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[0] >> 6) + lut_idxCnProcG3[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// for (k=1; k<2; k++)
|
||||
//{
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[0] >> 6) + lut_idxCnProcG3[j][1] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(*p_ones, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
// }
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, *maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm512_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[0] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 4 BNs
|
||||
fprintf(fd, "//Process group with 4 BNs\n");
|
||||
// Offset is 20*384/32 = 240
|
||||
const uint16_t lut_idxCnProcG4[4][3] = {{240, 480, 720}, {0, 480, 720}, {0, 240, 720}, {0, 240, 480}};
|
||||
|
||||
if (lut_numCnInCnGroups[1] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
fprintf(fd, " M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[1]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[1] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
for (j = 0; j < 4; j++) {
|
||||
fprintf(fd, " for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[1] >> 6) + lut_idxCnProcG4[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 3; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[1] >> 6) + lut_idxCnProcG4[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(sgn, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
// *p_cnProcBufResBit = simde_mm512_sign_epi8(min, sgn);
|
||||
// p_cnProcBufResBit++;
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[1] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 5 BNs
|
||||
fprintf(fd, "//Process group with 5 BNs\n");
|
||||
// Offset is 9*384/32 = 108
|
||||
const uint16_t lut_idxCnProcG5[5][4] = {{108, 216, 324, 432}, {0, 216, 324, 432}, {0, 108, 324, 432}, {0, 108, 216, 432}, {0, 108, 216, 324}};
|
||||
|
||||
if (lut_numCnInCnGroups[2] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
fprintf(fd, " M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[2]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[2] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 5; j++) {
|
||||
fprintf(fd, " for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[2] >> 6) + lut_idxCnProcG5[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 4; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[2] >> 6) + lut_idxCnProcG5[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(sgn, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[2] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 6 BNs
|
||||
fprintf(fd, "//Process group with 6 BNs\n");
|
||||
// Offset is 3*384/32 = 36
|
||||
const uint16_t lut_idxCnProcG6[6][5] = {{36, 72, 108, 144, 180}, {0, 72, 108, 144, 180}, {0, 36, 108, 144, 180}, {0, 36, 72, 144, 180}, {0, 36, 72, 108, 180}, {0, 36, 72, 108, 144}};
|
||||
|
||||
if (lut_numCnInCnGroups[3] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
fprintf(fd, " M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[3]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[3] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 6; j++) {
|
||||
fprintf(fd, " for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[3] >> 6) + lut_idxCnProcG6[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 5; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[3] >> 6) + lut_idxCnProcG6[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(sgn, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[3] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 8 BNs
|
||||
fprintf(fd, "//Process group with 8 BNs\n");
|
||||
// Offset is 2*384/32 = 24
|
||||
const uint8_t lut_idxCnProcG8[8][7] = {{24, 48, 72, 96, 120, 144, 168},
|
||||
{0, 48, 72, 96, 120, 144, 168},
|
||||
{0, 24, 72, 96, 120, 144, 168},
|
||||
{0, 24, 48, 96, 120, 144, 168},
|
||||
{0, 24, 48, 72, 120, 144, 168},
|
||||
{0, 24, 48, 72, 96, 144, 168},
|
||||
{0, 24, 48, 72, 96, 120, 168},
|
||||
{0, 24, 48, 72, 96, 120, 144}};
|
||||
|
||||
if (lut_numCnInCnGroups[4] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
fprintf(fd, " M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[4]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[4] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 8; j++) {
|
||||
fprintf(fd, " for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[4] >> 6) + lut_idxCnProcG8[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 7; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[4] >> 6) + lut_idxCnProcG8[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(sgn, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min, sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[4] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// Process group with 10 BNs
|
||||
fprintf(fd, "//Process group with 10 BNs\n");
|
||||
|
||||
const uint8_t lut_idxCnProcG10[10][9] = {{24, 48, 72, 96, 120, 144, 168, 192, 216},
|
||||
{0, 48, 72, 96, 120, 144, 168, 192, 216},
|
||||
{0, 24, 72, 96, 120, 144, 168, 192, 216},
|
||||
{0, 24, 48, 96, 120, 144, 168, 192, 216},
|
||||
{0, 24, 48, 72, 120, 144, 168, 192, 216},
|
||||
{0, 24, 48, 72, 96, 144, 168, 192, 216},
|
||||
{0, 24, 48, 72, 96, 120, 168, 192, 216},
|
||||
{0, 24, 48, 72, 96, 120, 144, 192, 216},
|
||||
{0, 24, 48, 72, 96, 120, 144, 168, 216},
|
||||
{0, 24, 48, 72, 96, 120, 144, 168, 192}};
|
||||
|
||||
if (lut_numCnInCnGroups[5] > 0) {
|
||||
// Number of groups of 64 CNs for parallel processing
|
||||
// Ceil for values not divisible by 64
|
||||
fprintf(fd, " M = (%d*Z + 63)>>6;\n", lut_numCnInCnGroups[5]);
|
||||
|
||||
// Set the offset to each bit within a group in terms of 64 Byte
|
||||
bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[5] * NR_LDPC_ZMAX) >> 6;
|
||||
|
||||
// Loop over every BN
|
||||
|
||||
for (j = 0; j < 10; j++) {
|
||||
fprintf(fd, " for (int i=0;i<M;i++) {\n");
|
||||
// Abs and sign of 64 CNs (first BN)
|
||||
// zmm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[5] >> 6) + lut_idxCnProcG10[j][0] / 2);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(ones, zmm0);\n");
|
||||
fprintf(fd, " min = simde_mm512_abs_epi8(zmm0);\n");
|
||||
|
||||
// Loop over BNs
|
||||
for (k = 1; k < 9; k++) {
|
||||
fprintf(fd,
|
||||
" zmm0 = ((simde__m512i*)cnProcBuf)[%d+i];\n",
|
||||
(lut_startAddrCnGroups[5] >> 6) + lut_idxCnProcG10[j][k] / 2);
|
||||
|
||||
// min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, simde_mm512_abs_epi8(zmm0));\n");
|
||||
|
||||
// sgn = simde_mm512_sign_epi8(sgn, zmm0);
|
||||
fprintf(fd, " sgn = simde_mm512_xor_si512(sgn, zmm0);\n");
|
||||
}
|
||||
|
||||
// Store result
|
||||
// min = simde_mm512_min_epu8(min, maxLLR); // 128 in epi8 is -127
|
||||
fprintf(fd, " min = simde_mm512_min_epu8(min, maxLLR);\n");
|
||||
|
||||
fprintf(fd,
|
||||
" ((simde__m512i*)cnProcBufRes)[%d+i] = conditional_negate(min,sgn,zeros);\n",
|
||||
(lut_startAddrCnGroups[5] >> 6) + (j * bitOffsetInGroup));
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fd, "}\n");
|
||||
fclose(fd);
|
||||
} // end of the function nrLDPC_cnProc_BG2
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#define NB_R 3
|
||||
void nrLDPC_cnProc_BG1_generator_AVX512(const char *, int);
|
||||
void nrLDPC_cnProc_BG2_generator_AVX512(const char *, int);
|
||||
|
||||
const char *__asan_default_options()
|
||||
{
|
||||
/* don't do leak checking in nr_ulsim, creates problems in the CI */
|
||||
return "detect_leaks=0";
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s <output-dir>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
const char *dir = argv[1];
|
||||
|
||||
int R[NB_R]={0,1,2};
|
||||
for(int i=0; i<NB_R;i++){
|
||||
nrLDPC_cnProc_BG1_generator_AVX512(dir, R[i]);
|
||||
nrLDPC_cnProc_BG2_generator_AVX512(dir, R[i]);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief Defines the debugging functions
|
||||
*/
|
||||
|
||||
#ifndef __NR_LDPC_DEBUG__H__
|
||||
#define __NR_LDPC_DEBUG__H__
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/**
|
||||
Enum with possible LDPC data buffers
|
||||
*/
|
||||
typedef enum nrLDPC_buffers {
|
||||
nrLDPC_buffers_LLR_PROC, /**< LLR processing buffer */
|
||||
nrLDPC_buffers_CN_PROC, /**< CN processing buffer */
|
||||
nrLDPC_buffers_CN_PROC_RES, /**< CN processing results buffer */
|
||||
nrLDPC_buffers_BN_PROC, /**< BN processing buffer */
|
||||
nrLDPC_buffers_BN_PROC_RES, /**< BN processing results buffer */
|
||||
nrLDPC_buffers_LLR_RES /**< LLR results buffer */
|
||||
} e_nrLDPC_buffers;
|
||||
|
||||
/**
|
||||
\brief Writes N data samples to a file
|
||||
\param fileName Name of the file
|
||||
\param p_data Pointer to the data
|
||||
\param N Number of values to write
|
||||
*/
|
||||
static inline void nrLDPC_writeFile(const char* fileName, int8_t* p_data, const uint32_t N)
|
||||
{
|
||||
FILE *f;
|
||||
uint32_t i;
|
||||
|
||||
f = fopen(fileName, "a");
|
||||
|
||||
// Newline indicating new data
|
||||
fprintf(f, "\n");
|
||||
for (i=0; i < N; i++)
|
||||
{
|
||||
fprintf(f, "%d, ", p_data[i]);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Creates empty new file
|
||||
\param fileName Name of the file
|
||||
*/
|
||||
static inline void nrLDPC_initFile(const char* fileName)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
f = fopen(fileName, "w");
|
||||
|
||||
fprintf(f, " ");
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Writes data of predefined buffers to file
|
||||
\param buffer Enum of buffer name to write
|
||||
*/
|
||||
static inline void nrLDPC_debug_writeBuffer2File(e_nrLDPC_buffers buffer, int8_t* p_buffer)
|
||||
{
|
||||
switch (buffer)
|
||||
{
|
||||
case nrLDPC_buffers_LLR_PROC:
|
||||
{
|
||||
nrLDPC_writeFile("llrProcBuf.txt", p_buffer, NR_LDPC_MAX_NUM_LLR);
|
||||
break;
|
||||
}
|
||||
case nrLDPC_buffers_CN_PROC:
|
||||
{
|
||||
nrLDPC_writeFile("cnProcBuf.txt", p_buffer, NR_LDPC_SIZE_CN_PROC_BUF);
|
||||
break;
|
||||
}
|
||||
case nrLDPC_buffers_CN_PROC_RES:
|
||||
{
|
||||
nrLDPC_writeFile("cnProcBufRes.txt", p_buffer, NR_LDPC_SIZE_CN_PROC_BUF);
|
||||
break;
|
||||
}
|
||||
case nrLDPC_buffers_BN_PROC:
|
||||
{
|
||||
nrLDPC_writeFile("bnProcBuf.txt", p_buffer, NR_LDPC_SIZE_BN_PROC_BUF);
|
||||
break;
|
||||
}
|
||||
case nrLDPC_buffers_BN_PROC_RES:
|
||||
{
|
||||
nrLDPC_writeFile("bnProcBufRes.txt", p_buffer, NR_LDPC_SIZE_BN_PROC_BUF);
|
||||
break;
|
||||
}
|
||||
case nrLDPC_buffers_LLR_RES:
|
||||
{
|
||||
nrLDPC_writeFile("llrRes.txt", p_buffer, NR_LDPC_MAX_NUM_LLR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Initializes file for writing a buffer
|
||||
\param buffer Enum of buffer name to write
|
||||
*/
|
||||
static inline void nrLDPC_debug_initBuffer2File(e_nrLDPC_buffers buffer)
|
||||
{
|
||||
switch (buffer)
|
||||
{
|
||||
case nrLDPC_buffers_LLR_PROC:
|
||||
{
|
||||
nrLDPC_initFile("llrProcBuf.txt");
|
||||
break;
|
||||
}
|
||||
case nrLDPC_buffers_CN_PROC:
|
||||
{
|
||||
nrLDPC_initFile("cnProcBuf.txt");
|
||||
break;
|
||||
}
|
||||
case nrLDPC_buffers_CN_PROC_RES:
|
||||
{
|
||||
nrLDPC_initFile("cnProcBufRes.txt");
|
||||
break;
|
||||
}
|
||||
case nrLDPC_buffers_BN_PROC:
|
||||
{
|
||||
nrLDPC_initFile("bnProcBuf.txt");
|
||||
break;
|
||||
}
|
||||
case nrLDPC_buffers_BN_PROC_RES:
|
||||
{
|
||||
nrLDPC_initFile("bnProcBufRes.txt");
|
||||
break;
|
||||
}
|
||||
case nrLDPC_buffers_LLR_RES:
|
||||
{
|
||||
nrLDPC_initFile("llrRes.txt");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
echo "to build the LDPC decoder headers: go to the build directory, and type"
|
||||
echo "make/ninja ldpc_generators"
|
||||
echo
|
||||
echo "assuming your build directory is ran_build/build, I trigger building for"
|
||||
echo "you now. The generated headers will be in ran_build/build/ldpc/generator_*/"
|
||||
echo
|
||||
|
||||
cd $OPENAIR_HOME/cmake_targets/ran_build/build
|
||||
make ldpc_generators || ninja ldpc_generators
|
||||
Reference in New Issue
Block a user