1 #ifndef SIMDJSON_FALLBACK_NUMBERPARSING_H
2 #define SIMDJSON_FALLBACK_NUMBERPARSING_H
4 #ifdef JSON_TEST_NUMBERS
5 void found_invalid_number(
const uint8_t *buf);
6 void found_integer(int64_t result,
const uint8_t *buf);
7 void found_unsigned_integer(uint64_t result,
const uint8_t *buf);
8 void found_float(
double result,
const uint8_t *buf);
12 namespace SIMDJSON_IMPLEMENTATION {
15 static simdjson_inline uint32_t parse_eight_digits_unrolled(
const char *chars) {
17 memcpy(&val, chars,
sizeof(uint64_t));
18 val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8;
19 val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16;
20 return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32);
22 static simdjson_inline uint32_t parse_eight_digits_unrolled(
const uint8_t *chars) {
23 return parse_eight_digits_unrolled(
reinterpret_cast<const char *
>(chars));
30 #define SIMDJSON_SWAR_NUMBER_PARSING 1
32 #include "simdjson/generic/numberparsing.h"
We want to support argument-dependent lookup (ADL).