diff --git a/src/builtins/select.c b/src/builtins/select.c index 30bd3694..637401f9 100644 --- a/src/builtins/select.c +++ b/src/builtins/select.c @@ -1,3 +1,34 @@ +// First Cell and Select (⊏) + +// First Cell is just a slice + +// Complications in Select mostly come from range checks and negative 𝕨 +// Atom 𝕨 and any rank 𝕩: slice +// Rank-1 𝕩: +// Empty 𝕨: no selection +// Small 𝕩 with Singeli: use shuffles +// Boolean 𝕨: use bit_sel for blend or similar +// Boolean 𝕩 and larger 𝕨: convert to i8, select, convert back +// Boolean 𝕩 otherwise: select/shift bytes, reversed for fast writing +// TRIED pext, doesn't seem faster (mask built with shifts anyway) +// SHOULD squeeze 𝕨 if not ≀i32 to get to optimized cases +// Integer 𝕨 with Singeli: fused wrap, range-check, and gather +// COULD try selecting from boolean with gather +// COULD detect