20
20
#include " allocators.h"
21
21
#include " stream.h"
22
22
#include " encodedstream.h"
23
+ #include " internal/clzll.h"
23
24
#include " internal/meta.h"
24
25
#include " internal/stack.h"
25
26
#include " internal/strtod.h"
@@ -443,16 +444,16 @@ inline const char *SkipWhitespace_SIMD(const char* p) {
443
444
444
445
x = vmvnq_u8 (x); // Negate
445
446
x = vrev64q_u8 (x); // Rev in 64
446
- uint64_t low = vgetq_lane_u64 (reinterpret_cast < uint64x2_t > (x), 0 ); // extract
447
- uint64_t high = vgetq_lane_u64 (reinterpret_cast < uint64x2_t > (x), 1 ); // extract
447
+ uint64_t low = vgetq_lane_u64 (vreinterpretq_u64_u8 (x), 0 ); // extract
448
+ uint64_t high = vgetq_lane_u64 (vreinterpretq_u64_u8 (x), 1 ); // extract
448
449
449
450
if (low == 0 ) {
450
451
if (high != 0 ) {
451
- int lz =__builtin_clzll (high); ;
452
+ uint32_t lz = RAPIDJSON_CLZLL (high);
452
453
return p + 8 + (lz >> 3 );
453
454
}
454
455
} else {
455
- int lz = __builtin_clzll (low); ;
456
+ uint32_t lz = RAPIDJSON_CLZLL (low);
456
457
return p + (lz >> 3 );
457
458
}
458
459
}
@@ -479,16 +480,16 @@ inline const char *SkipWhitespace_SIMD(const char* p, const char* end) {
479
480
480
481
x = vmvnq_u8 (x); // Negate
481
482
x = vrev64q_u8 (x); // Rev in 64
482
- uint64_t low = vgetq_lane_u64 (reinterpret_cast < uint64x2_t > (x), 0 ); // extract
483
- uint64_t high = vgetq_lane_u64 (reinterpret_cast < uint64x2_t > (x), 1 ); // extract
483
+ uint64_t low = vgetq_lane_u64 (vreinterpretq_u64_u8 (x), 0 ); // extract
484
+ uint64_t high = vgetq_lane_u64 (vreinterpretq_u64_u8 (x), 1 ); // extract
484
485
485
486
if (low == 0 ) {
486
487
if (high != 0 ) {
487
- int lz = __builtin_clzll (high);
488
+ uint32_t lz = RAPIDJSON_CLZLL (high);
488
489
return p + 8 + (lz >> 3 );
489
490
}
490
491
} else {
491
- int lz = __builtin_clzll (low);
492
+ uint32_t lz = RAPIDJSON_CLZLL (low);
492
493
return p + (lz >> 3 );
493
494
}
494
495
}
@@ -1244,19 +1245,19 @@ class GenericReader {
1244
1245
x = vorrq_u8 (x, vcltq_u8 (s, s3));
1245
1246
1246
1247
x = vrev64q_u8 (x); // Rev in 64
1247
- uint64_t low = vgetq_lane_u64 (reinterpret_cast < uint64x2_t > (x), 0 ); // extract
1248
- uint64_t high = vgetq_lane_u64 (reinterpret_cast < uint64x2_t > (x), 1 ); // extract
1248
+ uint64_t low = vgetq_lane_u64 (vreinterpretq_u64_u8 (x), 0 ); // extract
1249
+ uint64_t high = vgetq_lane_u64 (vreinterpretq_u64_u8 (x), 1 ); // extract
1249
1250
1250
1251
SizeType length = 0 ;
1251
1252
bool escaped = false ;
1252
1253
if (low == 0 ) {
1253
1254
if (high != 0 ) {
1254
- unsigned lz = ( unsigned ) __builtin_clzll ( high); ;
1255
+ uint32_t lz = RAPIDJSON_CLZLL ( high);
1255
1256
length = 8 + (lz >> 3 );
1256
1257
escaped = true ;
1257
1258
}
1258
1259
} else {
1259
- unsigned lz = ( unsigned ) __builtin_clzll ( low); ;
1260
+ uint32_t lz = RAPIDJSON_CLZLL ( low);
1260
1261
length = lz >> 3 ;
1261
1262
escaped = true ;
1262
1263
}
@@ -1314,19 +1315,19 @@ class GenericReader {
1314
1315
x = vorrq_u8 (x, vcltq_u8 (s, s3));
1315
1316
1316
1317
x = vrev64q_u8 (x); // Rev in 64
1317
- uint64_t low = vgetq_lane_u64 (reinterpret_cast < uint64x2_t > (x), 0 ); // extract
1318
- uint64_t high = vgetq_lane_u64 (reinterpret_cast < uint64x2_t > (x), 1 ); // extract
1318
+ uint64_t low = vgetq_lane_u64 (vreinterpretq_u64_u8 (x), 0 ); // extract
1319
+ uint64_t high = vgetq_lane_u64 (vreinterpretq_u64_u8 (x), 1 ); // extract
1319
1320
1320
1321
SizeType length = 0 ;
1321
1322
bool escaped = false ;
1322
1323
if (low == 0 ) {
1323
1324
if (high != 0 ) {
1324
- unsigned lz = ( unsigned ) __builtin_clzll (high);
1325
+ uint32_t lz = RAPIDJSON_CLZLL (high);
1325
1326
length = 8 + (lz >> 3 );
1326
1327
escaped = true ;
1327
1328
}
1328
1329
} else {
1329
- unsigned lz = ( unsigned ) __builtin_clzll (low);
1330
+ uint32_t lz = RAPIDJSON_CLZLL (low);
1330
1331
length = lz >> 3 ;
1331
1332
escaped = true ;
1332
1333
}
@@ -1370,17 +1371,17 @@ class GenericReader {
1370
1371
x = vorrq_u8 (x, vcltq_u8 (s, s3));
1371
1372
1372
1373
x = vrev64q_u8 (x); // Rev in 64
1373
- uint64_t low = vgetq_lane_u64 (reinterpret_cast < uint64x2_t > (x), 0 ); // extract
1374
- uint64_t high = vgetq_lane_u64 (reinterpret_cast < uint64x2_t > (x), 1 ); // extract
1374
+ uint64_t low = vgetq_lane_u64 (vreinterpretq_u64_u8 (x), 0 ); // extract
1375
+ uint64_t high = vgetq_lane_u64 (vreinterpretq_u64_u8 (x), 1 ); // extract
1375
1376
1376
1377
if (low == 0 ) {
1377
1378
if (high != 0 ) {
1378
- int lz = __builtin_clzll (high);
1379
+ uint32_t lz = RAPIDJSON_CLZLL (high);
1379
1380
p += 8 + (lz >> 3 );
1380
1381
break ;
1381
1382
}
1382
1383
} else {
1383
- int lz = __builtin_clzll (low);
1384
+ uint32_t lz = RAPIDJSON_CLZLL (low);
1384
1385
p += lz >> 3 ;
1385
1386
break ;
1386
1387
}
@@ -1403,7 +1404,7 @@ class GenericReader {
1403
1404
RAPIDJSON_FORCEINLINE Ch Peek () const { return is.Peek (); }
1404
1405
RAPIDJSON_FORCEINLINE Ch TakePush () { return is.Take (); }
1405
1406
RAPIDJSON_FORCEINLINE Ch Take () { return is.Take (); }
1406
- RAPIDJSON_FORCEINLINE void Push (char ) {}
1407
+ RAPIDJSON_FORCEINLINE void Push (char ) {}
1407
1408
1408
1409
size_t Tell () { return is.Tell (); }
1409
1410
size_t Length () { return 0 ; }
0 commit comments