And max offset of 8 by testing two vectors

This commit is contained in:
Marshall Lochbaum 2023-11-05 15:46:11 -05:00
parent ec31543604
commit 75aed91f32

View File

@ -522,16 +522,21 @@ def try_vec_memb{T, hash, hashlen, sh, maxh, has_maxh, rp, fp, n, done
@for (rp, fp over _ from u*l to n) rp = promote{R, homAny{test{fp}}} @for (rp, fp over _ from u*l to n) rp = promote{R, homAny{test{fp}}}
goto{done} goto{done}
} }
if (max_off < vl) { def try{nv} = {
hp := *V~~(hash + maxh>>sh) if (max_off < nv*vl) {
hv := load{hp} # Avoid matching maxh if it shouldn't be in the table
store{hp, 0, hv &~ (hv == V**(maxh &- ~has_maxh))} clear := V**(maxh &- ~has_maxh)
def test{x} = { @for (hv in *V~~(hash + maxh>>sh) over vl) hv = hv &~ (hv == clear)
h := hash_val{x}; j := h>>sh # Test against nv vectors
V**h == load{*V~~(hash+j), 0} def test{x} = {
h := hash_val{x}; vh := V**h
def any{{...r,a}} = any{r}|a; def any{{a}}=a
any{@collect (k in *V~~(hash+h>>sh) over nv) vh == k}
}
memb{test}
} }
memb{test}
} }
each{try, tup{1,2}}
} }
def exp_hash{T, name} = { def exp_hash{T, name} = {