From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id F1D8F385B804 for ; Sat, 9 Jul 2022 04:57:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F1D8F385B804 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 581BF300089; Sat, 9 Jul 2022 04:57:20 +0000 (UTC) From: Tsukasa OI To: Tsukasa OI Cc: binutils@sourceware.org Subject: [REVIEW ONLY 2/2] UNRATIFIED RISC-V: Add 'Zihintntl' extension tests Date: Sat, 9 Jul 2022 13:56:48 +0900 Message-Id: <45c0345065d48645963021d0396bf9c578c93060.1657342594.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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-List-Received-Date: Sat, 09 Jul 2022 04:57:24 -0000 [DO NOT MERGE] Until 'Zihintntl' extension is ratified and final version number is determined, this patch should not merged upstream. This commit uses unratified version 0.2 as in documentation (instead of possible 1.0 after ratification). This commit adds testcases for 'Zihintntl' extension. gas/ChangeLog: * testsuite/gas/riscv/zihintntl.s: New test for 4-byte hint instructions. * testsuite/gas/riscv/zihintntl.d: Likewise. * testsuite/gas/riscv/zihintntl-auto-c.d: Likewise but test auto compression to 2-byte instructions. * testsuite/gas/riscv/zihintntl-c.s: New test for 2-byte hint instructions. * testsuite/gas/riscv/zihintntl-c.d: Likewise. * testsuite/gas/riscv/zihintntl-c-noalias.d: Likewise but different output with -Mno-aliases. * testsuite/gas/riscv/zihintntl-base.s: New test for base instructions corresponding non-temporal locality hints. * testsuite/gas/riscv/zihintntl-base.d: Likewise. * testsuite/gas/riscv/zihintntl-base-noarch.d: Likewise but without 'Zihintntl' extension in -march. --- gas/testsuite/gas/riscv/zihintntl-auto-c.d | 17 +++++++++++++ .../gas/riscv/zihintntl-base-noarch.d | 25 +++++++++++++++++++ gas/testsuite/gas/riscv/zihintntl-base.d | 25 +++++++++++++++++++ gas/testsuite/gas/riscv/zihintntl-base.s | 17 +++++++++++++ gas/testsuite/gas/riscv/zihintntl-c-noalias.d | 17 +++++++++++++ gas/testsuite/gas/riscv/zihintntl-c.d | 17 +++++++++++++ gas/testsuite/gas/riscv/zihintntl-c.s | 9 +++++++ gas/testsuite/gas/riscv/zihintntl.d | 17 +++++++++++++ gas/testsuite/gas/riscv/zihintntl.s | 9 +++++++ 9 files changed, 153 insertions(+) create mode 100644 gas/testsuite/gas/riscv/zihintntl-auto-c.d create mode 100644 gas/testsuite/gas/riscv/zihintntl-base-noarch.d create mode 100644 gas/testsuite/gas/riscv/zihintntl-base.d create mode 100644 gas/testsuite/gas/riscv/zihintntl-base.s create mode 100644 gas/testsuite/gas/riscv/zihintntl-c-noalias.d create mode 100644 gas/testsuite/gas/riscv/zihintntl-c.d create mode 100644 gas/testsuite/gas/riscv/zihintntl-c.s create mode 100644 gas/testsuite/gas/riscv/zihintntl.d create mode 100644 gas/testsuite/gas/riscv/zihintntl.s diff --git a/gas/testsuite/gas/riscv/zihintntl-auto-c.d b/gas/testsuite/gas/riscv/zihintntl-auto-c.d new file mode 100644 index 00000000000..1e849d685e8 --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-auto-c.d @@ -0,0 +1,17 @@ +#as: -march=rv64ic_zihintntl +#source: zihintntl.s +#objdump: -dr + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 : +[ ]+[0-9a-f]+:[ ]+900a[ ]+ntl\.p1 +[ ]+[0-9a-f]+:[ ]+01b28023[ ]+sb[ ]+s11,0\(t0\) +[ ]+[0-9a-f]+:[ ]+900e[ ]+ntl\.pall +[ ]+[0-9a-f]+:[ ]+01b28123[ ]+sb[ ]+s11,2\(t0\) +[ ]+[0-9a-f]+:[ ]+9012[ ]+ntl\.s1 +[ ]+[0-9a-f]+:[ ]+01b28223[ ]+sb[ ]+s11,4\(t0\) +[ ]+[0-9a-f]+:[ ]+9016[ ]+ntl\.all +[ ]+[0-9a-f]+:[ ]+01b28323[ ]+sb[ ]+s11,6\(t0\) diff --git a/gas/testsuite/gas/riscv/zihintntl-base-noarch.d b/gas/testsuite/gas/riscv/zihintntl-base-noarch.d new file mode 100644 index 00000000000..5d3111cc3ec --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-base-noarch.d @@ -0,0 +1,25 @@ +#as: -march=rv64ic +#source: zihintntl-base.s +#objdump: -dr + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 : +[ ]+[0-9a-f]+:[ ]+00200033[ ]+add[ ]+zero,zero,sp +[ ]+[0-9a-f]+:[ ]+01b28823[ ]+sb[ ]+s11,16\(t0\) +[ ]+[0-9a-f]+:[ ]+00300033[ ]+add[ ]+zero,zero,gp +[ ]+[0-9a-f]+:[ ]+01b28923[ ]+sb[ ]+s11,18\(t0\) +[ ]+[0-9a-f]+:[ ]+00400033[ ]+add[ ]+zero,zero,tp +[ ]+[0-9a-f]+:[ ]+01b28a23[ ]+sb[ ]+s11,20\(t0\) +[ ]+[0-9a-f]+:[ ]+00500033[ ]+add[ ]+zero,zero,t0 +[ ]+[0-9a-f]+:[ ]+01b28b23[ ]+sb[ ]+s11,22\(t0\) +[ ]+[0-9a-f]+:[ ]+900a[ ]+c\.add[ ]+zero,sp +[ ]+[0-9a-f]+:[ ]+01b28c23[ ]+sb[ ]+s11,24\(t0\) +[ ]+[0-9a-f]+:[ ]+900e[ ]+c\.add[ ]+zero,gp +[ ]+[0-9a-f]+:[ ]+01b28d23[ ]+sb[ ]+s11,26\(t0\) +[ ]+[0-9a-f]+:[ ]+9012[ ]+c\.add[ ]+zero,tp +[ ]+[0-9a-f]+:[ ]+01b28e23[ ]+sb[ ]+s11,28\(t0\) +[ ]+[0-9a-f]+:[ ]+9016[ ]+c\.add[ ]+zero,t0 +[ ]+[0-9a-f]+:[ ]+01b28f23[ ]+sb[ ]+s11,30\(t0\) diff --git a/gas/testsuite/gas/riscv/zihintntl-base.d b/gas/testsuite/gas/riscv/zihintntl-base.d new file mode 100644 index 00000000000..ae98de5b3d0 --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-base.d @@ -0,0 +1,25 @@ +#as: -march=rv64ic_zihintntl +#source: zihintntl-base.s +#objdump: -dr -Mno-aliases + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 : +[ ]+[0-9a-f]+:[ ]+00200033[ ]+ntl\.p1 +[ ]+[0-9a-f]+:[ ]+01b28823[ ]+sb[ ]+s11,16\(t0\) +[ ]+[0-9a-f]+:[ ]+00300033[ ]+ntl\.pall +[ ]+[0-9a-f]+:[ ]+01b28923[ ]+sb[ ]+s11,18\(t0\) +[ ]+[0-9a-f]+:[ ]+00400033[ ]+ntl\.s1 +[ ]+[0-9a-f]+:[ ]+01b28a23[ ]+sb[ ]+s11,20\(t0\) +[ ]+[0-9a-f]+:[ ]+00500033[ ]+ntl\.all +[ ]+[0-9a-f]+:[ ]+01b28b23[ ]+sb[ ]+s11,22\(t0\) +[ ]+[0-9a-f]+:[ ]+900a[ ]+c\.ntl\.p1 +[ ]+[0-9a-f]+:[ ]+01b28c23[ ]+sb[ ]+s11,24\(t0\) +[ ]+[0-9a-f]+:[ ]+900e[ ]+c\.ntl\.pall +[ ]+[0-9a-f]+:[ ]+01b28d23[ ]+sb[ ]+s11,26\(t0\) +[ ]+[0-9a-f]+:[ ]+9012[ ]+c\.ntl\.s1 +[ ]+[0-9a-f]+:[ ]+01b28e23[ ]+sb[ ]+s11,28\(t0\) +[ ]+[0-9a-f]+:[ ]+9016[ ]+c\.ntl\.all +[ ]+[0-9a-f]+:[ ]+01b28f23[ ]+sb[ ]+s11,30\(t0\) diff --git a/gas/testsuite/gas/riscv/zihintntl-base.s b/gas/testsuite/gas/riscv/zihintntl-base.s new file mode 100644 index 00000000000..6678fc9c2b8 --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-base.s @@ -0,0 +1,17 @@ +target: + add x0, x0, x2 # ntl.p1 + sb s11, 2*0x8(t0) + add x0, x0, x3 # ntl.pall + sb s11, 2*0x9(t0) + add x0, x0, x4 # ntl.s1 + sb s11, 2*0xa(t0) + add x0, x0, x5 # ntl.all + sb s11, 2*0xb(t0) + c.add x0, x2 # c.ntl.p1 + sb s11, 2*0xc(t0) + c.add x0, x3 # c.ntl.pall + sb s11, 2*0xd(t0) + c.add x0, x4 # c.ntl.s1 + sb s11, 2*0xe(t0) + c.add x0, x5 # c.ntl.all + sb s11, 2*0xf(t0) diff --git a/gas/testsuite/gas/riscv/zihintntl-c-noalias.d b/gas/testsuite/gas/riscv/zihintntl-c-noalias.d new file mode 100644 index 00000000000..cd4897a1eef --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-c-noalias.d @@ -0,0 +1,17 @@ +#as: -march=rv64ic_zihintntl +#source: zihintntl-c.s +#objdump: -dr -Mno-aliases + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 : +[ ]+[0-9a-f]+:[ ]+900a[ ]+c\.ntl\.p1 +[ ]+[0-9a-f]+:[ ]+01b28423[ ]+sb[ ]+s11,8\(t0\) +[ ]+[0-9a-f]+:[ ]+900e[ ]+c\.ntl\.pall +[ ]+[0-9a-f]+:[ ]+01b28523[ ]+sb[ ]+s11,10\(t0\) +[ ]+[0-9a-f]+:[ ]+9012[ ]+c\.ntl\.s1 +[ ]+[0-9a-f]+:[ ]+01b28623[ ]+sb[ ]+s11,12\(t0\) +[ ]+[0-9a-f]+:[ ]+9016[ ]+c\.ntl\.all +[ ]+[0-9a-f]+:[ ]+01b28723[ ]+sb[ ]+s11,14\(t0\) diff --git a/gas/testsuite/gas/riscv/zihintntl-c.d b/gas/testsuite/gas/riscv/zihintntl-c.d new file mode 100644 index 00000000000..0e71029d5ac --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-c.d @@ -0,0 +1,17 @@ +#as: -march=rv64ic_zihintntl +#source: zihintntl-c.s +#objdump: -dr + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 : +[ ]+[0-9a-f]+:[ ]+900a[ ]+ntl\.p1 +[ ]+[0-9a-f]+:[ ]+01b28423[ ]+sb[ ]+s11,8\(t0\) +[ ]+[0-9a-f]+:[ ]+900e[ ]+ntl\.pall +[ ]+[0-9a-f]+:[ ]+01b28523[ ]+sb[ ]+s11,10\(t0\) +[ ]+[0-9a-f]+:[ ]+9012[ ]+ntl\.s1 +[ ]+[0-9a-f]+:[ ]+01b28623[ ]+sb[ ]+s11,12\(t0\) +[ ]+[0-9a-f]+:[ ]+9016[ ]+ntl\.all +[ ]+[0-9a-f]+:[ ]+01b28723[ ]+sb[ ]+s11,14\(t0\) diff --git a/gas/testsuite/gas/riscv/zihintntl-c.s b/gas/testsuite/gas/riscv/zihintntl-c.s new file mode 100644 index 00000000000..3f140d4f31b --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-c.s @@ -0,0 +1,9 @@ +target: + c.ntl.p1 + sb s11, 2*0x4(t0) + c.ntl.pall + sb s11, 2*0x5(t0) + c.ntl.s1 + sb s11, 2*0x6(t0) + c.ntl.all + sb s11, 2*0x7(t0) diff --git a/gas/testsuite/gas/riscv/zihintntl.d b/gas/testsuite/gas/riscv/zihintntl.d new file mode 100644 index 00000000000..e7ff6fc322a --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl.d @@ -0,0 +1,17 @@ +#as: -march=rv64i_zihintntl +#source: zihintntl.s +#objdump: -dr + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 : +[ ]+[0-9a-f]+:[ ]+00200033[ ]+ntl\.p1 +[ ]+[0-9a-f]+:[ ]+01b28023[ ]+sb[ ]+s11,0\(t0\) +[ ]+[0-9a-f]+:[ ]+00300033[ ]+ntl\.pall +[ ]+[0-9a-f]+:[ ]+01b28123[ ]+sb[ ]+s11,2\(t0\) +[ ]+[0-9a-f]+:[ ]+00400033[ ]+ntl\.s1 +[ ]+[0-9a-f]+:[ ]+01b28223[ ]+sb[ ]+s11,4\(t0\) +[ ]+[0-9a-f]+:[ ]+00500033[ ]+ntl\.all +[ ]+[0-9a-f]+:[ ]+01b28323[ ]+sb[ ]+s11,6\(t0\) diff --git a/gas/testsuite/gas/riscv/zihintntl.s b/gas/testsuite/gas/riscv/zihintntl.s new file mode 100644 index 00000000000..0e7660ea361 --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl.s @@ -0,0 +1,9 @@ +target: + ntl.p1 + sb s11, 2*0x0(t0) + ntl.pall + sb s11, 2*0x1(t0) + ntl.s1 + sb s11, 2*0x2(t0) + ntl.all + sb s11, 2*0x3(t0) -- 2.34.1