Skip to content

Commit 0d3c969

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

File tree

9 files changed

+30645
-1
lines changed

9 files changed

+30645
-1
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
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

Lines changed: 14 additions & 0 deletions
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

Lines changed: 27967 additions & 0 deletions
Large diffs are not rendered by default.

deps/simdutf/simdutf.gyp

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

0 commit comments

Comments
 (0)