merge develop and fix CI cross compilation issue
This commit is contained in:
@@ -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(commonOpts "-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic")
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS
|
set(CMAKE_C_FLAGS
|
||||||
"${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=gnu99 -funroll-loops")
|
"${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=gnu99 -funroll-loops -mpclmul")
|
||||||
set(CMAKE_CXX_FLAGS
|
set(CMAKE_CXX_FLAGS
|
||||||
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11")
|
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11 -mpclmul")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -150,11 +150,12 @@ can use SIMD optimized Intel CRC for LTE/NR 24a/24b variants
|
|||||||
unsigned int crc24a (unsigned char * inptr,
|
unsigned int crc24a (unsigned char * inptr,
|
||||||
int bitlen)
|
int bitlen)
|
||||||
{
|
{
|
||||||
|
|
||||||
int octetlen = bitlen / 8; /* Change in octets */
|
int octetlen = bitlen / 8; /* Change in octets */
|
||||||
#ifndef USE_INTEL_CRC
|
|
||||||
|
if ( bitlen % 8 || !__builtin_cpu_supports ("pclmul") ) {
|
||||||
unsigned int crc = 0;
|
unsigned int crc = 0;
|
||||||
int resbit= (bitlen % 8);
|
int resbit= (bitlen % 8);
|
||||||
|
|
||||||
while (octetlen-- > 0) {
|
while (octetlen-- > 0) {
|
||||||
// printf("crc24a: in %x => crc %x\n",crc,*inptr);
|
// printf("crc24a: in %x => crc %x\n",crc,*inptr);
|
||||||
crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)];
|
crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)];
|
||||||
@@ -163,10 +164,10 @@ unsigned int crc24a (unsigned char * inptr,
|
|||||||
if (resbit > 0)
|
if (resbit > 0)
|
||||||
crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
|
crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
|
||||||
return crc;
|
return crc;
|
||||||
#else
|
} else {
|
||||||
return crc32_calc_pclmulqdq(inptr, octetlen, 0,
|
return crc32_calc_pclmulqdq(inptr, octetlen, 0,
|
||||||
<e_crc24a_pclmulqdq);
|
<e_crc24a_pclmulqdq);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,10 +184,12 @@ static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq, 16) = {
|
|||||||
unsigned int crc24b (unsigned char * inptr,
|
unsigned int crc24b (unsigned char * inptr,
|
||||||
int bitlen)
|
int bitlen)
|
||||||
{
|
{
|
||||||
int octetlen= bitlen / 8;
|
int octetlen = bitlen / 8; /* Change in octets */
|
||||||
#ifndef USE_INTEL_CRC
|
|
||||||
|
if ( bitlen % 8 || !__builtin_cpu_supports ("pclmul") ) {
|
||||||
unsigned int crc = 0;
|
unsigned int crc = 0;
|
||||||
int resbit = (bitlen % 8);
|
int resbit = (bitlen % 8);
|
||||||
|
|
||||||
while (octetlen-- > 0) {
|
while (octetlen-- > 0) {
|
||||||
// printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]);
|
// printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]);
|
||||||
crc = (crc << 8) ^ crc24bTable[(*inptr++) ^ (crc >> 24)];
|
crc = (crc << 8) ^ crc24bTable[(*inptr++) ^ (crc >> 24)];
|
||||||
@@ -196,10 +199,10 @@ unsigned int crc24b (unsigned char * inptr,
|
|||||||
crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
|
crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
|
||||||
|
|
||||||
return crc;
|
return crc;
|
||||||
#else
|
} else {
|
||||||
return crc32_calc_pclmulqdq(inptr, octetlen, 0,
|
return crc32_calc_pclmulqdq(inptr, octetlen, 0,
|
||||||
<e_crc24b_pclmulqdq);
|
<e_crc24b_pclmulqdq);
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int crc24c (unsigned char * inptr,
|
unsigned int crc24c (unsigned char * inptr,
|
||||||
|
|||||||
Reference in New Issue
Block a user