On Fri, 11 Sep 2026 22:28:43 GMT, Sandhya Viswanathan 
<[email protected]> wrote:

>> Jatin Bhateja has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Regenerating jdk.incubator.vector sources post merge
>
> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 7134:
> 
>> 7132:      // res[255:128] = {src2[127:0]   , src1[255:128]}  >> SHIFT
>> 7133:      vperm2f128(dst, src1, src2, 0x21);
>> 7134:      vpalignr(dst, dst, src1, origin, Assembler::AVX_256bit);
> 
> For origin==8, it is better to use:
>   vshufps(dst, src1, dst, 0x4E, Assembler::AVX_256bit);
> instead of vpalignr.

Done

> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 7148:
> 
>> 7146:      // res[255:128] = {src2[255:128] , src2[127:0]}    >> (SHIFT - 16)
>> 7147:      vperm2f128(dst, src1, src2, 0x21);
>> 7148:      vpalignr(dst, src2, dst, origin - 16, Assembler::AVX_256bit);
> 
> For origin==24, it is better to use:
>   vshufps(dst, dst, src2, 0x4E, Assembler::AVX_256bit);
> instead of vpalignr.

Done

> src/hotspot/share/opto/vectorIntrinsics.cpp line 1841:
> 
>> 1839:   Node* origin_node = gvn().intcon(origin->get_con() * 
>> type2aelembytes(elem_bt));
>> 1840:   const TypeVect* vector_type = TypeVect::make(elem_bt, num_elem);
>> 1841:   Node* operation = gvn().transform(trace_vector(new 
>> VectorSliceNode(v1, v2, origin_node, vector_type)));
> 
> For subword vectors of length > 16 with mid range byte origin (16 < byte 
> origin < 48) there seems to be a regression.  This is due to having three 
> shuffle ops (valignd+valignd+valignr), we could instead rewrite this case 
> with VectorLoadConst followed by SelectFromTwoVector where supported. The 
> compiler would then hoist the VectorLoadConst above the loop and it would be 
> just vpermi2b/w inside the loop. 
>  
> Node* iota   = gvn().transform(new 
> VectorLoadConstNode(gvn().makecon(TypeInt::ZERO), vector_type));
> Node* bcast = 
> gvn().transform(VectorNode::scalar2vector(gvn().intcon(origin->get_con()), 
> num_elem, elem_bt));
> Node* index = gvn().transform(VectorNode::make(add_vopc, iota, bcast, 
> vector_type));
> operation = gvn().transform(trace_vector(new SelectFromTwoVectorNode(index, 
> v1, v2, vector_type)));

Addressed

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24104#discussion_r4012360474
PR Review Comment: https://git.openjdk.org/jdk/pull/24104#discussion_r4012360861
PR Review Comment: https://git.openjdk.org/jdk/pull/24104#discussion_r4012362183

Reply via email to