On Tue, 27 Jul 2021 08:17:55 GMT, Jatin Bhateja <jbhat...@openjdk.org> wrote:

>> src/hotspot/share/opto/vectorIntrinsics.cpp line 1598:
>> 
>>> 1596:       cnt = elem_bt == T_LONG ? gvn().transform(new ConvI2LNode(cnt)) 
>>> : cnt;
>>> 1597:       opd2 = gvn().transform(VectorNode::scalar2vector(cnt, num_elem, 
>>> type_bt));
>>> 1598:     } else {
>> 
>> Why conversion for only T_LONG and not for T_BYTE and T_SHORT? Is there an 
>> assumption here that only T_INT and T_LONG elem_bt are supported?
>
> Correcting this,  I2L may be needed in auto-vectorization flow since 
> Integer/Long.rotate[Right/Left] APIs accept only integral shift, so for 
> Long.rotate* operations integral shift value must be converted to long using 
> I2L before broadcasting it. VectorAPI lanewise operations between 
> vector-scalar, scalar type already matches with vector basic type.  Since 
> degeneration routine is common b/w both the flows so maintaining IR 
> consistency here.

For Vector API the shift is always coming in as int type for rotate by scalar 
(lanewiseShiftTemplate). The down conversion to byte or short needs to be done 
before scalar2vector.

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

PR: https://git.openjdk.java.net/jdk/pull/3720

Reply via email to