From 4e66b24231b6f7ff804ff122f7e226b9d64e2e2b Mon Sep 17 00:00:00 2001 From: William Baker Date: Mon, 30 Sep 2024 17:58:28 -0400 Subject: [PATCH] add comment explaining why arguments are 0 --- src/program_walker.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/program_walker.hh b/src/program_walker.hh index 97720d6..dde4dec 100644 --- a/src/program_walker.hh +++ b/src/program_walker.hh @@ -85,6 +85,10 @@ public: inline instruction at(const IP& ip) noexcept { int24_t op = m_program->at(ip.coords.first, ip.coords.second); if (is_branch(op, ip.dir)) { + // The arguments here aren't used. This needs to return `instruction` rather than `operation` in order to + // convey the argument for PSI/PSC, but the arguments for branches aren't used by the threads. While I could + // determine the locations that they would branch to, pair is smaller than IP, so that wouldn't even + // fit in the arguments. Instead, the arguments have to be hardcoded with some value, like 0. if (op == static_cast(THR_E) || op == static_cast(THR_W)) { return instruction::spawn_to({ { SIZE_C(0), SIZE_C(0) }, { SIZE_C(0), SIZE_C(0) } }); } else {