Skip to content

Commit 3e74059

Browse files
committed
Fix the shuffle.
1 parent e90c0f4 commit 3e74059

File tree

4 files changed

+80
-41
lines changed

4 files changed

+80
-41
lines changed

scripts/python/shuf.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#table1=[16, 0, 0, 0, 0, 0, 0, 0, 0, 8, 12, 1, 2, 9, 0, 0]
2+
#table2=[8, 0, 18, 4, 0, 1, 0, 1, 0, 0, 0, 3, 2, 1, 0, 0]
3+
table1=[0 for i in range(16)]
4+
table2=[0 for i in range(16)]
5+
spaces0=[0x0a,0x09,0x0d]
6+
spaces2=[0x20]
7+
struct2=[0x2c]
8+
struct3=[0x3a]
9+
struct57=[0x5b,0x5d,0x7b,0x7d]
10+
11+
for s in struct2:
12+
table1[s&0xF]|=1
13+
table2[(s>>4)&0xF]|=1
14+
for s in struct3:
15+
table1[s&0xF]|=2
16+
table2[(s>>4)&0xF]|=2
17+
for s in struct57:
18+
table1[s&0xF]|=4
19+
table2[(s>>4)&0xF]|=4
20+
21+
for s in spaces0:
22+
table1[s&0xF]|=8
23+
table2[(s>>4)&0xF]|=8
24+
for s in spaces2:
25+
table1[s&0xF]|=16
26+
table2[(s>>4)&0xF]|=16
27+
28+
print(len(table1), len(table2))
29+
print(table1)
30+
print(table2)
31+
for i in range(256):
32+
low = i & 0xF
33+
high = (i >> 4) & 0xF
34+
m = table1[low] & table2[high]
35+
if(m!=0):
36+
if(i>=0x20):
37+
print(hex(i), chr(i), bin(m))
38+
else:
39+
print(hex(i), bin(m))

singleheader/amalgamation_demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Fri Jan 4 17:36:46 EST 2019. Do not edit! */
1+
/* auto-generated on Fri 4 Jan 2019 20:12:48 EST. Do not edit! */
22

33
#include <iostream>
44
#include "simdjson.h"

singleheader/simdjson.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/* auto-generated on Fri Jan 4 17:36:46 EST 2019. Do not edit! */
1+
/* auto-generated on Fri 4 Jan 2019 20:12:48 EST. Do not edit! */
22
#include "simdjson.h"
33

44
/* used for http://dmalloc.com/ Dmalloc - Debug Malloc Library */
55
#ifdef DMALLOC
66
#include "dmalloc.h"
77
#endif
88

9-
/* begin file /home/dlemire/CVS/github/simdjson/src/jsonioutil.cpp */
9+
/* begin file /Users/lemire/CVS/github/simdjson/src/jsonioutil.cpp */
1010
#include <cstring>
1111
#include <stdlib.h>
1212

@@ -47,8 +47,8 @@ std::string_view get_corpus(std::string filename) {
4747
}
4848
throw std::runtime_error("could not load corpus");
4949
}
50-
/* end file /home/dlemire/CVS/github/simdjson/src/jsonioutil.cpp */
51-
/* begin file /home/dlemire/CVS/github/simdjson/src/jsonminifier.cpp */
50+
/* end file /Users/lemire/CVS/github/simdjson/src/jsonioutil.cpp */
51+
/* begin file /Users/lemire/CVS/github/simdjson/src/jsonminifier.cpp */
5252
#include <cstdint>
5353
#ifndef __AVX2__
5454

@@ -298,8 +298,8 @@ size_t jsonminify(const uint8_t *buf, size_t len, uint8_t *out) {
298298
}
299299

300300
#endif
301-
/* end file /home/dlemire/CVS/github/simdjson/src/jsonminifier.cpp */
302-
/* begin file /home/dlemire/CVS/github/simdjson/src/jsonparser.cpp */
301+
/* end file /Users/lemire/CVS/github/simdjson/src/jsonminifier.cpp */
302+
/* begin file /Users/lemire/CVS/github/simdjson/src/jsonparser.cpp */
303303
#ifdef _MSC_VER
304304
#include <windows.h>
305305
#include <sysinfoapi.h>
@@ -369,8 +369,8 @@ ParsedJson build_parsed_json(const uint8_t *buf, size_t len, bool reallocifneede
369369
}
370370
return pj;
371371
}
372-
/* end file /home/dlemire/CVS/github/simdjson/src/jsonparser.cpp */
373-
/* begin file /home/dlemire/CVS/github/simdjson/src/stage1_find_marks.cpp */
372+
/* end file /Users/lemire/CVS/github/simdjson/src/jsonparser.cpp */
373+
/* begin file /Users/lemire/CVS/github/simdjson/src/stage1_find_marks.cpp */
374374
#include <cassert>
375375

376376
#ifndef SIMDJSON_SKIPUTF8VALIDATION
@@ -814,8 +814,8 @@ WARN_UNUSED
814814
return true;
815815
#endif
816816
}
817-
/* end file /home/dlemire/CVS/github/simdjson/src/stage1_find_marks.cpp */
818-
/* begin file /home/dlemire/CVS/github/simdjson/src/stage2_build_tape.cpp */
817+
/* end file /Users/lemire/CVS/github/simdjson/src/stage1_find_marks.cpp */
818+
/* begin file /Users/lemire/CVS/github/simdjson/src/stage2_build_tape.cpp */
819819
#ifdef _MSC_VER
820820
/* Microsoft C/C++-compatible compiler */
821821
#include <intrin.h>
@@ -1322,4 +1322,4 @@ bool unified_machine(const uint8_t *buf, size_t len, ParsedJson &pj) {
13221322
fail:
13231323
return false;
13241324
}
1325-
/* end file /home/dlemire/CVS/github/simdjson/src/stage2_build_tape.cpp */
1325+
/* end file /Users/lemire/CVS/github/simdjson/src/stage2_build_tape.cpp */

singleheader/simdjson.h

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* auto-generated on Fri Jan 4 17:36:46 EST 2019. Do not edit! */
2-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/portability.h */
1+
/* auto-generated on Fri 4 Jan 2019 20:12:48 EST. Do not edit! */
2+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/portability.h */
33
#ifndef SIMDJSON_PORTABILITY_H
44
#define SIMDJSON_PORTABILITY_H
55

@@ -122,8 +122,8 @@ static inline void aligned_free(void *memblock) {
122122
}
123123

124124
#endif /* end of include PORTABILITY_H */
125-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/portability.h */
126-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/common_defs.h */
125+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/portability.h */
126+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/common_defs.h */
127127
#ifndef SIMDJSON_COMMON_DEFS_H
128128
#define SIMDJSON_COMMON_DEFS_H
129129

@@ -182,8 +182,8 @@ static inline void aligned_free(void *memblock) {
182182
#endif // MSC_VER
183183

184184
#endif // COMMON_DEFS_H
185-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/common_defs.h */
186-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/jsoncharutils.h */
185+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/common_defs.h */
186+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/jsoncharutils.h */
187187
#ifndef SIMDJSON_JSONCHARUTILS_H
188188
#define SIMDJSON_JSONCHARUTILS_H
189189

@@ -312,8 +312,8 @@ inline size_t codepoint_to_utf8(uint32_t cp, uint8_t *c) {
312312
}
313313

314314
#endif
315-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/jsoncharutils.h */
316-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/jsonformatutils.h */
315+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/jsoncharutils.h */
316+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/jsonformatutils.h */
317317
#ifndef SIMDJSON_JSONFORMATUTILS_H
318318
#define SIMDJSON_JSONFORMATUTILS_H
319319

@@ -410,8 +410,8 @@ static inline void print_with_escapes(const char *src, std::ostream &os) {
410410
}
411411

412412
#endif
413-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/jsonformatutils.h */
414-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/jsonioutil.h */
413+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/jsonformatutils.h */
414+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/jsonioutil.h */
415415
#ifndef SIMDJSON_JSONIOUTIL_H
416416
#define SIMDJSON_JSONIOUTIL_H
417417

@@ -451,8 +451,8 @@ std::string_view get_corpus(std::string filename);
451451

452452

453453
#endif
454-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/jsonioutil.h */
455-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/simdprune_tables.h */
454+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/jsonioutil.h */
455+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/simdprune_tables.h */
456456
#ifndef SIMDJSON_SIMDPRUNE_TABLES_H
457457
#define SIMDJSON_SIMDPRUNE_TABLES_H
458458

@@ -35531,8 +35531,8 @@ static const uint32_t mask256_epi32[] = {
3553135531
#endif //__AVX2__
3553235532

3553335533
#endif
35534-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/simdprune_tables.h */
35535-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/simdutf8check.h */
35534+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/simdprune_tables.h */
35535+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/simdutf8check.h */
3553635536

3553735537
#ifndef SIMDJSON_SIMDUTF8CHECK_H
3553835538
#define SIMDJSON_SIMDUTF8CHECK_H
@@ -35727,8 +35727,8 @@ avxcheckUTF8Bytes(__m256i current_bytes,
3572735727
#warning "We require AVX2 support!"
3572835728
#endif // __AVX2__
3572935729
#endif
35730-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/simdutf8check.h */
35731-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/jsonminifier.h */
35730+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/simdutf8check.h */
35731+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/jsonminifier.h */
3573235732
#ifndef SIMDJSON_JSONMINIFIER_H
3573335733
#define SIMDJSON_JSONMINIFIER_H
3573435734

@@ -35751,8 +35751,8 @@ static inline size_t jsonminify(const std::string_view & p, char *out) {
3575135751
}
3575235752

3575335753
#endif
35754-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/jsonminifier.h */
35755-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/parsedjson.h */
35754+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/jsonminifier.h */
35755+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/parsedjson.h */
3575635756
#ifndef SIMDJSON_PARSEDJSON_H
3575735757
#define SIMDJSON_PARSEDJSON_H
3575835758

@@ -36500,8 +36500,8 @@ inline void dumpbits32_always(uint32_t v, const std::string &msg) {
3650036500

3650136501

3650236502
#endif
36503-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/parsedjson.h */
36504-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/stage1_find_marks.h */
36503+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/parsedjson.h */
36504+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/stage1_find_marks.h */
3650536505
#ifndef SIMDJSON_STAGE1_FIND_MARKS_H
3650636506
#define SIMDJSON_STAGE1_FIND_MARKS_H
3650736507

@@ -36515,8 +36515,8 @@ static inline bool find_structural_bits(const char *buf, size_t len, ParsedJson
3651536515
}
3651636516

3651736517
#endif
36518-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/stage1_find_marks.h */
36519-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/stringparsing.h */
36518+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/stage1_find_marks.h */
36519+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/stringparsing.h */
3652036520
#ifndef SIMDJSON_STRINGPARSING_H
3652136521
#define SIMDJSON_STRINGPARSING_H
3652236522

@@ -36694,8 +36694,8 @@ really_inline bool parse_string(const uint8_t *buf, UNUSED size_t len,
3669436694

3669536695

3669636696
#endif
36697-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/stringparsing.h */
36698-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/numberparsing.h */
36697+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/stringparsing.h */
36698+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/numberparsing.h */
3669936699
#ifndef SIMDJSON_NUMBERPARSING_H
3670036700
#define SIMDJSON_NUMBERPARSING_H
3670136701

@@ -37212,8 +37212,8 @@ static really_inline bool parse_number(const uint8_t *const buf,
3721237212
}
3721337213

3721437214
#endif
37215-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/numberparsing.h */
37216-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/stage2_build_tape.h */
37215+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/numberparsing.h */
37216+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/stage2_build_tape.h */
3721737217
#ifndef SIMDJSON_STAGE34_UNIFIED_H
3721837218
#define SIMDJSON_STAGE34_UNIFIED_H
3721937219

@@ -37229,8 +37229,8 @@ static inline bool unified_machine(const char *buf, size_t len, ParsedJson &pj)
3722937229
}
3723037230

3723137231
#endif
37232-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/stage2_build_tape.h */
37233-
/* begin file /home/dlemire/CVS/github/simdjson/include/simdjson/jsonparser.h */
37232+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/stage2_build_tape.h */
37233+
/* begin file /Users/lemire/CVS/github/simdjson/include/simdjson/jsonparser.h */
3723437234
#ifndef SIMDJSON_JSONPARSER_H
3723537235
#define SIMDJSON_JSONPARSER_H
3723637236

@@ -37310,4 +37310,4 @@ inline ParsedJson build_parsed_json(const std::string_view &s, bool reallocifnee
3731037310
}
3731137311

3731237312
#endif
37313-
/* end file /home/dlemire/CVS/github/simdjson/include/simdjson/jsonparser.h */
37313+
/* end file /Users/lemire/CVS/github/simdjson/include/simdjson/jsonparser.h */

0 commit comments

Comments
 (0)