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

Xiaohong Gong xgong at openjdk.org
Tue Feb 28 01:37:39 UTC 2023


On Mon, 27 Feb 2023 10:42:39 GMT, Swati Sharma <duke at openjdk.org> wrote:

>> 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
>
> Thanks @XiaohongGong for the suggestion. This patch contains fp16 related changes, I am planning this optimization to be done in jdk mainline.

Thanks! That makes sense to me.

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

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


More information about the panama-dev mailing list