From d8b51627dd9a73d3bf597cd25fcbe76631be12bd Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 13 Nov 2023 18:35:22 +0900 Subject: [PATCH] build: fix GN configuration for deps/base64 --- deps/base64/unofficial.gni | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/deps/base64/unofficial.gni b/deps/base64/unofficial.gni index 8138d88798e1df..269c62d976d6ad 100644 --- a/deps/base64/unofficial.gni +++ b/deps/base64/unofficial.gni @@ -32,6 +32,7 @@ template("base64_gn_build") { "HAVE_SSE42=1", "HAVE_AVX=1", "HAVE_AVX2=1", + "HAVE_AVX512=1", ] } if (target_cpu == "arm") { @@ -65,6 +66,7 @@ template("base64_gn_build") { ":base64_sse42", ":base64_avx", ":base64_avx2", + ":base64_avx512", ":base64_neon32", ":base64_neon64", ] @@ -111,6 +113,7 @@ template("base64_gn_build") { } } } + source_set("base64_avx2") { configs += [ ":base64_internal_config" ] sources = [ "base64/lib/arch/avx2/codec.c" ] @@ -123,6 +126,21 @@ template("base64_gn_build") { } } + source_set("base64_avx512") { + configs += [ ":base64_internal_config" ] + sources = [ "base64/lib/arch/avx512/codec.c" ] + if (target_cpu == "x86" || target_cpu == "x64") { + if (is_clang || !is_win) { + cflags_c = [ + "-mavx512vl", + "-mavx512vbmi", + ] + } else if (is_win) { + cflags_c = [ "/arch:AVX512" ] + } + } + } + source_set("base64_neon32") { configs += [ ":base64_internal_config" ] sources = [ "base64/lib/arch/neon32/codec.c" ]