From patchwork Fri Mar 15 10:43:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 10854469 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8CBF915AC for ; Fri, 15 Mar 2019 10:45:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71C7D2A842 for ; Fri, 15 Mar 2019 10:45:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6077B2A86D; Fri, 15 Mar 2019 10:45:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EEB5C2A842 for ; Fri, 15 Mar 2019 10:45:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h4kJJ-0004gY-RJ; Fri, 15 Mar 2019 10:43:33 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h4kJJ-0004gQ-3I for xen-devel@lists.xenproject.org; Fri, 15 Mar 2019 10:43:33 +0000 X-Inumbo-ID: 2d040f67-470f-11e9-bc90-bc764e045a96 Received: from prv1-mh.provo.novell.com (unknown [137.65.248.33]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 2d040f67-470f-11e9-bc90-bc764e045a96; Fri, 15 Mar 2019 10:43:32 +0000 (UTC) Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Fri, 15 Mar 2019 04:43:31 -0600 Message-Id: <5C8B81D3020000780021F16D@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.1.0 Date: Fri, 15 Mar 2019 04:43:31 -0600 From: "Jan Beulich" To: "xen-devel" References: <5B6BF83602000078001DC548@prv1-mh.provo.novell.com> <5C8B7EC0020000780021F10B@prv1-mh.provo.novell.com> In-Reply-To: <5C8B7EC0020000780021F10B@prv1-mh.provo.novell.com> Mime-Version: 1.0 Content-Disposition: inline Subject: [Xen-devel] [PATCH v8 12/50] x86emul: support AVX512{BW, DQ} mask move insns X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: George Dunlap , Andrew Cooper , Wei Liu , Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Entries to the tables in evex-disp8.c are added despite these insns not allowing for memory operands, with the goal of the tables giving a complete picture of the supported EVEX-encoded insns in the end. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- v3: New. --- a/tools/tests/x86_emulator/evex-disp8.c +++ b/tools/tests/x86_emulator/evex-disp8.c @@ -314,9 +314,12 @@ static const struct test avx512bw_all[] INSN(pminsw, 66, 0f, ea, vl, w, vl), INSN(pminub, 66, 0f, da, vl, b, vl), INSN(pminuw, 66, 0f38, 3a, vl, w, vl), +// pmovb2m, f3, 0f38, 29, b +// pmovm2, f3, 0f38, 28, bw INSN(pmovswb, f3, 0f38, 20, vl_2, b, vl), INSN(pmovsxbw, 66, 0f38, 20, vl_2, b, vl), INSN(pmovuswb, f3, 0f38, 10, vl_2, b, vl), +// pmovw2m, f3, 0f38, 29, w INSN(pmovwb, f3, 0f38, 30, vl_2, b, vl), INSN(pmovzxbw, 66, 0f38, 30, vl_2, b, vl), INSN(pmulhuw, 66, 0f, e4, vl, w, vl), @@ -364,6 +367,9 @@ static const struct test avx512dq_all[] INSN_PFP(andn, 0f, 55), INSN(broadcasti32x2, 66, 0f38, 59, el_2, d, vl), INSN_PFP(or, 0f, 56), +// pmovd2m, f3, 0f38, 39, d +// pmovm2, f3, 0f38, 38, dq +// pmovq2m, f3, 0f38, 39, q INSN(pmullq, 66, 0f38, 40, vl, q, vl), INSN_PFP(xor, 0f, 57), }; --- a/tools/tests/x86_emulator/opmask.S +++ b/tools/tests/x86_emulator/opmask.S @@ -12,17 +12,23 @@ #if SIZE == 1 # define _(x) x##b +# define _v(x, t) _v_(x##q, t) #elif SIZE == 2 # define _(x) x##w +# define _v(x, t) _v_(x##d, t) # define WIDEN(x) x##bw #elif SIZE == 4 # define _(x) x##d +# define _v(x, t) _v_(x##w, t) # define WIDEN(x) x##wd #elif SIZE == 8 # define _(x) x##q +# define _v(x, t) _v_(x##b, t) # define WIDEN(x) x##dq #endif +#define _v_(x, t) v##x##t + .macro check res1:req, res2:req, line:req _(kmov) %\res1, DATA(out) #if SIZE < 8 || !defined(__i386__) @@ -131,6 +137,15 @@ _start: #endif +#if SIZE > 2 ? defined(__AVX512BW__) : defined(__AVX512DQ__) + + _(kmov) DATA(in1), %k0 + _v(pmovm2,) %k0, %zmm7 + _v(pmov,2m) %zmm7, %k3 + check k0, k3, __LINE__ + +#endif + xor %eax, %eax ret --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -8465,6 +8465,21 @@ x86_emulate( elem_bytes = (b & 7) < 3 ? 1 : (b & 7) != 5 ? 2 : 4; goto avx512f_no_sae; + case X86EMUL_OPC_EVEX_F3(0x0f38, 0x29): /* vpmov{b,w}2m [xyz]mm,k */ + case X86EMUL_OPC_EVEX_F3(0x0f38, 0x39): /* vpmov{d,q}2m [xyz]mm,k */ + generate_exception_if(!evex.r || !evex.R, EXC_UD); + /* fall through */ + case X86EMUL_OPC_EVEX_F3(0x0f38, 0x28): /* vpmovm2{b,w} k,[xyz]mm */ + case X86EMUL_OPC_EVEX_F3(0x0f38, 0x38): /* vpmovm2{d,q} k,[xyz]mm */ + if ( b & 0x10 ) + host_and_vcpu_must_have(avx512dq); + else + host_and_vcpu_must_have(avx512bw); + generate_exception_if(evex.opmsk || ea.type != OP_REG, EXC_UD); + d |= TwoOp; + op_bytes = 16 << evex.lr; + goto avx512f_no_sae; + case X86EMUL_OPC_66(0x0f38, 0x2a): /* movntdqa m128,xmm */ case X86EMUL_OPC_VEX_66(0x0f38, 0x2a): /* vmovntdqa mem,{x,y}mm */ generate_exception_if(ea.type != OP_MEM, EXC_UD);