Skip to content

Commit ced7ef2

Browse files
committed
deps: add simdutf dependency
1 parent 265ea1e commit ced7ef2

File tree

9 files changed

+30619
-1
lines changed

9 files changed

+30619
-1
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ with-code-cache test-code-cache:
170170

171171
out/Makefile: config.gypi common.gypi node.gyp \
172172
deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \
173+
deps/simdutf/simdutf.gyp \
173174
tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \
174175
tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp
175176
$(PYTHON) tools/gyp_node.py -f make

deps/simdutf/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# simdutf
2+
3+
This project boosts unicode validation and transcoding performance by
4+
utilizing SIMD operations where possible.
5+
6+
The source is pulled from: https://github.com/simdutf/simdutf
7+
8+
Active development occurs in the default branch (currently named `master`).
9+
10+
## Updating
11+
12+
```sh
13+
$ git clone https://github.com/simdutf/simdutf
14+
```

deps/simdutf/simdutf.cpp

+27,967
Large diffs are not rendered by default.

deps/simdutf/simdutf.gyp

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
'variables': {
3+
'arm_fpu%': '',
4+
'target_arch%': '',
5+
},
6+
'targets': [
7+
{
8+
'target_name': 'simdutf',
9+
'type': 'static_library',
10+
'include_dirs': ['.'],
11+
'sources': ['simdutf.cpp'],
12+
'conditions': [
13+
[ 'arm_fpu=="neon" and target_arch=="arm"', {
14+
'dependencies': [ 'simdutf_neon32' ],
15+
}],
16+
17+
# arm64 requires NEON, so it's safe to always use it
18+
[ 'target_arch=="arm64"', {
19+
'dependencies': [ 'simdutf_neon64' ],
20+
}],
21+
22+
# Runtime detection will happen for x86 CPUs
23+
[ 'target_arch in "ia32 x64 x32"', {
24+
'dependencies': [
25+
'simdutf_sse42',
26+
'simdutf_avx',
27+
'simdutf_avx2',
28+
],
29+
}],
30+
],
31+
},
32+
33+
{
34+
'target_name': 'simdutf_neon32',
35+
'type': 'static_library',
36+
'include_dirs': ['.'],
37+
'sources': ['simdutf.cpp'],
38+
'cflags': [ '-Wno-unused-function' ],
39+
'conditions': [
40+
[ 'OS!="win"', {
41+
'cflags': [ '-mfpu=neon' ],
42+
'xcode_settings': {
43+
'OTHER_CFLAGS': [ '-mfpu=neon' ]
44+
},
45+
}],
46+
],
47+
},
48+
49+
{
50+
'target_name': 'simdutf_neon64',
51+
'type': 'static_library',
52+
'include_dirs': ['.'],
53+
'sources': ['simdutf.cpp'],
54+
'cflags': [ '-Wno-unused-function' ],
55+
# NEON is required in arm64, so no -mfpu flag is needed
56+
},
57+
58+
{
59+
'target_name': 'simdutf_avx',
60+
'type': 'static_library',
61+
'include_dirs': ['.'],
62+
'sources': ['simdutf.cpp'],
63+
'cflags': [ '-Wno-unused-function' ],
64+
'conditions': [
65+
[ 'OS!="win"', {
66+
'cflags': [ '-mavx' ],
67+
'xcode_settings': {
68+
'OTHER_CFLAGS': [ '-mavx' ]
69+
},
70+
}, {
71+
'msvs_settings': {
72+
'VCCLCompilerTool': {
73+
'AdditionalOptions': [
74+
'/arch:AVX'
75+
],
76+
},
77+
},
78+
}],
79+
],
80+
},
81+
82+
{
83+
'target_name': 'simdutf_avx2',
84+
'type': 'static_library',
85+
'include_dirs': ['.'],
86+
'sources': ['simdutf.cpp'],
87+
'cflags': [ '-Wno-unused-function' ],
88+
'conditions': [
89+
[ 'OS!="win"', {
90+
'cflags': [ '-mavx2' ],
91+
'xcode_settings': {
92+
'OTHER_CFLAGS': [ '-mavx2' ]
93+
},
94+
}, {
95+
'msvs_settings': {
96+
'VCCLCompilerTool': {
97+
'AdditionalOptions': [
98+
'/arch:AVX2'
99+
],
100+
},
101+
},
102+
}],
103+
],
104+
},
105+
106+
{
107+
'target_name': 'simdutf_sse42',
108+
'type': 'static_library',
109+
'include_dirs': ['.'],
110+
'sources': ['simdutf.cpp'],
111+
'cflags': [ '-Wno-unused-function' ],
112+
'conditions': [
113+
[ 'OS!="win"', {
114+
'cflags': [ '-msse4.2' ],
115+
'xcode_settings': {
116+
'OTHER_CFLAGS': [ '-msse4.2' ]
117+
},
118+
}],
119+
],
120+
},
121+
]
122+
}

0 commit comments

Comments
 (0)