[vectorIntrinsics+mask] RFR: 8273406: Optimize various masked vector operations for AVX512 target. [v2]
Jatin Bhateja
jbhateja at openjdk.java.net
Mon Sep 13 06:42:08 UTC 2021
On Wed, 8 Sep 2021 23:34:33 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:
>> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8273406: Review comments resolution.
>
> src/hotspot/cpu/x86/assembler_x86.cpp line 9086:
>
>> 9084: }
>> 9085:
>> 9086: void Assembler::evpsllw(XMMRegister dst, KRegister mask, int shift, XMMRegister src, bool merge, int vector_len) {
>
> For all the shift and rotate instructions operand order could be dst, mask, src, shift, merge, vector_len.
DONE
> src/hotspot/cpu/x86/x86.ad line 8998:
>
>> 8996: bool is_varshift = !VectorNode::is_vshift_cnt_opcode(in(2)->isa_Mach()->ideal_Opcode());
>> 8997: __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister,
>> 8998: $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, is_varshift);
>
> x86.ad is sending is_varshift for rotates but is_varshift is not passed to evrold/evrord in evmasked_op.
Its not needed, unlike vector shifts, rotate always consume shift either as an immediate value or though a vector of same shape as source vector. Removing it.
> src/hotspot/share/opto/vectornode.hpp line 1397:
>
>> 1395: : VectorNode(in, dst_vt), _src_vt(src_vt) {
>> 1396: assert((!dst_vt->isa_vectmask() && !src_vt->isa_vectmask()) ||
>> 1397: (type2aelembytes(src_vt->element_basic_type()) >= type2aelembytes(dst_vt->element_basic_type())),
>
> Why this addition limitation for vectmask only? Some comments here please.
Only narrowing re-interpretation is supported if source and destinations are mask type operands i.e.
If Int512Mask is reinterpreted as Byte512Mask each true bit of Int species will correspond to 4 true bits of Byte species,
but reverse re-interpretation is not straight forwards, since not all 4 bits of byte species may be true and thus cannot be directly reinterpreted as 1 true mask bit for integer species.
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/122
More information about the panama-dev
mailing list