Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: enable sse4.2 and ssse3 in zlib #36693

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions deps/zlib/adler32_simd.c
Expand Up @@ -54,6 +54,9 @@
#define __attribute__()
#endif

// TODO(raisinten): When https://github.com/nodejs/node/pull/33044 lands,
// remove the next line and add `-mssse3` to the command line options.
#pragma GCC target ("ssse3")
#include <tmmintrin.h>

__attribute__((target("ssse3")))
Expand Down
2 changes: 2 additions & 0 deletions deps/zlib/contrib/optimizations/chunkcopy.h
Expand Up @@ -29,6 +29,8 @@
#include <arm_neon.h>
typedef uint8x16_t z_vec128i_t;
#elif defined(INFLATE_CHUNK_SIMD_SSE2)
// TODO(raisinten): When https://github.com/nodejs/node/pull/33044 lands,
// remove the next line and add `-msse2` to the command line options.
#pragma GCC target ("sse2")
#include <emmintrin.h>
typedef __m128i z_vec128i_t;
Expand Down
3 changes: 3 additions & 0 deletions deps/zlib/contrib/optimizations/insert_string.h
Expand Up @@ -16,6 +16,9 @@
// clang-format off
#if defined(CRC32_SIMD_SSE42_PCLMUL)
/* Required to make MSVC bot build pass. */
// TODO(raisinten): When https://github.com/nodejs/node/pull/33044 lands,
// remove the next line and add `-msse4.2` to the command line options.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this lands before #33044, a commit should be added to that PR that resolves this TODO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @richardlau
Please consider adding these options in your PR if you haven't added them already. :)

#pragma GCC target ("sse4.2")
#include <smmintrin.h>
#if defined(__GNUC__) || defined(__clang__)
#undef TARGET_CPU_WITH_CRC
Expand Down
5 changes: 5 additions & 0 deletions deps/zlib/crc32_simd.c
Expand Up @@ -20,6 +20,11 @@
* V. Gopal, E. Ozturk, et al., 2009, http://intel.ly/2ySEwL0
*/

// TODO(raisinten): When https://github.com/nodejs/node/pull/33044 lands,
// remove the next line and add `-msse4.2` and `-mpclmul` to the
// command line options.
#pragma GCC target ("sse4.2", "pclmul")

#include <emmintrin.h>
#include <smmintrin.h>
#include <wmmintrin.h>
Expand Down
5 changes: 5 additions & 0 deletions deps/zlib/crc_folding.c
Expand Up @@ -18,6 +18,11 @@

#include "deflate.h"

// TODO(raisinten): When https://github.com/nodejs/node/pull/33044 lands,
// remove the next line and add `-msse4.2` and `-mpclmul` to the
// command line options.
#pragma GCC target ("sse4.2", "pclmul")

#include <inttypes.h>
#include <emmintrin.h>
#include <immintrin.h>
Expand Down
2 changes: 2 additions & 0 deletions deps/zlib/fill_window_sse.c
Expand Up @@ -9,6 +9,8 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

// TODO(raisinten): When https://github.com/nodejs/node/pull/33044 lands,
// remove the next line and add `-msse2` to the command line options.
#pragma GCC target ("sse2")
#include <immintrin.h>
#include "deflate.h"
Expand Down