From 89f45e11fc5d6a8c6f5a556195dc2f363239568f Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 5 Oct 2026 12:25:27 +0100 Subject: Compile each nest of loops twice, the second with whole numbers as integers (narrow columns, counts, their arithmetic within 2^53), giving up to the executor for the rest of a round when that fails: BFS core 14.9 to 13.4 ms (022) --- core/module.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'core/module.c') diff --git a/core/module.c b/core/module.c index a01a411..bc9fb8f 100644 --- a/core/module.c +++ b/core/module.c @@ -3064,6 +3064,21 @@ int pure_run_item(Frame *frame, uint32_t pc) { return step(frame, op, pc, &next); } +int pure_run_rest(Frame *frame, uint32_t pc) { + unsigned depth = frame->depth; + for (;;) { + if (frame->depth < depth) return STEP_SKIP; /* it left the loop (BREAK) */ + if (pc >= frame->end) { /* a loop's block ran: the compiled code's, done; one opened here, its iteration */ + if (frame->depth == depth) return STEP_NEXT; + int how = iterate(frame, &pc); + if (how != STEP_NEXT) return how; + continue; + } + int how = step(frame, &frame->m->code[pc], pc, &pc); + if (how != STEP_NEXT) return how; + } +} + int pure_run_iterate(Frame *frame) { uint32_t next = UINT32_MAX; int how = iterate(frame, &next); -- cgit v1.2.3