Skip to content

Commit d41c593

Browse files
committed
Dont do popcount in sse2 path either
1 parent 56c34a4 commit d41c593

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

ext/json/ext/generator/generator.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,6 @@ static inline TARGET_SSE2 FORCE_INLINE unsigned char search_escape_basic_sse2(se
510510
continue;
511511
}
512512

513-
if (popcount32(needs_escape_mask) >= sizeof(__m128i)/2) {
514-
return sizeof(__m128i);
515-
}
516-
517513
search->has_matches = 1;
518514
search->matches_mask = needs_escape_mask;
519515
search->chunk_base = search->ptr;
@@ -539,10 +535,6 @@ static inline TARGET_SSE2 FORCE_INLINE unsigned char search_escape_basic_sse2(se
539535
return 0;
540536
}
541537

542-
if (popcount32(needs_escape_mask) >= sizeof(__m128i)/2) {
543-
return remaining;
544-
}
545-
546538
search->has_matches = 1;
547539
search->matches_mask = needs_escape_mask;
548540
search->chunk_base = search->ptr;

ext/json/ext/generator/simd.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,6 @@ static inline int trailing_zeros(int input) {
4848
#endif
4949
}
5050

51-
uint32_t popcount32(uint32_t x) {
52-
#if defined(__GNUC__) || defined(__clang__)
53-
return __builtin_popcount(x);
54-
#elif defined(__ARM_NEON)
55-
#include <arm_neon.h>
56-
return vaddv_u8(vcnt_u8(vcreate_u8((uint64_t)x))) & 0xFF;
57-
#else
58-
x = x - ((x >> 1) & 0x55555555);
59-
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
60-
x = (x + (x >> 4)) & 0x0F0F0F0F;
61-
return (x * 0x01010101) >> 24;
62-
#endif
63-
}
64-
6551
#define SIMD_MINIMUM_THRESHOLD 6
6652

6753
#if defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(__aarch64__) || defined(_M_ARM64)

0 commit comments

Comments
 (0)