[vector] RFR: Remove JVM support for bitwise NOT

Bhateja, Jatin jatin.bhateja at intel.com
Wed Apr 8 09:11:06 UTC 2020


Hi Vladimir,

Looks good to me. 

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

> 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. 

Best Regards,
Jatin

[1] http://hg.openjdk.java.net/jdk/jdk/rev/29d878d3af35


> -----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