File tree Expand file tree Collapse file tree 2 files changed +3
-28
lines changed Expand file tree Collapse file tree 2 files changed +3
-28
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ typedef struct _search_state {
115
115
#ifdef ENABLE_SIMD
116
116
const char * chunk_base ;
117
117
const char * chunk_end ;
118
- uint8_t has_matches ;
118
+ bool has_matches ;
119
119
120
120
#ifdef HAVE_SIMD_NEON
121
121
uint64_t matches_mask ;
@@ -223,11 +223,8 @@ static inline FORCE_INLINE void escape_UTF8_char_basic(search_state *search)
223
223
*/
224
224
static inline void convert_UTF8_to_JSON (search_state * search )
225
225
{
226
- unsigned char num_chars = 0 ;
227
- while ((num_chars = search_escape_basic_impl (search ))) {
228
- do {
229
- escape_UTF8_char_basic (search );
230
- } while (-- num_chars );
226
+ while (search_escape_basic_impl (search )) {
227
+ escape_UTF8_char_basic (search );
231
228
}
232
229
}
233
230
@@ -510,10 +507,6 @@ static inline TARGET_SSE2 FORCE_INLINE unsigned char search_escape_basic_sse2(se
510
507
continue ;
511
508
}
512
509
513
- if (popcount32 (needs_escape_mask ) >= sizeof (__m128i )/2 ) {
514
- return sizeof (__m128i );
515
- }
516
-
517
510
search -> has_matches = 1 ;
518
511
search -> matches_mask = needs_escape_mask ;
519
512
search -> chunk_base = search -> ptr ;
@@ -539,10 +532,6 @@ static inline TARGET_SSE2 FORCE_INLINE unsigned char search_escape_basic_sse2(se
539
532
return 0 ;
540
533
}
541
534
542
- if (popcount32 (needs_escape_mask ) >= sizeof (__m128i )/2 ) {
543
- return remaining ;
544
- }
545
-
546
535
search -> has_matches = 1 ;
547
536
search -> matches_mask = needs_escape_mask ;
548
537
search -> chunk_base = search -> ptr ;
Original file line number Diff line number Diff line change @@ -48,20 +48,6 @@ static inline int trailing_zeros(int input) {
48
48
#endif
49
49
}
50
50
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
-
65
51
#define SIMD_MINIMUM_THRESHOLD 6
66
52
67
53
#if defined(__ARM_NEON ) || defined(__ARM_NEON__ ) || defined(__aarch64__ ) || defined(_M_ARM64 )
You can’t perform that action at this time.
0 commit comments