forked from starcells/R8VeritasCC
removed visited_stat,SAVED 2/3 OF RUNTIME
This commit is contained in:
1 parent
33b22276fb
commit
9346a5ad89
3 files changed
+1
-11
No files matched your search
@@ -115,11 +115,6 @@ r8veritas::truthtable generate_truthtable(const r8veritas::op &operation);
|
||||
r8veritas::stat_ref operate_ins(const r8veritas::stat_ref &last_stat,
|
||||
const r8veritas::ins &ins);
|
||||
|
||||
inline std::unordered_map<
|
||||
std::pair<r8veritas::stat_ref, r8veritas::ins_bytecode>,
|
||||
r8veritas::stat_ref>
|
||||
visited_stat;
|
||||
|
||||
inline std::unordered_map<
|
||||
r8veritas::stat_ref,
|
||||
std::pair<r8veritas::stat_ref, r8veritas::ins_bytecode>>
|
||||
|
||||
@@ -53,10 +53,6 @@ r8veritas::stat_ref operate_ins(const r8veritas::stat_ref &last_stat,
|
||||
const r8veritas::ins &ins) {
|
||||
auto key = std::pair(last_stat, r8veritas::ins_bytecode(ins));
|
||||
r8veritas::stat next_stat = *last_stat;
|
||||
auto it = visited_stat.find(key);
|
||||
if (it != visited_stat.end()) { // found <last_stat,ins> in visited_stat
|
||||
return it->second;
|
||||
}
|
||||
int opcode = ins.bc & 1;
|
||||
|
||||
r8veritas::cell cell_mask = (ins.bc >> 1);
|
||||
@@ -72,7 +68,6 @@ r8veritas::stat_ref operate_ins(const r8veritas::stat_ref &last_stat,
|
||||
}
|
||||
}
|
||||
r8veritas::stat_ref tmp_next_stat_ref = save_stat(std::move(next_stat));
|
||||
visited_stat.insert(std::pair(key, tmp_next_stat_ref));
|
||||
visited_op.insert(std::pair(tmp_next_stat_ref, std::move(key)));
|
||||
return tmp_next_stat_ref;
|
||||
}
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ int main() {
|
||||
initialize_nicknames();
|
||||
initialize_tp_paths();
|
||||
r8veritas::debug_output = true;
|
||||
auto tab1 = generate_truthtable(func_full_add_S);
|
||||
auto tab1 = generate_truthtable(func_full_add_Co);
|
||||
auto new_tab1 = compress_stat_space(tab1);
|
||||
if (bfs(new_tab1)) {
|
||||
r8veritas::path p = track_path(tab1);
|
||||
|
||||
Reference in new issue
Block a user