From deda9c8fc9617d27de3de58d57a79dc6ba3f0e5a Mon Sep 17 00:00:00 2001 From: Zhao Junwang Date: Sat, 28 Nov 2026 11:37:15 +0800 Subject: [PATCH] fix(util): compile the Mumbling SWAR lookup only when needed --- src/iceberg/util/mumbling_bitmap.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/iceberg/util/mumbling_bitmap.cc b/src/iceberg/util/mumbling_bitmap.cc index cbe43e890..e864bac17 100644 --- a/src/iceberg/util/mumbling_bitmap.cc +++ b/src/iceberg/util/mumbling_bitmap.cc @@ -61,6 +61,7 @@ bool ContainsByte(const uint8_t* container, uint8_t length, uint8_t value) { return false; } +#if !ICEBERG_MUMBLING_SSE2 // Portable SWAR (SIMD within a register) version of ContainsByte: compares 8 // bytes per 64-bit word. Reads 32 bytes at `container`, so the caller must // make sure they are inside the buffer. @@ -82,7 +83,7 @@ bool ContainsByte32(const uint8_t* container, uint8_t length, uint8_t value) { return found != 0; } -#if ICEBERG_MUMBLING_SSE2 +#else // SSE2 version of ContainsByte32. Reads 32 bytes at `container`, so the caller // must make sure they are inside the buffer. bool ContainsByte32Sse2(const uint8_t* container, uint8_t length, uint8_t value) {