diff --git a/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S b/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S --- a/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S +++ b/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S @@ -1,5 +1,7 @@ #if defined(__x86_64__) +#include "llvm_blake3_prefix.h" + #if defined(__ELF__) && defined(__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_gnu.S b/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_gnu.S --- a/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_gnu.S +++ b/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_gnu.S @@ -1,3 +1,5 @@ +#include "llvm_blake3_prefix.h" + .intel_syntax noprefix .global _blake3_hash_many_avx2 .global blake3_hash_many_avx2 diff --git a/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_msvc.asm b/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_msvc.asm --- a/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_msvc.asm +++ b/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_msvc.asm @@ -1,11 +1,11 @@ -public _blake3_hash_many_avx2 -public blake3_hash_many_avx2 +public _llvm_blake3_hash_many_avx2 +public llvm_blake3_hash_many_avx2 _TEXT SEGMENT ALIGN(16) 'CODE' ALIGN 16 -blake3_hash_many_avx2 PROC -_blake3_hash_many_avx2 PROC +llvm_blake3_hash_many_avx2 PROC +_llvm_blake3_hash_many_avx2 PROC push r15 push r14 push r13 @@ -1785,8 +1785,8 @@ vmovdqu xmmword ptr [rbx+10H], xmm1 jmp unwind -_blake3_hash_many_avx2 ENDP -blake3_hash_many_avx2 ENDP +_llvm_blake3_hash_many_avx2 ENDP +llvm_blake3_hash_many_avx2 ENDP _TEXT ENDS _RDATA SEGMENT READONLY PAGE ALIAS(".rdata") 'CONST' diff --git a/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S b/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S --- a/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S +++ b/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S @@ -1,5 +1,7 @@ #if defined(__x86_64__) +#include "llvm_blake3_prefix.h" + #if defined(__ELF__) && defined(__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_gnu.S b/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_gnu.S --- a/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_gnu.S +++ b/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_gnu.S @@ -1,3 +1,5 @@ +#include "llvm_blake3_prefix.h" + .intel_syntax noprefix .global _blake3_hash_many_avx512 diff --git a/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_msvc.asm b/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_msvc.asm --- a/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_msvc.asm +++ b/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_msvc.asm @@ -1,15 +1,15 @@ -public _blake3_hash_many_avx512 -public blake3_hash_many_avx512 -public blake3_compress_in_place_avx512 -public _blake3_compress_in_place_avx512 -public blake3_compress_xof_avx512 -public _blake3_compress_xof_avx512 +public _llvm_blake3_hash_many_avx512 +public llvm_blake3_hash_many_avx512 +public llvm_blake3_compress_in_place_avx512 +public _llvm_blake3_compress_in_place_avx512 +public llvm_blake3_compress_xof_avx512 +public _llvm_blake3_compress_xof_avx512 _TEXT SEGMENT ALIGN(16) 'CODE' ALIGN 16 -blake3_hash_many_avx512 PROC -_blake3_hash_many_avx512 PROC +llvm_blake3_hash_many_avx512 PROC +_llvm_blake3_hash_many_avx512 PROC push r15 push r14 push r13 @@ -2404,12 +2404,12 @@ vmovdqu xmmword ptr [rbx+10H], xmm1 jmp unwind -_blake3_hash_many_avx512 ENDP -blake3_hash_many_avx512 ENDP +_llvm_blake3_hash_many_avx512 ENDP +llvm_blake3_hash_many_avx512 ENDP ALIGN 16 -blake3_compress_in_place_avx512 PROC -_blake3_compress_in_place_avx512 PROC +llvm_blake3_compress_in_place_avx512 PROC +_llvm_blake3_compress_in_place_avx512 PROC sub rsp, 72 vmovdqa xmmword ptr [rsp], xmm6 vmovdqa xmmword ptr [rsp+10H], xmm7 @@ -2498,12 +2498,12 @@ vmovdqa xmm9, xmmword ptr [rsp+30H] add rsp, 72 ret -_blake3_compress_in_place_avx512 ENDP -blake3_compress_in_place_avx512 ENDP +_llvm_blake3_compress_in_place_avx512 ENDP +llvm_blake3_compress_in_place_avx512 ENDP ALIGN 16 -blake3_compress_xof_avx512 PROC -_blake3_compress_xof_avx512 PROC +llvm_blake3_compress_xof_avx512 PROC +_llvm_blake3_compress_xof_avx512 PROC sub rsp, 72 vmovdqa xmmword ptr [rsp], xmm6 vmovdqa xmmword ptr [rsp+10H], xmm7 @@ -2597,8 +2597,8 @@ vmovdqa xmm9, xmmword ptr [rsp+30H] add rsp, 72 ret -_blake3_compress_xof_avx512 ENDP -blake3_compress_xof_avx512 ENDP +_llvm_blake3_compress_xof_avx512 ENDP +llvm_blake3_compress_xof_avx512 ENDP _TEXT ENDS diff --git a/llvm/lib/Support/BLAKE3/blake3_impl.h b/llvm/lib/Support/BLAKE3/blake3_impl.h --- a/llvm/lib/Support/BLAKE3/blake3_impl.h +++ b/llvm/lib/Support/BLAKE3/blake3_impl.h @@ -11,15 +11,7 @@ // For \p LLVM_LIBRARY_VISIBILITY #include "llvm/Support/Compiler.h" -// Remove the 'llvm_' prefix for the rest of the internal implementation. -#define BLAKE3_VERSION_STRING LLVM_BLAKE3_VERSION_STRING -#define BLAKE3_KEY_LEN LLVM_BLAKE3_KEY_LEN -#define BLAKE3_OUT_LEN LLVM_BLAKE3_OUT_LEN -#define BLAKE3_BLOCK_LEN LLVM_BLAKE3_BLOCK_LEN -#define BLAKE3_CHUNK_LEN LLVM_BLAKE3_CHUNK_LEN -#define BLAKE3_MAX_DEPTH LLVM_BLAKE3_MAX_DEPTH -#define blake3_hasher llvm_blake3_hasher -#define blake3_chunk_state llvm_blake3_chunk_state +#include "llvm_blake3_prefix.h" // internal flags enum blake3_flags { diff --git a/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S b/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S --- a/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S +++ b/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S @@ -1,5 +1,7 @@ #if defined(__x86_64__) +#include "llvm_blake3_prefix.h" + #if defined(__ELF__) && defined(__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_windows_gnu.S b/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_windows_gnu.S --- a/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_windows_gnu.S +++ b/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_windows_gnu.S @@ -1,3 +1,5 @@ +#include "llvm_blake3_prefix.h" + .intel_syntax noprefix .global blake3_hash_many_sse2 .global _blake3_hash_many_sse2 diff --git a/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_windows_msvc.asm b/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_windows_msvc.asm --- a/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_windows_msvc.asm +++ b/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_windows_msvc.asm @@ -1,15 +1,15 @@ -public _blake3_hash_many_sse2 -public blake3_hash_many_sse2 -public blake3_compress_in_place_sse2 -public _blake3_compress_in_place_sse2 -public blake3_compress_xof_sse2 -public _blake3_compress_xof_sse2 +public _llvm_blake3_hash_many_sse2 +public llvm_blake3_hash_many_sse2 +public llvm_blake3_compress_in_place_sse2 +public _llvm_blake3_compress_in_place_sse2 +public llvm_blake3_compress_xof_sse2 +public _llvm_blake3_compress_xof_sse2 _TEXT SEGMENT ALIGN(16) 'CODE' ALIGN 16 -blake3_hash_many_sse2 PROC -_blake3_hash_many_sse2 PROC +llvm_blake3_hash_many_sse2 PROC +_llvm_blake3_hash_many_sse2 PROC push r15 push r14 push r13 @@ -2034,11 +2034,11 @@ movups xmmword ptr [rbx], xmm0 movups xmmword ptr [rbx+10H], xmm1 jmp unwind -_blake3_hash_many_sse2 ENDP -blake3_hash_many_sse2 ENDP +_llvm_blake3_hash_many_sse2 ENDP +llvm_blake3_hash_many_sse2 ENDP -blake3_compress_in_place_sse2 PROC -_blake3_compress_in_place_sse2 PROC +llvm_blake3_compress_in_place_sse2 PROC +_llvm_blake3_compress_in_place_sse2 PROC sub rsp, 120 movdqa xmmword ptr [rsp], xmm6 movdqa xmmword ptr [rsp+10H], xmm7 @@ -2164,12 +2164,12 @@ movdqa xmm15, xmmword ptr [rsp+60H] add rsp, 120 ret -_blake3_compress_in_place_sse2 ENDP -blake3_compress_in_place_sse2 ENDP +_llvm_blake3_compress_in_place_sse2 ENDP +llvm_blake3_compress_in_place_sse2 ENDP ALIGN 16 -blake3_compress_xof_sse2 PROC -_blake3_compress_xof_sse2 PROC +llvm_blake3_compress_xof_sse2 PROC +_llvm_blake3_compress_xof_sse2 PROC sub rsp, 120 movdqa xmmword ptr [rsp], xmm6 movdqa xmmword ptr [rsp+10H], xmm7 @@ -2302,8 +2302,8 @@ movdqa xmm15, xmmword ptr [rsp+60H] add rsp, 120 ret -_blake3_compress_xof_sse2 ENDP -blake3_compress_xof_sse2 ENDP +_llvm_blake3_compress_xof_sse2 ENDP +llvm_blake3_compress_xof_sse2 ENDP _TEXT ENDS diff --git a/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S b/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S --- a/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S +++ b/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S @@ -1,5 +1,7 @@ #if defined(__x86_64__) +#include "llvm_blake3_prefix.h" + #if defined(__ELF__) && defined(__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_windows_gnu.S b/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_windows_gnu.S --- a/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_windows_gnu.S +++ b/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_windows_gnu.S @@ -1,3 +1,5 @@ +#include "llvm_blake3_prefix.h" + .intel_syntax noprefix .global blake3_hash_many_sse41 .global _blake3_hash_many_sse41 diff --git a/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_windows_msvc.asm b/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_windows_msvc.asm --- a/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_windows_msvc.asm +++ b/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_windows_msvc.asm @@ -1,15 +1,15 @@ -public _blake3_hash_many_sse41 -public blake3_hash_many_sse41 -public blake3_compress_in_place_sse41 -public _blake3_compress_in_place_sse41 -public blake3_compress_xof_sse41 -public _blake3_compress_xof_sse41 +public _llvm_blake3_hash_many_sse41 +public llvm_blake3_hash_many_sse41 +public llvm_blake3_compress_in_place_sse41 +public _llvm_blake3_compress_in_place_sse41 +public llvm_blake3_compress_xof_sse41 +public _llvm_blake3_compress_xof_sse41 _TEXT SEGMENT ALIGN(16) 'CODE' ALIGN 16 -blake3_hash_many_sse41 PROC -_blake3_hash_many_sse41 PROC +llvm_blake3_hash_many_sse41 PROC +_llvm_blake3_hash_many_sse41 PROC push r15 push r14 push r13 @@ -1797,11 +1797,11 @@ movups xmmword ptr [rbx], xmm0 movups xmmword ptr [rbx+10H], xmm1 jmp unwind -_blake3_hash_many_sse41 ENDP -blake3_hash_many_sse41 ENDP +_llvm_blake3_hash_many_sse41 ENDP +llvm_blake3_hash_many_sse41 ENDP -blake3_compress_in_place_sse41 PROC -_blake3_compress_in_place_sse41 PROC +llvm_blake3_compress_in_place_sse41 PROC +_llvm_blake3_compress_in_place_sse41 PROC sub rsp, 120 movdqa xmmword ptr [rsp], xmm6 movdqa xmmword ptr [rsp+10H], xmm7 @@ -1916,12 +1916,12 @@ movdqa xmm15, xmmword ptr [rsp+60H] add rsp, 120 ret -_blake3_compress_in_place_sse41 ENDP -blake3_compress_in_place_sse41 ENDP +_llvm_blake3_compress_in_place_sse41 ENDP +llvm_blake3_compress_in_place_sse41 ENDP ALIGN 16 -blake3_compress_xof_sse41 PROC -_blake3_compress_xof_sse41 PROC +llvm_blake3_compress_xof_sse41 PROC +_llvm_blake3_compress_xof_sse41 PROC sub rsp, 120 movdqa xmmword ptr [rsp], xmm6 movdqa xmmword ptr [rsp+10H], xmm7 @@ -2043,8 +2043,8 @@ movdqa xmm15, xmmword ptr [rsp+60H] add rsp, 120 ret -_blake3_compress_xof_sse41 ENDP -blake3_compress_xof_sse41 ENDP +_llvm_blake3_compress_xof_sse41 ENDP +llvm_blake3_compress_xof_sse41 ENDP _TEXT ENDS diff --git a/llvm/lib/Support/BLAKE3/llvm_blake3_prefix.h b/llvm/lib/Support/BLAKE3/llvm_blake3_prefix.h new file mode 100644 --- /dev/null +++ b/llvm/lib/Support/BLAKE3/llvm_blake3_prefix.h @@ -0,0 +1,41 @@ +#ifndef LLVM_BLAKE3_PREFIX_H +#define LLVM_BLAKE3_PREFIX_H + +#define BLAKE3_VERSION_STRING LLVM_BLAKE3_VERSION_STRING +#define BLAKE3_KEY_LEN LLVM_BLAKE3_KEY_LEN +#define BLAKE3_OUT_LEN LLVM_BLAKE3_OUT_LEN +#define BLAKE3_BLOCK_LEN LLVM_BLAKE3_BLOCK_LEN +#define BLAKE3_CHUNK_LEN LLVM_BLAKE3_CHUNK_LEN +#define BLAKE3_MAX_DEPTH LLVM_BLAKE3_MAX_DEPTH +#define blake3_hasher llvm_blake3_hasher +#define blake3_chunk_state llvm_blake3_chunk_state +#define blake3_compress_in_place llvm_blake3_compress_in_place +#define blake3_compress_xof llvm_blake3_compress_xof +#define blake3_hash_many llvm_blake3_hash_many +#define blake3_simd_degree llvm_blake3_simd_degree +#define blake3_compress_in_place_portable llvm_blake3_compress_in_place_portable +#define blake3_compress_xof_portable llvm_blake3_compress_xof_portable +#define blake3_hash_many_portable llvm_blake3_hash_many_portable +#define blake3_compress_in_place_sse2 llvm_blake3_compress_in_place_sse2 +#define _blake3_compress_in_place_sse2 _llvm_blake3_compress_in_place_sse2 +#define blake3_compress_xof_sse2 llvm_blake3_compress_xof_sse2 +#define _blake3_compress_xof_sse2 _llvm_blake3_compress_xof_sse2 +#define blake3_hash_many_sse2 llvm_blake3_hash_many_sse2 +#define _blake3_hash_many_sse2 _llvm_blake3_hash_many_sse2 +#define blake3_compress_in_place_sse41 llvm_blake3_compress_in_place_sse41 +#define _blake3_compress_in_place_sse41 _llvm_blake3_compress_in_place_sse41 +#define blake3_compress_xof_sse41 llvm_blake3_compress_xof_sse41 +#define _blake3_compress_xof_sse41 _llvm_blake3_compress_xof_sse41 +#define blake3_hash_many_sse41 llvm_blake3_hash_many_sse41 +#define _blake3_hash_many_sse41 _llvm_blake3_hash_many_sse41 +#define blake3_hash_many_avx2 llvm_blake3_hash_many_avx2 +#define _blake3_hash_many_avx2 _llvm_blake3_hash_many_avx2 +#define blake3_compress_in_place_avx512 llvm_blake3_compress_in_place_avx512 +#define _blake3_compress_in_place_avx512 _llvm_blake3_compress_in_place_avx512 +#define blake3_compress_xof_avx512 llvm_blake3_compress_xof_avx512 +#define _blake3_compress_xof_avx512 _llvm_blake3_compress_xof_avx512 +#define blake3_hash_many_avx512 llvm_blake3_hash_many_avx512 +#define _blake3_hash_many_avx512 _llvm_blake3_hash_many_avx512 +#define blake3_hash_many_neon llvm_blake3_hash_many_neon + +#endif /* LLVM_BLAKE3_PREFIX_H */