[vector] RFR: Remove JVM support for bitwise NOT

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Thu Apr 9 18:09:41 UTC 2020


Thanks, Jatin.

> Mainline already has an optimized version [1] for generating all ones pattern used within NotV operation [XorV Inp Replicate -1].

Yes, it has been already synced into panama/dev.

>> Considering x86 doesn't have a dedicated instruction which does the job,
>> there's no reason to do anything special for the pattern there: good enough
>> code is generated when XorV and Replicate are matched separately.
> 
> Just for the record sake, following single instruction could be used over AVX3 to generate logic not of $src.
> __ vpternlogd($dst$$XMMRegister, 0x11, $src$$XMMRegister, $src$$XMMRegister, vector_len);
> We can add this later though, once proper performance measurements are done.

Yes, good point. It can be utilized the same way as on aarch64.

Best regards,
Vladimir Ivanov

>> -----Original Message-----
>> From: panama-dev <panama-dev-bounces at openjdk.java.net> On Behalf Of
>> Vladimir Ivanov
>> Sent: Tuesday, April 7, 2020 10:15 PM
>> To: Paul Sandoz <paul.sandoz at oracle.com>
>> Cc: panama-dev <panama-dev at openjdk.java.net>
>> Subject: Re: [vector] RFR: Remove JVM support for bitwise NOT
>>
>>
>>> So IIUC you removed the underlying vector op + C2 node, composing from a
>> constant-all-set-bits + xor, then in hotspot recognizing more generally that
>> vector pattern for optimization on supported platforms, such as aarch64?
>>
>> Yes, "XorV src (Replicate 0xFF..FF)" pattern which is equivalent to vectorized
>> bitwise NOT is detected on backend side and optimal instruction sequence is
>> generated.
>>
>> Considering x86 doesn't have a dedicated instruction which does the job,
>> there's no reason to do anything special for the pattern there: good enough
>> code is generated when XorV and Replicate are matched separately.
>>
>> Best regards,
>> Vladimir Ivanov
>>
>>>> On Apr 7, 2020, at 6:36 AM, Vladimir Ivanov
>> <vladimir.x.ivanov at oracle.com> wrote:
>>>>
>>>> http://cr.openjdk.java.net/~vlivanov/panama/vector/notv/webrev.00
>>>>
>>>> Remove NotV support. Implement it as "XorV v (Replicate 0xFF..FF)"
>> instead.
>>>>
>>>> Testing: jdk/incubator/vector tests
>>>>
>>>> The patch is against vectorIntrinsics branch.
>>>>
>>>> Best regards,
>>>> Vladimir Ivanov
>>>


More information about the panama-dev mailing list