[vectorIntrinsics+fp16] RFR: 8302454: Improve VectorAPI fallback implementation for FP16 operations.

Xiaohong Gong xgong at openjdk.org
Thu Feb 16 08:57:54 UTC 2023


On Thu, 16 Feb 2023 05:03:53 GMT, Swati Sharma <duke at openjdk.org> wrote:

> Hi All,
> 
> The patch contains the below changes:
> - Remove redundant Halffloat object creation and rebase existing implementation using Float.float16ToFloat and floatToFloat16 APIs.
> - Enable all the vector API tests for FP16 operations.
> 
> Please review and provide your feedback.
> 
> Thanks,
> Swati

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractMask.java line 376:

> 374:             badMask =
> 375:                 iota.compare(GE, iota.broadcast(indexLimit));
> 376:         }

Is it better to add another "broadcast(long)" help method such as "broadcastDirect(long)" for each kind of Vector? Differently with the original "broadcast(long)", the long input is directly casted to the vector type (like the above special handle for Halffloat) without no checking.  The benefits are:

1. The above code is simplied. And it's no need to set "badMask" to "null", which I think is not recommended for vector/mask instance.
2.  The performance can improve for float/double operations that using this method. See an discussion here: https://github.com/openjdk/jdk/pull/12064#discussion_r1094101761

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

PR: https://git.openjdk.org/panama-vector/pull/211


More information about the panama-dev mailing list