RFR: 8348868: AArch64: Add backend support for SelectFromTwoVector [v3]

Xiaohong Gong xgong at openjdk.org
Wed Jun 18 08:55:30 UTC 2025


On Wed, 18 Jun 2025 08:48:37 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>>> Consider a vector type with 128bits, and the max vector size is 256bits, the result would be incorrect if using current SVE2 tbl instruction?
>> 
>> Yes, it would be incorrect. I tried to use SVE2 tbl instruction for 64-bit on a 128-bit machine and the results are incorrect. But we currently do not have an SVE2 machine with 256-bit to test our implementation on.
>> 
>>  
>>> values in index would be inside the vector length of 256bits
>> 
>>  No, the index should contain values according to the vector length being used. I could see that for 64-bit Byte, it generates numbers between 0-15 and not 0-31 (for vector length of 128)
>
>> Yes, it would be incorrect. I tried to use SVE2 tbl instruction for 64-bit on a 128-bit machine and the results are incorrect. But we currently do not have an SVE2 machine with 256-bit to test our implementation on.
> 
> It maybe possible in future, right? We can just use the 64bits and 128bits as an example to do the test.
> 
>> No, the index should contain values according to the vector length being used. I could see that for 64-bit Byte, it generates numbers between 0-15 and not 0-31 (for vector length of 128)
> 
> The valid index for a 64-bit byte should be 0-8, right? From the API level of `SelectFromTwoVector`, it seems the values inside of the `index` vector is in range of VLEN or 2 * VLEN ?

Or, maybe we can just disable/unsupport the cases for this op that the vector size is smaller than the max vector size and the max vector size >128-bits. And keep the 64bits as it is.  We should add comment and revisit this part once 256bits SVE2 machine is supported in future. WDYT?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23570#discussion_r2154038247


More information about the hotspot-compiler-dev mailing list