On Thu, 3 Jun 2021 00:29:00 GMT, Sandhya Viswanathan <sviswanat...@openjdk.org> 
wrote:

> The Vector API toShuffle method can be optimized  using existing vector 
> conversion intrinsic.
> 
> The following changes are made:
> 1) vector.toShuffle java implementation is changed to call 
> VectorSupport.convert.
> 2) The conversion intrinsic (inline_vector_convert()) in vectorIntrinsics.cpp 
> is changed to allow shuffle as a destination type.
> 3) The shuffle.toVector intrinsic (inline_vector_shuffle_to_vector()) in 
> vectorIntrinsics.cpp now explicitly generates conversion node instead of 
> performing conversion during unbox. This is to remove unnecessary boxing 
> during back to back vector.toShuffle and shuffle.toVector calls. 
> 
> Best Regards,
> Sandhya

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java 
line 335:

> 333:     @ForceInline
> 334:     private final
> 335:     VectorShuffle<Byte> toShuffleTemplate(AbstractSpecies<Byte> dsp) {

Is it better to move this template method to the super class like other APIs?

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java 
line 350:

> 348:                                      Byte128Shuffle.class, byte.class, 
> VLENGTH,
> 349:                                      this, VSPECIES,
> 350:                                      Byte128Vector::toShuffleTemplate);

ditto

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

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

Reply via email to