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
301a008c
Commit
301a008c
authored
Dec 09, 2021
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change runtime to compilation time detection of carryless mul
parent
9f813916
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+3
-3
openair1/PHY/CODING/crc_byte.c
openair1/PHY/CODING/crc_byte.c
+19
-5
No files found.
cmake_targets/CMakeLists.txt
View file @
301a008c
...
...
@@ -294,7 +294,7 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
set
(
COMPILATION_AVX2
"False"
)
endif
()
if
(
CPUINFO MATCHES
"sse4_1"
)
set
(
C_FLAGS_PROCESSOR
"
${
C_FLAGS_PROCESSOR
}
-msse4.1"
)
set
(
C_FLAGS_PROCESSOR
"
${
C_FLAGS_PROCESSOR
}
-msse4.1
-mpclmul
"
)
endif
()
if
(
CPUINFO MATCHES
"ssse3"
)
set
(
C_FLAGS_PROCESSOR
"
${
C_FLAGS_PROCESSOR
}
-mssse3"
)
...
...
@@ -322,9 +322,9 @@ add_definitions("-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAV
set
(
commonOpts
"-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
C_FLAGS_PROCESSOR
}
${
commonOpts
}
-std=gnu99 -funroll-loops
-mpclmul
"
)
"
${
CMAKE_C_FLAGS
}
${
C_FLAGS_PROCESSOR
}
${
commonOpts
}
-std=gnu99 -funroll-loops"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
C_FLAGS_PROCESSOR
}
${
commonOpts
}
-std=c++11
-mpclmul
"
)
"
${
CMAKE_CXX_FLAGS
}
${
C_FLAGS_PROCESSOR
}
${
commonOpts
}
-std=c++11"
)
...
...
openair1/PHY/CODING/crc_byte.c
View file @
301a008c
...
...
@@ -30,10 +30,13 @@
Modified in June, 2001, to include the length non multiple of 8
*/
#define USE_INTEL_CRC __SSE4_1__
#include "coding_defs.h"
#include "assertions.h"
#ifdef USE_INTEL_CRC
#include "crc.h"
#endif
/*ref 36-212 v8.6.0 , pp 8-9 */
/* the highest degree is set by default */
...
...
@@ -94,6 +97,7 @@ static unsigned short crc11Table[256];
static
unsigned
char
crc8Table
[
256
];
static
unsigned
char
crc6Table
[
256
];
#ifdef USE_INTEL_CRC
static
DECLARE_ALIGNED
(
struct
crc_pclmulqdq_ctx
lte_crc24a_pclmulqdq
,
16
)
=
{
0x64e4d700
,
/**< k1 */
0x2c8c9d00
,
/**< k2 */
...
...
@@ -113,6 +117,7 @@ DECLARE_ALIGNED(const uint8_t crc_xmm_shift_tab[48], 16) = {
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
};
#endif
void
crcTableInit
(
void
)
{
...
...
@@ -128,10 +133,11 @@ void crcTableInit (void)
crc8Table
[
c
]
=
(
unsigned
char
)
(
crcbit
(
&
c
,
1
,
poly8
)
>>
24
);
crc6Table
[
c
]
=
(
unsigned
char
)
(
crcbit
(
&
c
,
1
,
poly6
)
>>
24
);
}
while
(
++
c
);
if
(
__builtin_cpu_supports
(
"pclmul"
))
#ifdef USE_INTEL_CRC
crc_xmm_be_le_swap128
=
_mm_setr_epi32
(
0x0c0d0e0f
,
0x08090a0b
,
0x04050607
,
0x00010203
);
#endif
}
/*********************************************************
...
...
@@ -146,7 +152,7 @@ unsigned int crc24a (unsigned char * inptr,
{
int
octetlen
=
bitlen
/
8
;
/* Change in octets */
if
(
bitlen
%
8
||
!
__builtin_cpu_supports
(
"pclmul"
)
)
{
if
(
bitlen
%
8
||
!
USE_INTEL_CRC
)
{
unsigned
int
crc
=
0
;
int
resbit
=
(
bitlen
%
8
);
...
...
@@ -158,13 +164,17 @@ unsigned int crc24a (unsigned char * inptr,
if
(
resbit
>
0
)
crc
=
(
crc
<<
resbit
)
^
crc24aTable
[((
*
inptr
)
>>
(
8
-
resbit
))
^
(
crc
>>
(
32
-
resbit
))];
return
crc
;
}
else
{
}
#if USE_INTEL_CRC
else
{
return
crc32_calc_pclmulqdq
(
inptr
,
octetlen
,
0
,
&
lte_crc24a_pclmulqdq
);
}
#endif
}
#ifdef USE_INTEL_CRC
static
DECLARE_ALIGNED
(
struct
crc_pclmulqdq_ctx
lte_crc24b_pclmulqdq
,
16
)
=
{
0x80140500
,
/**< k1 */
0x42000100
,
/**< k2 */
...
...
@@ -173,12 +183,13 @@ static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq, 16) = {
0x80006300
,
/**< p */
0ULL
/**< res */
};
#endif
unsigned
int
crc24b
(
unsigned
char
*
inptr
,
int
bitlen
)
{
int
octetlen
=
bitlen
/
8
;
/* Change in octets */
if
(
bitlen
%
8
||
!
__builtin_cpu_supports
(
"pclmul"
)
)
{
if
(
bitlen
%
8
||
!
USE_INTEL_CRC
)
{
unsigned
int
crc
=
0
;
int
resbit
=
(
bitlen
%
8
);
...
...
@@ -191,10 +202,13 @@ unsigned int crc24b (unsigned char * inptr,
crc
=
(
crc
<<
resbit
)
^
crc24bTable
[((
*
inptr
)
>>
(
8
-
resbit
))
^
(
crc
>>
(
32
-
resbit
))];
return
crc
;
}
else
{
}
#if USE_INTEL_CRC
else
{
return
crc32_calc_pclmulqdq
(
inptr
,
octetlen
,
0
,
&
lte_crc24b_pclmulqdq
);
}
#endif
}
unsigned
int
crc24c
(
unsigned
char
*
inptr
,
...
...
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