RFR: 8370666: VectorAPI: Add clear comments for vector relative code in c2 [v3]

Emanuel Peter epeter at openjdk.org
Fri Jan 16 08:31:35 UTC 2026


On Wed, 14 Jan 2026 05:41:26 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>> The VectorMask implementation in Vector API involves complex interactions between types, nodes, and platform-specific
>> features, making the related code in HotSpot difficult to understand and review.
>> 
>> This patch adds comprehensive comments for vector mask related types, nodes, and methods in C2 to improve code clarity and
>> maintainability.
>> 
>> Note: This patch only adds comments; no functional changes are made.
>
> Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update comments in type.cpp

src/hotspot/share/opto/vectornode.hpp line 1513:

> 1511: // and incrementing by 1 up to "VLENGTH - 1". So far, the first input is an int
> 1512: // constant 0. For example, a 128-bit vector with int (32-bit) elements produces
> 1513: // a vector like "[0, 1, 2, 3]".

Are you saying that `in1` has to be a constant with value zero? Actually, it seems the backend just ignores the input value... so why do we even have it?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29130#discussion_r2697471218


More information about the hotspot-compiler-dev mailing list