Skip to content

Commit

Permalink
deps: add simdutf dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Dec 10, 2022
1 parent 265ea1e commit ced7ef2
Show file tree
Hide file tree
Showing 9 changed files with 30,619 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ with-code-cache test-code-cache:

out/Makefile: config.gypi common.gypi node.gyp \
deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \
deps/simdutf/simdutf.gyp \
tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \
tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp
$(PYTHON) tools/gyp_node.py -f make
Expand Down
14 changes: 14 additions & 0 deletions deps/simdutf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# simdutf

This project boosts unicode validation and transcoding performance by
utilizing SIMD operations where possible.

The source is pulled from: https://github.com/simdutf/simdutf

Active development occurs in the default branch (currently named `master`).

## Updating

```sh
$ git clone https://github.com/simdutf/simdutf
```
27,967 changes: 27,967 additions & 0 deletions deps/simdutf/simdutf.cpp

Large diffs are not rendered by default.

122 changes: 122 additions & 0 deletions deps/simdutf/simdutf.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
'variables': {
'arm_fpu%': '',
'target_arch%': '',
},
'targets': [
{
'target_name': 'simdutf',
'type': 'static_library',
'include_dirs': ['.'],
'sources': ['simdutf.cpp'],
'conditions': [
[ 'arm_fpu=="neon" and target_arch=="arm"', {
'dependencies': [ 'simdutf_neon32' ],
}],

# arm64 requires NEON, so it's safe to always use it
[ 'target_arch=="arm64"', {
'dependencies': [ 'simdutf_neon64' ],
}],

# Runtime detection will happen for x86 CPUs
[ 'target_arch in "ia32 x64 x32"', {
'dependencies': [
'simdutf_sse42',
'simdutf_avx',
'simdutf_avx2',
],
}],
],
},

{
'target_name': 'simdutf_neon32',
'type': 'static_library',
'include_dirs': ['.'],
'sources': ['simdutf.cpp'],
'cflags': [ '-Wno-unused-function' ],
'conditions': [
[ 'OS!="win"', {
'cflags': [ '-mfpu=neon' ],
'xcode_settings': {
'OTHER_CFLAGS': [ '-mfpu=neon' ]
},
}],
],
},

{
'target_name': 'simdutf_neon64',
'type': 'static_library',
'include_dirs': ['.'],
'sources': ['simdutf.cpp'],
'cflags': [ '-Wno-unused-function' ],
# NEON is required in arm64, so no -mfpu flag is needed
},

{
'target_name': 'simdutf_avx',
'type': 'static_library',
'include_dirs': ['.'],
'sources': ['simdutf.cpp'],
'cflags': [ '-Wno-unused-function' ],
'conditions': [
[ 'OS!="win"', {
'cflags': [ '-mavx' ],
'xcode_settings': {
'OTHER_CFLAGS': [ '-mavx' ]
},
}, {
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [
'/arch:AVX'
],
},
},
}],
],
},

{
'target_name': 'simdutf_avx2',
'type': 'static_library',
'include_dirs': ['.'],
'sources': ['simdutf.cpp'],
'cflags': [ '-Wno-unused-function' ],
'conditions': [
[ 'OS!="win"', {
'cflags': [ '-mavx2' ],
'xcode_settings': {
'OTHER_CFLAGS': [ '-mavx2' ]
},
}, {
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [
'/arch:AVX2'
],
},
},
}],
],
},

{
'target_name': 'simdutf_sse42',
'type': 'static_library',
'include_dirs': ['.'],
'sources': ['simdutf.cpp'],
'cflags': [ '-Wno-unused-function' ],
'conditions': [
[ 'OS!="win"', {
'cflags': [ '-msse4.2' ],
'xcode_settings': {
'OTHER_CFLAGS': [ '-msse4.2' ]
},
}],
],
},
]
}
Loading

0 comments on commit ced7ef2

Please sign in to comment.