nicer store-low in bins.singeli

also means it doesn't break on width>256
This commit is contained in:
dzaima 2025-04-03 03:30:12 +03:00
parent 78359afc71
commit 528fea645a
2 changed files with 2 additions and 6 deletions

View File

@ -289,6 +289,7 @@ def undef_promote{T, x:T} = x
def zero_promote{T, x:T} = x
def cvt{T, x:[_]T} = x
def extract{V=[k]E, x:V, 0} = x
def store_narrow_relaxed{p:*DE, x:[k]E} = store{p, narrow{DE, x}, k}
def broadcast{V=[_]T, v} = vec_broadcast{V, if (knum{v}) v else promote{T,v}}
def make{V=[_]_, ...xs} = vec_make{V, ...xs}

View File

@ -283,12 +283,7 @@ def bin_search_vec{prim, T, w:*T, wn, x:*T, xn, rp, maxwn if hasarch{'AVX2'}} =
if (r_out) {
r -= off
if (prim=='⊐') r = blend_hom{U**cast_i{u8,wn}, r, b}
rn := if (T==i8) r
else if (T==i16) half{narrow{u8, r}, 0}
else extract{re_el{i64, narrow{u8, r}}, 0}
rnp := *type{rn}~~(*i8~~rp+j)
if (isvec{type{rn}}) store{rnp, 0, rn}
else storeu{rnp, rn}
store_narrow_relaxed{*u8~~rp+j, r}
} else {
def B = ty_u{vl}; out := cast_i{B, hom_to_int{b}}
store{*B~~rp, cdiv{j,vl}, out>>((-j)%vl)}