[llvm] [Support] Add Arm NEON implementation for `llvm::xxh3_64bits` (PR #99634)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 21 23:17:58 PDT 2024


================
@@ -0,0 +1,31 @@
+#include "llvm/Support/xxhash.h"
+#include "benchmark/benchmark.h"
+
+static uint32_t xorshift(uint32_t State) {
+  State ^= State << 13;
+  State ^= State >> 17;
+  State ^= State << 5;
+  return State;
+}
+
+static void BM_xxh3_64bits(benchmark::State &State) {
+  uint32_t *Data = new uint32_t[State.range(0) / 4];
+
+  uint32_t Prev = 0xcafebabe;
+  for (int64_t I = 0; I < State.range(0) / 4; I++) {
+    Data[I] = Prev = xorshift(Prev);
----------------
MaskRay wrote:

remove braces https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements

https://github.com/llvm/llvm-project/pull/99634


More information about the llvm-commits mailing list