Skip to content

Commit 346b6e1

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

File tree

7 files changed

+30599
-1
lines changed

7 files changed

+30599
-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/simdutf.cpp

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

deps/simdutf/simdutf.gyp

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

0 commit comments

Comments
 (0)