Forgot to save this...

This commit is contained in:
Daniel Lemire 2018-07-28 18:28:50 -04:00
parent 77febdd006
commit ecf78d7249
2 changed files with 7 additions and 34 deletions

View File

@ -11,7 +11,7 @@ CXXFLAGS = -std=c++11 -O2 -march=native -Wall -Wextra -Wshadow
EXECUTABLES=parse
EXTRA_EXECUTABLES=parsenocheesy parsenodep8
all: $(EXECUTABLES)
-./parse
@ -19,53 +19,25 @@ all: $(EXECUTABLES)
parse: main.cpp common_defs.h linux-perf-events.h
$(CXX) $(CXXFLAGS) -o parse main.cpp
testflatten: parse parsenocheesy parsenodep2 parsenodep4 parsenodep6 parsenodep8 parsenodep10 parsenodep12 parsenodep14 parsenodep16
testflatten: parse parsenocheesy parsenodep8
for filename in jsonexamples/twitter.json jsonexamples/gsoc-2018.json jsonexamples/citm_catalog.json jsonexamples/canada.json ; do \
echo $$filename ; \
set -x; \
./parsenocheesy $$filename ; \
./parse $$filename ; \
./parsenocheesy $$filename ; \
./parsenocheesy $$filename ; \
./parsenodep2 $$filename ; \
./parsenodep4 $$filename ; \
./parsenodep6 $$filename ; \
./parsenodep8 $$filename ; \
./parsenodep10 $$filename ; \
./parsenodep12 $$filename ; \
./parsenodep14 $$filename ; \
./parsenodep16 $$filename ; \
set +x; \
done
parsenocheesy: main.cpp common_defs.h linux-perf-events.h
$(CXX) $(CXXFLAGS) -o parsenocheesy main.cpp -DSUPPRESS_CHEESY_FLATTEN
parsenodep2: main.cpp common_defs.h linux-perf-events.h
$(CXX) $(CXXFLAGS) -o parsenodep2 main.cpp -DNO_PDEP_PLEASE -DNO_PDEP_WIDTH=2
parsenodep4: main.cpp common_defs.h linux-perf-events.h
$(CXX) $(CXXFLAGS) -o parsenodep4 main.cpp -DNO_PDEP_PLEASE -DNO_PDEP_WIDTH=4
parsenodep6: main.cpp common_defs.h linux-perf-events.h
$(CXX) $(CXXFLAGS) -o parsenodep6 main.cpp -DNO_PDEP_PLEASE -DNO_PDEP_WIDTH=6
parsenodep8: main.cpp common_defs.h linux-perf-events.h
$(CXX) $(CXXFLAGS) -o parsenodep8 main.cpp -DNO_PDEP_PLEASE -DNO_PDEP_WIDTH=8
parsenodep10: main.cpp common_defs.h linux-perf-events.h
$(CXX) $(CXXFLAGS) -o parsenodep10 main.cpp -DNO_PDEP_PLEASE -DNO_PDEP_WIDTH=10
parsenodep12: main.cpp common_defs.h linux-perf-events.h
$(CXX) $(CXXFLAGS) -o parsenodep12 main.cpp -DNO_PDEP_PLEASE -DNO_PDEP_WIDTH=12
parsenodep14: main.cpp common_defs.h linux-perf-events.h
$(CXX) $(CXXFLAGS) -o parsenodep14 main.cpp -DNO_PDEP_PLEASE -DNO_PDEP_WIDTH=14
parsenodep16: main.cpp common_defs.h linux-perf-events.h
$(CXX) $(CXXFLAGS) -o parsenodep16 main.cpp -DNO_PDEP_PLEASE -DNO_PDEP_WIDTH=16
clean:
rm -f $(EXECUTABLES)
rm -f $(EXECUTABLES) $(EXTRA_EXECUTABLES)
cleandist:
rm -f $(EXECUTABLES)
rm -f $(EXECUTABLES) $(EXTRA_EXECUTABLES)

View File

@ -286,6 +286,7 @@ const u32 ROOT_NODE = 1;
// just transform the bitmask to a big list of 32-bit integers for now
// that's all; the type of character the offset points to will
// tell us exactly what we need to know. Naive but straightforward implementation
__attribute__((optimize("unroll-loops"))) // this matters for the NO_PDEP_WIDTH
never_inline bool flatten_indexes(size_t len, ParsedJson & pj) {
u32 * base_ptr = pj.structural_indexes;
base_ptr[DUMMY_NODE] = base_ptr[ROOT_NODE] = 0; // really shouldn't matter
@ -298,7 +299,7 @@ never_inline bool flatten_indexes(size_t len, ParsedJson & pj) {
}
#elif defined(NO_PDEP_PLEASE)
#ifndef NO_PDEP_WIDTH
#define NO_PDEP_WIDTH 6
#define NO_PDEP_WIDTH 8
#endif
u32 cnt = __builtin_popcountll(s);
u32 next_base = base + cnt;