RFR: 8291600: [vectorapi] vector cast op check is not always needed for vector mask cast [v5]

Xiaohong Gong xgong at openjdk.org
Wed Aug 31 03:16:13 UTC 2022


On Wed, 31 Aug 2022 02:55:50 GMT, Jie Fu <jiefu at openjdk.org> wrote:

>> Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add vector cast op check for vector mask for some cases
>
> src/hotspot/share/opto/vectorIntrinsics.cpp line 2503:
> 
>> 2501: 
>> 2502:     // Make sure that vector cast is implemented to particular type/size combination.
>> 2503:     bool no_vec_cast_check = is_mask && (src_type->isa_vectmask() ||
> 
> To make it safer, let's also check `dst_type->isa_vectmask()` like the following.
> 
>       if (is_mask) {
>         if ((dst_type->isa_vectmask() && src_type->isa_vectmask()) ||
>             (type2aelembytes(elem_bt_from) == type2aelembytes(elem_bt_to))) {
>           op = gvn().transform(new VectorMaskCastNode(op, dst_type));
>         } else {
>           op = VectorMaskCastNode::makeCastNode(&gvn(), op, dst_type);
>         }
>       }

>From the check https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/vectorIntrinsics.cpp#L2485, we know the basic mask type of dst and src must be the same. So just checking `src_type` is ok here. Besides, this part of changes will be removed finally after I unify the vector mask cast operation.

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

PR: https://git.openjdk.org/jdk/pull/9737


More information about the hotspot-compiler-dev mailing list