From 699f0b0942c5390a46aa84ada95e5d38a9f21a10 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Mon, 22 Sep 2025 16:02:10 -0500 Subject: [PATCH v1 1/2] Remove vector32_is_highbit_set(). --- src/include/port/pg_lfind.h | 2 +- src/include/port/simd.h | 23 ----------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/include/port/pg_lfind.h b/src/include/port/pg_lfind.h index 20f7497dcb7..0f460472601 100644 --- a/src/include/port/pg_lfind.h +++ b/src/include/port/pg_lfind.h @@ -139,7 +139,7 @@ pg_lfind32_simd_helper(const Vector32 keys, const uint32 *base) result = vector32_or(tmp1, tmp2); /* return whether there was a match */ - return vector32_is_highbit_set(result); + return vector8_is_highbit_set(result); } #endif /* ! USE_NO_SIMD */ diff --git a/src/include/port/simd.h b/src/include/port/simd.h index 97c5f353022..6424e8f5a97 100644 --- a/src/include/port/simd.h +++ b/src/include/port/simd.h @@ -78,7 +78,6 @@ static inline bool vector8_has_zero(const Vector8 v); static inline bool vector8_has_le(const Vector8 v, const uint8 c); static inline bool vector8_is_highbit_set(const Vector8 v); #ifndef USE_NO_SIMD -static inline bool vector32_is_highbit_set(const Vector32 v); static inline uint32 vector8_highbit_mask(const Vector8 v); #endif @@ -279,28 +278,6 @@ vector8_is_highbit_set(const Vector8 v) #endif } -/* - * Exactly like vector8_is_highbit_set except for the input type, so it - * looks at each byte separately. - * - * XXX x86 uses the same underlying type for 8-bit, 16-bit, and 32-bit - * integer elements, but Arm does not, hence the need for a separate - * function. We could instead adopt the behavior of Arm's vmaxvq_u32(), i.e. - * check each 32-bit element, but that would require an additional mask - * operation on x86. - */ -#ifndef USE_NO_SIMD -static inline bool -vector32_is_highbit_set(const Vector32 v) -{ -#if defined(USE_NEON) - return vector8_is_highbit_set((Vector8) v); -#else - return vector8_is_highbit_set(v); -#endif -} -#endif /* ! USE_NO_SIMD */ - /* * Return a bitmask formed from the high-bit of each element. */ -- 2.39.5 (Apple Git-154)