public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Tsukasa OI <research_trasio@irq.a4lg.com>
To: Tsukasa OI <research_trasio@irq.a4lg.com>
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	[thread overview]
Message-ID: <45c0345065d48645963021d0396bf9c578c93060.1657342594.git.research_trasio@irq.a4lg.com> (raw)
In-Reply-To: <cover.1657342594.git.research_trasio@irq.a4lg.com>

[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 <target>:
+[ 	]+[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 <target>:
+[ 	]+[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 <target>:
+[ 	]+[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 <target>:
+[ 	]+[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 <target>:
+[ 	]+[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 <target>:
+[ 	]+[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


  parent reply	other threads:[~2022-07-09  4:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09  4:56 [REVIEW ONLY 0/2] RISC-V (unratified): Add 'Zihintntl' extension Tsukasa OI
2022-07-09  4:56 ` [REVIEW ONLY 1/2] UNRATIFIED RISC-V: " Tsukasa OI
2022-07-09  4:56 ` Tsukasa OI [this message]
2022-09-18 10:13 ` [REVIEW ONLY v2 0/1] RISC-V (unratified): " Tsukasa OI
2022-09-18 10:13   ` [REVIEW ONLY v2 1/1] UNRATIFIED RISC-V: " Tsukasa OI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45c0345065d48645963021d0396bf9c578c93060.1657342594.git.research_trasio@irq.a4lg.com \
    --to=research_trasio@irq.a4lg.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).