crc32_simd.h 1009 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* crc32_simd.h
  2. *
  3. * Copyright 2017 The Chromium Authors. All rights reserved.
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the Chromium source repository LICENSE file.
  6. */
  7. #include <stdint.h>
  8. #include "zconf.h"
  9. #include "zutil.h"
  10. #include "deflate.h"
  11. /*
  12. * crc32_sse42_simd_(): compute the crc32 of the buffer, where the buffer
  13. * length must be at least 64, and a multiple of 16.
  14. */
  15. uint32_t ZLIB_INTERNAL crc32_sse42_simd_(
  16. const unsigned char *buf,
  17. z_size_t len,
  18. uint32_t crc);
  19. /*
  20. * crc32_sse42_simd_ buffer size constraints: see the use in zlib/crc32.c
  21. * for computing the crc32 of an arbitrary length buffer.
  22. */
  23. #define Z_CRC32_SSE42_MINIMUM_LENGTH 64
  24. #define Z_CRC32_SSE42_CHUNKSIZE_MASK 15
  25. /*
  26. * CRC32 checksums using ARMv8-a crypto instructions.
  27. */
  28. uint32_t ZLIB_INTERNAL armv8_crc32_little(unsigned long crc,
  29. const unsigned char* buf,
  30. z_size_t len);