[PATCH] aarch64: Fix TLBIP and SYSP instructions operands
Alice Carlotti
alice.carlotti@arm.com
Tue Mar 24 18:05:41 GMT 2026
On Tue, Feb 03, 2026 at 10:21:21AM +0000, richard.ball@arm.com wrote:
> From: Richard Ball <Richard.Ball@arm.com>
>
> These instruction should accept only 3 operands, previously it
> was possible to provide only 1 of the pair of registers.
I think the pair of registers should still be optional for the sysp
instruction. I'd suggest modifiying parse_operands around the location of the
optional_operand_p check at the end of the loop - all optional operands are at
the end of the instruction, so we could probably exit the loop early here, and
perhaps simplify and improve some of the existing logic.
This is a nice trick for tlbip itself, however - perhaps it might be worth
having that as a separate patch and then fixing sysp itself later.
> ---
> gas/config/tc-aarch64.c | 8 -
> .../gas/aarch64/illegal-sysp-tlbip-optional.d | 4 -
> .../gas/aarch64/illegal-sysp-tlbip-optional.l | 2 -
> .../gas/aarch64/illegal-sysp-tlbip-optional.s | 5 -
> .../gas/aarch64/sysp-tlbip-optional.d | 16 --
> .../gas/aarch64/sysp-tlbip-optional.s | 17 --
> gas/testsuite/gas/aarch64/tlbip-invalid-2.d | 3 +
> gas/testsuite/gas/aarch64/tlbip-invalid-2.l | 241 ++++++++++++++++++
> gas/testsuite/gas/aarch64/tlbip-invalid-2.s | 130 ++++++++++
> opcodes/aarch64-tbl.h | 4 +-
> 10 files changed, 376 insertions(+), 54 deletions(-)
> delete mode 100644 gas/testsuite/gas/aarch64/illegal-sysp-tlbip-optional.d
> delete mode 100644 gas/testsuite/gas/aarch64/illegal-sysp-tlbip-optional.l
> delete mode 100644 gas/testsuite/gas/aarch64/illegal-sysp-tlbip-optional.s
> delete mode 100644 gas/testsuite/gas/aarch64/sysp-tlbip-optional.d
> delete mode 100644 gas/testsuite/gas/aarch64/sysp-tlbip-optional.s
> create mode 100644 gas/testsuite/gas/aarch64/tlbip-invalid-2.d
> create mode 100644 gas/testsuite/gas/aarch64/tlbip-invalid-2.l
> create mode 100644 gas/testsuite/gas/aarch64/tlbip-invalid-2.s
>
...
> diff --git a/gas/testsuite/gas/aarch64/tlbip-invalid-2.s b/gas/testsuite/gas/aarch64/tlbip-invalid-2.s
> new file mode 100644
> index 00000000000..6d9a51609a5
> --- /dev/null
> +++ b/gas/testsuite/gas/aarch64/tlbip-invalid-2.s
> @@ -0,0 +1,130 @@
> + // Test file for AArch64 GAS -- Invalid TLB invalidation instructions.
> +
> + .macro tlbip_m op expl
> + .ifc \expl, 1
> + tlbip \op, x0,
> + .else
> + tlbip \op
> + .endif
> + .endm
This macro just adds unnecessary indirection with no benefit that I can see.
> +
> + tlbip_m vae1os 1
> + tlbip_m vaae1os 1
More information about the Binutils
mailing list