aboutsummaryrefslogtreecommitdiff
path: root/string/include/benchlib.h
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2025-01-10 10:34:52 +0000
committerAndrew Turner <andrew@FreeBSD.org>2025-01-10 10:39:34 +0000
commit9d1de25930735261c16ed874a933b4c1f1d9041e (patch)
treeb0cac1c933cc1ecb885c7e757b89ffbf13f1f012 /string/include/benchlib.h
parentedc5c0de794f521eb620d2b6cbaee2434442a8f3 (diff)
Diffstat (limited to 'string/include/benchlib.h')
-rw-r--r--string/include/benchlib.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/string/include/benchlib.h b/string/include/benchlib.h
index f1bbea388cd2..486504e99ddf 100644
--- a/string/include/benchlib.h
+++ b/string/include/benchlib.h
@@ -30,4 +30,35 @@ rand32 (uint32_t seed)
return res;
}
+/* Macros to run a benchmark BENCH using string function FN. */
+#define RUN(BENCH, FN) BENCH(#FN, FN)
+#if __aarch64__
+# define RUNA64(BENCH, FN) BENCH(#FN, FN)
+#else
+# define RUNA64(BENCH, FN)
+#endif
+
+#if __ARM_FEATURE_SVE
+# define RUNSVE(BENCH, FN) BENCH(#FN, FN)
+#else
+# define RUNSVE(BENCH, FN)
+#endif
+
+#if WANT_MOPS
+# define RUNMOPS(BENCH, FN) BENCH(#FN, FN)
+#else
+# define RUNMOPS(BENCH, FN)
+#endif
+
+#if __arm__
+# define RUNA32(BENCH, FN) BENCH(#FN, FN)
+#else
+# define RUNA32(BENCH, FN)
+#endif
+
+#if __arm__ && __ARM_ARCH >= 6 && __ARM_ARCH_ISA_THUMB == 2
+# define RUNT32(BENCH, FN) BENCH(#FN, FN)
+#else
+# define RUNT32(BENCH, FN)
+#endif