RFR: 8351623: VectorAPI: Add SVE implementation of subword gather load operation [v3]
Xiaohong Gong
xgong at openjdk.org
Tue Sep 9 07:32:37 UTC 2025
On Tue, 9 Sep 2025 07:27:46 GMT, Emanuel Peter <epeter 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?
>>
>> 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 ;)
Sure, I will do that in next commit. Thanks for your suggestion!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26236#discussion_r2332301225
More information about the hotspot-compiler-dev
mailing list