-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update blake3 fixups from buck2 repo
- Loading branch information
1 parent
1cd9b7f
commit 30d0c2d
Showing
1 changed file
with
90 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,93 @@ | ||
[[buildscript]] | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under both the MIT license found in the | ||
# LICENSE-MIT file in the root directory of this source tree and the Apache | ||
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory | ||
# of this source tree. | ||
|
||
[buildscript.cxx_library] | ||
name = "blake3_avx512" | ||
srcs = ["c/blake3_avx512.c"] | ||
buildscript = [] | ||
|
||
## The various X86 platform fixups | ||
|
||
[platform_fixup.'cfg(target_arch = "x86_64")'] | ||
cfgs = [ | ||
"blake3_sse2_ffi", | ||
"blake3_sse41_ffi", | ||
"blake3_avx2_ffi", | ||
"blake3_avx512_ffi", | ||
] | ||
buildscript = [] | ||
|
||
# , any(target_env = "fbcode", target_env = "gnu") | ||
[[platform_fixup.'cfg(all(target_arch = "x86_64", any(target_os = "linux", target_os = "macos")))'.buildscript]] | ||
[platform_fixup.'cfg(all(target_arch = "x86_64", any(target_os = "linux", target_os = "macos")))'.buildscript.cxx_library] | ||
name = "simd_x86_unix" | ||
srcs = [ | ||
"c/blake3.c", | ||
"c/blake3_dispatch.c", | ||
"c/blake3_portable.c", | ||
"c/blake3_sse2_x86-64_unix.S", | ||
"c/blake3_sse41_x86-64_unix.S", | ||
"c/blake3_avx2_x86-64_unix.S", | ||
"c/blake3_avx512_x86-64_unix.S", | ||
] | ||
# Older versions of Clang require these flags, even for assembly. See | ||
# https://github.com/BLAKE3-team/BLAKE3/issues/79. | ||
compiler_flags = ["-mavx512f", "-mavx512vl"] | ||
headers = ["c/*.h"] | ||
compatible_with = [ | ||
"prelude//os/constraints:linux", | ||
"prelude//os/constraints:macos", | ||
] | ||
|
||
[[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "gnu"))'.buildscript]] | ||
[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "gnu"))'.buildscript.cxx_library] | ||
name = "simd_x86_windows_gnu" | ||
srcs = [ | ||
"c/blake3.c", | ||
"c/blake3_dispatch.c", | ||
"c/blake3_portable.c", | ||
"c/blake3_sse2_x86-64_windows_gnu.S", | ||
"c/blake3_sse41_x86-64_windows_gnu.S", | ||
"c/blake3_avx2_x86-64_windows_gnu.S", | ||
"c/blake3_avx512_x86-64_windows_gnu.S", | ||
] | ||
# Older versions of Clang require these flags, even for assembly. See | ||
# https://github.com/BLAKE3-team/BLAKE3/issues/79. | ||
compiler_flags = ["-mavx512f", "-mavx512vl"] | ||
headers = ["c/*.h"] | ||
compatible_with = ["prelude//os/constraints:windows"] | ||
|
||
[[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc"))'.buildscript]] | ||
[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc"))'.buildscript.cxx_library] | ||
name = "simd_x86_windows_msvc" | ||
srcs = [ | ||
"c/blake3.c", | ||
"c/blake3_dispatch.c", | ||
"c/blake3_portable.c", | ||
"c/blake3_sse2_x86-64_windows_msvc.asm", | ||
"c/blake3_sse41_x86-64_windows_msvc.asm", | ||
"c/blake3_avx2_x86-64_windows_msvc.asm", | ||
"c/blake3_avx512_x86-64_windows_msvc.asm", | ||
] | ||
headers = ["c/*.h"] | ||
compatible_with = ["prelude//os/constraints:windows"] | ||
|
||
## ARM and AArch64 fixups | ||
|
||
[platform_fixup.'cfg(any(target_arch = "aarch64", target_arch = "arm"))'] | ||
cfgs = ["blake3_neon"] | ||
buildscript = [] | ||
|
||
[[platform_fixup.'cfg(target_arch = "aarch64")'.buildscript]] | ||
[platform_fixup.'cfg(target_arch = "aarch64")'.buildscript.cxx_library] | ||
name = "simd_neon-aarch64" | ||
srcs = ["c/blake3_neon.c"] | ||
headers = ["c/*.h"] | ||
|
||
[[platform_fixup.'cfg(target_arch = "arm")'.buildscript]] | ||
[platform_fixup.'cfg(target_arch = "arm")'.buildscript.cxx_library] | ||
name = "simd_neon-armv7" | ||
srcs = ["c/blake3_neon.c"] | ||
compiler_flags = ["-mfpu=neon-vfpv4", "-mfloat-abi=hard"] | ||
headers = ["c/*.h"] |