Path: blob/master/Utilities/cmliblzma/liblzma/check/crc32_table.c
3153 views
// SPDX-License-Identifier: 0BSD12///////////////////////////////////////////////////////////////////////////////3//4/// \file crc32_table.c5/// \brief Precalculated CRC32 table with correct endianness6//7// Author: Lasse Collin8//9///////////////////////////////////////////////////////////////////////////////1011#include "common.h"121314// FIXME: Compared to crc_common.h this has to check for __x86_64__ too15// so that in 32-bit builds crc32_x86.S won't break due to a missing table.16#if defined(HAVE_USABLE_CLMUL) && ((defined(__x86_64__) && defined(__SSSE3__) \17&& defined(__SSE4_1__) && defined(__PCLMUL__)) \18|| (defined(__e2k__) && __iset__ >= 6))19# define NO_CRC32_TABLE2021#elif defined(HAVE_ARM64_CRC32) \22&& !defined(WORDS_BIGENDIAN) \23&& defined(__ARM_FEATURE_CRC32)24# define NO_CRC32_TABLE25#endif262728#if !defined(HAVE_ENCODERS) && defined(NO_CRC32_TABLE)29// No table needed. Use a typedef to avoid an empty translation unit.30typedef void lzma_crc32_dummy;3132#else33// Having the declaration here silences clang -Wmissing-variable-declarations.34extern const uint32_t lzma_crc32_table[8][256];3536# ifdef WORDS_BIGENDIAN37# include "crc32_table_be.h"38# else39# include "crc32_table_le.h"40# endif41#endif424344