RFR: 8351623: VectorAPI: Add SVE implementation of subword gather load operation [v3]

Emanuel Peter epeter at openjdk.org
Tue Sep 9 07:32:36 UTC 2025


On Mon, 8 Sep 2025 02:28:16 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>> To me a `false` means this:
>> If we support gater/scalter, then we do not need a vector index, we can do without it.
>> 
>> Is that correct?
>> 
>> But that would contradict @fg1417 's statement:
>> If we support gater/scalter, then we do not permit a vector index.
>> 
>> Can you clarify?
>
>> To me a `false` means this: If we support gater/scalter, then we do not need a vector index, we can do without it.
>> 
>> Is that correct?
> 
> Thanks for your review!  Actually gather/scatter always need an index input. What this function want to decide is how the index elements are passed to the operations.
> 
> It doesn't take an assumption whether vector gather_load/scatter_store is supported or not in backend. It just checks whether the `index` input of such operations requires a vector register or an address which stores the indexes. Currently, on x86, it passes an array address for subword types (the indexes are then will be loaded one-by-one in backend codegen). However, on AArch64, we requires it a vector type for all types instead (the indexes have been loaded and saved into vector registers in IR level). 
> 
>> The current platform does not support vector gather-load or scatter-store at all.
> 
> I'm sorry that I didn't  clarify very clear about @fg1417 's second statement. Whether the current platform supports vector gather-load/scatter-store is still decided by `Matcher::match_rule_supported_vector()` like other operations. It return `false` here just because arm doesn't support any vector operations. Assume if it want to support a vector gather/scatter, the index input must not be a vector, right?

Thanks for all the explanations, that was very helpful!

Can you please adjust the comment so that all the relevant information is there?
We could also make the name of the method more precise / informative?
Maybe you could write something like this:

// true -> if gather/scatter supported: require index in vector register
// false -> if gather/scatter supported: allows both index in vector register AND array address holding indices

Then give more information about platform specific things that you mentioned about aarch64 and x86 in the relevant files ;)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26236#discussion_r2332295242


More information about the hotspot-compiler-dev mailing list