public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Carlotti <andrew.carlotti@arm.com>
To: binutils@sourceware.org
Cc: Richard Earnshaw <richard.earnshaw@arm.com>
Subject: [PATCH 09/11] aarch64: Add +xs flag for existing instructions
Date: Fri, 12 Jan 2024 01:45:25 +0000	[thread overview]
Message-ID: <aeb67e01-d588-51a0-9992-d409187c1ea1@e124511.cambridge.arm.com> (raw)
In-Reply-To: <1496882f-bd18-37f7-761c-e33e5fca6a4b@e124511.cambridge.arm.com>

Additionally, change FEAT_XS tlbi variants to be gated on "+xs" instead of
"+d128".  This is an incremental improvement; there are still some FEAT_XS tlbi
variants that are gated incorrectly or missing entirely.


diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 5b3cdd837b3f042a1f0d8e8b98c7dde1b604a49c..7eb732adbb6c85fdf4db7c4b14d0be5fafa370b6 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -10323,6 +10323,7 @@ static const struct aarch64_option_cpu_value_table aarch64_features[] = {
   {"flagm",		AARCH64_FEATURE (FLAGM), AARCH64_NO_FEATURES},
   {"flagm2",		AARCH64_FEATURE (FLAGMANIP), AARCH64_FEATURE (FLAGM)},
   {"pauth",		AARCH64_FEATURE (PAC), AARCH64_NO_FEATURES},
+  {"xs",		AARCH64_FEATURE (XS), AARCH64_NO_FEATURES},
   {"wfxt",		AARCH64_FEATURE (WFXT), AARCH64_NO_FEATURES},
   {"mops",		AARCH64_FEATURE (MOPS), AARCH64_NO_FEATURES},
   {"hbc",		AARCH64_FEATURE (HBC), AARCH64_NO_FEATURES},
diff --git a/gas/testsuite/gas/aarch64/system-4.d b/gas/testsuite/gas/aarch64/system-4.d
index 0f600f80abda8f9f697f6765753c09d3083afa59..5673436823ad4427a1f2021759c659fc519bbdb4 100644
--- a/gas/testsuite/gas/aarch64/system-4.d
+++ b/gas/testsuite/gas/aarch64/system-4.d
@@ -14,3 +14,11 @@ Disassembly of section \.text:
 .*:	d503363f 	dsb	nshnxs
 .*:	d5033a3f 	dsb	ishnxs
 .*:	d5033e3f 	dsb	synxs
+.*:	d503323f 	dsb	oshnxs
+.*:	d503363f 	dsb	nshnxs
+.*:	d5033a3f 	dsb	ishnxs
+.*:	d5033e3f 	dsb	synxs
+.*:	d503323f 	dsb	oshnxs
+.*:	d503363f 	dsb	nshnxs
+.*:	d5033a3f 	dsb	ishnxs
+.*:	d5033e3f 	dsb	synxs
diff --git a/gas/testsuite/gas/aarch64/system-4.s b/gas/testsuite/gas/aarch64/system-4.s
index f95eb35df567657b8c5a17811814c17eb19ffeb7..fbf92caf7bcbd41015d8fe093bbfe6f35a8c0860 100644
--- a/gas/testsuite/gas/aarch64/system-4.s
+++ b/gas/testsuite/gas/aarch64/system-4.s
@@ -10,3 +10,15 @@
     dsb nshnxs
     dsb ishnxs
     dsb synxs
+
+.arch armv8-a+xs
+
+    dsb #16
+    dsb #20
+    dsb #24
+    dsb #28
+
+    dsb oshnxs
+    dsb nshnxs
+    dsb ishnxs
+    dsb synxs
diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h
index 973118c0d577da770ee2cce5599f25a73bd56782..9d64d7a0ebefa4014f30a46c5be7bda124666327 100644
--- a/include/opcode/aarch64.h
+++ b/include/opcode/aarch64.h
@@ -141,6 +141,8 @@ enum aarch64_feature_bit {
   AARCH64_FEATURE_MEMTAG,
   /* Transactional Memory Extension.  */
   AARCH64_FEATURE_TME,
+  /* XS memory attribute.  */
+  AARCH64_FEATURE_XS,
   /* WFx instructions with timeout.  */
   AARCH64_FEATURE_WFXT,
   /* Standardization of memory operations.  */
@@ -273,6 +275,7 @@ enum aarch64_feature_bit {
 					 | AARCH64_FEATBIT (X, BFLOAT16) \
 					 | AARCH64_FEATBIT (X, I8MM))
 #define AARCH64_ARCH_V8_7A_FEATURES(X)	(AARCH64_FEATBIT (X, V8_7A)	\
+					 | AARCH64_FEATBIT (X, XS)      \
 					 | AARCH64_FEATBIT (X, WFXT)    \
 					 | AARCH64_FEATBIT (X, LS64))
 #define AARCH64_ARCH_V8_8A_FEATURES(X)	(AARCH64_FEATBIT (X, V8_8A)	\
diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c
index 2e7472ac3e78419ceb508c2092da847e4d146dc7..e3ad32f5a1e070fe1cc464e1c0df2b0f4347f45f 100644
--- a/opcodes/aarch64-opc.c
+++ b/opcodes/aarch64-opc.c
@@ -5171,7 +5171,7 @@ aarch64_sys_ins_reg_supported_p (const aarch64_feature_set features,
        || reg_value == CPENS (6, C9, C6, 5)
        || reg_value == CPENS (6, C9, C7, 1)
        || reg_value == CPENS (6, C9, C7, 5))
-      && AARCH64_CPU_HAS_FEATURE (features, D128))
+      && AARCH64_CPU_HAS_FEATURE (features, XS))
     return true;
 
   /* AT S1E1RP, AT S1E1WP.  Values are from aarch64_sys_regs_at.  */
diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h
index f6538aa5536d355881016442a82458334477ec58..95f7757e8ebaa5ca1958be212283aa17cacdcc5b 100644
--- a/opcodes/aarch64-tbl.h
+++ b/opcodes/aarch64-tbl.h
@@ -2598,6 +2598,8 @@ static const aarch64_feature_set aarch64_feature_ls64 =
   AARCH64_FEATURE (LS64);
 static const aarch64_feature_set aarch64_feature_flagm =
   AARCH64_FEATURE (FLAGM);
+static const aarch64_feature_set aarch64_feature_xs =
+  AARCH64_FEATURE (XS);
 static const aarch64_feature_set aarch64_feature_wfxt =
   AARCH64_FEATURE (WFXT);
 static const aarch64_feature_set aarch64_feature_mops =
@@ -2678,6 +2680,7 @@ static const aarch64_feature_set aarch64_feature_d128_the =
 #define ARMV8_7A  &aarch64_feature_v8_7a
 #define LS64	  &aarch64_feature_ls64
 #define FLAGM	  &aarch64_feature_flagm
+#define XS	  &aarch64_feature_xs
 #define WFXT	  &aarch64_feature_wfxt
 #define MOPS	  &aarch64_feature_mops
 #define MOPS_MEMTAG &aarch64_feature_mops_memtag
@@ -2828,6 +2831,8 @@ static const aarch64_feature_set aarch64_feature_d128_the =
   { NAME, OPCODE, MASK, CLASS, 0, ARMV8R, OPS, QUALS, FLAGS, 0, 0, NULL }
 #define V8_7A_INSN(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS) \
   { NAME, OPCODE, MASK, CLASS, 0, ARMV8_7A, OPS, QUALS, FLAGS, 0, 0, NULL }
+#define XS_INSN(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS) \
+  { NAME, OPCODE, MASK, CLASS, 0, XS, OPS, QUALS, FLAGS, 0, 0, NULL }
 #define WFXT_INSN(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS) \
   { NAME, OPCODE, MASK, CLASS, 0, WFXT, OPS, QUALS, FLAGS, 0, 0, NULL }
 #define _LS64_INSN(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS) \
@@ -4225,7 +4230,7 @@ const struct aarch64_opcode aarch64_opcode_table[] =
   CORE_INSN ("clearbhb", 0xd50322df, 0xffffffff, ic_system, 0, OP0 (), {}, F_ALIAS),
   CORE_INSN ("clrex", 0xd503305f, 0xfffff0ff, ic_system, 0, OP1 (UIMM4), {}, F_OPD0_OPT | F_DEFAULT (0xF)),
   CORE_INSN ("dsb", 0xd503309f, 0xfffff0ff, ic_system, 0, OP1 (BARRIER), {}, F_HAS_ALIAS),
-  V8_7A_INSN ("dsb", 0xd503323f, 0xfffff3ff, ic_system, OP1 (BARRIER_DSB_NXS), {}, F_HAS_ALIAS),
+  XS_INSN ("dsb", 0xd503323f, 0xfffff3ff, ic_system, OP1 (BARRIER_DSB_NXS), {}, F_HAS_ALIAS),
   V8R_INSN ("dfb", 0xd5033c9f, 0xffffffff, ic_system, OP0 (), {}, F_ALIAS),
   CORE_INSN ("ssbb", 0xd503309f, 0xffffffff, ic_system, 0, OP0 (), {}, F_ALIAS),
   CORE_INSN ("pssbb", 0xd503349f, 0xffffffff, ic_system, 0, OP0 (), {}, F_ALIAS),

  parent reply	other threads:[~2024-01-12  1:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12  1:39 [PATCH 00/11] aarch64: New feature flags and flag fixes Andrew Carlotti
2024-01-12  1:40 ` [PATCH 01/11] aarch64: Fix +lse feature flag dependency Andrew Carlotti
2024-01-12  1:41 ` [PATCH 02/11] aarch64: Add +fcma alias for +compnum Andrew Carlotti
2024-01-12  1:42 ` [PATCH 03/11] aarch64: Fix option parsing to disallow prefixes of valid options Andrew Carlotti
2024-01-12  1:42 ` [PATCH 04/11] aarch64: Add +jscvt flag for existing fjcvtzs instruction Andrew Carlotti
2024-01-12  1:43 ` [PATCH 05/11] aarch64: Add +frintts flag for existing instructions Andrew Carlotti
2024-01-12  1:43 ` [PATCH 06/11] aarch64: Add +flagm2 " Andrew Carlotti
2024-01-12  1:44 ` [PATCH 07/11] aarch64: Add +rcpc2 " Andrew Carlotti
2024-01-12  1:44 ` [PATCH 08/11] aarch64: Add +wfxt " Andrew Carlotti
2024-01-12  1:45 ` Andrew Carlotti [this message]
2024-01-12  1:45 ` [PATCH 10/11] aarch64: Make FEAT_ASMv8p2 instruction aliases always available Andrew Carlotti
2024-01-12  1:46 ` [PATCH 11/11] aarch64: Remove unused code Andrew Carlotti
2024-01-12 13:47 ` [PATCH 00/11] aarch64: New feature flags and flag fixes 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=aeb67e01-d588-51a0-9992-d409187c1ea1@e124511.cambridge.arm.com \
    --to=andrew.carlotti@arm.com \
    --cc=binutils@sourceware.org \
    --cc=richard.earnshaw@arm.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).