Skip to content

Commit e4a552d

Browse files
committed
build: fix GN configuration for deps/base64
1 parent 5e250bd commit e4a552d

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

deps/base64/base64/lib/env.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@
4646
#if defined (__x86_64__)
4747
// This also works for the x32 ABI, which has a 64-bit word size.
4848
# define BASE64_WORDSIZE 64
49-
#elif defined (_INTEGRAL_MAX_BITS)
50-
# define BASE64_WORDSIZE _INTEGRAL_MAX_BITS
5149
#elif defined (__WORDSIZE)
5250
# define BASE64_WORDSIZE __WORDSIZE
5351
#elif defined (__SIZE_WIDTH__)
5452
# define BASE64_WORDSIZE __SIZE_WIDTH__
53+
#elif defined (_INTEGRAL_MAX_BITS) && !defined(_WIN32)
54+
# define BASE64_WORDSIZE _INTEGRAL_MAX_BITS
5555
#else
5656
# error BASE64_WORDSIZE_NOT_DEFINED
5757
#endif

deps/base64/unofficial.gni

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ template("base64_gn_build") {
3232
"HAVE_SSE42=1",
3333
"HAVE_AVX=1",
3434
"HAVE_AVX2=1",
35+
"HAVE_AVX512=1",
3536
]
3637
}
3738
if (target_cpu == "arm") {
@@ -65,6 +66,7 @@ template("base64_gn_build") {
6566
":base64_sse42",
6667
":base64_avx",
6768
":base64_avx2",
69+
":base64_avx512",
6870
":base64_neon32",
6971
":base64_neon64",
7072
]
@@ -111,6 +113,7 @@ template("base64_gn_build") {
111113
}
112114
}
113115
}
116+
114117
source_set("base64_avx2") {
115118
configs += [ ":base64_internal_config" ]
116119
sources = [ "base64/lib/arch/avx2/codec.c" ]
@@ -123,6 +126,21 @@ template("base64_gn_build") {
123126
}
124127
}
125128

129+
source_set("base64_avx512") {
130+
configs += [ ":base64_internal_config" ]
131+
sources = [ "base64/lib/arch/avx512/codec.c" ]
132+
if (target_cpu == "x86" || target_cpu == "x64") {
133+
if (is_clang || !is_win) {
134+
cflags_c = [
135+
"-mavx512vl",
136+
"-mavx512vbmi",
137+
]
138+
} else if (is_win) {
139+
cflags_c = [ "/arch:AVX512" ]
140+
}
141+
}
142+
}
143+
126144
source_set("base64_neon32") {
127145
configs += [ ":base64_internal_config" ]
128146
sources = [ "base64/lib/arch/neon32/codec.c" ]

0 commit comments

Comments
 (0)