[PATCH v6 1/4] aarch64: Add support for POE2 instructions

Alice Carlotti alice.carlotti@arm.com
Mon Jan 5 17:33:51 GMT 2026


On Wed, Dec 31, 2025 at 07:12:35PM +0000, Srinath Parvathaneni wrote:
> This patch adds support for FEAT_S1POE2 feature enabled by "+poe2"
> flag along with support for following instructions.
> 
> * TCHANGEB (immediate)
> * TCHANGEB (register)
> * TCHANGEF (immediate)
> * TCHANGEF (register)
> 
> A new operand AARCH64_OPND_NOT_BALANCED_17 is added to the code in this
> patch to support the new optional argument "NB" (not_balanced) which
> is a 1-bit field in the encoding for all the above mentioned
> instructions.
> 
> Regression tested for aarch64-none-elf target and found no regressions.
> 
> Ok for binutils-master?
> 
> Regards,
> Srinath
> 
> Co-authored-by:  Matthew Malcomson <matthew.malcomson@arm.com>
> ---
>  gas/config/tc-aarch64.c                    | 23 ++++++++
>  gas/doc/c-aarch64.texi                     |  2 +
>  gas/testsuite/gas/aarch64/poe2-invalid-1.d |  4 ++
>  gas/testsuite/gas/aarch64/poe2-invalid-1.l | 55 +++++++++++++++++
>  gas/testsuite/gas/aarch64/poe2-invalid-1.s | 69 ++++++++++++++++++++++
>  gas/testsuite/gas/aarch64/poe2-invalid-2.d |  4 ++
>  gas/testsuite/gas/aarch64/poe2-invalid-2.l | 29 +++++++++
>  gas/testsuite/gas/aarch64/poe2.d           | 37 ++++++++++++
>  gas/testsuite/gas/aarch64/poe2.s           | 43 ++++++++++++++
>  include/opcode/aarch64.h                   |  3 +
>  opcodes/aarch64-asm-2.c                    |  1 +
>  opcodes/aarch64-dis-2.c                    | 69 +++++++++++++++++-----
>  opcodes/aarch64-opc-2.c                    |  1 +
>  opcodes/aarch64-opc.c                      |  5 ++
>  opcodes/aarch64-tbl-2.h                    |  4 ++
>  opcodes/aarch64-tbl.h                      | 19 ++++++
>  16 files changed, 354 insertions(+), 14 deletions(-)
>  create mode 100644 gas/testsuite/gas/aarch64/poe2-invalid-1.d
>  create mode 100644 gas/testsuite/gas/aarch64/poe2-invalid-1.l
>  create mode 100644 gas/testsuite/gas/aarch64/poe2-invalid-1.s
>  create mode 100644 gas/testsuite/gas/aarch64/poe2-invalid-2.d
>  create mode 100644 gas/testsuite/gas/aarch64/poe2-invalid-2.l
>  create mode 100644 gas/testsuite/gas/aarch64/poe2.d
>  create mode 100644 gas/testsuite/gas/aarch64/poe2.s
> 
> diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
> index 7a03adfbde2..91e4db1125b 100644
> --- a/gas/config/tc-aarch64.c
> +++ b/gas/config/tc-aarch64.c
> @@ -6437,6 +6437,10 @@ process_omitted_operand (enum aarch64_opnd type, const aarch64_opcode *opcode,
>        operand->hint_option = aarch64_hint_options + default_value;
>        break;
>  
> +    case AARCH64_OPND_NOT_BALANCED_17:
> +      operand->imm.value = default_value;
> +      break;
> +
>      default:
>        break;
>      }
> @@ -8184,6 +8188,24 @@ parse_operands (char *str, const aarch64_opcode *opcode)
>  	  info->barrier = aarch64_barrier_dsb_nxs_options + val;
>  	  break;
>  
> +	case AARCH64_OPND_NOT_BALANCED_17:
> +	  {
> +	    char *p = str;
> +	    while (ISALPHA (*str))
> +	      str++;
> +
> +	    if ((strncasecmp (p, "nb", 2) == 0) && (str == p + 2))
> +	      info->imm.value = 1;
> +	    else
> +	      {
> +		set_default_error ();

Most operands that use the default error rely on it being set as a fallback
after jumping to the failure: label, instead of setting it explicitly before
jumping.  You could do the same here for consistency - i.e., just delete this
line.

The whole series is ok with this change (and also ok without the change if
you'd prefer to keep the explicit call).

Thanks,
Alice


> +		/* Turn off backtrack as this optional operand is present.  */
> +		backtrack_pos = 0;
> +		goto failure;
> +	      }
> +	    break;
> +	  }
> +
>  	case AARCH64_OPND_PRFOP:
>  	  val = parse_pldop (&str);
>


More information about the Binutils mailing list