Re: RFR: 8354242: VectorAPI: combine vector not operation with compare [v5]

2025-05-13 Thread erifan
On Wed, 7 May 2025 11:13:23 GMT, Jatin Bhateja wrote: >> erifan has updated the pull request with a new target base due to a merge or >> a rebase. The incremental webrev excludes the unrelated changes brought in >> by the merge/rebase. The pull request contains eight additional commits >> sinc

Re: RFR: 8354242: VectorAPI: combine vector not operation with compare [v5]

2025-05-13 Thread erifan
On Fri, 9 May 2025 09:37:22 GMT, erifan wrote: >> Yes, converting `VectorMask.fromLong(SPECIES, -1L)` to `MaskAll()` would be >> better, and that will benefit AArch64 as well, since `MaskAll()` is much >> more cheaper than `fromLong()` on AArch64. We can add such a transformation >> with anoth

Re: RFR: 8354242: VectorAPI: combine vector not operation with compare [v5]

2025-05-09 Thread erifan
On Thu, 8 May 2025 01:49:45 GMT, Xiaohong Gong wrote: >> Yes, that's the right approach. For this PR, I think you can mix some test >> points covering compare, xor(maskAll(true)). > > Yes, converting `VectorMask.fromLong(SPECIES, -1L)` to `MaskAll()` would be > better, and that will benefit AAr

Re: RFR: 8354242: VectorAPI: combine vector not operation with compare [v5]

2025-05-09 Thread erifan
On Wed, 7 May 2025 02:10:56 GMT, erifan wrote: >> This patch optimizes the following patterns: >> For integer types: >> >> (XorV (VectorMaskCmp src1 src2 cond) (Replicate -1)) >> => (VectorMaskCmp src1 src2 ncond) >> (XorVMask (VectorMaskCmp src1 src2 cond) (MaskAll m1)) >> => (VectorMas

Re: RFR: 8354242: VectorAPI: combine vector not operation with compare [v5]

2025-05-07 Thread Xiaohong Gong
On Wed, 7 May 2025 11:02:43 GMT, Jatin Bhateja wrote: >> Hi @jatin-bhateja It is feasible. But I was thinking about whether another >> solution would be better, which is to turn `VectorMask.fromLong(SPECIES, >> -1L)` into `MaskAll(true)` in the mid-end. In this way, we don't need to >> check

Re: RFR: 8354242: VectorAPI: combine vector not operation with compare [v5]

2025-05-07 Thread Jatin Bhateja
On Wed, 7 May 2025 02:10:56 GMT, erifan wrote: >> This patch optimizes the following patterns: >> For integer types: >> >> (XorV (VectorMaskCmp src1 src2 cond) (Replicate -1)) >> => (VectorMaskCmp src1 src2 ncond) >> (XorVMask (VectorMaskCmp src1 src2 cond) (MaskAll m1)) >> => (VectorMas

Re: RFR: 8354242: VectorAPI: combine vector not operation with compare [v5]

2025-05-07 Thread Jatin Bhateja
On Wed, 7 May 2025 10:24:14 GMT, erifan wrote: >> src/hotspot/share/opto/vectornode.cpp line 2231: >> >>> 2229: } >>> 2230: if (in1->Opcode() != Op_VectorMaskCmp || in1->outcnt() > 1 || >>> 2231: !((VectorMaskCmpNode*) in1)->predicate_can_be_inverted() || >> >> Do you plan to extend

Re: RFR: 8354242: VectorAPI: combine vector not operation with compare [v5]

2025-05-07 Thread erifan
On Wed, 7 May 2025 06:59:34 GMT, Jatin Bhateja wrote: >> erifan has updated the pull request with a new target base due to a merge or >> a rebase. The incremental webrev excludes the unrelated changes brought in >> by the merge/rebase. The pull request contains eight additional commits >> sinc

Re: RFR: 8354242: VectorAPI: combine vector not operation with compare [v5]

2025-05-07 Thread erifan
On Wed, 7 May 2025 06:59:34 GMT, Jatin Bhateja wrote: >> erifan has updated the pull request with a new target base due to a merge or >> a rebase. The incremental webrev excludes the unrelated changes brought in >> by the merge/rebase. The pull request contains eight additional commits >> sinc

Re: RFR: 8354242: VectorAPI: combine vector not operation with compare [v5]

2025-05-07 Thread Jatin Bhateja
On Wed, 7 May 2025 02:10:56 GMT, erifan wrote: >> This patch optimizes the following patterns: >> For integer types: >> >> (XorV (VectorMaskCmp src1 src2 cond) (Replicate -1)) >> => (VectorMaskCmp src1 src2 ncond) >> (XorVMask (VectorMaskCmp src1 src2 cond) (MaskAll m1)) >> => (VectorMas

Re: RFR: 8354242: VectorAPI: combine vector not operation with compare [v5]

2025-05-06 Thread erifan
> This patch optimizes the following patterns: > For integer types: > > (XorV (VectorMaskCmp src1 src2 cond) (Replicate -1)) > => (VectorMaskCmp src1 src2 ncond) > (XorVMask (VectorMaskCmp src1 src2 cond) (MaskAll m1)) > => (VectorMaskCmp src1 src2 ncond) > > cond can be eq, ne, le, ge, l