1 #ifndef SIMDJSON_ARM64_NUMBERPARSING_DEFS_H
2 #define SIMDJSON_ARM64_NUMBERPARSING_DEFS_H
4 #ifndef SIMDJSON_CONDITIONAL_INCLUDE
5 #include "simdjson/arm64/base.h"
6 #include "simdjson/arm64/intrinsics.h"
7 #include "simdjson/internal/numberparsing_tables.h"
12 #if SIMDJSON_REGULAR_VISUAL_STUDIO && SIMDJSON_IS_ARM64
19 namespace numberparsing {
24 static simdjson_inline uint32_t parse_eight_digits_unrolled(
const uint8_t *chars) {
26 std::memcpy(&val, chars,
sizeof(uint64_t));
27 val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8;
28 val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16;
29 return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32);
32 simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) {
33 internal::value128 answer;
34 #if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS
37 answer.high = __umulh(value1, value2);
38 answer.low = value1 * value2;
40 answer.low = _umul128(value1, value2, &answer.high);
43 __uint128_t r = (
static_cast<__uint128_t
>(value1)) * value2;
44 answer.low = uint64_t(r);
45 answer.high = uint64_t(r >> 64);
54 #ifndef SIMDJSON_SWAR_NUMBER_PARSING
55 #if SIMDJSON_IS_BIG_ENDIAN
56 #define SIMDJSON_SWAR_NUMBER_PARSING 0
58 #define SIMDJSON_SWAR_NUMBER_PARSING 1
The top level simdjson namespace, containing everything the library provides.