crc64_table.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. /// \file crc64_table.c
  4. /// \brief Precalculated CRC64 table with correct endianness
  5. //
  6. // Author: Lasse Collin
  7. //
  8. // This file has been put into the public domain.
  9. // You can do whatever you want with this file.
  10. //
  11. ///////////////////////////////////////////////////////////////////////////////
  12. #include "common.h"
  13. // FIXME: Compared to crc64_fast.c this has to check for __x86_64__ too
  14. // so that in 32-bit builds crc64_x86.S won't break due to a missing table.
  15. #if (defined(__x86_64__) && defined(__SSSE3__) \
  16. && defined(__SSE4_1__) && defined(__PCLMUL__)) \
  17. || (defined(__e2k__) && __iset__ >= 6)
  18. // No table needed but something has to be exported to keep some toolchains
  19. // happy. Also use a declaration to silence compiler warnings.
  20. extern const char lzma_crc64_dummy;
  21. const char lzma_crc64_dummy;
  22. #else
  23. // Having the declaration here silences clang -Wmissing-variable-declarations.
  24. extern const uint64_t lzma_crc64_table[4][256];
  25. # if defined(WORDS_BIGENDIAN)
  26. # error #include "crc64_table_be.h"
  27. # else
  28. # include "crc64_table_le.h"
  29. # endif
  30. #endif