11
#include "../../zbuild.h"
12
#include "../../deflate.h"
17
static inline void slide_hash_chain(Pos *table0, Pos *table1, uint32_t entries0,
18
uint32_t entries1, const __m128i wsize) {
21
__m128i value0, value1, result0, result1;
26
table = (on_chain) ? table1 : table0;
27
entries = (on_chain) ? entries1 : entries0;
35
value0 = _mm_load_si128((__m128i *)table);
36
value1 = _mm_load_si128((__m128i *)(table + 8));
37
result0 = _mm_subs_epu16(value0, wsize);
38
result1 = _mm_subs_epu16(value1, wsize);
39
_mm_store_si128((__m128i *)table, result0);
40
_mm_store_si128((__m128i *)(table + 8), result1);
44
} while (entries > 0);
54
Z_INTERNAL void slide_hash_sse2(deflate_state *s) {
55
uint16_t wsize = (uint16_t)s->w_size;
56
const __m128i xmm_wsize = _mm_set1_epi16((short)wsize);
58
assert(((uintptr_t)s->head & 15) == 0);
59
assert(((uintptr_t)s->prev & 15) == 0);
61
slide_hash_chain(s->head, s->prev, HASH_SIZE, wsize, xmm_wsize);