From a486e87451bed7d9330cfcf308b6f0870f64ebb5 Mon Sep 17 00:00:00 2001 From: dzaima Date: Fri, 26 Jul 2024 21:51:34 +0300 Subject: [PATCH] select-cells comments --- src/builtins/select.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/builtins/select.c b/src/builtins/select.c index 6eaa962c..f3ea8b1e 100644 --- a/src/builtins/select.c +++ b/src/builtins/select.c @@ -2,6 +2,7 @@ // First Cell is just a slice +// Select - 𝕨 ⊏ 𝕩 // Complications in Select mostly come from range checks and negative 𝕨 // Atom or enclosed atom 𝕨 and rank-1 𝕩: make new array // Atom or enclosed atom 𝕨 and high-rank 𝕩: slice @@ -16,18 +17,21 @@ // TRIED pext, doesn't seem faster (mask built with shifts anyway) // 𝕩 with cell sizes of 1, 2, 4, or 8 bytes: // Small 𝕩 and i8 𝕨 with Singeli: use shuffles +// COULD try to squeeze 𝕨 to i8 if small enough 𝕩 // Boolean 𝕨: use bit_sel for blend or similar // Integer 𝕨 with Singeli: fused wrap, range-check, and gather // COULD try selecting from boolean with gather // COULD detect