Skip to content

Commit

Permalink
add comment explaining why arguments are 0
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrk24 committed Sep 30, 2024
1 parent 5818f9e commit 4e66b24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/program_walker.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t> 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<int24_t>(THR_E) || op == static_cast<int24_t>(THR_W)) {
return instruction::spawn_to({ { SIZE_C(0), SIZE_C(0) }, { SIZE_C(0), SIZE_C(0) } });
} else {
Expand Down

0 comments on commit 4e66b24

Please sign in to comment.