What are the semantics of bitselect
on vectors?
Will an instruction like bitselect 0b10 x y
result in a vector where the first lane is the first lane of x and the second lane is the second lane of y?
Or is the bitmask applied to each lane separately? ie the first lane would be bitselect(0b10 x[0] y[0])
and the second lane would be bitselect(0b10 x[1] y[1])
?
What about when the bitmask is itself a vector?
The documentation for bitselect
says "For each bit in c
, this instruction selects the corresponding bit from x
if the bit in x
is 1 and the corresponding bit from y
if the bit in c
is 0." I believe that applies the same to vectors as scalars, so this instruction doesn't care about lane boundaries: each bit in each lane is used to determine which input to use for the corresponding bit of the result.
kmeakin has marked this topic as resolved.
Last updated: Dec 23 2024 at 12:05 UTC