Commit Graph

1392 Commits

Author SHA1 Message Date
Srinath Parvathaneni
43d523e207 aarch64: Add support for POE2 PLBI instruction
This patch adds support for PLB invalidate operation (PLBI) instruction
and the corresponding system registers as operand (<plbi_op>).

Syntax: PLBI <plbi_op>{, <Xt>}

This instruction is an alias to "SYS #<op1>, C10, <Cm>, #<op2>{, <Xt>}"
and PLBI being the preferred disassembly.

The following list of system registers are supported in this patch for the
PLBI instructions enabled by "+poe2" flag and also the "nxs" variants of
these system registers are enabled by "+poe2+xs" flag.

   * alle1
   * alle1is
   * alle1os
   * alle2
   * alle2is
   * alle2os
   * alle3
   * alle3is
   * alle3os
   * aside1
   * aside1is
   * aside1os
   * permae1
   * permae1is
   * permae1os
   * perme1
   * perme1is
   * perme1os
   * perme2
   * perme2is
   * perme2os
   * perme3
   * perme3is
   * perme3os
   * vmalle1
   * vmalle1is
   * vmalle1os
2026-01-05 17:50:55 +00:00
Srinath Parvathaneni
859d7ccd9f aarch64: Add support for TEV instructions
This patch adds support for FEAT_TEV feature enabled by "+tev"
flag along with support for following instructions.

* TENTER
* TEXIT

TENTER instruction uses the existing AARCH64_OPND_NOT_BALANCED_17 operand
to handle the not_balanced (NB) argument , where as a new operand
AARCH64_OPND_NOT_BALANCED_10 is added to support the NB (not_balanced)
argument in TEXIT instruction.
2026-01-05 17:50:43 +00:00
Srinath Parvathaneni
37fd5c9428 aarch64: Add support for POE2 instructions
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.

Co-authored-by:  Matthew Malcomson <matthew.malcomson@arm.com>
2026-01-05 17:50:24 +00:00
Alan Modra
c8f306af2f Update year range in copyright notice of binutils files
Avoid warnings about invalid escapes in etc/update-copyright.py by
using raw strings, add BinutilsFilter to skip psql.rc and add
"Kalray SA." as another copyright holder.
2026-01-01 23:22:14 +10:30
Alice Carlotti
1db7006c37 aarch64: Remove sme2_movaz instruction class
The behaviour of sme2_movaz was identical to sme_misc, so use that
instead.
2025-12-29 12:03:03 +00:00
Sivan Shani
d8d024ad42 AArch64 v9.7 extensions: FEAT_SVE_B16MM
This patch includes:
  - Feature flag for FEAT_SVE_B16MM
  - Instruction:
      - BFMMLA (non-widening) BFloat16 matrix multiply-accumulate.
2025-12-27 12:45:53 +00:00
Sivan Shani
3eb520ce6a AArch64 v9.7 extensions: FEAT_F16MM
This patch includes:
  - Feature flag for FEAT_F16MM
  - Instructions:
	- FMMLA (non-widening) Half-precision matrix multiply-accumulate
	- FMMLA (non-widening) Floating-point matrix multiply-accumulate
2025-12-27 12:45:53 +00:00
Sivan Shani
a6956e0c79 AArch64: Add FEAT_F16F32MM
This patch includes:
    - The feature flag for the FEAT_F16F32MM feature.
    - Instruction FMMLA Half-precision matrix multiply-accumulate to single-precision.
2025-12-27 12:45:52 +00:00
Sivan Shani
4373edd2f6 AArch64: Add FEAT_F16F32DOT instructions
This includes the instructions for the F16F32DOT feature:
    - FDOT half-precision to single-precision, by element
    - FDOT half-precision to single-precision, vector
2025-12-27 12:45:52 +00:00
Sivan Shani
a722387a1f AArch64: Add FEAT_SVE2p3 and FEAT_SME2p3 instructions.
This patch includes:

    - Flags for the FEAT_SVE2p3 and FEAT_SME2p3 features.
    - Instructions:
      - ADDQP
      - ADDSUBP
      - FCVTZSN
      - FCVTZUN
      - LUTI6 16-bit
      - LUTI6 8-bit
      - SABAL
      - SCVTF
      - SCVTFLT
      - SDOT vectors
      - SDOT indexed
      - SQRSHRN
      - SQRSHRUN
      - SQSHRN
      - SQSHRUN
      - SUBP
      - UABAL
      - UCVTF
      - UCVTFLT
      - UDOT vectors
      - UDOT indexed
      - UQRSHRN
      - UQSHRN
      - LUTI6 vector
      - LUTI6 table, four registers
      - LUTI6 table, single, 8-bit

    In addition, new operands:
      - OPND_SME_Zmx2_INDEX_22: an operand represents a list of vector registers with an index.
      - OPND_SME_Zn7xN_UNTYPED: an operand represents an untyped list of vector registers.
2025-12-27 12:19:23 +00:00
Yury Khrustalev
242e78b76a aarch64: Add FEAT_MOPS_GO instructions
Also add +mops-go feature flag and make the mops-go feature
depend on the memtag and mops features.
2025-12-27 09:23:51 +00:00
Lulu Cai
8bea934667 LoongArch: Add disassembly support for ud ui5
ud ui5, also known as amswap.w rd,$r1,rj(rd==rj), is displayed as
"ud ui5" by default during disassembly. Alternatively, the original
instruction can be printed using the objdump -M no-aliases.

To implement this support, a format specifier "ru0:5,ru5:5" for ud is
applied exclusively during disassembly. This specifier indicates that
registers should be printed using their corresponding numeric values,
and when the instruction is identified as ud, only a single parameter
is displayed.

binutils/

        * testsuite/binutils-all/loongarch64/dis-amswap-ud-noaliases.d:
	  New test.
        * testsuite/binutils-all/loongarch64/dis-amswap-ud.d: New test.
        * testsuite/binutils-all/loongarch64/dis-amswap-ud.s: New test.

gas/

        * testsuite/gas/loongarch/macro_ud.d: Update test.

include/

        * opcode/loongarch.h: New macro.

opcodes/

        * loongarch-dis.c (get_loongarch_opcode_by_binfmt): Correct match `ud`.
        (dis_one_arg): Disassemble the `ud` parameter.
        * loongarch-opc.c: Add opcode for "ud" alias.
2025-12-20 10:49:47 +08:00
Srinath Parvathaneni
d0514e7441 aarch64: Add support for new BTI <target> "r"
This patch adds support for new BTI <target> "r" (instruction: bti r),
which is an alias to "bti" (with no target), for both "bti" and "bti r"
the preferred disassembly is "bti r". This "bti r" instruction is by
default available from Armv8-A architecture.

The HINT_OPD_F_NOPRINT macro has become redundant with these changes
and has been removed.
2025-12-15 11:01:49 +00:00
Richard Ball
4f9b9eaa24 aarch64: Add support for FEAT_LSCP
This patch adds the new instructions from FEAT_LSCP.
These instructions are LDAP, LDAPP and STLP.
2025-12-11 14:10:42 +00:00
mengqinggang
d17b290265 LoongArch: Add linker relaxation for got_pcadd_hi20 and got_pcadd_lo12
.L1:
pcaddu12i $t0, %got_pcadd_hi20(a)     -> pcaddu12i $t0, %pcadd_hi20(a)
ld.w/d $t0, $t0, %got_pcadd_lo12(.L1) -> addi.w/d $t0, $t0, %pcadd_lo12(.L1)
2025-12-10 16:06:48 +08:00
mengqinggang
82f67b063b LoongArch: Add support for tls type transition on LA32
desc -> le
ie -> le
desc -> ie

For desc/ie -> le, need to change the symbol of le_lo12 to the symbol of
[desc|ie]_pcadd_hi20.
2025-12-10 16:06:48 +08:00
Lulu Cai
9bb91ce42f LoongArch: Add support for the ud macro instruction
In the "ud ui5" macro, the value of ui5 must be in the range 0–31. It
expands to "amswap.w $rd, $r1, $rj", where ui5 specifies the register
number for $rd in the amswap.w instruction, and $rd == $rj.

The test case have been adjusted to no longer report errors for illegal
operands of the amswap.w instruction.

gas/

	* config/tc-loongarch.c (check_this_insn_before_appending): No
	  longer check amswap.w.
	* testsuite/gas/loongarch/illegal-operand.l: Update.
	* testsuite/gas/loongarch/illegal-operand.s: Update.
	* testsuite/gas/loongarch/macro_ud.d: New test.
	* testsuite/gas/loongarch/macro_ud.s: New test.

include/

	* opcode/loongarch.h: Add new macro for amswap.w.

opcodes/

	* loongarch-opc.c: Add macro for ud.
2025-12-09 17:06:26 +08:00
Alice Carlotti
7fc6ffb18e aarch64: Improve comment for aarch64_opnd_info.sysreg.flags
This field is used differently during assembly and disassembly.  It
would be nice if we could make this more consistent, but for now just
extend the comment to explain what is going on.
2025-12-04 16:21:55 +00:00
timurgol007
3241ec3eca RISC-V: Fixed opcodes for some bitmanip instructions
Currently some of the instructions in bitmanip extensions can not be obtained
using DECLARE_INSN macros. I generated them using riscv-opcodes and added to
other opcodes.

Approved-By: Nelson Chu <nelson@rivosinc.com>
2025-11-21 22:33:09 +03:00
Alice Carlotti
552ddbabb5 aarch64: Add support for FEAT_SSVE_BITPERM 2025-10-10 01:33:15 +01:00
Alice Carlotti
8a5fe4ee71 aarch64: Add support for FEAT_SSVE_FEXPA 2025-10-10 01:33:14 +01:00
Alice Carlotti
64aae286f6 aarch64: Add support for FEAT_SME_MOP4 2025-10-10 01:29:19 +01:00
Alice Carlotti
0787e01a25 aarch64: Add support for FEAT_SME_TMOP 2025-10-10 01:29:18 +01:00
Alice Carlotti
3b957f92de aarch64: Remove incorrect disassembly constraint
A check in print_insn_aarch64_word asserted that part of the encoding
space couldn't contain any valid encodings, and then returned ERR_NYI
("Not Yet Implemented", perhaps?) for these values.  However, some of
the new FEAT_MOP4 instructions will trigger the assert.  The check seems
to be outdated, and is clearly no longer valid, so it can just be
deleted.

Additionally, there are no other assignments of ERR_NYI, so delete all
remaining references to this error type.
2025-10-10 01:14:07 +01:00
Andre Vieira
94861aa1c0 aarch64, gas: Relax Armv9.6-A mandatory feature set
Remove FPRCVT and SVE2p2 from the set of mandatory features for Armv9.6-A.
2025-10-08 11:30:56 +01:00
Saurabh Jha
a149def232 gas: aarch64: Add instructions for GICv5
Add new instructions from the Generic Interrupt Controller, GICv5,
extension. These instructions are aliases to system instructions and are
the following:

* gic <operation>, <reg>
* gicr <reg>, <operation>
* gsb <operation>
2025-10-06 17:56:26 +00:00
Saurabh Jha
c3954fc3a1 gas: aarch64: Add flag for GICv5
Generic Interrupt Controller v5, GICv5, adds new system registers
and system instructions. These are enabled with the +gcie flag, where
gcie stands for GICv5 (Generic Interrupt Controller) CPU Interrupt
Extension.
2025-10-06 17:56:26 +00:00
Alice Carlotti
7ca856a271 aarch64: Reorder feature bits
Group the architecture version bits at the start of the enum, and add a
comment explaining the purpose of AARCH64_FEATURE_V8A.
2025-09-23 19:42:45 +01:00
Alice Carlotti
1b28f5f095 aarch64: Remove unused feature bits
Many feature bits were unnecessarily added for features with no command
line flags, and effectively acted as aliases of the architecture version
bit they were linked to.  The system register regating patch removed all
uses of these feature bits, so we can just remove them.
2025-09-23 19:42:45 +01:00
Alice Carlotti
22c3912a11 aarch64: Remove F_ARCHEXT flag
The flag is unnecessary, because we can just unconditionally check the
features field every time.  Having the information duplicated in two
separate fields makes it harder to maintain, particularly in the context
of the upcoming regating patch.

The reg_flags parameter of aarch64_sys_ins_reg_supported_p is now
unused, so remove that as well.
2025-09-23 19:42:43 +01:00
Alice Carlotti
3b6b69205c aarch64: Add support for --march=armv9.6-a 2025-07-12 10:04:27 +01:00
Alice Carlotti
891fa528c2 aarch64: Refactor exclusion of reg names in immediates
When parsing immediate values, register names should not be
misinterpreted as symbols.  However, for backwards compatibility we need
to permit some newer register names within older instructions.  The
current mechanism for doing so depends on the list of explicit
architecture requirements for the instructions, which is fragile and
easy to forget, and grows increasingly messy as more architecture
features are added.

This patch add explicit flags to each opcode to indicate which set of
register names is disallowed in each instance.  These flags are
mandatory for all opcodes with immediate operands, which ensures that
the choice of disallowed names will always be deliberate and explicit.

This patch should have no functional change.
2025-07-12 10:04:26 +01:00
Ezra Sitorus
87dcc3ddd6 aarch64: Support for FEAT_SVE_AES2
FEAT_SVE_AES2 implements the SVE multi-vector Advanced Encryption
Standard and 128-bit destination element polynomial multiply long
instructions, when the PE is not in Streaming SVE mode.
2025-07-11 12:53:25 +01:00
Ezra Sitorus
621c0c3469 aarch64: Support for FEAT_LSUI
FEAT_LSUI introduces unprivileged variants of load and store instructions so
that clearing PSTATE.PAN is never required in privileged software.
2025-07-11 12:53:19 +01:00
Ezra Sitorus
b80240ecba aarch64: Support for FEAT_PCDPHINT
FEAT_PCDPHINT - Producer-consumer data placement hints - is an optional
ISA extension that provides hint instructions to indicate:
- a store in the current execution thread is generating data at a specific
location, which a thread of execution on one or more other observers is
waiting on.
- the thread of execution on the current PE will read a location that may not
yet have been written with the value to be consumed.

This extension introduces:
- STSHH, a hint instruction, with operands (policies) keep and strm
- PRFM *IR*, a new prefetch memory operand.
2025-07-11 12:53:09 +01:00
Nelson Chu
34fcc16e79 RISC-V: Clarify the imply rule of c
This also fix the imply result for .option rvc.

Imply zcf when c and f and rv32
Imply zcd when c and d
Imply zca when c

Changed INSN_CLASS_C to INSN_CLASS_ZCA
Changed INSN_CLASS_F_AND_C to INSN_CLASS_ZCF
Changed INSN_CLASS_D_AND_C to INSN_CLASS_ZCD
Changed INSN_CLASS_ZIHINTNTL_AND_C to INSN_CLASS_ZIHINTNTL_AND_ZCA
2025-07-10 19:32:07 +08:00
Alan Modra
de8acd2005 gas d30v_insn plus other non-const pointers
d30v has a bunch of casts that are only needed due to various types
missing a const.  Fix that.
2025-07-09 09:35:07 +09:30
Alice Carlotti
e68a412e16 aarch64: Add support for FEAT_SVE2p2 and FEAT_SME2p2 2025-07-08 21:15:43 +01:00
Srinath Parvathaneni
5103708c01 aarch64: Add supports for FEAT_PoPS feature and DC instructions.
This patch add support for FEAT_PoPS feature which can be enabled
through +pops command line flag.

This patch also adds support for following DC instructions and the
spec can be found here [1].
1. "dc cigdvaps" enabled on passing +memtag+pops command line flags.
2. "dc civaps" enabled on passing +pops command line flag.

[1]: https://developer.arm.com/documentation/ddi0601/2025-03/AArch64-Instructions?lang=en
2025-06-25 13:34:59 +01:00
Kito Cheng
9b4b518ece RISC-V: Support for unlabeled landing pad PLT generation
This patch adds support for generating unlabeled landing pad PLT entries
for the RISC-V architecture. Unlabeled landing pad will place a LPAD
instruction at the PLT entry and PLT header, also PLT header will have
few changes due to the offset is different from the original one.

Ref: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/417
2025-06-24 18:14:45 +08:00
Ezra Sitorus
17cae8183b aarch64: Support for FEAT_LSFE
FEAT_LSFE - Large System Float Extension - implements A64 base atomic
floating-point in-memory instructions.
2025-06-19 14:48:13 +01:00
Ezra Sitorus
4a6d6c97ca aarch64: Support for FEAT_SVE_F16F32MM, FEAT_F8F16M, FEAT_F8F32MM
FEAT_SVE_F16F32MM introduces the SVE half-precision floating-point
matrix multiply-accumulate to single-precision instruction.

FEAT_F8F32MM introduces the Advanced SIMD 8-bit floating-point matrix
multiply-accumulate to single-precision instruction.

FEAT_F8F16MM introduces the Advanced SIMD 8-bit floating-point matrix
multiply-accumulate to half-precision instruction.
2025-06-19 14:36:33 +01:00
Ezra Sitorus
a1f853de0f aarch64: Support for FEAT_CMPBR
FEAT_CMPBR - Compare and branch instructions. This patch adds these
instructions:
- CB<CC> (register)
- CB<CC> (immediate)
- CBH<CC>
- CBB<CC>

where CC is one of the following:
- EQ
- NE
- GT
- GE
- LT
- LE
- HI
- HS
- LO
- LS
2025-06-19 14:30:34 +01:00
Ezra Sitorus
78155cbb35 aarch64: Add occmo flag for FEAT_OCCMO
FEAT_OCCMO support was introduced, but the feature flags were missing.
This patch adds these flags, as well as splitting up the tests to test
occmo vs occmo+memtag operands.
2025-06-19 14:05:14 +01:00
Ezra Sitorus
3165109751 aarch64: Support for FEAT_SVE_BFSCALE
FEAT_SVE_BFSCALE introduces the SVE BFSCALE instruction, when the PE is not in
Streaming SVE mode. If FEAT_SME2 is implemented, FEAT_SVE_BFSCALE also
introduces SME multi-vector Z-targeting BFloat16 scaling instructions, BFSCALE
and BFMUL.
2025-06-19 13:59:29 +01:00
Richard Ball
f9a37571ba aarch64: Add support for FEAT_FPRCVT
FEAT_FPRCVT introduces new versions of previous instructions.
The instructions are used to convert between floating points and
Integers. These new versions take as operands SIMD&FP registers
for both the source and destination register. FEAT_FPRCVT also
enables the use of some existing AdvSIMD instructions in
streaming mode. However, no changes are needed in gas to support this.
2025-06-12 01:39:24 +01:00
Yury Khrustalev
c97cba49cf aarch64: Add definitions for missing architecture bits
Complete macros for feature bits for v9.1-A, v9.2-A, v9.3-A,
and v9.4-A.
2025-06-11 09:05:07 +01:00
Alan Modra
04b475ac46 kvx gcc-4.5 build fixes
More missing struct initialisers, for expressionS vars that in this
case don't need to be initialised.  Also an error: redefinition of
typedef 'symbolS'.  OK, so don't use a typedef.
2025-06-11 07:26:07 +09:30
Richard Earnshaw
ab65e51fa9 aarch64: Increase the number of feature words to 3
Now that most of the effort of updating the number of feature words is
handled by macros, add an additional one, taking the number of
supported features to 192.
2025-06-09 15:42:35 +01:00
Richard Earnshaw
dccb302cf2 aarch64: use macro trickery to automate feature array size replication
There are quite a few macros that need to be changed when we need to
increase the number of words in the features data structure.  With
some macro trickery we can automate most of this so that a single
macro needs to be updated.

With C2X we could probably do even better by using recursion, but this
is still a much better situation than we had previously.

A static assertion is used to ensure that there is always enough space
in the flags macro for the number of feature bits we need to support.
2025-06-09 15:42:35 +01:00