[vectorIntrinsics] Issue to VectorAPI "selectFrom" for byte type with Arm SVE 2048-bits

Xiaohong Gong Xiaohong.Gong at arm.com
Thu Oct 29 06:52:10 UTC 2020


Hi Paul,

 > > Thanks very much for your detailed explanation!
 > >
 > >> 1) the selectFrom(Vector ) methods will never be able to index
 > anything greater than the 127th lane element, if supported by the
 > species. I think we would require the notion of a Vector whose lane
 > elements are unsigned bytes, which I think requires Valhalla and
 > additional numeric types.
 > > This limitation would obviously become even more apparent if say
 > a future SVE specification supported vector shapes of 4096 bits.
 > >
 > > Yes, I agree with you. And it also makes sense to me that only
 > the unsigned bytes can be the valid elements for this API, even the
 > larger vector shapes might be supported like SVE 2048-bits.
 > > So regarding to the test failures, I think we'd better to limit
 > the lane elements to the valid values to make the tests pass.  I
 > will raise a patch for it if it's ok to you.
 > >
 > 
 > Yes, clamp to Byte.MAX_VALUE for a maximum valid index on relevant
 > platforms.
 > 
 
OK, here is the PR to the tests: https://github.com/openjdk/panama-vector/pull/19.
It's a great pleasure if you could have a look at it. Thanks!

 > >> Because of 3) we cannot directly create a VectorShuffle for a
 > 2048:byte species that supports indexes > 127. That seems fixable
 > by modifying the implementation of ByteMaxShuffle to hold short[]
 > instead of byte[], or byte[] twice the length etc. That may require
 > some care with regards to the intrinsic. This seems possible.
 > >
 > > Yes, exactly. Currently we have created a patch to fix this
 > issue. And the main idea is the same with https://mail.openjdk.java.net/pipermail/panama-dev/2020-August/010384.html.
 > >
 > 
 > Ok, I’ll wait for a PR, but I wonder if its possible to focus the
 > code more on the ByteMax implementations.
 > 
 > Paul;.

Thanks for your suggestion!  Yeah, it's better to make the codes focus more on the
ByteMax related parts. And we will also try to find a better way for it. 

Thanks,
Xiaohong Gong



More information about the panama-dev mailing list