if (state->wrap == 1)
param->cv = strm->adler;
else if (state->wrap == 2)
- param->cv = ZSWAP32(state->crc_fold.value);
+ param->cv = ZSWAP32(strm->adler);
/* When opening a block, choose a Huffman-Table Type */
if (!param->bcf) {
if (state->wrap == 1)
strm->adler = param->cv;
else if (state->wrap == 2)
- state->crc_fold.value = ZSWAP32(param->cv);
+ strm->adler = ZSWAP32(param->cv);
/* Unmask the input data */
strm->avail_in += masked_avail_in;
#include "crc32_braid_tbl.h"
#include "x86_intrins.h"
+/* sizeof(__m128i) * (4 folds) */
+#define CRC32_FOLD_BUFFER_SIZE (16 * 4)
+
+typedef struct crc32_fold_s {
+ uint8_t fold[CRC32_FOLD_BUFFER_SIZE];
+ uint32_t value;
+} crc32_fold;
+
+
static const unsigned ALIGNED_(16) crc_k[] = {
0xccaa009e, 0x00000000, /* rk1 */
0x751997d0, 0x00000001, /* rk2 */
#ifndef CRC32_H_
#define CRC32_H_
-/* sizeof(__m128i) * (4 folds) */
-#define CRC32_FOLD_BUFFER_SIZE (16 * 4)
-
/* Size thresholds for Chorba algorithm variants */
#define CHORBA_LARGE_THRESHOLD (sizeof(z_word_t) * 64 * 1024)
#define CHORBA_MEDIUM_UPPER_THRESHOLD 32768
# define CHORBA_SMALL_THRESHOLD 80
#endif
-typedef struct crc32_fold_s {
- uint8_t fold[CRC32_FOLD_BUFFER_SIZE];
- uint32_t value;
-} crc32_fold;
-
#endif
int32_t padding1[1];
/* Cacheline 3 */
- struct crc32_fold_s ALIGNED_(16) crc_fold;
+ uint8_t ALIGNED_(16) padding4[68];
/* used by trees.c: */
/* Didn't use ct_data typedef below to suppress compiler warning */
#if defined(_M_IX86) || defined(_M_ARM)
uint32_t padding[1];
#endif
- struct crc32_fold_s ALIGNED_(16) crc_fold;
+ uint8_t ALIGNED_(16) padding4[68];
uint16_t lens[320]; /* temporary storage for code lengths */
uint16_t work[288]; /* work area for code table building */