Condition compilation of CLMUL to IA32/AMD64 and check if it's available before executing.

This commit is contained in:
2021-09-26 17:37:50 +01:00
parent bf1b026a7e
commit 6b45dd6e5b
9 changed files with 98 additions and 68 deletions

View File

@@ -1,3 +1,6 @@
#if defined(__x86_64__) || defined(__amd64) || defined(_M_AMD64) || defined(_M_X64) || defined(__I386__) || \
defined(__i386__) || defined(__THW_INTEL) || defined(_M_IX86)
#include <inttypes.h>
#include <smmintrin.h>
#include <wmmintrin.h>
@@ -183,4 +186,6 @@ CLMUL uint64_t crc64_clmul(uint64_t crc, const uint8_t* data, size_t length)
#else
return ~(((uint64_t)(uint32_t)_mm_extract_epi32(T2, 3) << 32) | (uint64_t)(uint32_t)_mm_extract_epi32(T2, 2));
#endif
}
}
#endif