From patchwork Fri Mar 15 10:59:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 10854519 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 B012F1575 for ; Fri, 15 Mar 2019 11:01:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 988FD2A6AF for ; Fri, 15 Mar 2019 11:01:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A0CF2A938; Fri, 15 Mar 2019 11:01:04 +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 1C8B82A6AF for ; Fri, 15 Mar 2019 11:01:04 +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 1h4kYc-00082q-QF; Fri, 15 Mar 2019 10:59:22 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h4kYb-00082d-MO for xen-devel@lists.xenproject.org; Fri, 15 Mar 2019 10:59:21 +0000 X-Inumbo-ID: 6250d186-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 6250d186-4711-11e9-bc90-bc764e045a96; Fri, 15 Mar 2019 10:59:20 +0000 (UTC) Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Fri, 15 Mar 2019 04:59:19 -0600 Message-Id: <5C8B8587020000780021F251@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.1.0 Date: Fri, 15 Mar 2019 04:59:19 -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 33/50] x86emul: add high register S/G test cases 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 In order to verify that in particular the index register decoding works correctly in the S/G emulation paths, add dedicated (64-bit only) cases disallowing the compiler to use the lower registers. Other than in the generic SIMD case, where occasional uses of %xmm or %ymm registers in generated code cause various internal compiler errors when disallowing use of all of the lower 16 registers (apparently due to insn templates trying to use AVX2 encodings), doing so here in the AVX512F case looks to be fine. While the main goal here is the AVX512F case, add an AVX2 variant as well. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- v6: New. --- a/tools/tests/x86_emulator/Makefile +++ b/tools/tests/x86_emulator/Makefile @@ -147,6 +147,12 @@ $(foreach flavor,$(SIMD) $(FMA),$(eval $ $(foreach flavor,$(SG),$(eval $(call simd-sg-defs,$(flavor)))) $(foreach flavor,$(OPMASK),$(eval $(call opmask-defs,$(flavor)))) +first-string = $(shell for s in $(1); do echo "$$s"; break; done) + +avx2-sg-cflags-x86_64 := "-D_high $(foreach n,7 6 5 4 3 2 1,-ffixed-ymm$(n)) $(call first-string,$(avx2-sg-cflags))" +avx512f-sg-cflags-x86_64 := "-D_higher $(foreach n,7 6 5 4 3 2 1,-ffixed-zmm$(n)) $(call first-string,$(avx512f-sg-cflags))" +avx512f-sg-cflags-x86_64 += "-D_highest $(foreach n,15 14 13 12 11 10 9 8,-ffixed-zmm$(n)) $(call first-string,$(avx512f-sg-cflags-x86_64))" + $(addsuffix .h,$(TESTCASES)): %.h: %.c testcase.mk Makefile rm -f $@.new $*.bin $(foreach arch,$(filter-out $(XEN_COMPILE_ARCH),x86_32) $(XEN_COMPILE_ARCH), \ --- a/tools/tests/x86_emulator/test_x86_emulator.c +++ b/tools/tests/x86_emulator/test_x86_emulator.c @@ -266,6 +266,9 @@ static const struct { SIMD(AVX2 S/G i64[4x32], avx2_sg, 32x4i8), SIMD(AVX2 S/G i32[4x64], avx2_sg, 32x8i4), SIMD(AVX2 S/G i64[4x64], avx2_sg, 32x8i8), +#ifdef __x86_64__ + SIMD_(64, AVX2 S/G %ymm8+, avx2_sg, high), +#endif SIMD(XOP 128bit single, xop, 16f4), SIMD(XOP 256bit single, xop, 32f4), SIMD(XOP 128bit double, xop, 16f8), @@ -303,6 +306,10 @@ static const struct { SIMD(AVX512F S/G i64[ 8x32], avx512f_sg, 64x4i8), SIMD(AVX512F S/G i32[ 8x64], avx512f_sg, 64x8i4), SIMD(AVX512F S/G i64[ 8x64], avx512f_sg, 64x8i8), +#ifdef __x86_64__ + SIMD_(64, AVX512F S/G %zmm8+, avx512f_sg, higher), + SIMD_(64, AVX512F S/G %zmm16+, avx512f_sg, highest), +#endif AVX512VL(VL f32x4, avx512f, 16f4), AVX512VL(VL f64x2, avx512f, 16f8), AVX512VL(VL f32x8, avx512f, 32f4),