From: Andrea Corallo <andrea.corallo@arm.com>
To: <binutils@sourceware.org>
Cc: <Richard.Earnshaw@arm.com>, <nickc@redhat.com>,
Andrea Corallo <andrea.corallo@arm.com>
Subject: [PATCH 3/3] aarch64: Add FEAT_ITE support
Date: Mon, 6 Nov 2023 15:04:55 +0100 [thread overview]
Message-ID: <20231106140455.1694695-3-andrea.corallo@arm.com> (raw)
In-Reply-To: <20231106140455.1694695-1-andrea.corallo@arm.com>
This patch add support for FEAT_ITE "Instrumentation Extension" adding
the "trcit" instruction.
This is enabled by the +ite march flag.
---
gas/config/tc-aarch64.c | 1 +
gas/doc/c-aarch64.texi | 2 ++
gas/testsuite/gas/aarch64/illegal-ite1-1.d | 3 +++
gas/testsuite/gas/aarch64/illegal-ite1-1.l | 2 ++
gas/testsuite/gas/aarch64/ite1.d | 9 +++++++++
gas/testsuite/gas/aarch64/ite1.s | 4 ++++
include/opcode/aarch64.h | 2 ++
opcodes/aarch64-tbl.h | 8 ++++++++
8 files changed, 31 insertions(+)
create mode 100644 gas/testsuite/gas/aarch64/illegal-ite1-1.d
create mode 100644 gas/testsuite/gas/aarch64/illegal-ite1-1.l
create mode 100644 gas/testsuite/gas/aarch64/ite1.d
create mode 100644 gas/testsuite/gas/aarch64/ite1.s
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 827e0436136..84c69a8eedf 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -10305,6 +10305,7 @@ static const struct aarch64_option_cpu_value_table aarch64_features[] = {
{"gcs", AARCH64_FEATURE (GCS), AARCH64_NO_FEATURES},
{"prfmslc", AARCH64_FEATURE (PRFMSLC), AARCH64_NO_FEATURES},
{"rasv2", AARCH64_FEATURE (RASv2), AARCH64_NO_FEATURES},
+ {"ite", AARCH64_FEATURE (ITE), AARCH64_NO_FEATURES},
{NULL, AARCH64_NO_FEATURES, AARCH64_NO_FEATURES},
};
diff --git a/gas/doc/c-aarch64.texi b/gas/doc/c-aarch64.texi
index 0624c4f0bb8..3c0aeeb6720 100644
--- a/gas/doc/c-aarch64.texi
+++ b/gas/doc/c-aarch64.texi
@@ -267,6 +267,8 @@ automatically cause those extensions to be disabled.
@tab Enable the Reliability, Availability and Serviceability extension v2.
@item @code{predres2} @tab ARMv8-A/Armv9-A @tab ARMv8.9-A/Armv9.4-A or later
@tab Enable Prediction instructions.
+@item @code{ite} @tab N/A @tab no
+ @tab Enable TRCIT instruction.
@end multitable
@node AArch64 Syntax
diff --git a/gas/testsuite/gas/aarch64/illegal-ite1-1.d b/gas/testsuite/gas/aarch64/illegal-ite1-1.d
new file mode 100644
index 00000000000..99ef4d47d7b
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/illegal-ite1-1.d
@@ -0,0 +1,3 @@
+#as: -march=armv8-a
+#source: ite1.s
+#error_output: illegal-ite1-1.l
\ No newline at end of file
diff --git a/gas/testsuite/gas/aarch64/illegal-ite1-1.l b/gas/testsuite/gas/aarch64/illegal-ite1-1.l
new file mode 100644
index 00000000000..1e97c9147ee
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/illegal-ite1-1.l
@@ -0,0 +1,2 @@
+[^:]*: Assembler messages:
+[^:]*:[0-9]+: Error: selected processor does not support `trcit x1'
diff --git a/gas/testsuite/gas/aarch64/ite1.d b/gas/testsuite/gas/aarch64/ite1.d
new file mode 100644
index 00000000000..7c4b486ced8
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/ite1.d
@@ -0,0 +1,9 @@
+#as: -march=armv9.4-a+ite
+#objdump: -dr
+
+.*: file format .*
+
+Disassembly of section \.text:
+
+0+ <.*>:
+.*: d50b72e1 trcit x1
diff --git a/gas/testsuite/gas/aarch64/ite1.s b/gas/testsuite/gas/aarch64/ite1.s
new file mode 100644
index 00000000000..595ecf897f2
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/ite1.s
@@ -0,0 +1,4 @@
+/* File to test the +ite option. */
+func:
+ trcit x1
+
diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h
index ae6457597e5..fe046b9adfb 100644
--- a/include/opcode/aarch64.h
+++ b/include/opcode/aarch64.h
@@ -173,6 +173,8 @@ enum aarch64_feature_bit {
AARCH64_FEATURE_RASv2,
/* Speculation Prediction Restriction instructions. */
AARCH64_FEATURE_PREDRES2,
+ /* Instrumentation Extension. */
+ AARCH64_FEATURE_ITE,
DUMMY1,
DUMMY2,
DUMMY3,
diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h
index b64d94ab70f..ac21a563b3b 100644
--- a/opcodes/aarch64-tbl.h
+++ b/opcodes/aarch64-tbl.h
@@ -2582,6 +2582,8 @@ static const aarch64_feature_set aarch64_feature_prfmslc =
AARCH64_FEATURE (PRFMSLC);
static const aarch64_feature_set aarch64_feature_rasv2 =
AARCH64_FEATURE (RASv2);
+static const aarch64_feature_set aarch64_feature_ite =
+ AARCH64_FEATURE (ITE);
#define CORE &aarch64_feature_v8
#define FP &aarch64_feature_fp
@@ -2645,6 +2647,7 @@ static const aarch64_feature_set aarch64_feature_rasv2 =
#define GCS &aarch64_feature_gcs
#define PRFMSLC &aarch64_feature_prfmslc
#define RASv2 &aarch64_feature_rasv2
+#define ITE &aarch64_feature_ite
#define CORE_INSN(NAME,OPCODE,MASK,CLASS,OP,OPS,QUALS,FLAGS) \
{ NAME, OPCODE, MASK, CLASS, OP, CORE, OPS, QUALS, FLAGS, 0, 0, NULL }
@@ -2848,6 +2851,9 @@ static const aarch64_feature_set aarch64_feature_rasv2 =
#define PREDRES2_INSN(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS) \
{ NAME, OPCODE, MASK, CLASS, 0, PREDRES2, OPS, QUALS, FLAGS, 0, 0, NULL }
+#define ITE_INSN(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS) \
+ { NAME, OPCODE, MASK, CLASS, 0, ITE, OPS, QUALS, FLAGS, 0, 0, NULL }
+
const struct aarch64_opcode aarch64_opcode_table[] =
{
/* Add/subtract (with carry). */
@@ -6105,6 +6111,8 @@ const struct aarch64_opcode aarch64_opcode_table[] =
command-line flags. */
CORE_INSN ("clrbhb", 0xd50322df, 0xffffffff, ic_system, 0, OP0 (), {}, F_ALIAS),
+ ITE_INSN ("trcit", 0xd50b72e0, 0xffffffe0, ic_system, OP1 (Rt), QL_I1X, F_ALIAS),
+
{0, 0, 0, 0, 0, 0, {}, {}, 0, 0, 0, NULL},
};
--
2.25.1
next prev parent reply other threads:[~2023-11-06 14:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 14:04 [PATCH 1/3] aarch64: Add FEAT_SPECRES2 support Andrea Corallo
2023-11-06 14:04 ` [PATCH 2/3] aarch64: Add FEAT_ECBHB support Andrea Corallo
2023-11-07 10:58 ` Nick Clifton
2023-11-06 14:04 ` Andrea Corallo [this message]
2023-11-07 10:59 ` [PATCH 3/3] aarch64: Add FEAT_ITE support Nick Clifton
2023-12-19 14:41 ` Andrea Corallo
2023-11-07 10:57 ` [PATCH 1/3] aarch64: Add FEAT_SPECRES2 support Nick Clifton
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=20231106140455.1694695-3-andrea.corallo@arm.com \
--to=andrea.corallo@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=binutils@sourceware.org \
--cc=nickc@redhat.com \
/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).