[vector] vector shift operations

Paul Sandoz paul.sandoz at oracle.com
Tue Feb 20 20:34:22 UTC 2018



> On Feb 20, 2018, at 12:20 PM, Adam Pocock <adam.pocock at oracle.com> wrote:
> 
> Ooops, wrong intrinsic link. I mean vpsllvd, https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=epi&techs=AVX2&cats=Shift&expand=4933.
> 

Ok, i get out now :-)

That seems reasonable for int/long if you are ok for the shift values to be of the same type/shape (getting arrays of byte values efficiently into int/long vectors is then a separate problem).

API-wise it’s easy, unsure about HotSpot, but if i cargo cult how other binary ops are integrated it naively looks like a mechanical exercise.

Paul.

> Adam
> 
> On 20/02/18 14:47, Adam Pocock wrote:
>> I'm implementing Csuros approximate counters (https://arxiv.org/abs/0904.3062) which have a data dependent shift in them to recover the int value from the stored byte. I'd like to be able to recover n ints from an array of n bytes using the Vector API, but that requires left shifting each element of a vector of n ints by a data dependent value from the vector of n bytes (encoded as ints for simplicity).
>> 
>> It looks like there is an instruction in AVX2 which does this from the vpslld family (https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=epi&techs=AVX2&cats=Shift&expand=4871). Is there a roadmap somewhere for how much coverage the Vector API will have over the wide space of intrinsics? Should we expect the API to grow over time, or are the current operations the only ones which are expected to be supported?
>> 
>> Thanks,
>> 
>> Adam
>> 
> 
> -- 
> Adam Pocock
> Principal Member of Technical Staff
> Machine Learning Research Group
> Oracle Labs, Burlington, MA
> 



More information about the panama-dev mailing list