From 5cf9dcb47cd0037461782335ba812481363970da Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 5 Oct 2026 16:21:59 +0100 Subject: The tier's keys and positions in range for every round, checked once where their loop opens (each affine in its round: both ends below the limit), the checks in the round gone; constants in the instructions (add, sub, cmp); one-byte columns widened to four where the tier begins, its loads and stores of four bytes only. roots 14.0 to 14.0 ms, knapsack 38.8 to 16.5, matmul 48.6 to 25.7 --- core/module-list.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/module-list.c') diff --git a/core/module-list.c b/core/module-list.c index db79802..a798c41 100644 --- a/core/module-list.c +++ b/core/module-list.c @@ -1514,8 +1514,11 @@ bool pure_list_suits(PureList *list, unsigned needs, unsigned narrow) { if (needs & 2 && list->form != FLAT && !(list->form == DENSE && dense_keys(list) && list->full)) return false; /* by position */ if (needs & 4 && !(list->form == DENSE && dense_keys(list) && list->full)) return false; /* a key its position */ if (list->form != FLAT && list->form != DENSE) return false; - for (unsigned f = 0; f < list->layout.fields; ++f) - if (narrow >> f & 1 && list->width[f] != 1 && list->width[f] != 4) return false; + for (unsigned f = 0; f < list->layout.fields; ++f) { /* its cells of one byte widened to four: the tier's code reads four */ + if (!(narrow >> f & 1)) continue; + if (list->width[f] == 1 && !widen(list, f, 4)) return false; + if (list->width[f] != 4) return false; + } return true; } -- cgit v1.2.3