Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG-RAN
Commits
4cd25ba6
Commit
4cd25ba6
authored
2 years ago
by
Raymond
Committed by
laurent
2 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adaptations of LDPC decoder generator for ARMv8 performance
parent
81a2da50
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
140 additions
and
50 deletions
+140
-50
CMakeLists.txt
CMakeLists.txt
+1
-1
common/utils/time_meas.c
common/utils/time_meas.c
+2
-3
openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h
openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h
+3
-3
openair1/PHY/CODING/TESTBENCH/ldpctest.c
openair1/PHY/CODING/TESTBENCH/ldpctest.c
+30
-29
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
+1
-1
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/generator_cnProc/cnProc_gen_BG1_avx2.c
...coder/nrLDPC_tools/generator_cnProc/cnProc_gen_BG1_avx2.c
+103
-13
No files found.
CMakeLists.txt
View file @
4cd25ba6
...
@@ -245,7 +245,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ggdb2 -Wl,-rpath -Wl,${C
...
@@ -245,7 +245,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ggdb2 -Wl,-rpath -Wl,${C
# these changes are related to hardcoded path to include .h files
# these changes are related to hardcoded path to include .h files
set
(
debugOpt
"-ggdb2 -DMALLOC_CHECK_=3 -fno-delete-null-pointer-checks"
)
set
(
debugOpt
"-ggdb2 -DMALLOC_CHECK_=3 -fno-delete-null-pointer-checks"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
debugOpt
}
-O0"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
debugOpt
}
-O0"
)
set
(
CMAKE_C_FLAGS_RELWITHDEBINFO
"
${
debugOpt
}
-O
2
"
)
set
(
CMAKE_C_FLAGS_RELWITHDEBINFO
"
${
debugOpt
}
-O
3
"
)
set
(
CMAKE_C_FLAGS_RELEASE
"-O3"
)
set
(
CMAKE_C_FLAGS_RELEASE
"-O3"
)
# Enable assert() for RelWithDebInfo builds
# Enable assert() for RelWithDebInfo builds
...
...
This diff is collapsed.
Click to expand it.
common/utils/time_meas.c
View file @
4cd25ba6
...
@@ -38,7 +38,7 @@ static time_stats_t **measur_table;
...
@@ -38,7 +38,7 @@ static time_stats_t **measur_table;
notifiedFIFO_t
measur_fifo
;
notifiedFIFO_t
measur_fifo
;
double
get_cpu_freq_GHz
(
void
)
double
get_cpu_freq_GHz
(
void
)
{
{
if
(
cpu_freq_GHz
<
1
)
{
if
(
cpu_freq_GHz
<
0
.
0
1
)
{
time_stats_t
ts
=
{
0
};
time_stats_t
ts
=
{
0
};
reset_meas
(
&
ts
);
reset_meas
(
&
ts
);
ts
.
trials
++
;
ts
.
trials
++
;
...
@@ -46,8 +46,7 @@ double get_cpu_freq_GHz(void)
...
@@ -46,8 +46,7 @@ double get_cpu_freq_GHz(void)
sleep
(
1
);
sleep
(
1
);
ts
.
diff
=
(
rdtsc_oai
()
-
ts
.
in
);
ts
.
diff
=
(
rdtsc_oai
()
-
ts
.
in
);
cpu_freq_GHz
=
(
double
)
ts
.
diff
/
1000000000
;
cpu_freq_GHz
=
(
double
)
ts
.
diff
/
1000000000
;
printf
(
"CPU Freq is %f
\n
"
,
cpu_freq_GHz
);
}
}
return
cpu_freq_GHz
;
return
cpu_freq_GHz
;
}
}
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h
View file @
4cd25ba6
...
@@ -34,9 +34,9 @@ void exit_function(const char* file, const char* function, const int line, const
...
@@ -34,9 +34,9 @@ void exit_function(const char* file, const char* function, const int line, const
exit
(
-
1
);
exit
(
-
1
);
}
}
signed
char
quantize
(
double
D
,
double
x
,
unsigned
char
B
)
{
int8_t
quantize
(
double
D
,
double
x
,
uint8_t
B
)
{
double
qxd
;
double
qxd
;
shor
t
maxlev
;
int16_
t
maxlev
;
qxd
=
floor
(
x
/
D
);
qxd
=
floor
(
x
/
D
);
maxlev
=
1
<<
(
B
-
1
);
//(char)(pow(2,B-1));
maxlev
=
1
<<
(
B
-
1
);
//(char)(pow(2,B-1));
...
@@ -45,7 +45,7 @@ signed char quantize(double D, double x, unsigned char B) {
...
@@ -45,7 +45,7 @@ signed char quantize(double D, double x, unsigned char B) {
else
if
(
qxd
>=
maxlev
)
else
if
(
qxd
>=
maxlev
)
qxd
=
maxlev
-
1
;
qxd
=
maxlev
-
1
;
return
((
char
)
qxd
);
return
((
int8_t
)
qxd
);
}
}
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/CODING/TESTBENCH/ldpctest.c
View file @
4cd25ba6
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <math.h>
#include <math.h>
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <stdint.h>
#include "assertions.h"
#include "assertions.h"
#include "SIMULATION/TOOLS/sim.h"
#include "SIMULATION/TOOLS/sim.h"
#include "common/utils/load_module_shlib.h"
#include "common/utils/load_module_shlib.h"
...
@@ -43,7 +44,7 @@
...
@@ -43,7 +44,7 @@
#define NR_LDPC_ENABLE_PARITY_CHECK
#define NR_LDPC_ENABLE_PARITY_CHECK
// 4-bit quantizer
// 4-bit quantizer
char
quantize4bit
(
double
D
,
double
x
)
int8_t
quantize4bit
(
double
D
,
double
x
)
{
{
double
qxd
;
double
qxd
;
qxd
=
floor
(
x
/
D
);
qxd
=
floor
(
x
/
D
);
...
@@ -54,13 +55,13 @@ char quantize4bit(double D,double x)
...
@@ -54,13 +55,13 @@ char quantize4bit(double D,double x)
else
if
(
qxd
>
7
)
else
if
(
qxd
>
7
)
qxd
=
7
;
qxd
=
7
;
return
((
char
)
qxd
);
return
((
int8_t
)
qxd
);
}
}
char
quantize8bit
(
double
D
,
double
x
)
int8_t
quantize8bit
(
double
D
,
double
x
)
{
{
double
qxd
;
double
qxd
;
//
char
maxlev;
//
int8_t
maxlev;
qxd
=
floor
(
x
/
D
);
qxd
=
floor
(
x
/
D
);
//maxlev = 1<<(B-1);
//maxlev = 1<<(B-1);
...
@@ -72,7 +73,7 @@ char quantize8bit(double D,double x)
...
@@ -72,7 +73,7 @@ char quantize8bit(double D,double x)
else
if
(
qxd
>=
128
)
else
if
(
qxd
>=
128
)
qxd
=
127
;
qxd
=
127
;
return
((
char
)
qxd
);
return
((
int8_t
)
qxd
);
}
}
typedef
struct
{
typedef
struct
{
...
@@ -92,7 +93,7 @@ int test_ldpc(short max_iterations,
...
@@ -92,7 +93,7 @@ int test_ldpc(short max_iterations,
int
nom_rate
,
int
nom_rate
,
int
denom_rate
,
int
denom_rate
,
double
SNR
,
double
SNR
,
u
nsigned
char
qbits
,
u
int8_t
qbits
,
short
block_length
,
short
block_length
,
unsigned
int
ntrials
,
unsigned
int
ntrials
,
int
n_segments
,
int
n_segments
,
...
@@ -117,15 +118,15 @@ int test_ldpc(short max_iterations,
...
@@ -117,15 +118,15 @@ int test_ldpc(short max_iterations,
sigma
=
1
.
0
/
sqrt
(
2
*
SNR
);
sigma
=
1
.
0
/
sqrt
(
2
*
SNR
);
opp_enabled
=
1
;
opp_enabled
=
1
;
//short test_input[block_length];
//short test_input[block_length];
u
nsigned
char
*
test_input
[
MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER
*
NR_MAX_NB_LAYERS
]
=
{
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
};;
u
int8_t
*
test_input
[
MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER
*
NR_MAX_NB_LAYERS
]
=
{
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
};;
//short *c; //padded codeword
//short *c; //padded codeword
u
nsigned
char
estimated_output
[
MAX_NUM_DLSCH_SEGMENTS
][
block_length
];
u
int8_t
estimated_output
[
MAX_NUM_DLSCH_SEGMENTS
][
block_length
];
memset
(
estimated_output
,
0
,
sizeof
(
estimated_output
));
memset
(
estimated_output
,
0
,
sizeof
(
estimated_output
));
u
nsigned
char
*
channel_input
[
MAX_NUM_DLSCH_SEGMENTS
];
u
int8_t
*
channel_input
[
MAX_NUM_DLSCH_SEGMENTS
];
u
nsigned
char
*
channel_input_optim
[
MAX_NUM_DLSCH_SEGMENTS
];
u
int8_t
*
channel_input_optim
[
MAX_NUM_DLSCH_SEGMENTS
];
//double channel_output[68 * 384];
//double channel_output[68 * 384];
double
modulated_input
[
MAX_NUM_DLSCH_SEGMENTS
][
68
*
384
]
=
{
0
};
double
modulated_input
[
MAX_NUM_DLSCH_SEGMENTS
][
68
*
384
]
=
{
0
};
char
channel_output_fixed
[
MAX_NUM_DLSCH_SEGMENTS
][
68
*
384
]
=
{
0
};
int8_t
channel_output_fixed
[
MAX_NUM_DLSCH_SEGMENTS
][
68
*
384
]
=
{
0
};
short
BG
=
0
,
nrows
=
0
;
//,ncols;
short
BG
=
0
,
nrows
=
0
;
//,ncols;
int
no_punctured_columns
,
removed_bit
;
int
no_punctured_columns
,
removed_bit
;
int
i1
,
Zc
,
Kb
=
0
;
int
i1
,
Zc
,
Kb
=
0
;
...
@@ -149,12 +150,12 @@ int test_ldpc(short max_iterations,
...
@@ -149,12 +150,12 @@ int test_ldpc(short max_iterations,
// generate input block
// generate input block
for
(
int
j
=
0
;
j
<
MAX_NUM_DLSCH_SEGMENTS
;
j
++
)
{
for
(
int
j
=
0
;
j
<
MAX_NUM_DLSCH_SEGMENTS
;
j
++
)
{
test_input
[
j
]
=
(
u
nsigned
char
*
)
malloc16
(
sizeof
(
unsigned
char
)
*
block_length
/
8
);
test_input
[
j
]
=
(
u
int8_t
*
)
malloc16
(
sizeof
(
uint8_t
)
*
block_length
/
8
);
memset
(
test_input
[
j
],
0
,
sizeof
(
u
nsigned
char
)
*
block_length
/
8
);
memset
(
test_input
[
j
],
0
,
sizeof
(
u
int8_t
)
*
block_length
/
8
);
channel_input
[
j
]
=
(
u
nsigned
char
*
)
malloc16
(
sizeof
(
unsigned
char
)
*
68
*
384
);
channel_input
[
j
]
=
(
u
int8_t
*
)
malloc16
(
sizeof
(
uint8_t
)
*
68
*
384
);
memset
(
channel_input
[
j
],
0
,
sizeof
(
u
nsigned
char
)
*
68
*
384
);
memset
(
channel_input
[
j
],
0
,
sizeof
(
u
int8_t
)
*
68
*
384
);
channel_input_optim
[
j
]
=
(
u
nsigned
char
*
)
malloc16
(
sizeof
(
unsigned
char
)
*
68
*
384
);
channel_input_optim
[
j
]
=
(
u
int8_t
*
)
malloc16
(
sizeof
(
uint8_t
)
*
68
*
384
);
memset
(
channel_input_optim
[
j
],
0
,
sizeof
(
u
nsigned
char
)
*
68
*
384
);
memset
(
channel_input_optim
[
j
],
0
,
sizeof
(
u
int8_t
)
*
68
*
384
);
}
}
reset_meas
(
&
time
);
reset_meas
(
&
time
);
...
@@ -179,7 +180,7 @@ int test_ldpc(short max_iterations,
...
@@ -179,7 +180,7 @@ int test_ldpc(short max_iterations,
for
(
int
j
=
0
;
j
<
MAX_NUM_DLSCH_SEGMENTS
;
j
++
)
{
for
(
int
j
=
0
;
j
<
MAX_NUM_DLSCH_SEGMENTS
;
j
++
)
{
for
(
int
i
=
0
;
i
<
block_length
/
8
;
i
++
)
{
for
(
int
i
=
0
;
i
<
block_length
/
8
;
i
++
)
{
test_input
[
j
][
i
]
=
(
u
nsigned
char
)
rand
();
test_input
[
j
][
i
]
=
(
u
int8_t
)
rand
();
//test_input[j][i]=j%256;
//test_input[j][i]=j%256;
//test_input[j][i]=252;
//test_input[j][i]=252;
}
}
...
@@ -326,21 +327,21 @@ int test_ldpc(short max_iterations,
...
@@ -326,21 +327,21 @@ int test_ldpc(short max_iterations,
modulated_input
[
j
][
i
]
=-
1
.
0
;
///sqrt(2);
modulated_input
[
j
][
i
]
=-
1
.
0
;
///sqrt(2);
///channel_output[i] = modulated_input[i] + gaussdouble(0.0,1.0) * 1/sqrt(2*SNR);
///channel_output[i] = modulated_input[i] + gaussdouble(0.0,1.0) * 1/sqrt(2*SNR);
//channel_output_fixed[i] = (
char
) ((channel_output[i]*128)<0?(channel_output[i]*128-0.5):(channel_output[i]*128+0.5)); //fixed point 9-7
//channel_output_fixed[i] = (
int8_t
) ((channel_output[i]*128)<0?(channel_output[i]*128-0.5):(channel_output[i]*128+0.5)); //fixed point 9-7
//printf("llr[%d]=%d\n",i,channel_output_fixed[i]);
//printf("llr[%d]=%d\n",i,channel_output_fixed[i]);
//channel_output_fixed[i] = (
char
)quantize(sigma/4.0,(2.0*modulated_input[i]) - 1.0 + sigma*gaussdouble(0.0,1.0),qbits);
//channel_output_fixed[i] = (
int8_t
)quantize(sigma/4.0,(2.0*modulated_input[i]) - 1.0 + sigma*gaussdouble(0.0,1.0),qbits);
channel_output_fixed
[
j
][
i
]
=
(
char
)
quantize
(
sigma
/
4
.
0
/
4
.
0
,
modulated_input
[
j
][
i
]
+
sigma
*
gaussdouble
(
0
.
0
,
1
.
0
),
qbits
);
channel_output_fixed
[
j
][
i
]
=
(
int8_t
)
quantize
(
sigma
/
4
.
0
/
4
.
0
,
modulated_input
[
j
][
i
]
+
sigma
*
gaussdouble
(
0
.
0
,
1
.
0
),
qbits
);
//channel_output_fixed[i] = (
char
)quantize8bit(sigma/4.0,(2.0*modulated_input[i]) - 1.0 + sigma*gaussdouble(0.0,1.0));
//channel_output_fixed[i] = (
int8_t
)quantize8bit(sigma/4.0,(2.0*modulated_input[i]) - 1.0 + sigma*gaussdouble(0.0,1.0));
//printf("llr[%d]=%d\n",i,channel_output_fixed[i]);
//printf("llr[%d]=%d\n",i,channel_output_fixed[i]);
//printf("channel_output_fixed[%d]: %d\n",i,channel_output_fixed[i]);
//printf("channel_output_fixed[%d]: %d\n",i,channel_output_fixed[i]);
//Uncoded BER
//Uncoded BER
u
nsigned
char
channel_output_uncoded
=
channel_output_fixed
[
j
][
i
]
<
0
?
1
/* QPSK demod */
:
0
;
u
int8_t
channel_output_uncoded
=
channel_output_fixed
[
j
][
i
]
<
0
?
1
/* QPSK demod */
:
0
;
if
(
channel_output_uncoded
!=
channel_input_optim
[
j
][
i
-
2
*
Zc
])
if
(
channel_output_uncoded
!=
channel_input_optim
[
j
][
i
-
2
*
Zc
])
*
errors_bit_uncoded
=
(
*
errors_bit_uncoded
)
+
1
;
*
errors_bit_uncoded
=
(
*
errors_bit_uncoded
)
+
1
;
}
}
...
@@ -367,8 +368,8 @@ int test_ldpc(short max_iterations,
...
@@ -367,8 +368,8 @@ int test_ldpc(short max_iterations,
}
}
for
(
int
i
=
0
;
i
<
block_length
;
i
++
)
for
(
int
i
=
0
;
i
<
block_length
;
i
++
)
{
{
u
nsigned
char
estoutputbit
=
(
estimated_output
[
j
][
i
/
8
]
&
(
1
<<
(
i
&
7
)))
>>
(
i
&
7
);
u
int8_t
estoutputbit
=
(
estimated_output
[
j
][
i
/
8
]
&
(
1
<<
(
i
&
7
)))
>>
(
i
&
7
);
u
nsigned
char
inputbit
=
(
test_input
[
j
][
i
/
8
]
&
(
1
<<
(
i
&
7
)))
>>
(
i
&
7
);
// Further correct for multiple segments
u
int8_t
inputbit
=
(
test_input
[
j
][
i
/
8
]
&
(
1
<<
(
i
&
7
)))
>>
(
i
&
7
);
// Further correct for multiple segments
if
(
estoutputbit
!=
inputbit
)
if
(
estoutputbit
!=
inputbit
)
*
errors_bit
=
(
*
errors_bit
)
+
1
;
*
errors_bit
=
(
*
errors_bit
)
+
1
;
}
}
...
@@ -423,13 +424,13 @@ int test_ldpc(short max_iterations,
...
@@ -423,13 +424,13 @@ int test_ldpc(short max_iterations,
return
*
errors
;
return
*
errors
;
}
}
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
int8_t
*
argv
[])
{
{
unsigned
int
errors
,
errors_bit
,
crc_misses
;
unsigned
int
errors
,
errors_bit
,
crc_misses
;
double
errors_bit_uncoded
;
double
errors_bit_uncoded
;
short
block_length
=
8448
;
// decoder supports length: 1201 -> 1280, 2401 -> 2560
short
block_length
=
8448
;
// decoder supports length: 1201 -> 1280, 2401 -> 2560
char
*
ldpc_version
=
NULL
;
/* version of the ldpc decoder library to use (XXX suffix to use when loading libldpc_XXX.so */
int8_t
*
ldpc_version
=
NULL
;
/* version of the ldpc decoder library to use (XXX suffix to use when loading libldpc_XXX.so */
short
max_iterations
=
5
;
short
max_iterations
=
5
;
int
n_segments
=
1
;
int
n_segments
=
1
;
//double rate=0.333;
//double rate=0.333;
...
@@ -437,7 +438,7 @@ int main(int argc, char *argv[])
...
@@ -437,7 +438,7 @@ int main(int argc, char *argv[])
int
nom_rate
=
1
;
int
nom_rate
=
1
;
int
denom_rate
=
3
;
int
denom_rate
=
3
;
double
SNR0
=-
2
.
0
,
SNR
,
SNR_lin
;
double
SNR0
=-
2
.
0
,
SNR
,
SNR_lin
;
u
nsigned
char
qbits
=
8
;
u
int8_t
qbits
=
8
;
unsigned
int
decoded_errors
[
10000
];
// initiate the size of matrix equivalent to size of SNR
unsigned
int
decoded_errors
[
10000
];
// initiate the size of matrix equivalent to size of SNR
int
c
,
i
=
0
,
i1
=
0
;
int
c
,
i
=
0
,
i1
=
0
;
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
View file @
4cd25ba6
...
@@ -112,7 +112,7 @@
...
@@ -112,7 +112,7 @@
#define NR_LDPC_ENABLE_PARITY_CHECK
#define NR_LDPC_ENABLE_PARITY_CHECK
//
#define NR_LDPC_PROFILER_DETAIL
#define NR_LDPC_PROFILER_DETAIL
#ifdef NR_LDPC_DEBUG_MODE
#ifdef NR_LDPC_DEBUG_MODE
#include "nrLDPC_tools/nrLDPC_debug.h"
#include "nrLDPC_tools/nrLDPC_debug.h"
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/generator_cnProc/cnProc_gen_BG1_avx2.c
View file @
4cd25ba6
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
#include <stdint.h>
#include <stdint.h>
#include "../../nrLDPCdecoder_defs.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
)
void
nrLDPC_cnProc_BG1_generator_AVX2
(
const
char
*
dir
,
int
R
)
{
{
const
char
*
ratestr
[
3
]
=
{
"13"
,
"23"
,
"89"
};
const
char
*
ratestr
[
3
]
=
{
"13"
,
"23"
,
"89"
};
...
@@ -87,8 +89,8 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -87,8 +89,8 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
const
uint8_t
lut_idxCnProcG3
[
3
][
2
]
=
{{
12
,
24
},
{
0
,
24
},
{
0
,
12
}};
const
uint8_t
lut_idxCnProcG3
[
3
][
2
]
=
{{
12
,
24
},
{
0
,
24
},
{
0
,
12
}};
fprintf
(
fd
,
" simde__m256i ymm0, min, sgn,ones,maxLLR;
\n
"
);
fprintf
(
fd
,
" simde__m256i ymm0, min, sgn,ones,maxLLR;
\n
"
);
fprintf
(
fd
,
" ones = simde_mm256_set1_epi8((
char
)1);
\n
"
);
fprintf
(
fd
,
" ones = simde_mm256_set1_epi8((
int8_t
)1);
\n
"
);
fprintf
(
fd
,
" maxLLR = simde_mm256_set1_epi8((
char
)127);
\n
"
);
fprintf
(
fd
,
" maxLLR = simde_mm256_set1_epi8((
int8_t
)127);
\n
"
);
fprintf
(
fd
,
" uint32_t M;
\n
"
);
fprintf
(
fd
,
" uint32_t M;
\n
"
);
...
@@ -122,7 +124,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -122,7 +124,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
// 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
]);
fprintf
(
fd
,
" ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];
\n
"
,(
lut_startAddrCnGroups
[
0
]
>>
5
)
+
lut_idxCnProcG3
[
j
][
0
]);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(ones, ymm0);
\n
"
);
#endif
// min = simde_mm256_abs_epi8(ymm0);
// min = simde_mm256_abs_epi8(ymm0);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
...
@@ -134,18 +140,22 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -134,18 +140,22 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(sgn, ymm0);
\n
"
);
#endif
// Store result
// Store result
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
// 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
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, maxLLR);
\n
"
);
#endif
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++;
// p_cnProcBufResBit++;
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
0
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
0
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
fprintf
(
fd
,
" }
\n
"
);
fprintf
(
fd
,
" }
\n
"
);
}
}
}
}
// =====================================================================
// =====================================================================
// Process group with 4 BNs
// Process group with 4 BNs
fprintf
(
fd
,
"//Process group with 4 BNs
\n
"
);
fprintf
(
fd
,
"//Process group with 4 BNs
\n
"
);
...
@@ -181,7 +191,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -181,7 +191,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
// 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
]);
fprintf
(
fd
,
" ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];
\n
"
,(
lut_startAddrCnGroups
[
1
]
>>
5
)
+
lut_idxCnProcG4
[
j
][
0
]);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(ones, ymm0);
\n
"
);
#endif
// min = simde_mm256_abs_epi8(ymm0);
// min = simde_mm256_abs_epi8(ymm0);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
...
@@ -195,12 +209,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -195,12 +209,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(sgn, ymm0);
\n
"
);
#endif
}
}
// Store result
// Store result
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
// 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
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, maxLLR);
\n
"
);
#endif
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++;
// p_cnProcBufResBit++;
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
1
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
1
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
...
@@ -246,7 +266,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -246,7 +266,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
// 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
]);
fprintf
(
fd
,
" ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];
\n
"
,(
lut_startAddrCnGroups
[
2
]
>>
5
)
+
lut_idxCnProcG5
[
j
][
0
]);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(ones, ymm0);
\n
"
);
#endif
// min = simde_mm256_abs_epi8(ymm0);
// min = simde_mm256_abs_epi8(ymm0);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
...
@@ -260,12 +284,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -260,12 +284,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(sgn, ymm0);
\n
"
);
#endif
}
}
// Store result
// Store result
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
// 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
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, maxLLR);
\n
"
);
#endif
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++;
// p_cnProcBufResBit++;
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
2
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
2
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
...
@@ -311,7 +341,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -311,7 +341,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
// 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
]);
fprintf
(
fd
,
" ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];
\n
"
,(
lut_startAddrCnGroups
[
3
]
>>
5
)
+
lut_idxCnProcG6
[
j
][
0
]);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(ones, ymm0);
\n
"
);
#endif
// min = simde_mm256_abs_epi8(ymm0);
// min = simde_mm256_abs_epi8(ymm0);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
...
@@ -325,12 +359,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -325,12 +359,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(sgn, ymm0);
\n
"
);
#endif
}
}
// Store result
// Store result
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
// 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
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, maxLLR);
\n
"
);
#endif
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++;
// p_cnProcBufResBit++;
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
3
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
3
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
...
@@ -379,7 +419,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -379,7 +419,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
// 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
]);
fprintf
(
fd
,
" ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];
\n
"
,(
lut_startAddrCnGroups
[
4
]
>>
5
)
+
lut_idxCnProcG7
[
j
][
0
]);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(ones, ymm0);
\n
"
);
#endif
// min = simde_mm256_abs_epi8(ymm0);
// min = simde_mm256_abs_epi8(ymm0);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
...
@@ -393,12 +437,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -393,12 +437,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(sgn, ymm0);
\n
"
);
#endif
}
}
// Store result
// Store result
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
// 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
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, maxLLR);
\n
"
);
#endif
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++;
// p_cnProcBufResBit++;
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
4
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
4
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
...
@@ -448,7 +498,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -448,7 +498,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
// 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
]);
fprintf
(
fd
,
" ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];
\n
"
,(
lut_startAddrCnGroups
[
5
]
>>
5
)
+
lut_idxCnProcG8
[
j
][
0
]);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(ones, ymm0);
\n
"
);
#endif
// min = simde_mm256_abs_epi8(ymm0);
// min = simde_mm256_abs_epi8(ymm0);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
...
@@ -462,12 +516,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -462,12 +516,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(sgn, ymm0);
\n
"
);
#endif
}
}
// Store result
// Store result
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
// 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
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, maxLLR);
\n
"
);
#endif
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++;
// p_cnProcBufResBit++;
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
5
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
5
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
...
@@ -517,7 +577,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -517,7 +577,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
// 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
]);
fprintf
(
fd
,
" ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];
\n
"
,(
lut_startAddrCnGroups
[
6
]
>>
5
)
+
lut_idxCnProcG9
[
j
][
0
]);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(ones, ymm0);
\n
"
);
#endif
// min = simde_mm256_abs_epi8(ymm0);
// min = simde_mm256_abs_epi8(ymm0);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
...
@@ -531,12 +595,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -531,12 +595,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(sgn, ymm0);
\n
"
);
#endif
}
}
// Store result
// Store result
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
// 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
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, maxLLR);
\n
"
);
#endif
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++;
// p_cnProcBufResBit++;
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
6
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
6
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
...
@@ -587,7 +657,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -587,7 +657,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
// 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
]);
fprintf
(
fd
,
" ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];
\n
"
,(
lut_startAddrCnGroups
[
7
]
>>
5
)
+
lut_idxCnProcG10
[
j
][
0
]);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(ones, ymm0);
\n
"
);
#endif
// min = simde_mm256_abs_epi8(ymm0);
// min = simde_mm256_abs_epi8(ymm0);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
...
@@ -601,12 +675,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -601,12 +675,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(sgn, ymm0);
\n
"
);
#endif
}
}
// Store result
// Store result
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
// 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
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, maxLLR);
\n
"
);
#endif
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++;
// p_cnProcBufResBit++;
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
7
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
7
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
...
@@ -630,7 +710,7 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -630,7 +710,7 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
{
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
,
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
}};
{
0
,
48
,
96
,
144
,
192
,
240
,
288
,
336
,
384
,
432
,
480
,
528
,
576
,
624
,
672
,
720
,
768
,
816
}};
if
(
lut_numCnInCnGroups
[
8
]
>
0
)
if
(
lut_numCnInCnGroups
[
8
]
>
0
)
{
{
// Number of groups of 32 CNs for parallel processing
// Number of groups of 32 CNs for parallel processing
...
@@ -660,7 +740,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -660,7 +740,11 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
// ymm0 = p_cnProcBuf[lut_idxCnProcG3[j][0] + i];
// 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
]);
fprintf
(
fd
,
" ymm0 = ((simde__m256i*)cnProcBuf)[%d+i];
\n
"
,(
lut_startAddrCnGroups
[
8
]
>>
5
)
+
lut_idxCnProcG19
[
j
][
0
]);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
// sgn = simde_mm256_sign_epi8(ones, ymm0);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(ones, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(ones, ymm0);
\n
"
);
#endif
// min = simde_mm256_abs_epi8(ymm0);
// min = simde_mm256_abs_epi8(ymm0);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_abs_epi8(ymm0);
\n
"
);
...
@@ -674,12 +758,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
...
@@ -674,12 +758,18 @@ void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, simde_mm256_abs_epi8(ymm0));
\n
"
);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
// sgn = simde_mm256_sign_epi8(sgn, ymm0);
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#ifndef AVOID_MM256_SIGN
fprintf
(
fd
,
" sgn = simde_mm256_sign_epi8(sgn, ymm0);
\n
"
);
#else
fprintf
(
fd
,
" sgn = simde_mm256_xor_si256(sgn, ymm0);
\n
"
);
#endif
}
}
// Store result
// Store result
// min = simde_mm256_min_epu8(min, maxLLR); // 128 in epi8 is -127
// 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
"
);
fprintf
(
fd
,
" min = simde_mm256_min_epu8(min, maxLLR);
\n
"
);
#endif
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// *p_cnProcBufResBit = simde_mm256_sign_epi8(min, sgn);
// p_cnProcBufResBit++;
// p_cnProcBufResBit++;
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
8
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
fprintf
(
fd
,
" ((simde__m256i*)cnProcBufRes)[%d+i] = simde_mm256_sign_epi8(min, sgn);
\n
"
,(
lut_startAddrCnGroups
[
8
]
>>
5
)
+
(
j
*
bitOffsetInGroup
));
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment