From patchwork Fri Apr 7 03:28:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiang, Haochen" X-Patchwork-Id: 80642 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp17356vqo; Thu, 6 Apr 2023 20:28:28 -0700 (PDT) X-Google-Smtp-Source: AKy350a6q94JV+8mlxEYSkE4t/ORTLpoGC+oU4iIaH7RFeopMwzIsXHjfkMwoLJidjOPLNctuamV X-Received: by 2002:a17:906:dc94:b0:947:c995:3f75 with SMTP id cs20-20020a170906dc9400b00947c9953f75mr1033940ejc.71.1680838108115; Thu, 06 Apr 2023 20:28:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680838108; cv=none; d=google.com; s=arc-20160816; b=PALHgBDYkTU0fOzWp8DFUNlAR81pzgVlVLZscKz5lQJ7H8nCeIno8aFAoCkNhoS4PN mTAUgWmpVvh8jJXuw1Fp7xIhh4dMGDk0W01jYnCU67vfUrGGoaaxtu8mPhcl2FVkLlTP Ti9CutAsl1/kTdKPHVGGmaG7601KylLTlJlfw2WyEzDKiG6cbGYXcDg7UlgY41C89q+s E5DoRqqhu3NKYaJ6Aiy/PBXUcPaExPEgErVxsl+VGAf7aQszDZH6YrqZGwZCBLxQb0AA mC4pg0v0ciVY5VJq6aCErtCV3MpSzkdQfp5cqBRlR/oohe0HYif5KWwynV/89XzGehEP tSaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=AxCOcqJU/shgNDFBdG3IxQT6Pbxj108WcyBoNKHnx50=; b=bWEXMu1o7ze07yb/eIPAmsbhrWRek3jUugD6QTUECkmkvUw3rhWZJCJc5TD39rgamD X/35o/P1WOVQJzRIDZf5F03QlQNbRHOgYkKCD/V/lEXH8B1rKzip2qDOsPsA3iFdPz/S pzDhdyeTJ4ET7AiKm4cmU2vlC93MuLw3CqiJrCA5hBMZnXTc7MJXDbfdRLOPBamZZQFf u5wol3qdWgt897bF3V9l0VROAo3moXFx80v/b3d62VH9QLgenEBNPMsVLvphsW9eIrF0 WxdhnAM+cdKgQwm0pGjA35PLiNb2A6yH3KCxBhzGEjQ1XFPyfDYieTrL1tkxqmHJf3zD lvBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=emndHB7k; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id 19-20020a170906209300b00946a18bb2dfsi521349ejq.986.2023.04.06.20.28.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 20:28:28 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=emndHB7k; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5E06F385840F for ; Fri, 7 Apr 2023 03:28:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E06F385840F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680838104; bh=AxCOcqJU/shgNDFBdG3IxQT6Pbxj108WcyBoNKHnx50=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=emndHB7kxfffJbGPjDWdIcTe6C52ecgEZ6PWyARqULH6cHGivvdELA4JSBM/RKNnR DiFnxgsVxHH36D+K0vh2BjSNLcLHhfOy9Q5odPAm75IpnNfpJf2lETaCy9WdLWMJTv AoY7l/cDHnhemxVsqw7WgBImLZyVFKZgLm2mImAk= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by sourceware.org (Postfix) with ESMTPS id A85A83858D28 for ; Fri, 7 Apr 2023 03:28:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A85A83858D28 X-IronPort-AV: E=McAfee;i="6600,9927,10672"; a="342925682" X-IronPort-AV: E=Sophos;i="5.98,324,1673942400"; d="scan'208";a="342925682" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2023 20:28:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10672"; a="1017127530" X-IronPort-AV: E=Sophos;i="5.98,324,1673942400"; d="scan'208";a="1017127530" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmsmga005.fm.intel.com with ESMTP; 06 Apr 2023 20:28:10 -0700 Received: from shliclel4217.sh.intel.com (shliclel4217.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 991DB10081EA; Fri, 7 Apr 2023 11:28:09 +0800 (CST) To: binutils@sourceware.org Cc: jbeulich@suse.com, hjl.tools@gmail.com Subject: [PATCH] x86: Add inval tests for AMX instructions Date: Fri, 7 Apr 2023 11:28:09 +0800 Message-Id: <20230407032809.3763561-1-haochen.jiang@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Haochen Jiang via Binutils From: "Jiang, Haochen" Reply-To: Haochen Jiang Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762486499811833153?= X-GMAIL-MSGID: =?utf-8?q?1762486499811833153?= Hi all, As the AMX-COMPLEX thread said, the AMX invalid checks are missing. This patch adds those missing all-operands-must- be-distinct checking. Tested on x86_64-pc-linux-gnu. Ok for trunk? BRs, Haochen gas/ChangeLog: * testsuite/gas/i386/i386.exp: Run AMX-FP16 and AMX-COMPLEX inval testcases. * testsuite/gas/i386/x86-64-amx-inval.l: Add AMX-BF16 tests. * testsuite/gas/i386/x86-64-amx-inval.s: Ditto. * testsuite/gas/i386/x86-64-amx-complex-inval.l: New test. * testsuite/gas/i386/x86-64-amx-complex-inval.s: Ditto. * testsuite/gas/i386/x86-64-amx-fp16-inval.l: Ditto. * testsuite/gas/i386/x86-64-amx-fp16-inval.s: Ditto. --- gas/testsuite/gas/i386/i386.exp | 2 ++ .../gas/i386/x86-64-amx-complex-inval.l | 7 ++++++ .../gas/i386/x86-64-amx-complex-inval.s | 12 ++++++++++ .../gas/i386/x86-64-amx-fp16-inval.l | 7 ++++++ .../gas/i386/x86-64-amx-fp16-inval.s | 12 ++++++++++ gas/testsuite/gas/i386/x86-64-amx-inval.l | 22 ++++++++++++------- gas/testsuite/gas/i386/x86-64-amx-inval.s | 6 +++++ 7 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 gas/testsuite/gas/i386/x86-64-amx-complex-inval.l create mode 100644 gas/testsuite/gas/i386/x86-64-amx-complex-inval.s create mode 100644 gas/testsuite/gas/i386/x86-64-amx-fp16-inval.l create mode 100644 gas/testsuite/gas/i386/x86-64-amx-fp16-inval.s diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index 6d326b49a39..40e75ac6f88 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -1169,6 +1169,7 @@ if [gas_64_check] then { run_dump_test "x86-64-amx-fp16" run_dump_test "x86-64-amx-fp16-intel" run_dump_test "x86-64-amx-fp16-bad" + run_list_test "x86-64-amx-fp16-inval" run_dump_test "x86-64-avx-ifma" run_dump_test "x86-64-avx-ifma-intel" run_list_test "x86-64-avx-ifma-inval" @@ -1187,6 +1188,7 @@ if [gas_64_check] then { run_dump_test "x86-64-amx-complex" run_dump_test "x86-64-amx-complex-intel" run_dump_test "x86-64-amx-complex-bad" + run_list_test "x86-64-amx-complex-inval" run_dump_test "x86-64-clzero" run_dump_test "x86-64-mwaitx-bdver4" run_list_test "x86-64-mwaitx-reg" diff --git a/gas/testsuite/gas/i386/x86-64-amx-complex-inval.l b/gas/testsuite/gas/i386/x86-64-amx-complex-inval.l new file mode 100644 index 00000000000..f9832ada295 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-amx-complex-inval.l @@ -0,0 +1,7 @@ +.* Assembler messages: +.*:5: Error: all tmm registers must be distinct for `tcmmimfp16ps' +.*:6: Error: all tmm registers must be distinct for `tcmmimfp16ps' +.*:7: Error: all tmm registers must be distinct for `tcmmimfp16ps' +.*:10: Error: all tmm registers must be distinct for `tcmmimfp16ps' +.*:11: Error: all tmm registers must be distinct for `tcmmimfp16ps' +.*:12: Error: all tmm registers must be distinct for `tcmmimfp16ps' diff --git a/gas/testsuite/gas/i386/x86-64-amx-complex-inval.s b/gas/testsuite/gas/i386/x86-64-amx-complex-inval.s new file mode 100644 index 00000000000..eb34c4e48e0 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-amx-complex-inval.s @@ -0,0 +1,12 @@ +# Check illegal register usage in AMX-COMPLEX instructions + + .text +_start: + tcmmimfp16ps %tmm1, %tmm1, %tmm0 + tcmmimfp16ps %tmm1, %tmm0, %tmm1 + tcmmimfp16ps %tmm0, %tmm1, %tmm1 + + .intel_syntax noprefix + tcmmimfp16ps tmm0, tmm1, tmm1 + tcmmimfp16ps tmm1, tmm0, tmm1 + tcmmimfp16ps tmm0, tmm1, tmm1 diff --git a/gas/testsuite/gas/i386/x86-64-amx-fp16-inval.l b/gas/testsuite/gas/i386/x86-64-amx-fp16-inval.l new file mode 100644 index 00000000000..0e0a332b665 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-amx-fp16-inval.l @@ -0,0 +1,7 @@ +.* Assembler messages: +.*:5: Error: all tmm registers must be distinct for `tdpfp16ps' +.*:6: Error: all tmm registers must be distinct for `tdpfp16ps' +.*:7: Error: all tmm registers must be distinct for `tdpfp16ps' +.*:10: Error: all tmm registers must be distinct for `tdpfp16ps' +.*:11: Error: all tmm registers must be distinct for `tdpfp16ps' +.*:12: Error: all tmm registers must be distinct for `tdpfp16ps' diff --git a/gas/testsuite/gas/i386/x86-64-amx-fp16-inval.s b/gas/testsuite/gas/i386/x86-64-amx-fp16-inval.s new file mode 100644 index 00000000000..dab3151983d --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-amx-fp16-inval.s @@ -0,0 +1,12 @@ +# Check illegal register usage in AMX-FP16 instructions + + .text +_start: + tdpfp16ps %tmm1, %tmm1, %tmm0 + tdpfp16ps %tmm1, %tmm0, %tmm1 + tdpfp16ps %tmm0, %tmm1, %tmm1 + + .intel_syntax noprefix + tdpfp16ps tmm0, tmm1, tmm1 + tdpfp16ps tmm1, tmm0, tmm1 + tdpfp16ps tmm0, tmm1, tmm1 diff --git a/gas/testsuite/gas/i386/x86-64-amx-inval.l b/gas/testsuite/gas/i386/x86-64-amx-inval.l index 6757b780ea8..73300e84d4f 100644 --- a/gas/testsuite/gas/i386/x86-64-amx-inval.l +++ b/gas/testsuite/gas/i386/x86-64-amx-inval.l @@ -7,11 +7,17 @@ .*:10: Error: all tmm registers must be distinct for `tdpbssd' .*:11: Error: all tmm registers must be distinct for `tdpbssd' .*:12: Error: all tmm registers must be distinct for `tdpbssd' -.*:15: Error: `\[rip\]' cannot be used here -.*:16: Error: `\[rip\]' cannot be used here -.*:17: Error: `\[rip\]' cannot be used here -.*:18: Error: operand size mismatch for `tdpbssd' -.*:19: Error: operand size mismatch for `vaddps' -.*:20: Error: all tmm registers must be distinct for `tdpbssd' -.*:21: Error: all tmm registers must be distinct for `tdpbssd' -.*:22: Error: all tmm registers must be distinct for `tdpbssd' +.*:13: Error: all tmm registers must be distinct for `tdpbf16ps' +.*:14: Error: all tmm registers must be distinct for `tdpbf16ps' +.*:15: Error: all tmm registers must be distinct for `tdpbf16ps' +.*:18: Error: `\[rip\]' cannot be used here +.*:19: Error: `\[rip\]' cannot be used here +.*:20: Error: `\[rip\]' cannot be used here +.*:21: Error: operand size mismatch for `tdpbssd' +.*:22: Error: operand size mismatch for `vaddps' +.*:23: Error: all tmm registers must be distinct for `tdpbssd' +.*:24: Error: all tmm registers must be distinct for `tdpbssd' +.*:25: Error: all tmm registers must be distinct for `tdpbssd' +.*:26: Error: all tmm registers must be distinct for `tdpbf16ps' +.*:27: Error: all tmm registers must be distinct for `tdpbf16ps' +.*:28: Error: all tmm registers must be distinct for `tdpbf16ps' diff --git a/gas/testsuite/gas/i386/x86-64-amx-inval.s b/gas/testsuite/gas/i386/x86-64-amx-inval.s index 6e294536697..a083727e5d5 100644 --- a/gas/testsuite/gas/i386/x86-64-amx-inval.s +++ b/gas/testsuite/gas/i386/x86-64-amx-inval.s @@ -10,6 +10,9 @@ _start: tdpbssd %tmm1, %tmm1, %tmm0 tdpbssd %tmm1, %tmm0, %tmm1 tdpbssd %tmm0, %tmm1, %tmm1 + tdpbf16ps %tmm1, %tmm1, %tmm0 + tdpbf16ps %tmm1, %tmm0, %tmm1 + tdpbf16ps %tmm0, %tmm1, %tmm1 .intel_syntax noprefix tileloadd tmm1, [rip] @@ -20,3 +23,6 @@ _start: tdpbssd tmm0, tmm1, tmm1 tdpbssd tmm1, tmm0, tmm1 tdpbssd tmm1, tmm1, tmm0 + tdpbf16ps tmm0, tmm1, tmm1 + tdpbf16ps tmm1, tmm0, tmm1 + tdpbf16ps tmm0, tmm1, tmm1