GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — deps: fix zlib compilation for CPUs without SIMD features · nodejs/node@43419ad

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • deps/zlib
    • adler32_simd.c
    • crc32_simd.c
    • crc_folding.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎deps/zlib/adler32_simd.c‎

Copy file name to clipboardExpand all lines: deps/zlib/adler32_simd.c
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,13 @@
5050
#define NMAX 5552
5151

5252
#if defined(ADLER32_SIMD_SSSE3)
53+
#ifndef __GNUC__
54+
#define __attribute__()
55+
#endif
5356

5457
#include <tmmintrin.h>
5558

59+
__attribute__((target("ssse3")))
5660
uint32_t ZLIB_INTERNAL adler32_simd_( /* SSSE3 */
5761
uint32_t adler,
5862
const unsigned char *buf,
Collapse file

‎deps/zlib/crc32_simd.c‎

Copy file name to clipboardExpand all lines: deps/zlib/crc32_simd.c
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#include "crc32_simd.h"
99

1010
#if defined(CRC32_SIMD_SSE42_PCLMUL)
11+
#ifndef __GNUC__
12+
#define __attribute__()
13+
#endif
1114

1215
/*
1316
* crc32_sse42_simd_(): compute the crc32 of the buffer, where the buffer
@@ -21,6 +24,7 @@
2124
#include <smmintrin.h>
2225
#include <wmmintrin.h>
2326

27+
__attribute__((target("sse4.2,pclmul")))
2428
uint32_t ZLIB_INTERNAL crc32_sse42_simd_( /* SSE4.2+PCLMUL */
2529
const unsigned char *buf,
2630
z_size_t len,
Collapse file

‎deps/zlib/crc_folding.c‎

Copy file name to clipboardExpand all lines: deps/zlib/crc_folding.c
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
#include <immintrin.h>
2626
#include <wmmintrin.h>
2727

28+
#ifndef __GNUC__
29+
#define __attribute__()
30+
#endif
31+
2832
#define CRC_LOAD(s) \
2933
do { \
3034
__m128i xmm_crc0 = _mm_loadu_si128((__m128i *)s->crc0 + 0);\
@@ -41,6 +45,7 @@
4145
_mm_storeu_si128((__m128i *)s->crc0 + 4, xmm_crc_part);\
4246
} while (0);
4347

48+
__attribute__((target("sse4.2,pclmul")))
4449
ZLIB_INTERNAL void crc_fold_init(deflate_state *const s)
4550
{
4651
CRC_LOAD(s)
@@ -55,6 +60,7 @@ ZLIB_INTERNAL void crc_fold_init(deflate_state *const s)
5560
s->strm->adler = 0;
5661
}
5762

63+
__attribute__((target("sse4.2,pclmul")))
5864
local void fold_1(deflate_state *const s,
5965
__m128i *xmm_crc0, __m128i *xmm_crc1,
6066
__m128i *xmm_crc2, __m128i *xmm_crc3)
@@ -81,6 +87,7 @@ local void fold_1(deflate_state *const s,
8187
*xmm_crc3 = _mm_castps_si128(ps_res);
8288
}
8389

90+
__attribute__((target("sse4.2,pclmul")))
8491
local void fold_2(deflate_state *const s,
8592
__m128i *xmm_crc0, __m128i *xmm_crc1,
8693
__m128i *xmm_crc2, __m128i *xmm_crc3)
@@ -115,6 +122,7 @@ local void fold_2(deflate_state *const s,
115122
*xmm_crc3 = _mm_castps_si128(ps_res31);
116123
}
117124

125+
__attribute__((target("sse4.2,pclmul")))
118126
local void fold_3(deflate_state *const s,
119127
__m128i *xmm_crc0, __m128i *xmm_crc1,
120128
__m128i *xmm_crc2, __m128i *xmm_crc3)
@@ -155,6 +163,7 @@ local void fold_3(deflate_state *const s,
155163
*xmm_crc3 = _mm_castps_si128(ps_res32);
156164
}
157165

166+
__attribute__((target("sse4.2,pclmul")))
158167
local void fold_4(deflate_state *const s,
159168
__m128i *xmm_crc0, __m128i *xmm_crc1,
160169
__m128i *xmm_crc2, __m128i *xmm_crc3)
@@ -221,6 +230,7 @@ local const unsigned zalign(32) pshufb_shf_table[60] = {
221230
0x0201008f,0x06050403,0x0a090807,0x0e0d0c0b /* shl 1 (16 -15)/shr15*/
222231
};
223232

233+
__attribute__((target("sse4.2,pclmul")))
224234
local void partial_fold(deflate_state *const s, const size_t len,
225235
__m128i *xmm_crc0, __m128i *xmm_crc1,
226236
__m128i *xmm_crc2, __m128i *xmm_crc3,
@@ -271,6 +281,7 @@ local void partial_fold(deflate_state *const s, const size_t len,
271281
*xmm_crc3 = _mm_castps_si128(ps_res);
272282
}
273283

284+
__attribute__((target("sse4.2,pclmul")))
274285
ZLIB_INTERNAL void crc_fold_copy(deflate_state *const s,
275286
unsigned char *dst, const unsigned char *src, long len)
276287
{
@@ -427,6 +438,7 @@ local const unsigned zalign(16) crc_mask2[4] = {
427438
0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF
428439
};
429440

441+
__attribute__((target("sse4.2,pclmul")))
430442
unsigned ZLIB_INTERNAL crc_fold_512to32(deflate_state *const s)
431443
{
432444
const __m128i xmm_mask = _mm_load_si128((__m128i *)crc_mask);

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.