diff --git a/llvm/lib/Support/BLAKE3/CMakeLists.txt b/llvm/lib/Support/BLAKE3/CMakeLists.txt index 51a6ee84768db0..718dd6421648da 100644 --- a/llvm/lib/Support/BLAKE3/CMakeLists.txt +++ b/llvm/lib/Support/BLAKE3/CMakeLists.txt @@ -1,7 +1,7 @@ set(LLVM_BLAKE3_FILES - BLAKE3/blake3.c - BLAKE3/blake3_dispatch.c - BLAKE3/blake3_portable.c + blake3.c + blake3_dispatch.c + blake3_portable.c ) # The BLAKE3 team recommends using the assembly versions, from the README: @@ -12,38 +12,43 @@ set(LLVM_BLAKE3_FILES # preferred. They perform better, they perform more consistently across # different compilers, and they build more quickly." # FIXME: Figure out what is wrong with the builders when using the assembly files and neon. +if (MSVC) + enable_language(ASM_MASM) +endif() + if (FALSE)#CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$") if (MSVC) list(APPEND LLVM_BLAKE3_FILES - BLAKE3/blake3_sse2_x86-64_windows_msvc.asm - BLAKE3/blake3_sse41_x86-64_windows_msvc.asm - BLAKE3/blake3_avx2_x86-64_windows_msvc.asm - BLAKE3/blake3_avx512_x86-64_windows_msvc.asm + blake3_sse2_x86-64_windows_msvc.asm + blake3_sse41_x86-64_windows_msvc.asm + blake3_avx2_x86-64_windows_msvc.asm + blake3_avx512_x86-64_windows_msvc.asm ) elseif(WIN32) list(APPEND LLVM_BLAKE3_FILES - BLAKE3/blake3_sse2_x86-64_windows_gnu.S - BLAKE3/blake3_sse41_x86-64_windows_gnu.S - BLAKE3/blake3_avx2_x86-64_windows_gnu.S - BLAKE3/blake3_avx512_x86-64_windows_gnu.S + blake3_sse2_x86-64_windows_gnu.S + blake3_sse41_x86-64_windows_gnu.S + blake3_avx2_x86-64_windows_gnu.S + blake3_avx512_x86-64_windows_gnu.S ) else() list(APPEND LLVM_BLAKE3_FILES - BLAKE3/blake3_sse2_x86-64_unix.S - BLAKE3/blake3_sse41_x86-64_unix.S - BLAKE3/blake3_avx2_x86-64_unix.S - BLAKE3/blake3_avx512_x86-64_unix.S + blake3_sse2_x86-64_unix.S + blake3_sse41_x86-64_unix.S + blake3_avx2_x86-64_unix.S + blake3_avx512_x86-64_unix.S ) endif() endif() if (FALSE)#CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|aarch)") list(APPEND LLVM_BLAKE3_FILES - BLAKE3/blake3_neon.c + blake3_neon.c ) endif() -set(LLVM_BLAKE3_FILES - ${LLVM_BLAKE3_FILES} - PARENT_SCOPE -) +# FIXME: Figure out what is wrong with the builders when using the assembly files. +add_definitions(-DBLAKE3_NO_AVX512 -DBLAKE3_NO_AVX2 -DBLAKE3_NO_SSE41 -DBLAKE3_NO_SSE2 -DBLAKE3_USE_NEON=0) + +add_library(LLVMSupportBlake3 OBJECT EXCLUDE_FROM_ALL ${LLVM_BLAKE3_FILES}) +llvm_update_compile_flags(LLVMSupportBlake3) diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt index edaf5db2867e99..7cbff3dddbcdf9 100644 --- a/llvm/lib/Support/CMakeLists.txt +++ b/llvm/lib/Support/CMakeLists.txt @@ -101,14 +101,7 @@ if(LLVM_INTEGRATED_CRT_ALLOC) endif() endif() -# Sets up the LLVM_BLAKE3_FILES variable with the files to compile. add_subdirectory(BLAKE3) -if (MSVC) - enable_language(ASM_MASM) -endif() -# FIXME: Figure out what is wrong with the builders when using the assembly files. -add_definitions(-DBLAKE3_NO_AVX512 -DBLAKE3_NO_AVX2 -DBLAKE3_NO_SSE41 -DBLAKE3_NO_SSE2 -DBLAKE3_USE_NEON=0) - add_llvm_component_library(LLVMSupport AArch64TargetParser.cpp @@ -244,7 +237,7 @@ add_llvm_component_library(LLVMSupport Z3Solver.cpp ${ALLOCATOR_FILES} - ${LLVM_BLAKE3_FILES} + $ # System Atomic.cpp diff --git a/llvm/utils/gn/secondary/llvm/lib/Support/BLAKE3/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Support/BLAKE3/BUILD.gn index 9076cb95d02c14..01a85ba249e55b 100644 --- a/llvm/utils/gn/secondary/llvm/lib/Support/BLAKE3/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/lib/Support/BLAKE3/BUILD.gn @@ -1,6 +1,10 @@ static_library("BLAKE3") { output_name = "LLVMSupportBlake3" - sources = [ "blake3.c", "blake3_dispatch.c", "blake3_portable.c" ] + sources = [ + "blake3.c", + "blake3_dispatch.c", + "blake3_portable.c", + ] defines = [ "BLAKE3_NO_AVX512", "BLAKE3_NO_AVX2", @@ -12,17 +16,14 @@ static_library("BLAKE3") { source_set("hack") { sources = [ - "BLAKE3/blake3.c", - "BLAKE3/blake3_avx2_x86-64_unix.S", - "BLAKE3/blake3_avx2_x86-64_windows_gnu.S", - "BLAKE3/blake3_avx512_x86-64_unix.S", - "BLAKE3/blake3_avx512_x86-64_windows_gnu.S", - "BLAKE3/blake3_dispatch.c", - "BLAKE3/blake3_neon.c", - "BLAKE3/blake3_portable.c", - "BLAKE3/blake3_sse2_x86-64_unix.S", - "BLAKE3/blake3_sse2_x86-64_windows_gnu.S", - "BLAKE3/blake3_sse41_x86-64_unix.S", - "BLAKE3/blake3_sse41_x86-64_windows_gnu.S", + "blake3_avx2_x86-64_unix.S", + "blake3_avx2_x86-64_windows_gnu.S", + "blake3_avx512_x86-64_unix.S", + "blake3_avx512_x86-64_windows_gnu.S", + "blake3_neon.c", + "blake3_sse2_x86-64_unix.S", + "blake3_sse2_x86-64_windows_gnu.S", + "blake3_sse41_x86-64_unix.S", + "blake3_sse41_x86-64_windows_gnu.S", ] }