RFR: 8367292: VectorAPI: Optimize VectorMask.fromLong/toLong() for SVE [v3]
    Emanuel Peter 
    epeter at openjdk.org
       
    Fri Oct 24 08:55:03 UTC 2025
    
    
  
On Fri, 24 Oct 2025 08:27:49 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>>> 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 ;)
What about `prefers` instead of `uses`? Or `should_use`?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27481#discussion_r2459396208
    
    
More information about the hotspot-compiler-dev
mailing list