Browse Source

perf: bfs root aka `cache[0]` static

legacy
Dnomd343 2 years ago
parent
commit
04b38e897d
  1. 4
      src/core/bfs.h
  2. 4
      src/core/core.cc

4
src/core/bfs.h

@ -4,9 +4,7 @@
int next_addr; \ int next_addr; \
cache_size = 1; \ cache_size = 1; \
int current = 0; \ int current = 0; \
cache[0].filter = 0; \ cache[0].addr = addr;
cache[0].addr = addr; \
cache[0].code = code;
#define BFS_LOAD \ #define BFS_LOAD \
code = cache[current].code; \ code = cache[current].code; \

4
src/core/core.cc

@ -138,7 +138,11 @@ void Core::next_step(uint64_t raw_code, uint64_t mask) { // search next step cas
auto range = raw_code | mask; auto range = raw_code | mask;
cache[0].filter = 0;
cache[0].code = raw_code;
for (int addr = 0; range; addr += 3, range >>= 3) { // traverse every 3-bits for (int addr = 0; range; addr += 3, range >>= 3) { // traverse every 3-bits
// cache[0].addr = addr;
switch (range & 0b111) { // match low 3-bits switch (range & 0b111) { // match low 3-bits
case B_1x1: case B_1x1:
move_1x1(raw_code, addr); // try to move 1x1 block move_1x1(raw_code, addr); // try to move 1x1 block

Loading…
Cancel
Save