Skip to content

Commit 6e60a3d

Browse files
authored
Merge pull request #4151 from akyrtzi/reenable-blake3-simd
[Support/BLAKE3] Re-enable BLAKE3 assembly implementation
2 parents 89ed1bc + f2f13b7 commit 6e60a3d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

llvm/lib/Support/BLAKE3/CMakeLists.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ set(LLVM_BLAKE3_FILES
44
blake3_portable.c
55
)
66

7-
# Temporary disable assembly until rdar://91050484 is investigated.
8-
set(CAN_USE_ASSEMBLER FALSE)
9-
107
# The BLAKE3 team recommends using the assembly versions, from the README:
118
#
129
# "For each of the x86 SIMD instruction sets, four versions are available:
@@ -21,9 +18,17 @@ if (MSVC)
2118
else()
2219
check_symbol_exists(__x86_64__ "" IS_X64)
2320
check_symbol_exists(__aarch64__ "" IS_ARM64)
21+
22+
if (IS_X64)
23+
# Clang-6 needs this flag.
24+
set_source_files_properties(blake3_avx512_x86-64_windows_gnu.S
25+
PROPERTIES COMPILE_OPTIONS "-mavx512vl")
26+
set_source_files_properties(blake3_avx512_x86-64_unix.S
27+
PROPERTIES COMPILE_OPTIONS "-mavx512vl")
28+
endif()
2429
endif()
2530

26-
if (IS_X64 AND CAN_USE_ASSEMBLER)
31+
if (IS_X64)
2732
if (MSVC)
2833
enable_language(ASM_MASM)
2934
list(APPEND LLVM_BLAKE3_FILES
@@ -55,9 +60,5 @@ if (IS_ARM64)
5560
)
5661
endif()
5762

58-
if (IS_X64 AND NOT CAN_USE_ASSEMBLER)
59-
add_definitions(-DBLAKE3_NO_AVX512 -DBLAKE3_NO_AVX2 -DBLAKE3_NO_SSE41 -DBLAKE3_NO_SSE2)
60-
endif()
61-
6263
add_library(LLVMSupportBlake3 OBJECT EXCLUDE_FROM_ALL ${LLVM_BLAKE3_FILES})
6364
llvm_update_compile_flags(LLVMSupportBlake3)

0 commit comments

Comments
 (0)