diff --git a/src/builtins/cells.c b/src/builtins/cells.c index 7d40b3ea..b5ea3bb2 100644 --- a/src/builtins/cells.c +++ b/src/builtins/cells.c @@ -220,7 +220,7 @@ NOINLINE B leading_axis_arith(FC2 fc2, B w, B x, usz* wsh, usz* xsh, ur mr) { // // fast special-case implementations extern void (*const si_select_cells_bit_lt64)(u64*,u64*,usz,usz,usz); // from fold.c (fold.singeli) -extern usz (*const si_select_cells_byte)(void*,void*,usz,usz); +extern usz (*const si_select_cells_byte)(void*,void*,usz,usz,u8); static NOINLINE B select_cells(usz ind, B x, usz cam, usz k, bool leaf) { // ind {leaf? <∘⊑; ⊏}⎉¯k x; TODO probably can share some parts with takedrop_highrank and/or call ⊏? ur xr = RNK(x); assert(xr>1 && k=32 and l<20 and (l&1)==1) { +fn select_rows_byte(x0:*void, r0:*void, n:usz, l:usz, e:u8) : usz = { + n <<= e + if (hasarch{'AVX2'} and n>=32 and l < usz~~20>>e and (l&1)!=0) { def V = [32]u8 def swap_by{x, m} = homBlend{x, shuf{[4]u64, x, 2,3,0,1}, m} l8 := cast_i{u8, l} li := cast_i{u8, l + 2 * ((l-1) + (l&2))} # Inverse mod 32 - ie := make{[16]u16, 2*iota{16}} + elo:= V**(u8~~1<>e) * nv} } 0 }