diff options
| author | Nathan Moinvaziri <nathan@nathanm.com> | 2026-02-02 13:25:08 -0800 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2026-02-06 14:52:54 +0100 |
| commit | 99e3729d5ec983fef319956c4e019ca53601faae (patch) | |
| tree | 03399ca4bae52781d98f567afda607a0de046169 /test | |
| parent | 39bf6fdac6850a304ed19502f0d19e3a0c4a4a4c (diff) | |
| download | Project-Tick-99e3729d5ec983fef319956c4e019ca53601faae.tar.gz Project-Tick-99e3729d5ec983fef319956c4e019ca53601faae.zip | |
Cleanup compare256 and compare256_rle implementations.
We no longer need to check for HAVE_BUILTIN_CTZ or HAVE_BUILTIN_CTZLL,
since that logic is now handled in zng_ctz32/zng_ctz64.
Diffstat (limited to 'test')
| -rw-r--r-- | test/benchmarks/benchmark_compare256.cc | 19 | ||||
| -rw-r--r-- | test/benchmarks/benchmark_compare256_rle.cc | 6 | ||||
| -rw-r--r-- | test/test_compare256.cc | 19 | ||||
| -rw-r--r-- | test/test_compare256_rle.cc | 6 |
4 files changed, 14 insertions, 36 deletions
diff --git a/test/benchmarks/benchmark_compare256.cc b/test/benchmarks/benchmark_compare256.cc index eb103af0d1..2d8352879d 100644 --- a/test/benchmarks/benchmark_compare256.cc +++ b/test/benchmarks/benchmark_compare256.cc @@ -9,7 +9,6 @@ extern "C" { # include "zbuild.h" # include "arch_functions.h" # include "../test_cpu_features.h" -# include "arch/generic/compare256_p.h" } #define MAX_COMPARE_SIZE (256 + 64) @@ -74,25 +73,21 @@ public: BENCHMARK_COMPARE256(native, native_compare256, 1); #else +#ifdef WITH_ALL_FALLBACKS BENCHMARK_COMPARE256(8, compare256_8, 1); -BENCHMARK_COMPARE256(16, compare256_16, 1); -#if defined(HAVE_BUILTIN_CTZ) -BENCHMARK_COMPARE256(32, compare256_32, 1); -#endif -#if defined(HAVE_BUILTIN_CTZLL) BENCHMARK_COMPARE256(64, compare256_64, 1); #endif -#if defined(X86_SSE2) && defined(HAVE_BUILTIN_CTZ) +#ifdef X86_SSE2 BENCHMARK_COMPARE256(sse2, compare256_sse2, test_cpu_features.x86.has_sse2); #endif -#if defined(X86_AVX2) && defined(HAVE_BUILTIN_CTZ) +#ifdef X86_AVX2 BENCHMARK_COMPARE256(avx2, compare256_avx2, test_cpu_features.x86.has_avx2); #endif -#if defined(X86_AVX512) && defined(HAVE_BUILTIN_CTZLL) +#ifdef X86_AVX512 BENCHMARK_COMPARE256(avx512, compare256_avx512, test_cpu_features.x86.has_avx512_common); #endif -#if defined(ARM_NEON) && defined(HAVE_BUILTIN_CTZLL) +#ifdef ARM_NEON BENCHMARK_COMPARE256(neon, compare256_neon, test_cpu_features.arm.has_neon); #endif #ifdef POWER9 @@ -101,10 +96,10 @@ BENCHMARK_COMPARE256(power9, compare256_power9, test_cpu_features.power.has_arch #ifdef RISCV_RVV BENCHMARK_COMPARE256(rvv, compare256_rvv, test_cpu_features.riscv.has_rvv); #endif -#if defined(LOONGARCH_LSX) && defined(HAVE_BUILTIN_CTZ) +#ifdef LOONGARCH_LSX BENCHMARK_COMPARE256(lsx, compare256_lsx, test_cpu_features.loongarch.has_lsx); #endif -#if defined(LOONGARCH_LASX) && defined(HAVE_BUILTIN_CTZ) +#ifdef LOONGARCH_LASX BENCHMARK_COMPARE256(lasx, compare256_lasx, test_cpu_features.loongarch.has_lasx); #endif diff --git a/test/benchmarks/benchmark_compare256_rle.cc b/test/benchmarks/benchmark_compare256_rle.cc index 96489cf59a..db5adacc19 100644 --- a/test/benchmarks/benchmark_compare256_rle.cc +++ b/test/benchmarks/benchmark_compare256_rle.cc @@ -69,10 +69,4 @@ public: BENCHMARK_REGISTER_F(compare256_rle, name)->Arg(1)->Arg(10)->Arg(40)->Arg(80)->Arg(100)->Arg(175)->Arg(256);; BENCHMARK_COMPARE256_RLE(8, compare256_rle_8, 1); -BENCHMARK_COMPARE256_RLE(16, compare256_rle_16, 1); -#if defined(HAVE_BUILTIN_CTZ) -BENCHMARK_COMPARE256_RLE(32, compare256_rle_32, 1); -#endif -#if defined(HAVE_BUILTIN_CTZLL) BENCHMARK_COMPARE256_RLE(64, compare256_rle_64, 1); -#endif diff --git a/test/test_compare256.cc b/test/test_compare256.cc index c689023a64..b3efe79fb9 100644 --- a/test/test_compare256.cc +++ b/test/test_compare256.cc @@ -12,7 +12,6 @@ extern "C" { # include "zutil.h" # include "arch_functions.h" # include "test_cpu_features.h" -# include "arch/generic/compare256_p.h" } #include <gtest/gtest.h> @@ -64,25 +63,21 @@ static inline void compare256_match_check(compare256_func compare256) { TEST_COMPARE256(native, native_compare256, 1) #else +#ifdef WITH_ALL_FALLBACKS TEST_COMPARE256(8, compare256_8, 1) -TEST_COMPARE256(16, compare256_16, 1) -#if defined(HAVE_BUILTIN_CTZ) -TEST_COMPARE256(32, compare256_32, 1) -#endif -#if defined(HAVE_BUILTIN_CTZLL) TEST_COMPARE256(64, compare256_64, 1) #endif -#if defined(X86_SSE2) && defined(HAVE_BUILTIN_CTZ) +#ifdef X86_SSE2 TEST_COMPARE256(sse2, compare256_sse2, test_cpu_features.x86.has_sse2) #endif -#if defined(X86_AVX2) && defined(HAVE_BUILTIN_CTZ) +#ifdef X86_AVX2 TEST_COMPARE256(avx2, compare256_avx2, test_cpu_features.x86.has_avx2) #endif -#if defined(X86_AVX512) && defined(HAVE_BUILTIN_CTZLL) +#ifdef X86_AVX512 TEST_COMPARE256(avx512, compare256_avx512, test_cpu_features.x86.has_avx512_common) #endif -#if defined(ARM_NEON) && defined(HAVE_BUILTIN_CTZLL) +#ifdef ARM_NEON TEST_COMPARE256(neon, compare256_neon, test_cpu_features.arm.has_neon) #endif #ifdef POWER9 @@ -91,10 +86,10 @@ TEST_COMPARE256(power9, compare256_power9, test_cpu_features.power.has_arch_3_00 #ifdef RISCV_RVV TEST_COMPARE256(rvv, compare256_rvv, test_cpu_features.riscv.has_rvv) #endif -#if defined(LOONGARCH_LSX) && defined(HAVE_BUILTIN_CTZ) +#ifdef LOONGARCH_LSX TEST_COMPARE256(lsx, compare256_lsx, test_cpu_features.loongarch.has_lsx) #endif -#if defined(LOONGARCH_LASX) && defined(HAVE_BUILTIN_CTZ) +#ifdef LOONGARCH_LASX TEST_COMPARE256(lasx, compare256_lasx, test_cpu_features.loongarch.has_lasx) #endif diff --git a/test/test_compare256_rle.cc b/test/test_compare256_rle.cc index 2ed85083fe..7a77fce59f 100644 --- a/test/test_compare256_rle.cc +++ b/test/test_compare256_rle.cc @@ -51,10 +51,4 @@ static inline void compare256_rle_match_check(compare256_rle_func compare256_rle } TEST_COMPARE256_RLE(8, compare256_rle_8, 1) -TEST_COMPARE256_RLE(16, compare256_rle_16, 1) -#if defined(HAVE_BUILTIN_CTZ) -TEST_COMPARE256_RLE(32, compare256_rle_32, 1) -#endif -#if defined(HAVE_BUILTIN_CTZLL) TEST_COMPARE256_RLE(64, compare256_rle_64, 1) -#endif |
