RFR: 8367292: VectorAPI: Optimize VectorMask.fromLong/toLong() for SVE [v3]
Emanuel Peter
epeter at openjdk.org
Fri Oct 24 08:30:04 UTC 2025
On Fri, 24 Oct 2025 08:01:38 GMT, erifan <duke at openjdk.org> wrote:
>> There could be additional confusion: is the `packed vector` for the mask, or for all its inputs? is the `vt` for the mask type, or the output type of the `mask_op`?
>>
>> Suggestion:
>> `mask_op_uses_packed_vector` -> `mask_op_uses_packed_vector_mask`
>> `vt` -> `mask_vt`
>>
>> What do you think?
>
>> I find uses to be ambiguous. does mask_op require packed vector (nothing else accepted), or just allow packed vector (and other options are also accepted)?
>
> Currently, there are three layouts for vector masks in Aarch64 registers:
> 1. Predicate register (requires SVE support), **m-bit** mask in **p** register for **m*8-byte** vector element.
> 2. Unpacked vector register, **m-byte** mask in **v** register for **m-byte** vector element.
> 3. Packed vector register, **1-byte** mask in **v** register for **m-byte** vector element.
>
> @XiaohongGong explained this earlier.
>
> So, if SVE is supported, an IR with a mask input, such as `VectorMaskToLong`, can use any layout. Different layouts will simply result in different code generation. For performance reasons, we use different layouts for different IRs and in different cases. So, there's no mandatory layout; it's just about better performance. So, personally I tend to **use**.
Ah, I see, thanks for the explanations. Is this documented somewhere in code comments? That would really save you having to explain it repeatedly: you could just point to the code comments ;)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27481#discussion_r2459303010
More information about the hotspot-compiler-dev
mailing list