hom_ones
This commit is contained in:
parent
6f03371e3b
commit
94cdc28ea9
@ -294,6 +294,9 @@ def broadcast{V=[_]T, v} = vec_broadcast{V, if (knum{v}) v else promote{T,v}}
|
||||
def make{V=[_]_, ...xs} = vec_make{V, ...xs}
|
||||
def iota{V=[k]_} = make{V, ...range{k}}
|
||||
def absu{a:[_]_} = ty_u{__abs{a}}
|
||||
def hom_ones{[k]E} = [k]E ** hom_ones{E}
|
||||
def hom_ones{E if issigned{E}} = E ~~ -1
|
||||
def hom_ones{E if isunsigned{E}} = E ~~ maxvalue{E}
|
||||
def shuf = vec_shuffle
|
||||
|
||||
|
||||
|
||||
@ -341,7 +341,7 @@ def pext_popc{x0:V, m0:V if hasarch{'PCLMUL'} and V==[2]u64} = {
|
||||
m := m0
|
||||
x := x0 & m
|
||||
d := ~m << 1 # One bit of the position difference at x
|
||||
c := V**tail{64}
|
||||
c := hom_ones{V}
|
||||
@unroll (i to lb{scalwidth{V}}) {
|
||||
def sh = 1 << i
|
||||
def shift_at{v, s} = { v = (v&~s) | (v&s)>>sh }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user