-
-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit: Removed glue code in deflate.c, since we want to implement this differently in zlib-ng.
- Loading branch information
Showing
3 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* SSE optimized hash slide | ||
* | ||
* Copyright (C) 2017 Intel Corporation | ||
* Authors: | ||
* Arjan van de Ven <[email protected]> | ||
* Jim Kukunas <[email protected]> | ||
* | ||
* For conditions of distribution and use, see copyright notice in zlib.h | ||
*/ | ||
#include "deflate.h" | ||
|
||
#ifdef USE_SSE_SLIDE | ||
#include <immintrin.h> | ||
|
||
void slide_hash_sse(deflate_state *s) | ||
{ | ||
unsigned n; | ||
Posf *p; | ||
uInt wsize = s->w_size; | ||
z_const __m128i xmm_wsize = _mm_set1_epi16(s->w_size); | ||
|
||
n = s->hash_size; | ||
p = &s->head[n] - 8; | ||
do { | ||
__m128i value, result; | ||
|
||
value = _mm_loadu_si128((__m128i *)p); | ||
result= _mm_subs_epu16(value, xmm_wsize); | ||
_mm_storeu_si128((__m128i *)p, result); | ||
p -= 8; | ||
n -= 8; | ||
} while (n > 0); | ||
|
||
#ifndef FASTEST | ||
n = wsize; | ||
p = &s->prev[n] - 8; | ||
do { | ||
__m128i value, result; | ||
|
||
value = _mm_loadu_si128((__m128i *)p); | ||
result= _mm_subs_epu16(value, xmm_wsize); | ||
_mm_storeu_si128((__m128i *)p, result); | ||
|
||
p -= 8; | ||
n -= 8; | ||
} while (n > 0); | ||
#endif | ||
} | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters