From a43a42e4d1f4e22fe08a62c1f04d3c26e0949904 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Tue, 6 Sep 2022 16:30:03 -0400 Subject: [PATCH] Select from small boolean list by copying to bytes --- src/builtins/select.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/builtins/select.c b/src/builtins/select.c index 9935c741..b4a98452 100644 --- a/src/builtins/select.c +++ b/src/builtins/select.c @@ -121,6 +121,9 @@ B select_c2(B t, B w, B x) { for (usz i=0; i < wia; i++) HARR_ADD(r, i, Get(x, WRAP(wp[i], xia, thrF("โŠ: Indexing out-of-bounds (%iโˆŠ๐•จ, %sโ‰กโ‰ ๐•ฉ)", wp[i], xia)))); \ decG(x); return withFill(HARR_FCD(r,w),xf); \ } + if (xe==el_bit && wia>=256 && wia/4>=xia && we!=el_bit) { + return taga(cpyBitArr(select_c2(m_f64(0), w, taga(cpyI8Arr(x))))); + } if (we==el_bit) { if (xia<2) { u64* wp=bitarr_ptr(w);