RFR: 8351623: VectorAPI: Add SVE implementation of subword gather load operation [v5]
    Xiaohong Gong 
    xgong at openjdk.org
       
    Tue Oct  7 08:56:52 UTC 2025
    
    
  
On Tue, 9 Sep 2025 07:33:49 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> It just has the `Extract` node to extract an element from vector in C2, right? Extracting the lowest part can be implemented with `VectorReinterpret` easily. But how about the higher parts? Maybe this can also be implemented with operations like `slice` ? But, seems this will also make the IR more complex? For `Cast`, we have `VectorCastMask` now, but it assumes the vector length should be the same for input and output. So the `VectorReinterpret` or an `VectorExtract` is sill needed. 
>> 
>> I can have a try with separating the IR. But I guess an additional new node is still necessary. 
>> 
>>> It would just allow us to have one fewer nodes.
>> 
>> This is also what I expect really.
>
> It would just be nice to build on "simple" building blocks and not have too many complex nodes, that have very special semantics (widen + split into two). It just means that the IR optimizations have to take care of more special cases, rather than following simple rules/optimizations because every IR node does a relatively simple thing.
> 
> Maybe you find out that we really need a complex node, and can provide good arguments. Looking forward to what you find :)
Hi @iwanowww , regarding to the operation of extending the higher half element size for a vector mask, do you have any better idea? To split the gather operation for a subword type, we usually need to split the input mask as well. Especially for SVE, which the vector mask needs the same data type for an element. I need to extract the part of the original vector mask, and extend it to the int type. For Vector API, I think we can either use similar vector slice for a mask, or a vector extract API. WDYT?
Note that on SVE, it has the native `PUNPKHI` [1] instruction supported. 
[1] https://developer.arm.com/documentation/ddi0596/2020-12/SVE-Instructions/PUNPKHI--PUNPKLO--Unpack-and-widen-half-of-predicate-
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26236#discussion_r2409903068
    
    
More information about the hotspot-compiler-dev
mailing list