mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 09:59:42 +00:00
Cleanup includes for CRC32 and CRC32C
This commit is contained in:
parent
65222dfe9e
commit
3ff04f1bf0
16
crc-simd.cpp
16
crc-simd.cpp
@ -10,23 +10,17 @@
|
||||
#include "config.h"
|
||||
#include "misc.h"
|
||||
|
||||
// We set CRYPTOPP_ARM_CRC32_AVAILABLE based on compiler version.
|
||||
// If the crc is not available, then we have to disable it here.
|
||||
// Android does not provide -march=armv8-a+crc or -march=armv8.1-a+crc, so
|
||||
// it looks like we will have to disable CRC acceleration of their devices.
|
||||
#if !(defined(__ARM_FEATURE_CRC32) || defined(_MSC_VER)) || defined(__ANDROID__)
|
||||
# undef CRYPTOPP_ARM_CRC32_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if (CRYPTOPP_SSE42_AVAILABLE)
|
||||
# include <nmmintrin.h>
|
||||
#endif
|
||||
|
||||
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
|
||||
# include <arm_neon.h>
|
||||
# if defined(CRYPTOPP_ARM_ACLE_AVAILABLE)
|
||||
# include <arm_acle.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CRYPTOPP_ARM_ACLE_AVAILABLE)
|
||||
# include <stdint.h>
|
||||
# include <arm_acle.h>
|
||||
#endif
|
||||
|
||||
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
|
||||
|
13
crc.cpp
13
crc.cpp
@ -8,13 +8,6 @@
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
// We set CRYPTOPP_ARM_CRC32_AVAILABLE based on compiler version.
|
||||
// Android does not provide -march=armv8-a+crc or -march=armv8.1-a+crc, so
|
||||
// it looks like we will have to disable CRC acceleration of their devices.
|
||||
#if defined(__ANDROID__)
|
||||
# undef CRYPTOPP_ARM_CRC32_AVAILABLE
|
||||
#endif
|
||||
|
||||
// crc-simd.cpp
|
||||
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
|
||||
extern void CRC32_Update_ARMV8(const byte *s, size_t n, word32& c);
|
||||
@ -164,8 +157,7 @@ void CRC32::Update(const byte *s, size_t n)
|
||||
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
||||
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
||||
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
||||
n -= 4;
|
||||
s += 4;
|
||||
n -= 4; s += 4;
|
||||
}
|
||||
|
||||
while (n--)
|
||||
@ -330,8 +322,7 @@ void CRC32C::Update(const byte *s, size_t n)
|
||||
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
||||
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
||||
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
|
||||
n -= 4;
|
||||
s += 4;
|
||||
n -= 4; s += 4;
|
||||
}
|
||||
|
||||
while (n--)
|
||||
|
Loading…
Reference in New Issue
Block a user