RFR: 8377438: [VectorAPI] Add new carrier type to LaneType class [v2]

Paul Sandoz psandoz at openjdk.org
Tue Feb 24 01:12:17 UTC 2026


On Thu, 19 Feb 2026 12:02:27 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> As per https://github.com/openjdk/jdk/pull/28002#issuecomment-3789507594 on JDK-8370691 pull request, splitting out portion of PR#28002 into a separate patch.
>> 
>> With Float16 we need to differentiate b/w vector lane element type and carrier type. while element type corresponds to exact type of lane i.e. Float16.class, carrier type corresponds to the storage type required to propagate IEEE 754 float16 values to inline expander.
>> 
>> Patch adds a new carrier type to existing LaneType structure and use it for following purpose.
>>  - To compute preferred shape of vector.
>>  - To allocate vector backing storage during dummy vector and iota array creation.
>>  - Sanity checking to ensure vector lane type is a primitive type in inline expander.
>> 
>> All existing Vector API jtreg test are passing with the patch.
>> 
>> Kindly review and share your feedback.
>> 
>> Best Regards,
>> Jatin
>
> Jatin Bhateja has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
> 
>  - Merge branch 'master' of http://github.com/openjdk/jdk into JDK-8377438
>  - 8377438: [VectorAPI] Add new carrier type to LaneType class

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LaneType.java line 70:

> 68:         this.typeChar = genericElementType.getSimpleName().charAt(0);
> 69:         this.carrierType = carrierType;
> 70:         assert("FDBSIL".indexOf(typeChar) == ordinal()) : this;

Can you move this assert statement to be directly after where `typeChar` is assigned? Then after the assignment of `carrierType` you can `assert(carrierType.isPrimitive())`, which while not full-proof does express the intent.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29629#discussion_r2843895458


More information about the core-libs-dev mailing list