From e4d024e0310628751d9ff48e7e02faec44199c83 Mon Sep 17 00:00:00 2001 From: dzaima Date: Wed, 18 Jun 2025 20:16:05 +0300 Subject: [PATCH] =?UTF-8?q?comments=20about=20potential=20inds=E2=8A=B8?= =?UTF-8?q?=E2=8A=8F=CB=98bitmat=20optimizations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/select.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/builtins/select.c b/src/builtins/select.c index 7cec9e00..3a050f70 100644 --- a/src/builtins/select.c +++ b/src/builtins/select.c @@ -52,6 +52,10 @@ // Boolean indices: // Short inds and short cells: Widen to i8 // Otherwise: bitsel call per cell +// SHOULD specialize wider input/output: +// AVX2 extract 16 bits from 128: vbroadcasti128+vpshufb+vpmullw +// AVX-512 extract 64 bits from 64: vpmultishiftqb/vpshufbitqmb +// potentially better options via transposing to allow a shuffle to reorder multiple rows // 1, 2, 4 or 8-byte data elements & short cells & short index list: // Split indices to available native shuffle width (e.g. 2‿1⊸⊏˘ n‿5⥊i16 → 2‿3‿0‿1⊸⊏˘ n‿10⥊i8) // Repeat indices if using ≤0.5x of shuffle width (e.g. 0‿0‿2⊸⊏˘ n‿3⥊i8 → 0‿0‿2‿3‿3‿5⊸⊏˘ n‿6⥊i8)