[vector] vector shift operations
Viswanathan, Sandhya
sandhya.viswanathan at intel.com
Tue Feb 20 21:14:47 UTC 2018
Yes, variable vector shift (shift left, shift right arithmetic, shift right logical) for int/long should be easily doable in the backend similar to other binary ops.
Thanks,
Sandhya
-----Original Message-----
From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Paul Sandoz
Sent: Tuesday, February 20, 2018 12:34 PM
To: Adam Pocock <adam.pocock at oracle.com>
Cc: panama-dev at openjdk.java.net
Subject: Re: [vector] vector shift operations
> 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