summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryintong <yintong.ustc@bytedance.com>2025-04-22 10:58:52 +0800
committerHans Kristian Rosbach <hk-github@circlestorm.org>2025-04-27 18:23:50 +0200
commit10b51fa592348799eecaad409a68ee0ec1e93dd9 (patch)
treef40db9569b1626ad8c3f125821660bd4185ffc60 /test
parent46fc33f39d0de9b85330c275b26391645a04ffa5 (diff)
downloadProject-Tick-10b51fa592348799eecaad409a68ee0ec1e93dd9.tar.gz
Project-Tick-10b51fa592348799eecaad409a68ee0ec1e93dd9.zip
riscv: add crc32 optimization using zbc extension
Diffstat (limited to 'test')
-rw-r--r--test/benchmarks/benchmark_crc32.cc3
-rw-r--r--test/test_crc32.cc3
2 files changed, 6 insertions, 0 deletions
diff --git a/test/benchmarks/benchmark_crc32.cc b/test/benchmarks/benchmark_crc32.cc
index e6947715ff..23a1dc196f 100644
--- a/test/benchmarks/benchmark_crc32.cc
+++ b/test/benchmarks/benchmark_crc32.cc
@@ -80,6 +80,9 @@ BENCHMARK_CRC32(native, native_crc32, 1);
#ifdef ARM_CRC32
BENCHMARK_CRC32(armv8, crc32_armv8, test_cpu_features.arm.has_crc32);
#endif
+#ifdef RISCV_CRC32_ZBC
+BENCHMARK_CRC32(riscv, crc32_riscv64_zbc, test_cpu_features.riscv.has_zbc);
+#endif
#ifdef POWER8_VSX_CRC32
BENCHMARK_CRC32(power8, crc32_power8, test_cpu_features.power.has_arch_2_07);
#endif
diff --git a/test/test_crc32.cc b/test/test_crc32.cc
index 56667f0283..2f768d0c4e 100644
--- a/test/test_crc32.cc
+++ b/test/test_crc32.cc
@@ -270,6 +270,9 @@ INSTANTIATE_TEST_SUITE_P(crc32_alignment, crc32_align, testing::ValuesIn(align_o
TEST_CRC32(armv8, crc32_armv8, test_cpu_features.arm.has_crc32)
TEST_CRC32_ALIGN(armv8_align, crc32_armv8, test_cpu_features.arm.has_crc32)
#endif
+#ifdef RISCV_CRC32_ZBC
+TEST_CRC32(riscv, crc32_riscv64_zbc, test_cpu_features.riscv.has_zbc)
+#endif
#ifdef POWER8_VSX_CRC32
TEST_CRC32(power8, crc32_power8, test_cpu_features.power.has_arch_2_07)
#endif