On Tue, 10 Nov 2026 05:37:19 GMT, Jatin Bhateja <[email protected]> wrote:
> Hi All, > > Currently Float16Vector.compress/expand operations are not intrinsified and > are executed through the fallback implementation. > These are pure lane-permutation (data movement) operation; it never > interprets the 16-bit lane bits as an IEEE binary16 > number. Since a Float16 lane maps to T_SHORT, it reuses the existing 16-bit > vector compress/expand backend directly. > > Patch adds Add intrinsification support encompassing the following tasks: > > - Inline expander extension: allow LT_FLOAT16 past the lane-type guard in > inline_vector_compress_expand all downstream logic already resolves to the > T_SHORT permute path. > - Add an IR verification test asserting VectorRearrange is generated for > Float16Vector.rearrange with correctness versus the fallback. > > Following are the performance numbers of benchmarks included with the patch > on an AVX512-FP16 target. > > > Baseline:- > Benchmark (vectorDim) Mode Cnt > Score Error Units > Float16VectorOperationsBenchmark.compressBenchmark 1024 thrpt 5 > 107.904 ± 1.803 ops/ms > Float16VectorOperationsBenchmark.compressBenchmark 2057 thrpt 5 > 46.988 ± 8.393 ops/ms > Float16VectorOperationsBenchmark.expandBenchmark 1024 thrpt 5 > 109.750 ± 0.760 ops/ms > Float16VectorOperationsBenchmark.expandBenchmark 2057 thrpt 5 > 36.400 ± 7.317 ops/ms > Withopt:- > Benchmark (vectorDim) Mode Cnt > Score Error Units > Float16VectorOperationsBenchmark.compressBenchmark 1024 thrpt 5 > 35222.954 ± 262.904 ops/ms > Float16VectorOperationsBenchmark.compressBenchmark 2057 thrpt 5 > 3476.914 ± 27.990 ops/ms > Float16VectorOperationsBenchmark.expandBenchmark 1024 thrpt 5 > 35857.758 ± 214.781 ops/ms > Float16VectorOperationsBenchmark.expandBenchmark 2057 thrpt 5 > 4267.513 ± 33.399 ops/ms > > > Kindly review and share your feedback. > > Best Regards, > Jatin > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). src/hotspot/share/opto/vectorIntrinsics.cpp line 3145: > 3143: > 3144: int num_elem = vlen->get_con(); > 3145: BasicType elem_bt = get_vector_primitive_lane_type(vltype); Would it be good to add a small comment mentioning that `LT_FLOAT16` maps to `T_SHORT` which allows the existing infrastructure for `T_SHORT` to be used for Float16 type as well. test/micro/org/openjdk/bench/jdk/incubator/vector/Float16VectorOperationsBenchmark.java line 23: > 21: * questions. > 22: */ > 23: package org.openjdk.bench.java.lang; change the package to `org.openjdk.bench.jdk.incubator.vector` (although this isn't part of this PR but is a trivial change to incorporate in this one)? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/33810#discussion_r4540134014 PR Review Comment: https://git.openjdk.org/jdk/pull/33810#discussion_r4540144904
