[vector] ByteVector swizzle
richard at openkappa.co.uk
Tue May 29 15:46:08 UTC 2018
I would like to permute the elements of a ByteVector<Shapes.S256Bit>. I would expect the semantics to be similar to _mm256_shuffle_epi8/VPSHUFB, which would entail the use of a ByteVector<Shapes.S256Bit> to specify the permutation. Currently Species.shuffleFromVector only supports Vector<Integer, Shape> as an argument. Is there a plan to expand this?
Will swizzle in its current state use VPSHUFD/_mm256_shiffle_epi32?
For what it’s worth my aim is to implement a bit count for a 256 bit integral vector, where for a DIY implementation a ByteVector.shiftLeft would be ideal, but without access to VPSHUFB it’s impossible. There are well known algorithms for vector bitcounts, perhaps this would be a useful addition to the API?
More information about the panama-dev