RFR: 8291600: [vectorapi] vector cast op check is not always needed for vector mask cast [v4]
Xiaohong Gong
xgong at openjdk.org
Wed Aug 31 02:09:55 UTC 2022
On Mon, 29 Aug 2022 06:43:38 GMT, Jie Fu <jiefu at openjdk.org> wrote:
> Thanks for the update.
>
> May I ask can we do it like this?
>
> ```
> diff --git a/src/hotspot/share/opto/vectorIntrinsics.cpp b/src/hotspot/share/opto/vectorIntrinsics.cpp
> index 66bacf0..c4e807a 100644
> --- a/src/hotspot/share/opto/vectorIntrinsics.cpp
> +++ b/src/hotspot/share/opto/vectorIntrinsics.cpp
> @@ -2494,8 +2494,9 @@ bool LibraryCallKit::inline_vector_convert() {
> new_elem_bt_from = elem_bt_from == T_FLOAT ? T_INT : T_LONG;
> }
> int cast_vopc = VectorCastNode::opcode(new_elem_bt_from, !is_ucast);
> + bool no_vec_cast_check = is_mask && (type2aelembytes(elem_bt_from) == type2aelembytes(elem_bt_to));
> // Make sure that cast is implemented to particular type/size combination.
> - if (!arch_supports_vector(cast_vopc, num_elem_to, elem_bt_to, VecMaskNotUsed)) {
> + if (!no_vec_cast_check && !arch_supports_vector(cast_vopc, num_elem_to, elem_bt_to, VecMaskNotUsed)) {
> if (C->print_intrinsics()) {
> tty->print_cr(" ** not supported: arity=1 op=cast#%d/3 vlen2=%d etype2=%s ismask=%d",
> cast_vopc,
> ```
Thanks for the advice! The new commit has fixed this issue. Could you please check whether it is ok for you? Thanks!
-------------
PR: https://git.openjdk.org/jdk/pull/9737
More information about the hotspot-compiler-dev
mailing list