aboutsummaryrefslogtreecommitdiffstats
path: root/core/module-run.h
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-05 23:13:47 +0100
committereunhhu <[email protected]>2026-10-05 23:13:47 +0100
commit390169f69dc61ad12f9acb1edc8f1ccee359c696 (patch)
tree980e50d5feaba3a9454f0123b2150ef55e4e6739 /core/module-run.h
parent65b86223e36948c9cfc3693a3c3018bacc0dddb5 (diff)
downloadpure-390169f69dc61ad12f9acb1edc8f1ccee359c696.tar.gz
pure-390169f69dc61ad12f9acb1edc8f1ccee359c696.zip
Batch executor stage 2 (024): a loop in the batch's block runs its rounds for every lane together (round t for the lanes with more than t rounds that did not break out; BREAK leaves it lane by lane; its slot as each round sets it), and x = x op e (op +, min, max; x read no other way) is a reduction: each lane's own from op's identity (-0 a sum's), folded in the rounds' order at the batch's end (a sum's lanes of several whole numbers only, below 2^53); nested rounds' work counted for each lane and checked before anything changes; lanes and masks no holder keeps freed between nested rounds. Planned at load: a local read before set in its loop's scope, or not a reduction's, keeps the loop round by round. PURE_JIT=0: roots 130.5 to 16.8 ms, matmul 914.7 to 68.2. module_tier makes nested loops with breaks and reductions (seeds 1, 2, 3, 23: 549 programs alike); NESTED_SOURCE
Diffstat (limited to 'core/module-run.h')
-rw-r--r--core/module-run.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/module-run.h b/core/module-run.h
index 1e48072..3f8a9ca 100644
--- a/core/module-run.h
+++ b/core/module-run.h
@@ -162,6 +162,10 @@ int pure_run_rest(Frame *, uint32_t pc);
* runs round by round next, at least until round loop->resume), the frame
* left as the last of them leaves it, their work counted. */
unsigned pure_batch_run(Frame *, Loop *);
+/* Whether the LOCAL_LOAD at pc, in a block ending at end, begins x = x op e
+ * (x its local, op ADD, MIN or MAX, e computed above x with no branch or
+ * loop): a reduction across a batch's rounds. *at: op's pc. */
+bool pure_batch_reduces(const PureModule *, uint32_t pc, uint32_t end, uint32_t *at);
/* Where a list keeps what compiled code reads of it (module-list.c owns the
* layout and says where): its item count, its key set (the words, how many,