[PATCH] D126543: [bazel] BLAKE3: Adopt aarch64 and x86_64.

NAKAMURA Takumi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 27 07:47:04 PDT 2022


chapuni created this revision.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
chapuni requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126543

Files:
  utils/bazel/llvm-project-overlay/llvm/BUILD.bazel


Index: utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
===================================================================
--- utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+++ utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
@@ -193,7 +193,17 @@
         "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",
+        ],
+    }),
     hdrs = glob([
         "include/llvm/Support/**/*.h",
         "include/llvm/ADT/*.h",
@@ -213,13 +223,22 @@
         "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": [],


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126543.432557.patch
Type: text/x-patch
Size: 1693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220527/b89328c7/attachment.bin>


More information about the llvm-commits mailing list