mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
[blake3] Add assembly implementations (#25921)
* [blake3] Extend build script to support assembly implementations * [blake3] Add AVX512 assembly implementation
This commit is contained in:
parent
4b03e5c3d5
commit
09d4f8ec9c
@ -10,22 +10,46 @@ target_sources(blake3 PRIVATE
|
|||||||
c/blake3_portable.c
|
c/blake3_portable.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# This is a bit too exotic to be worth supporting right now
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||||
target_compile_definitions(blake3 PRIVATE BLAKE3_NO_AVX512=1)
|
target_compile_definitions(blake3 PRIVATE BLAKE3_NO_AVX512=1)
|
||||||
|
|
||||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
|
||||||
target_sources(blake3 PRIVATE
|
target_sources(blake3 PRIVATE
|
||||||
c/blake3_avx2.c
|
c/blake3_avx2.c
|
||||||
c/blake3_sse2.c
|
c/blake3_sse2.c
|
||||||
c/blake3_sse41.c
|
c/blake3_sse41.c
|
||||||
)
|
)
|
||||||
if (NOT MSVC)
|
if(NOT MSVC)
|
||||||
set_source_files_properties(c/blake3_avx2.c COMPILE_FLAGS -mavx2)
|
set_source_files_properties(c/blake3_avx2.c COMPILE_FLAGS -mavx2)
|
||||||
set_source_files_properties(c/blake3_sse2.c COMPILE_FLAGS -msse2)
|
set_source_files_properties(c/blake3_sse2.c COMPILE_FLAGS -msse2)
|
||||||
set_source_files_properties(c/blake3_sse41.c COMPILE_FLAGS -msse4.1)
|
set_source_files_properties(c/blake3_sse41.c COMPILE_FLAGS -msse4.1)
|
||||||
endif()
|
endif()
|
||||||
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||||
|
if(WIN32 AND MSVC)
|
||||||
|
enable_language(ASM_MASM)
|
||||||
|
target_sources(blake3 PRIVATE
|
||||||
|
c/blake3_avx2_x86-64_windows_msvc.asm
|
||||||
|
c/blake3_sse2_x86-64_windows_msvc.asm
|
||||||
|
c/blake3_sse41_x86-64_windows_msvc.asm
|
||||||
|
c/blake3_avx512_x86-64_windows_msvc.asm
|
||||||
|
)
|
||||||
|
elseif(WIN32 AND NOT MSVC)
|
||||||
|
enable_language(ASM)
|
||||||
|
target_sources(blake3 PRIVATE
|
||||||
|
c/blake3_avx2_x86-64_windows_gnu.S
|
||||||
|
c/blake3_sse2_x86-64_windows_gnu.S
|
||||||
|
c/blake3_sse41_x86-64_windows_gnu.S
|
||||||
|
c/blake3_avx512_x86-64_windows_gnu.S
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
enable_language(ASM)
|
||||||
|
target_sources(blake3 PRIVATE
|
||||||
|
c/blake3_avx2_x86-64_unix.S
|
||||||
|
c/blake3_sse2_x86-64_unix.S
|
||||||
|
c/blake3_sse41_x86-64_unix.S
|
||||||
|
c/blake3_avx512_x86-64_unix.S
|
||||||
|
)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
target_compile_definitions(blake3 PRIVATE BLAKE3_NO_SSE2=1 BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1)
|
target_compile_definitions(blake3 PRIVATE BLAKE3_NO_SSE2=1 BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 BLAKE3_NO_AVX512=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "blake3",
|
"name": "blake3",
|
||||||
"version": "1.3.1",
|
"version": "1.3.1",
|
||||||
|
"port-version": 1,
|
||||||
"description": "BLAKE3 cryptographic hash function.",
|
"description": "BLAKE3 cryptographic hash function.",
|
||||||
"homepage": "https://github.com/BLAKE3-team/BLAKE3",
|
"homepage": "https://github.com/BLAKE3-team/BLAKE3",
|
||||||
"license": "CC0-1.0 OR Apache-2.0",
|
"license": "CC0-1.0 OR Apache-2.0",
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"git-tree": "78cffdc59cdb9f1c75dffa671578203d0a79fa42",
|
||||||
|
"version": "1.3.1",
|
||||||
|
"port-version": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"git-tree": "62a5201ca424389c823b9b4be3d588e1cbb88a58",
|
"git-tree": "62a5201ca424389c823b9b4be3d588e1cbb88a58",
|
||||||
"version": "1.3.1",
|
"version": "1.3.1",
|
||||||
|
@ -502,7 +502,7 @@
|
|||||||
},
|
},
|
||||||
"blake3": {
|
"blake3": {
|
||||||
"baseline": "1.3.1",
|
"baseline": "1.3.1",
|
||||||
"port-version": 0
|
"port-version": 1
|
||||||
},
|
},
|
||||||
"blas": {
|
"blas": {
|
||||||
"baseline": "1",
|
"baseline": "1",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user