From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by sourceware.org (Postfix) with ESMTPS id 028BD385840F for ; Fri, 7 Apr 2023 15:50:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 028BD385840F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-xb35.google.com with SMTP id h198so5631656ybg.12 for ; Fri, 07 Apr 2023 08:50:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680882656; x=1683474656; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9+38fkgRw9Qx134SSxaFxUsw38yVxps0OsczWuDiTAE=; b=GY46EG+o37DIt5UTWwkYvlWUZQ1VYQ3vGqithLTjdYqddu4OP4Isw6ekqw6RakL3CF qKXrt4W8WmMmgP2B/ji+n/Hh9Wiowg37gnICXiYgz7QrJ864US+Ons0+1Obry+1LYhCW EbaRUBySp6XlYBENaOThQNnf5bJk6vnMGURWClv36LW5xW3iCBqLr9HyNdqrpeTYFIr8 VwRF5dnxFpQdK5XzyWSf5qF/aUS+Y9rQGLeeDR1Zzi3ACMW7PY6ekpAftIoLdUgGOFT1 EUqqLJLN3GWhv5xjDeoQFw3M6gF8w9KfXIooaxRnq0YMNa0meN1ru1758SnPcnxldVzh ORgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680882656; x=1683474656; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9+38fkgRw9Qx134SSxaFxUsw38yVxps0OsczWuDiTAE=; b=QQkDDp1zqh09dhQh/ajHj5I0sN858iMRX9z4giEQ9AXxxa/q8R5RBPub/Cb+bRthDR nn5PDWkchTiZC7bHr/MBWsSPiDP+EDRGKxDEDLMpssVNGPccMxe5r2awIZC+zieSjQ6O R7eWUWtg9gOvBCI/1b/cGYr0UhuB5Gph8ZRJ9fgKHEtUC43AO9LIlk00S9hOvWLlB5KO 5f9ykf4t3RQEho08tuHHO03UUXuKV76WFECeTGko7sPx3RGYUWINrIZ8+oGXVvvK87pd FmHnHa/lwhWkyDttBzAL6D7po3Nn1F6AZlxaSE02UMdYoaP/0QQaKY+7p2+JpIFdGoxO DWTg== X-Gm-Message-State: AAQBX9eUKbKB0f6tc/Uqt1EwW6JebKRxyFLGQnjxOqIp/v+2Q4IeNmEN TbxZmwH4dOwJJqFc7nDItVnPeycKcaBs7D6jF0hh51YU X-Google-Smtp-Source: AKy350aB2JUXsuR2T47SjYVcxtEE3bZfSkX3DyDtM0HlgerNkVkCNN4M1vVJORie4WalHEb4/n/s9wAlE1XzlRJL4/o= X-Received: by 2002:a25:cf8c:0:b0:b73:caa7:f05e with SMTP id f134-20020a25cf8c000000b00b73caa7f05emr2087229ybg.2.1680882656162; Fri, 07 Apr 2023 08:50:56 -0700 (PDT) MIME-Version: 1.0 References: <20230407032809.3763561-1-haochen.jiang@intel.com> In-Reply-To: <20230407032809.3763561-1-haochen.jiang@intel.com> From: "H.J. Lu" Date: Fri, 7 Apr 2023 08:50:20 -0700 Message-ID: Subject: Re: [PATCH] x86: Add inval tests for AMX instructions To: Haochen Jiang Cc: binutils@sourceware.org, jbeulich@suse.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3021.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On Thu, Apr 6, 2023 at 8:28=E2=80=AFPM Haochen Jiang wrote: > > 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/i38= 6.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/test= suite/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/test= suite/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/testsui= te/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/testsui= te/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/ga= s/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/ga= s/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 > -- > 2.31.1 > OK. Thanks. --=20 H.J.