| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c41e67f commit 45ba14b
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,9 +50,13 @@ | |||
| 50 | 50 | #define NMAX 5552 | |
| 51 | 51 | ||
| 52 | 52 | #if defined(ADLER32_SIMD_SSSE3) | |
| 53 | + #ifndef __GNUC__ | ||
| 54 | + #define __attribute__() | ||
| 55 | + #endif | ||
| 53 | 56 | ||
| 54 | 57 | #include <tmmintrin.h> | |
| 55 | 58 | ||
| 59 | + __attribute__((target("ssse3"))) | ||
| 56 | 60 | uint32_t ZLIB_INTERNAL adler32_simd_( /* SSSE3 */ | |
| 57 | 61 | uint32_t adler, | |
| 58 | 62 | const unsigned char *buf, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,9 @@ | |||
| 8 | 8 | #include "crc32_simd.h" | |
| 9 | 9 | ||
| 10 | 10 | #if defined(CRC32_SIMD_SSE42_PCLMUL) | |
| 11 | + #ifndef __GNUC__ | ||
| 12 | + #define __attribute__() | ||
| 13 | + #endif | ||
| 11 | 14 | ||
| 12 | 15 | /* | |
| 13 | 16 | * crc32_sse42_simd_(): compute the crc32 of the buffer, where the buffer | |
@@ -21,6 +24,7 @@ | |||
| 21 | 24 | #include <smmintrin.h> | |
| 22 | 25 | #include <wmmintrin.h> | |
| 23 | 26 | ||
| 27 | + __attribute__((target("sse4.2,pclmul"))) | ||
| 24 | 28 | uint32_t ZLIB_INTERNAL crc32_sse42_simd_( /* SSE4.2+PCLMUL */ | |
| 25 | 29 | const unsigned char *buf, | |
| 26 | 30 | z_size_t len, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,10 @@ | |||
| 25 | 25 | #include <immintrin.h> | |
| 26 | 26 | #include <wmmintrin.h> | |
| 27 | 27 | ||
| 28 | + #ifndef __GNUC__ | ||
| 29 | + #define __attribute__() | ||
| 30 | + #endif | ||
| 31 | + | ||
| 28 | 32 | #define CRC_LOAD(s) \ | |
| 29 | 33 | do { \ | |
| 30 | 34 | __m128i xmm_crc0 = _mm_loadu_si128((__m128i *)s->crc0 + 0);\ | |
@@ -41,6 +45,7 @@ | |||
| 41 | 45 | _mm_storeu_si128((__m128i *)s->crc0 + 4, xmm_crc_part);\ | |
| 42 | 46 | } while (0); | |
| 43 | 47 | ||
| 48 | + __attribute__((target("sse4.2,pclmul"))) | ||
| 44 | 49 | ZLIB_INTERNAL void crc_fold_init(deflate_state *const s) | |
| 45 | 50 | { | |
| 46 | 51 | CRC_LOAD(s) | |
@@ -55,6 +60,7 @@ ZLIB_INTERNAL void crc_fold_init(deflate_state *const s) | |||
| 55 | 60 | s->strm->adler = 0; | |
| 56 | 61 | } | |
| 57 | 62 | ||
| 63 | + __attribute__((target("sse4.2,pclmul"))) | ||
| 58 | 64 | local void fold_1(deflate_state *const s, | |
| 59 | 65 | __m128i *xmm_crc0, __m128i *xmm_crc1, | |
| 60 | 66 | __m128i *xmm_crc2, __m128i *xmm_crc3) | |
@@ -81,6 +87,7 @@ local void fold_1(deflate_state *const s, | |||
| 81 | 87 | *xmm_crc3 = _mm_castps_si128(ps_res); | |
| 82 | 88 | } | |
| 83 | 89 | ||
| 90 | + __attribute__((target("sse4.2,pclmul"))) | ||
| 84 | 91 | local void fold_2(deflate_state *const s, | |
| 85 | 92 | __m128i *xmm_crc0, __m128i *xmm_crc1, | |
| 86 | 93 | __m128i *xmm_crc2, __m128i *xmm_crc3) | |
@@ -115,6 +122,7 @@ local void fold_2(deflate_state *const s, | |||
| 115 | 122 | *xmm_crc3 = _mm_castps_si128(ps_res31); | |
| 116 | 123 | } | |
| 117 | 124 | ||
| 125 | + __attribute__((target("sse4.2,pclmul"))) | ||
| 118 | 126 | local void fold_3(deflate_state *const s, | |
| 119 | 127 | __m128i *xmm_crc0, __m128i *xmm_crc1, | |
| 120 | 128 | __m128i *xmm_crc2, __m128i *xmm_crc3) | |
@@ -155,6 +163,7 @@ local void fold_3(deflate_state *const s, | |||
| 155 | 163 | *xmm_crc3 = _mm_castps_si128(ps_res32); | |
| 156 | 164 | } | |
| 157 | 165 | ||
| 166 | + __attribute__((target("sse4.2,pclmul"))) | ||
| 158 | 167 | local void fold_4(deflate_state *const s, | |
| 159 | 168 | __m128i *xmm_crc0, __m128i *xmm_crc1, | |
| 160 | 169 | __m128i *xmm_crc2, __m128i *xmm_crc3) | |
@@ -221,6 +230,7 @@ local const unsigned zalign(32) pshufb_shf_table[60] = { | |||
| 221 | 230 | 0x0201008f,0x06050403,0x0a090807,0x0e0d0c0b /* shl 1 (16 -15)/shr15*/ | |
| 222 | 231 | }; | |
| 223 | 232 | ||
| 233 | + __attribute__((target("sse4.2,pclmul"))) | ||
| 224 | 234 | local void partial_fold(deflate_state *const s, const size_t len, | |
| 225 | 235 | __m128i *xmm_crc0, __m128i *xmm_crc1, | |
| 226 | 236 | __m128i *xmm_crc2, __m128i *xmm_crc3, | |
@@ -271,6 +281,7 @@ local void partial_fold(deflate_state *const s, const size_t len, | |||
| 271 | 281 | *xmm_crc3 = _mm_castps_si128(ps_res); | |
| 272 | 282 | } | |
| 273 | 283 | ||
| 284 | + __attribute__((target("sse4.2,pclmul"))) | ||
| 274 | 285 | ZLIB_INTERNAL void crc_fold_copy(deflate_state *const s, | |
| 275 | 286 | unsigned char *dst, const unsigned char *src, long len) | |
| 276 | 287 | { | |
@@ -427,6 +438,7 @@ local const unsigned zalign(16) crc_mask2[4] = { | |||
| 427 | 438 | 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF | |
| 428 | 439 | }; | |
| 429 | 440 | ||
| 441 | + __attribute__((target("sse4.2,pclmul"))) | ||
| 430 | 442 | unsigned ZLIB_INTERNAL crc_fold_512to32(deflate_state *const s) | |
| 431 | 443 | { | |
| 432 | 444 | const __m128i xmm_mask = _mm_load_si128((__m128i *)crc_mask); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments