On Wed, 28 Oct 2026 17:19:24 GMT, Chen Liang <[email protected]> wrote:

> `VectorShape` is currently an enum. It has a constant `S_Max_Bits`, which 
> makes it not suitable for the potential future enhancements; for example, 
> aarch64 SVE2 has a streaming vector length distinct from the old "max length" 
> of a vector already.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShapeImpl.java
 line 55:

> 53:     final int switchKey;
> 54: 
> 55:     VectorShapeImpl(int switchKey, int vectorBitSize) {

We can pass in the `SK_X_BIT` constant as argument to the constructor's 
`switchKey` parameter.

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShapeImpl.java
 line 85:

> 83:     // Switch keys for local use.
> 84:     // We need these because switches keyed on enums
> 85:     // don't optimize properly; see JDK-8161245

Out of date comment, since we are no longer using an `enum`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33610#discussion_r4519528168
PR Review Comment: https://git.openjdk.org/jdk/pull/33610#discussion_r4519535993

Reply via email to