aboutsummaryrefslogtreecommitdiffstats
path: root/core/module-list.c
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-05 16:21:59 +0100
committereunhhu <[email protected]>2026-10-05 16:21:59 +0100
commit5cf9dcb47cd0037461782335ba812481363970da (patch)
treee4d344cf2c7e5a92ca9a2396c7038df60b2dbbce /core/module-list.c
parent6cd7f5a415f9286ae4bec58545dccd89a15ef46d (diff)
downloadpure-5cf9dcb47cd0037461782335ba812481363970da.tar.gz
pure-5cf9dcb47cd0037461782335ba812481363970da.zip
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
Diffstat (limited to 'core/module-list.c')
-rw-r--r--core/module-list.c7
1 files changed, 5 insertions, 2 deletions
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;
}