From patchwork Fri Mar 15 11:01:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 10854531 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 035451575 for ; Fri, 15 Mar 2019 11:04:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF62228AA8 for ; Fri, 15 Mar 2019 11:04:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D38CD28B17; Fri, 15 Mar 2019 11:04:10 +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 66CAB28AA8 for ; Fri, 15 Mar 2019 11:04:10 +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 1h4kaW-0000eL-O5; Fri, 15 Mar 2019 11:01:20 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h4kaV-0000du-6c for xen-devel@lists.xenproject.org; Fri, 15 Mar 2019 11:01:19 +0000 X-Inumbo-ID: a8758a8b-4711-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 a8758a8b-4711-11e9-bc90-bc764e045a96; Fri, 15 Mar 2019 11:01:18 +0000 (UTC) Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Fri, 15 Mar 2019 05:01:17 -0600 Message-Id: <5C8B85FC020000780021F2AF@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.1.0 Date: Fri, 15 Mar 2019 05:01:16 -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 37/50] x86emul: complete support of AVX512_VBMI 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 Also add testing of ones support for which was added before. Sadly gcc's command line option naming is not in line with Intel's naming of the feature, which makes it necessary to mis-name things in the test harness. Since the only new insn here and in particular its memory access pattern follows the usual scheme, I didn't think it was necessary to add a contrived test specifically for it, beyond the Disp8 scaling one. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- v6: New. --- a/tools/tests/x86_emulator/Makefile +++ b/tools/tests/x86_emulator/Makefile @@ -16,7 +16,7 @@ vpath %.c $(XEN_ROOT)/xen/lib/x86 CFLAGS += $(CFLAGS_xeninclude) -SIMD := 3dnow sse sse2 sse4 avx avx2 xop avx512f avx512bw avx512dq avx512er +SIMD := 3dnow sse sse2 sse4 avx avx2 xop avx512f avx512bw avx512dq avx512er avx512vbmi FMA := fma4 fma SG := avx2-sg avx512f-sg avx512vl-sg TESTCASES := blowfish $(SIMD) $(FMA) $(SG) @@ -83,6 +83,9 @@ avx512dq-flts := $(avx512f-flts) avx512er-vecs := 64 avx512er-ints := avx512er-flts := 4 8 +avx512vbmi-vecs := $(avx512bw-vecs) +avx512vbmi-ints := $(avx512bw-ints) +avx512vbmi-flts := $(avx512bw-flts) avx512f-opmask-vecs := 2 avx512dq-opmask-vecs := 1 2 --- a/tools/tests/x86_emulator/evex-disp8.c +++ b/tools/tests/x86_emulator/evex-disp8.c @@ -542,6 +542,7 @@ static const struct test avx512_vbmi_all INSN(permb, 66, 0f38, 8d, vl, b, vl), INSN(permi2b, 66, 0f38, 75, vl, b, vl), INSN(permt2b, 66, 0f38, 7d, vl, b, vl), + INSN(pmultishiftqb, 66, 0f38, 83, vl, q, vl), }; static const struct test avx512_vbmi2_all[] = { --- a/tools/tests/x86_emulator/test_x86_emulator.c +++ b/tools/tests/x86_emulator/test_x86_emulator.c @@ -27,6 +27,7 @@ asm ( ".pushsection .test, \"ax\", @prog #include "avx512bw.h" #include "avx512dq.h" #include "avx512er.h" +#include "avx512vbmi.h" #define verbose false /* Switch to true for far more logging. */ @@ -127,6 +128,16 @@ static bool simd_check_avx512bw_vl(void) return cpu_has_avx512bw && cpu_has_avx512vl; } +static bool simd_check_avx512vbmi(void) +{ + return cpu_has_avx512_vbmi; +} + +static bool simd_check_avx512vbmi_vl(void) +{ + return cpu_has_avx512_vbmi && cpu_has_avx512vl; +} + static void simd_set_regs(struct cpu_user_regs *regs) { if ( cpu_has_mmx ) @@ -372,6 +383,18 @@ static const struct { SIMD(AVX512ER f32x16, avx512er, 64f4), SIMD(AVX512ER f64 scalar,avx512er, f8), SIMD(AVX512ER f64x8, avx512er, 64f8), + SIMD(AVX512_VBMI s8x64, avx512vbmi, 64i1), + SIMD(AVX512_VBMI u8x64, avx512vbmi, 64u1), + SIMD(AVX512_VBMI s16x32, avx512vbmi, 64i2), + SIMD(AVX512_VBMI u16x32, avx512vbmi, 64u2), + AVX512VL(_VBMI+VL s8x16, avx512vbmi, 16i1), + AVX512VL(_VBMI+VL u8x16, avx512vbmi, 16u1), + AVX512VL(_VBMI+VL s8x32, avx512vbmi, 32i1), + AVX512VL(_VBMI+VL u8x32, avx512vbmi, 32u1), + AVX512VL(_VBMI+VL s16x8, avx512vbmi, 16i2), + AVX512VL(_VBMI+VL u16x8, avx512vbmi, 16u2), + AVX512VL(_VBMI+VL s16x16, avx512vbmi, 32i2), + AVX512VL(_VBMI+VL u16x16, avx512vbmi, 32u2), #undef AVX512VL_ #undef AVX512VL #undef SIMD_ --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -493,6 +493,7 @@ static const struct ext0f38_table { [0x7a ... 0x7c] = { .simd_size = simd_none, .two_op = 1 }, [0x7d ... 0x7e] = { .simd_size = simd_packed_int, .d8s = d8s_vl }, [0x7f] = { .simd_size = simd_packed_fp, .d8s = d8s_vl }, + [0x83] = { .simd_size = simd_packed_int, .d8s = d8s_vl }, [0x88] = { .simd_size = simd_packed_fp, .two_op = 1, .d8s = d8s_dq }, [0x89] = { .simd_size = simd_packed_int, .two_op = 1, .d8s = d8s_dq }, [0x8a] = { .simd_size = simd_packed_fp, .to_mem = 1, .two_op = 1, .d8s = d8s_dq }, @@ -9023,6 +9024,12 @@ x86_emulate( ASSERT(!state->simd_size); break; + case X86EMUL_OPC_EVEX_66(0x0f38, 0x83): /* vpmultishiftqb [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */ + generate_exception_if(!evex.w, EXC_UD); + host_and_vcpu_must_have(avx512_vbmi); + fault_suppression = false; + goto avx512f_no_sae; + case X86EMUL_OPC_VEX_66(0x0f38, 0x8c): /* vpmaskmov{d,q} mem,{x,y}mm,{x,y}mm */ case X86EMUL_OPC_VEX_66(0x0f38, 0x8e): /* vpmaskmov{d,q} {x,y}mm,{x,y}mm,mem */ generate_exception_if(ea.type != OP_MEM, EXC_UD);