blob: 68bc235cbe16828c4a1da3c8cf39f76a097ffeab [file] [log] [blame]
Noel Gordon8e904b32018-01-04 12:10:08 +11001/* 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 Cavalcanti21cc38f2018-08-15 01:06:05 +000012#include "deflate.h"
Noel Gordon8e904b32018-01-04 12:10:08 +110013
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 */
18uint32_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 Cavalcanti72356722018-02-16 03:41:14 +000029
30/*
31 * CRC32 checksums using ARMv8-a crypto instructions.
32 */
33uint32_t ZLIB_INTERNAL armv8_crc32_little(unsigned long crc,
34 const unsigned char* buf,
35 z_size_t len);
36