RFR: 8367292: VectorAPI: Optimize VectorMask.fromLong/toLong() for SVE [v2]

Bhavana Kilambi bkilambi at openjdk.org
Thu Oct 23 09:23:33 UTC 2025


On Thu, 23 Oct 2025 07:22:37 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>> `VectorStoreMask` is a opposite operation of `VectorLoadMask`. We can treat it as a layout conversion for a vector mask. It is used to convert a vector mask (either a unpacked vector or a predicate) to a packed vector status (i.e. 8-bit element size). Because, in Java API, elements of a `VectorMask` is stored into a boolean array.
>
>> if (Matcher::vector_mask_must_be_packed_vector(mopc, mask_vec->bottom_type()->is_vect())) {
>>     mask_vec = gvn().transform(VectorStoreMaskNode::make(gvn(), mask_vec, elem_bt, num_elem));
>>   }
> 
> Is the function name `vector_mask_must_be_packed` fine to you? This looks smarter to me.

Hi @XiaohongGong I am a bit confused with this condition here - 

`mask_vec->bottom_type()->isa_vectmask() == nullptr`

So this means that `mask_vec` is not of type `TypeVectMask` right? Which means it is not a vector predicate/mask type? Then how can the `VectorStoreMaskNode` convert mask_vec predicate to a packed vector?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27481#discussion_r2454474880


More information about the hotspot-compiler-dev mailing list