File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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" ]
You can’t perform that action at this time.
0 commit comments