[bazel] BLAKE3: Adopt aarch64 and x86_64.

FIXME: arm(32) may be applicable here. I haven't tested yet.

Differential Revision: https://reviews.llvm.org/D126543
This commit is contained in:
NAKAMURA Takumi 2022-05-27 23:39:52 +09:00
parent 9191078707
commit de20fb72ad
1 changed files with 29 additions and 8 deletions

View File

@ -193,7 +193,19 @@ cc_library(
"lib/Support/BLAKE3/blake3.c",
"lib/Support/BLAKE3/blake3_dispatch.c",
"lib/Support/BLAKE3/blake3_portable.c",
],
] + select({
"@platforms//cpu:aarch64": [
"lib/Support/BLAKE3/blake3_neon.c",
],
"@platforms//cpu:x86_64": [
"lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S",
"lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S",
"lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S",
"lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S",
],
"//conditions:default": [
]
}),
hdrs = glob([
"include/llvm/Support/**/*.h",
"include/llvm/ADT/*.h",
@ -213,13 +225,22 @@ cc_library(
"include/llvm/Support/VCSRevision.h",
],
copts = llvm_copts,
defines = [
"BLAKE3_NO_AVX2",
"BLAKE3_NO_AVX512",
"BLAKE3_NO_SSE2",
"BLAKE3_NO_SSE41",
"BLAKE3_USE_NEON=0",
],
defines = select({
"@platforms//cpu:aarch64": [
],
"//conditions:default": [
"BLAKE3_USE_NEON=0",
]
}) + select({
"@platforms//cpu:x86_64": [
],
"//conditions:default": [
"BLAKE3_NO_AVX2",
"BLAKE3_NO_AVX512",
"BLAKE3_NO_SSE2",
"BLAKE3_NO_SSE41",
]
}),
includes = ["include"],
linkopts = select({
"@bazel_tools//src/conditions:windows": [],