Noel Gordon | 8e904b3 | 2018-01-04 12:10:08 +1100 | [diff] [blame] | 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 | |
| 8 | #include <stdint.h> |
| 9 | |
| 10 | #include "zconf.h" |
| 11 | #include "zutil.h" |
Adenilson Cavalcanti | 21cc38f | 2018-08-15 01:06:05 +0000 | [diff] [blame] | 12 | #include "deflate.h" |
Noel Gordon | 8e904b3 | 2018-01-04 12:10:08 +1100 | [diff] [blame] | 13 | |
| 14 | /* |
| 15 | * crc32_sse42_simd_(): compute the crc32 of the buffer, where the buffer |
| 16 | * length must be at least 64, and a multiple of 16. |
| 17 | */ |
| 18 | uint32_t ZLIB_INTERNAL crc32_sse42_simd_( |
| 19 | const unsigned char *buf, |
| 20 | z_size_t len, |
| 21 | uint32_t crc); |
| 22 | |
| 23 | /* |
| 24 | * crc32_sse42_simd_ buffer size constraints: see the use in zlib/crc32.c |
| 25 | * for computing the crc32 of an arbitrary length buffer. |
| 26 | */ |
| 27 | #define Z_CRC32_SSE42_MINIMUM_LENGTH 64 |
| 28 | #define Z_CRC32_SSE42_CHUNKSIZE_MASK 15 |
Adenilson Cavalcanti | 7235672 | 2018-02-16 03:41:14 +0000 | [diff] [blame] | 29 | |
| 30 | /* |
| 31 | * CRC32 checksums using ARMv8-a crypto instructions. |
| 32 | */ |
| 33 | uint32_t ZLIB_INTERNAL armv8_crc32_little(unsigned long crc, |
| 34 | const unsigned char* buf, |
| 35 | z_size_t len); |
| 36 | |