1#ifndef SIMDJSON_RVV_VLS_STRINGPARSING_DEFS_H
2#define SIMDJSON_RVV_VLS_STRINGPARSING_DEFS_H
4#ifndef SIMDJSON_CONDITIONAL_INCLUDE
5#include "simdjson/rvv-vls/base.h"
15struct backslash_and_quote {
17 static constexpr uint64_t BYTES_PROCESSED =
sizeof(simd8<uint8_t>);
18 simdjson_inline backslash_and_quote copy_and_find(
const uint8_t *src, uint8_t *dst);
20 simdjson_inline
bool has_quote_first() {
return ((bs_bits - 1) & quote_bits) != 0; }
21 simdjson_inline
bool has_backslash() {
return ((quote_bits - 1) & bs_bits) != 0; }
22 simdjson_inline
int quote_index() {
return trailing_zeroes(quote_bits); }
23 simdjson_inline
int backslash_index() {
return trailing_zeroes(bs_bits); }
29simdjson_inline backslash_and_quote backslash_and_quote::copy_and_find(
const uint8_t *src, uint8_t *dst) {
30 static_assert(
SIMDJSON_PADDING >= (BYTES_PROCESSED - 1),
"backslash and quote finder must process fewer than SIMDJSON_PADDING bytes");
31 simd8<uint8_t> v(src);
33 return { (v ==
'\\').to_bitmask(), (v ==
'"').to_bitmask() };
37 static constexpr uint64_t BYTES_PROCESSED =
sizeof(simd8<uint8_t>);
38 simdjson_inline
static escaping copy_and_find(
const uint8_t *src, uint8_t *dst);
40 simdjson_inline
bool has_escape() {
return escape_bits != 0; }
41 simdjson_inline
int escape_index() {
return trailing_zeroes(escape_bits) / 4; }
46simdjson_inline escaping escaping::copy_and_find(
const uint8_t *src, uint8_t *dst) {
47 static_assert(
SIMDJSON_PADDING >= (BYTES_PROCESSED - 1),
"escaping finder must process fewer than SIMDJSON_PADDING bytes");
48 simd8<uint8_t> v(src);
50 return { ((v ==
'"') | (v ==
'\\') | (v == 32)).to_bitmask() };
The top level simdjson namespace, containing everything the library provides.
constexpr size_t SIMDJSON_PADDING
The amount of padding needed in a buffer to parse JSON.