RFR: 8376187: [VectorAPI] Define new lane type constants and pass them to intrinsic entries [v4]

Jatin Bhateja jbhateja at openjdk.org
Sun Feb 1 07:42:04 UTC 2026


On Fri, 30 Jan 2026 23:31:29 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review comments resolutions
>
> src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java line 152:
> 
>> 150:     int laneTypeOrdinal() {
>> 151:         return laneType.ordinal();
>> 152:     }
> 
> Is this needed? Won't all concrete sub types override this?

This interface provides access to lane type constant though species, its used for consistency, please have a look at following line and other places around it.
https://github.com/jatin-bhateja/jdk/blob/ff73dc3d48a9435c4395556c8325fbce7610cba9/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java#L3374

> src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java line 60:
> 
>> 58: 
>> 59:     static final int LANE_TYPE_ORDINAL = LT_BYTE;
>> 60: 
> 
> You can move this up to `ByteVector` and then reuse it to replace `byte.class`, so it is used consistently.

Done

> src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorOperators.java line 821:
> 
>> 819:     convert(String name, char kind, Class<E> dom, Class<F> ran, int opCode, int flags) {
>> 820:         int domran = ((LaneType.of(dom).ordinal() << VO_DOM_SHIFT) +
>> 821:                       (LaneType.of(ran).ordinal() << VO_RAN_SHIFT));
> 
> As i understand this is still correct because the maximum ordinal value is less than 16 (as was already the case for the basic type).

Correct.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29481#discussion_r2750675259
PR Review Comment: https://git.openjdk.org/jdk/pull/29481#discussion_r2750675162
PR Review Comment: https://git.openjdk.org/jdk/pull/29481#discussion_r2750675209


More information about the hotspot-dev mailing list