Tidy up hardware crc32 implementations

This commit is contained in:
King_DuckZ 2022-06-03 15:54:45 +02:00
commit 730f4f45ef
10 changed files with 217 additions and 239 deletions

View file

@ -69,7 +69,7 @@ namespace wren {
constexpr inline auto g_polynomial_table = PolynomialTable<Polynomial>::table;
template <std::uint32_t Polynomial, std::uint32_t XorIn=0xffffffff, std::uint32_t XorOut=XorIn>
constexpr std::uint32_t crc32 (const char* data, std::size_t len, std::uint32_t crc) {
constexpr std::uint32_t crc32 (const char* data, std::size_t len, std::uint32_t crc) noexcept {
//static_assert(g_polynomial_table<Polynomial>[0b10000000] == Polynomial);
crc ^= XorIn;
for (std::size_t z = 0; z < len; ++z) {