Skip to content

Commit

Permalink
Merge pull request #4 from kadena-io/johnw/aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiegley authored Nov 18, 2022
2 parents 8f7619f + 9bb1999 commit cd64b8d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions vendored/rocksdb-haskell-kadena/rocksdb-6.29.3/util/crc32c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

#endif

#if defined(HAVE_ARM64_CRC)
#if defined(__linux__) && defined(HAVE_ARM64_CRC)
bool pmull_runtime_flag = false;
#endif

Expand Down Expand Up @@ -499,7 +499,7 @@ static bool isAltiVec() {
}
#endif

#if defined(HAVE_ARM64_CRC)
#if defined(__linux__) && defined(HAVE_ARM64_CRC)
uint32_t ExtendARMImpl(uint32_t crc, const char *buf, size_t size) {
return crc32c_arm64(crc, (const unsigned char *)buf, size);
}
Expand All @@ -520,11 +520,14 @@ std::string IsFastCrc32Supported() {
arch = "PPC";
#endif
#elif defined(HAVE_ARM64_CRC)
#if defined(__linux__)
if (crc32c_runtime_check()) {
has_fast_crc = true;
arch = "Arm64";
pmull_runtime_flag = crc32c_pmull_runtime_check();
} else {
} else
#endif
{
has_fast_crc = false;
arch = "Arm64";
}
Expand Down Expand Up @@ -1253,10 +1256,13 @@ static inline Function Choose_Extend() {
#ifdef HAVE_POWER8
return isAltiVec() ? ExtendPPCImpl : ExtendImpl<Slow_CRC32>;
#elif defined(HAVE_ARM64_CRC)
#if defined(__linux__)
if(crc32c_runtime_check()) {
pmull_runtime_flag = crc32c_pmull_runtime_check();
return ExtendARMImpl;
} else {
} else
#endif
{
return ExtendImpl<Slow_CRC32>;
}
#else
Expand Down

0 comments on commit cd64b8d

Please sign in to comment.