1 #ifndef SIMDJSON_PPC64_NUMBERPARSING_DEFS_H
2 #define SIMDJSON_PPC64_NUMBERPARSING_DEFS_H
4 #ifndef SIMDJSON_CONDITIONAL_INCLUDE
5 #include "simdjson/ppc64/base.h"
6 #include "simdjson/ppc64/intrinsics.h"
7 #include "simdjson/internal/numberparsing_tables.h"
12 #if defined(__linux__)
14 #elif defined(__FreeBSD__)
15 #include <sys/endian.h>
20 namespace numberparsing {
25 static simdjson_inline uint32_t parse_eight_digits_unrolled(
const uint8_t *chars) {
27 std::memcpy(&val, chars,
sizeof(uint64_t));
29 #if defined(__linux__)
31 #elif defined(__FreeBSD__)
35 val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8;
36 val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16;
37 return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32);
41 simdjson_inline internal::value128 full_multiplication(uint64_t value1, uint64_t value2) {
42 internal::value128 answer;
43 #if SIMDJSON_REGULAR_VISUAL_STUDIO || SIMDJSON_IS_32BITS
46 answer.high = __umulh(value1, value2);
47 answer.low = value1 * value2;
49 answer.low = _umul128(value1, value2, &answer.high);
52 __uint128_t r = (
static_cast<__uint128_t
>(value1)) * value2;
53 answer.low = uint64_t(r);
54 answer.high = uint64_t(r >> 64);
63 #ifndef SIMDJSON_SWAR_NUMBER_PARSING
64 #if SIMDJSON_IS_BIG_ENDIAN
65 #define SIMDJSON_SWAR_NUMBER_PARSING 0
67 #define SIMDJSON_SWAR_NUMBER_PARSING 1
The top level simdjson namespace, containing everything the library provides.