[PATCH v2] aarch64: Add support for FEAT_CMH

Alice Carlotti alice.carlotti@arm.com
Fri Jan 16 01:11:28 GMT 2026


On Thu, Jan 15, 2026 at 03:33:32PM +0000, richard.ball@arm.com wrote:
> From: Richard Ball <Richard.Ball@arm.com>
> 
> This patch adds the new instructions from FEAT_CMH
> These new instructions are hints, STCPH and SHUH.
> SHUH can have an operand PH or no operand.
> ---
>  gas/config/tc-aarch64.c             |  6 +++++-
>  gas/testsuite/gas/aarch64/cmh-bad.d |  4 ++++
>  gas/testsuite/gas/aarch64/cmh-bad.l |  3 +++
>  gas/testsuite/gas/aarch64/cmh-bad.s |  3 +++
>  gas/testsuite/gas/aarch64/cmh.d     | 11 +++++++++++
>  gas/testsuite/gas/aarch64/cmh.s     |  4 ++++
>  gas/testsuite/gas/aarch64/system.d  |  6 +++---
>  include/opcode/aarch64.h            |  3 +++
>  opcodes/aarch64-asm-2.c             |  3 +++
>  opcodes/aarch64-dis-2.c             |  7 +++++++
>  opcodes/aarch64-opc-2.c             |  1 +
>  opcodes/aarch64-opc.c               | 12 +++++++++++-
>  opcodes/aarch64-tbl-2.h             |  2 ++
>  opcodes/aarch64-tbl.h               |  4 ++++
>  14 files changed, 64 insertions(+), 5 deletions(-)
>  create mode 100644 gas/testsuite/gas/aarch64/cmh-bad.d
>  create mode 100644 gas/testsuite/gas/aarch64/cmh-bad.l
>  create mode 100644 gas/testsuite/gas/aarch64/cmh-bad.s
>  create mode 100644 gas/testsuite/gas/aarch64/cmh.d
>  create mode 100644 gas/testsuite/gas/aarch64/cmh.s
> 
...
> diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c
> index e4ce347bdc9..d42f37c0134 100644
> --- a/opcodes/aarch64-opc.c
> +++ b/opcodes/aarch64-opc.c
> @@ -597,8 +597,11 @@ const struct aarch64_name_value_pair aarch64_barrier_dsb_nxs_options[4] =
>  
>  const struct aarch64_name_value_pair aarch64_hint_options[] =
>  {
> -  /* BTI.  This is also the F_DEFAULT entry for AARCH64_OPND_BTI_TARGET.  */
> +  /* BTI.  This is also the F_DEFAULT entry for AARCH64_OPND_BTI_TARGET.
> +     BTI R and SHUH must be the first and second entries respectively
> +     so that F_DEFAULT refers to the correct table entries.  */
>    { "r",	HINT_OPD_R },		/* BTI R.  */
> +  { " ",	HINT_OPD_NPHINT},	/* SHUH. */

Could you use an empty string instead of a space?

>    { "csync",	HINT_OPD_CSYNC },	/* PSB CSYNC.  */
>    { "dsync",	HINT_OPD_DSYNC },	/* GCSB DSYNC.  */
>    { "c",	HINT_OPD_C },		/* BTI C.  */
> @@ -606,6 +609,7 @@ const struct aarch64_name_value_pair aarch64_hint_options[] =
>    { "jc",	HINT_OPD_JC },		/* BTI JC.  */
>    { "keep",	HINT_OPD_KEEP },	/* STSHH KEEP  */
>    { "strm",	HINT_OPD_STRM },	/* STSHH STRM  */
> +  { "ph",	HINT_OPD_PHINT },	/* SHUH PH.  */
>    { NULL,	HINT_OPD_NULL },
>  };
>  
> @@ -5178,6 +5182,12 @@ aarch64_print_operand (char *buf, size_t size, bfd_vma pc,
>        snprintf (buf, size, "%s", style_sub_mnem (styler, opnd->hint_option->name));
>        break;
>  
> +    case AARCH64_OPND_SHUH_PHINT:
> +      if (strcmp(opnd->hint_option->name, " ") != 0)
> +	snprintf (buf, size, "%s",
> +		  style_sub_mnem (styler, opnd->hint_option->name));

With the above change, this check can become:
+      name = opnd->hint_option->name;
+      if (*name)
+	snprintf (buf, size, "%s", style_sub_mnem (styler, name));

OK with those changes, thanks.

Alice

> +      break;
> +
>      case AARCH64_OPND_MOPS_ADDR_Rd:
>      case AARCH64_OPND_MOPS_ADDR_Rs:
>        snprintf (buf, size, "[%s]!",


More information about the Binutils mailing list