Make AVX2 deduplicate branchless

This commit is contained in:
Marshall Lochbaum 2023-04-27 21:08:32 -04:00
parent 1700d84740
commit 6c81fb3149
2 changed files with 2 additions and 2 deletions

View File

@ -557,7 +557,7 @@ B find_c1(B t, B x) {
}
#if SINGELI_AVX2
if (elWidth(xe)==1 && RNK(x)==1 && !FL_HAS(x, fl_asc|fl_dsc)) {
TALLOC(u8, tab, 512); u8* res = tab+256;
TALLOC(u8, tab, 513); u8* res = tab+256;
usz ria = avx2_deduplicate_u8(tyany_ptr(x), n, res, tab);
B r; i8* rp = m_tyarrv(&r, 1, ria, el2t(xe));
memcpy(rp, res, ria);

View File

@ -123,7 +123,7 @@ def do_bittab{x0:*void, n:u64, tab:*void, u:u8, t, mode, r0} = {
btab:= *i8~~tab
def settab_sub{x, v} = {
if (rval and v!=0) store{*u8~~r0, u, x}
if (rval) store{*u8~~r0, u, x}
u+= u8~~(t - v) # u tracks the total of btab
store{btab, x, t}
v