1 #ifndef SIMDJSON_LASX_NUMBERPARSING_DEFS_H
2 #define SIMDJSON_LASX_NUMBERPARSING_DEFS_H
4 #ifndef SIMDJSON_CONDITIONAL_INCLUDE
5 #include "simdjson/lasx/base.h"
6 #include "simdjson/lasx/intrinsics.h"
7 #include "simdjson/internal/numberparsing_tables.h"
14 namespace numberparsing {
19 static simdjson_inline uint32_t parse_eight_digits_unrolled(
const uint8_t *chars) {
21 std::memcpy(&val, chars,
sizeof(uint64_t));
22 val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8;
23 val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16;
24 return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32);
27 simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) {
28 internal::value128 answer;
29 __uint128_t r = (
static_cast<__uint128_t
>(value1)) * value2;
30 answer.low = uint64_t(r);
31 answer.high = uint64_t(r >> 64);
39 #ifndef SIMDJSON_SWAR_NUMBER_PARSING
40 #if SIMDJSON_IS_BIG_ENDIAN
41 #define SIMDJSON_SWAR_NUMBER_PARSING 0
43 #define SIMDJSON_SWAR_NUMBER_PARSING 1
The top level simdjson namespace, containing everything the library provides.