Skip to content

Commit 5566c99

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

File tree

9 files changed

+30620
-1
lines changed

9 files changed

+30620
-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: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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+
],
30+
}],
31+
],
32+
},
33+
34+
{
35+
'target_name': 'simdutf_neon32',
36+
'type': 'static_library',
37+
'include_dirs': ['.'],
38+
'sources': ['simdutf.cpp'],
39+
'cflags': [ '-Wno-unused-function' ],
40+
'conditions': [
41+
[ 'OS!="win"', {
42+
'cflags': [ '-mfpu=neon' ],
43+
'xcode_settings': {
44+
'OTHER_CFLAGS': [ '-mfpu=neon' ]
45+
},
46+
}],
47+
],
48+
},
49+
50+
{
51+
'target_name': 'simdutf_neon64',
52+
'type': 'static_library',
53+
'include_dirs': ['.'],
54+
'sources': ['simdutf.cpp'],
55+
'cflags': [ '-Wno-unused-function' ],
56+
# NEON is required in arm64, so no -mfpu flag is needed
57+
},
58+
59+
{
60+
'target_name': 'simdutf_avx',
61+
'type': 'static_library',
62+
'include_dirs': ['.'],
63+
'sources': ['simdutf.cpp'],
64+
'cflags': [ '-Wno-unused-function' ],
65+
'conditions': [
66+
[ 'OS!="win"', {
67+
'cflags': [ '-mavx' ],
68+
'xcode_settings': {
69+
'OTHER_CFLAGS': [ '-mavx' ]
70+
},
71+
}, {
72+
'msvs_settings': {
73+
'VCCLCompilerTool': {
74+
'AdditionalOptions': [
75+
'/arch:AVX'
76+
],
77+
},
78+
},
79+
}],
80+
],
81+
},
82+
83+
{
84+
'target_name': 'simdutf_avx2',
85+
'type': 'static_library',
86+
'include_dirs': ['.'],
87+
'sources': ['simdutf.cpp'],
88+
'cflags': [ '-Wno-unused-function' ],
89+
'conditions': [
90+
[ 'OS!="win"', {
91+
'cflags': [ '-mavx2' ],
92+
'xcode_settings': {
93+
'OTHER_CFLAGS': [ '-mavx2' ]
94+
},
95+
}, {
96+
'msvs_settings': {
97+
'VCCLCompilerTool': {
98+
'AdditionalOptions': [
99+
'/arch:AVX2'
100+
],
101+
},
102+
},
103+
}],
104+
],
105+
},
106+
107+
{
108+
'target_name': 'simdutf_sse42',
109+
'type': 'static_library',
110+
'include_dirs': ['.'],
111+
'sources': ['simdutf.cpp'],
112+
'cflags': [ '-Wno-unused-function' ],
113+
'conditions': [
114+
[ 'OS!="win"', {
115+
'cflags': [ '-msse4.2' ],
116+
'xcode_settings': {
117+
'OTHER_CFLAGS': [ '-msse4.2' ]
118+
},
119+
}],
120+
],
121+
},
122+
]
123+
}

0 commit comments

Comments
 (0)