RFR: 8367292: VectorAPI: Optimize VectorMask.fromLong/toLong() for SVE [v3]
    Xiaohong Gong 
    xgong at openjdk.org
       
    Tue Oct 28 10:50:05 UTC 2025
    
    
  
On Tue, 28 Oct 2025 10:27:39 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Well, we went with `prefers` because you said that on `aarch64` both are implemented, see our conversation above. So we are now spinning in circles.
>> 
>> I would approach it like this:
>> Write down what it means if the method returns true, and what it means if it returns false. Make sure to use `requires`, if anything else is not permitted/implemented. Use `prefers` if both are permitted/implemented, but one is preferred.
>
> Another idea: use a return `Enum`. Then you can give things names, which can sometimes be more helpful than `true/false`.
I'm sorry that I might not explain too clear in above comments. A mask op can either be implemented with vector registers or predicate register on AArch64. But we can just choose one of them for a specific architecture. On NEON, it must use vector. But on SVE, in general mask ops use predicate instructions. However, for several special ops like ops in this PR, they are implemented with vector instructions. And there is no predicate version supported. Anyway, I will change to use `requires` any where.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27481#discussion_r2469018071
    
    
More information about the hotspot-compiler-dev
mailing list