Opting for a more common intrinsic.
This commit is contained in:
parent
3c7a17cbc1
commit
17f5d0517d
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
//#define MAX_JSON_BYTES 0xFFFFFF
|
||||
|
||||
|
||||
const u32 MAX_DEPTH = 256;
|
||||
const u32 DEPTH_SAFETY_MARGIN = 32; // should be power-of-2 as we check this
|
||||
|
@ -20,7 +20,13 @@ const u32 REDLINE_DEPTH = MAX_DEPTH - DEPTH_SAFETY_MARGIN;
|
|||
const size_t MAX_TAPE_ENTRIES = 127 * 1024;
|
||||
const size_t MAX_TAPE = MAX_DEPTH * MAX_TAPE_ENTRIES;
|
||||
|
||||
/////////////
|
||||
// TODO: move this to be more like a real class
|
||||
// currently, you need to create it like so...
|
||||
// ParsedJson *pj_ptr = allocate_ParsedJson(numberofbytes); // allocate memory for parsing up to numberofbytes
|
||||
// and we clear it like so deallocate_ParsedJson(pj_ptr);
|
||||
// That's obviously not very C++-ish. It should be trivial to add a constructor and a destructor.
|
||||
////////////
|
||||
struct ParsedJson {
|
||||
public:
|
||||
size_t bytecapacity; // indicates how many bits are meant to be supported by
|
||||
|
|
|
@ -109,7 +109,7 @@ really_inline bool parse_string(const u8 *buf, UNUSED size_t len,
|
|||
#endif // CHECKUNESCAPED
|
||||
|
||||
u32 quote_dist = _mm_tzcnt_64(quote_bits);
|
||||
u32 bs_dist = _mm_tzcnt_64(bs_bits);
|
||||
u32 bs_dist = __tzcnt_u64(bs_bits);
|
||||
// store to dest unconditionally - we can overwrite the bits we don't like
|
||||
// later
|
||||
_mm256_storeu_si256((m256 *)(dst), v);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#endif
|
||||
|
||||
#define SET_BIT(i) \
|
||||
base_ptr[base + i] = (u32)idx + _mm_tzcnt_64(s); \
|
||||
base_ptr[base + i] = (u32)idx + __tzcnt_u64(s); \
|
||||
s = s & (s - 1);
|
||||
|
||||
#define SET_BIT1 SET_BIT(0)
|
||||
|
|
Loading…
Reference in New Issue