diff options
| author | dtorilov <[email protected]> | 2025-08-29 16:16:58 +0300 |
|---|---|---|
| committer | dtorilov <[email protected]> | 2025-08-29 16:44:11 +0300 |
| commit | 25c13a35fdc745b08c8c37b514dc71197ca958a0 (patch) | |
| tree | 7593efbe6494728e7a6bd2e867346559bd510226 /library/cpp/string_utils/base64/base64.cpp | |
| parent | 853bc971e12bc81580d5431c64c2ad46e14e736d (diff) | |
YT-25950: Fix WebAssembly compilation
commit_hash:205598251dba71e1700845ebcb16ce1057ea1fad
Diffstat (limited to 'library/cpp/string_utils/base64/base64.cpp')
| -rw-r--r-- | library/cpp/string_utils/base64/base64.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/library/cpp/string_utils/base64/base64.cpp b/library/cpp/string_utils/base64/base64.cpp index fec827dd931..d63b2e68275 100644 --- a/library/cpp/string_utils/base64/base64.cpp +++ b/library/cpp/string_utils/base64/base64.cpp @@ -32,16 +32,27 @@ namespace { #endif # ifdef _windows_ - // msvc does something wrong in release-build, so we temprorary disable this branch on windows + // msvc does something wrong in release-build, so we temporarily disable this branch on windows // https://developercommunity.visualstudio.com/content/problem/334085/release-build-has-made-wrong-optimizaion-in-base64.html const bool isWin = true; # else const bool isWin = false; # endif - if (!isWin && NX86::HaveAVX() && NX86::HaveAVX2()) { + +#if defined (_wasm_) + const bool haveAVX = false; + const bool haveAVX2 = false; + const bool haveSSSE3 = false; +#else + const bool haveAVX = NX86::HaveAVX(); + const bool haveAVX2 = NX86::HaveAVX2(); + const bool haveSSSE3 = NX86::HaveSSSE3(); +#endif + + if (!isWin && haveAVX && haveAVX2) { Encode = avx2_base64_encode; Decode = avx2_base64_decode; - } else if (NX86::HaveSSSE3()) { + } else if (haveSSSE3) { Encode = ssse3_base64_encode; Decode = ssse3_base64_decode; } else if (haveNEON64) { |
