Fix compilation in MSVC (x86).

This commit is contained in:
2021-10-12 23:26:48 +01:00
parent 09f91a4116
commit 6c10f3e58d
8 changed files with 9 additions and 10 deletions

View File

@@ -78,7 +78,7 @@ AARU_EXPORT int AARU_CALL adler32_update(adler32_ctx* ctx, const uint8_t* data,
return 0; return 0;
} }
void adler32_slicing(uint16_t* sum1, uint16_t* sum2, const unsigned char* data, long len) AARU_EXPORT void AARU_CALL adler32_slicing(uint16_t* sum1, uint16_t* sum2, const unsigned char* data, long len)
{ {
uint32_t s1 = *sum1; uint32_t s1 = *sum1;
uint32_t s2 = *sum2; uint32_t s2 = *sum2;

View File

@@ -38,8 +38,8 @@ AARU_EXPORT void AARU_CALL adler32_slicing(uint16_t* sum1, uint16_t* sum
#if defined(__x86_64__) || defined(__amd64) || defined(_M_AMD64) || defined(_M_X64) || defined(__I386__) || \ #if defined(__x86_64__) || defined(__amd64) || defined(_M_AMD64) || defined(_M_X64) || defined(__I386__) || \
defined(__i386__) || defined(__THW_INTEL) || defined(_M_IX86) defined(__i386__) || defined(__THW_INTEL) || defined(_M_IX86)
AARU_EXPORT void AARU_CALL adler32_ssse3(uint16_t* sum1, uint16_t* sum2, const unsigned char* buf, long len); AARU_EXPORT SSSE3 void AARU_CALL adler32_ssse3(uint16_t* sum1, uint16_t* sum2, const unsigned char* buf, long len);
AARU_EXPORT void AARU_CALL adler32_avx2(uint16_t* sum1, uint16_t* sum2, const unsigned char* buf, long len); AARU_EXPORT AVX2 void AARU_CALL adler32_avx2(uint16_t* sum1, uint16_t* sum2, const unsigned char* buf, long len);
#endif #endif

View File

@@ -12,7 +12,7 @@
#include "adler32.h" #include "adler32.h"
#include "simd.h" #include "simd.h"
AVX2 void adler32_avx2(uint16_t* sum1, uint16_t* sum2, const unsigned char* buf, long len) AARU_EXPORT AVX2 void AARU_CALL adler32_avx2(uint16_t* sum1, uint16_t* sum2, const unsigned char* buf, long len)
{ {
uint32_t s1 = *sum1; uint32_t s1 = *sum1;
uint32_t s2 = *sum2; uint32_t s2 = *sum2;

View File

@@ -51,7 +51,7 @@
#include "library.h" #include "library.h"
#include "adler32.h" #include "adler32.h"
SSSE3 void adler32_ssse3(uint16_t* sum1, uint16_t* sum2, const unsigned char* buf, long len) AARU_EXPORT SSSE3 void AARU_CALL adler32_ssse3(uint16_t* sum1, uint16_t* sum2, const unsigned char* buf, long len)
{ {
uint32_t s1 = *sum1; uint32_t s1 = *sum1;
uint32_t s2 = *sum2; uint32_t s2 = *sum2;

View File

@@ -67,7 +67,7 @@ AARU_EXPORT int AARU_CALL crc32_update(crc32_ctx* ctx, const uint8_t* data, uint
return 0; return 0;
} }
void crc32_slicing(uint32_t* crc, const unsigned char* data, long len) AARU_EXPORT void AARU_CALL crc32_slicing(uint32_t* crc, const unsigned char* data, long len)
{ {
// Unroll according to Intel slicing by uint8_t // Unroll according to Intel slicing by uint8_t
// http://www.intel.com/technology/comms/perfnet/download/CRC_generators.pdf // http://www.intel.com/technology/comms/perfnet/download/CRC_generators.pdf

View File

@@ -237,8 +237,7 @@ static void partial_fold(const size_t len,
*/ */
#define XOR_INITIAL(where) ONCE(where = _mm_xor_si128(where, xmm_initial)) #define XOR_INITIAL(where) ONCE(where = _mm_xor_si128(where, xmm_initial))
CLMUL AARU_EXPORT CLMUL uint32_t AARU_CALL crc32_clmul(const uint8_t* src, long len, uint32_t initial_crc)
uint32_t crc32_clmul(const uint8_t* src, long len, uint32_t initial_crc)
{ {
unsigned long algn_diff; unsigned long algn_diff;
__m128i xmm_t0, xmm_t1, xmm_t2, xmm_t3; __m128i xmm_t0, xmm_t1, xmm_t2, xmm_t3;

View File

@@ -242,7 +242,7 @@ AARU_EXPORT void AARU_CALL crc64_slicing(uint64_t* crc, const uint8_t* dat
#if defined(__x86_64__) || defined(__amd64) || defined(_M_AMD64) || defined(_M_X64) || defined(__I386__) || \ #if defined(__x86_64__) || defined(__amd64) || defined(_M_AMD64) || defined(_M_X64) || defined(__I386__) || \
defined(__i386__) || defined(__THW_INTEL) || defined(_M_IX86) defined(__i386__) || defined(__THW_INTEL) || defined(_M_IX86)
AARU_EXPORT uint64_t AARU_CALL crc64_clmul(uint64_t crc, const uint8_t* data, long length); AARU_EXPORT CLMUL uint64_t AARU_CALL crc64_clmul(uint64_t crc, const uint8_t* data, long length);
#endif #endif
#if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM) #if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM)

View File

@@ -64,7 +64,7 @@ CLMUL static __m128i fold(__m128i in, __m128i foldConstants)
return _mm_xor_si128(_mm_clmulepi64_si128(in, foldConstants, 0x00), _mm_clmulepi64_si128(in, foldConstants, 0x11)); return _mm_xor_si128(_mm_clmulepi64_si128(in, foldConstants, 0x00), _mm_clmulepi64_si128(in, foldConstants, 0x11));
} }
CLMUL uint64_t crc64_clmul(uint64_t crc, const uint8_t* data, long length) AARU_EXPORT CLMUL uint64_t AARU_CALL crc64_clmul(uint64_t crc, const uint8_t* data, long length)
{ {
const uint64_t k1 = 0xe05dd497ca393ae4; // bitReflect(expMod65(128 + 64, poly, 1)) << 1; const uint64_t k1 = 0xe05dd497ca393ae4; // bitReflect(expMod65(128 + 64, poly, 1)) << 1;
const uint64_t k2 = 0xdabe95afc7875f40; // bitReflect(expMod65(128, poly, 1)) << 1; const uint64_t k2 = 0xdabe95afc7875f40; // bitReflect(expMod65(128, poly, 1)) << 1;