RFR: 8367292: VectorAPI: Optimize VectorMask.fromLong/toLong() for SVE [v2]
    Paul Sandoz 
    psandoz at openjdk.org
       
    Mon Oct 27 16:54:42 UTC 2025
    
    
  
On Mon, 27 Oct 2025 02:13:22 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
>> Maybe @PaulSandoz has a good idea for a better naming of `VectorLoadMask` and `VectorStoreMask`?
>> 
>> @XiaohongGong Is there any good place where we already document the different kinds of masks, and how they can be converted, and how they are used? If not: it would be really great if we could add that to `vectornode.hpp`. I also see that `TypeVectMask` has no class comment. We really should improve things there. It would make reviewing Vector API code so much easier.
>
> Hi @eme64 , I'm afraid that there is not a place that we document these things now. And I agree that clearly comments might be necessary. I'v created a separate JBS to record https://bugs.openjdk.org/browse/JDK-8370666. Thanks for your suggestion!
> Maybe @PaulSandoz has a good idea for a better naming of `VectorLoadMask` and `VectorStoreMask`?
> 
IIUC these nodes represent conversions or casts:
- `VectorLoadMask` - converts a vector register of 8-bit lanes representing a mask to a platform-specific mask register
- `VectorStoreMask` - converts a platform-specific mask register to a vector register of 8-bit lanes representing the mask
In theory we could model such conversations using `VectorOperators` as we do other conversions, which might hold some clues as to their names. There is already `VectorMaskCastNode`, but i believe that operates on the platform-specific mask register, casting between different vector species of the same length.
So perhaps we could rename to the following:
- `VectorLoadMask` -> `VectorCastB2MaskNode`
- `VectorStoreMask` -> `VectorCastMask2BNode`
Having a naming convention for the various mask representations might further help and influence those names:
- `BVectMask`, vector register of 8-bit lanes representing the mask
- `NVectMask`, vector register of N-bit lanes representing the mask; and
- `PVectMask`, representing the platform-specific predicate/mask register, which might be the same as `NVectMask` on certain hardware.
Does that help?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27481#discussion_r2466385252
    
    
More information about the hotspot-compiler-dev
mailing list