summaryrefslogtreecommitdiff
path: root/opcodes
AgeCommit message (Collapse)Author
2024-01-29bpf: there is no ldinddw nor ldabsdw instructionsJose E. Marchesi
There are no legacy ldind nor ldabs BPF instructions with BPF_SIZE_DW. For some reason we were (incorrectly) supporting these. This patch updates the opcodes so the instructions get removed and modifies the GAS manual and testsuite accordingly. See discussion at https://lore.kernel.org/bpf/110aad7a-f8a3-46ed-9fda-2f8ee54dcb89@linux.dev Tested in bpf-uknonwn-none target, x86-64-linux-gnu host. include/ChangeLog: 2024-01-29 Jose E. Marchesi <jose.marchesi@oracle.com> * opcode/bpf.h (enum bpf_insn_id): Remove BPF_INSN_LDINDDW and BPF_INSN_LDABSDW instructions. opcodes/ChangeLog: 2024-01-29 Jose E. Marchesi <jose.marchesi@oracle.com> * bpf-opc.c (bpf_opcodes): Remove BPF_INSN_LDINDDW and BPF_INSN_LDABSDW instructions. gas/ChangeLog: 2024-01-29 Jose E. Marchesi <jose.marchesi@oracle.com> * doc/c-bpf.texi (BPF Instructions): There is no indirect 64-bit load instruction. (BPF Instructions): There is no absolute 64-bit load instruction. * testsuite/gas/bpf/mem.s: Update test accordingly. * testsuite/gas/bpf/mem-be-pseudoc.d: Likewise. * testsuite/gas/bpf/mem-be.d: Likewise. * testsuite/gas/bpf/mem-pseudoc.d: Likewise. * testsuite/gas/bpf/mem-pseudoc.s: Likewise. * testsuite/gas/bpf/mem.d: Likewise. * testsuite/gas/bpf/mem.s: Likewise.
2024-01-26aarch64: move SHA512 instructions to +sha3Andrew Carlotti
SHA512 instructions were added to the architecture at the same time as SHA3 instructions, but later than the SHA1 and SHA256 instructions. Furthermore, implementations must support either both or neither of the SHA512 and SHA3 instruction sets. However, SHA512 instructions were originally (and incorrectly) added to Binutils under the +sha2 flag. This patch moves SHA512 instructions under the +sha3 flag, which matches the architecture constraints and existing GCC and LLVM behaviour.
2024-01-26x86/APX: TILE{RELEASE,ZERO} have no EVEX encodingsJan Beulich
Re-using the entire VEX decode hierarchy for the respective major opcode has led to those two also being decoded as-if valid. Follow the earlier USE_X86_64_EVEX_{PFX,W}_TABLE approach to avoid this happening.
2024-01-26x86/APX: no need to have decode go through x86_64_table[]Jan Beulich
As suggested during review already, all such entries have their first slot as Bad_Opcode, so by adding two more enumerators we can avoid doing that decode step altogether.
2024-01-26x86/APX: optimize MOVBEJan Beulich
With identical source and destination it can be covered by the NDD-to- legacy conversion logic as well, even if in this case the original insn doesn't use an NDD encoding. The size savings are even better here, for the replacement (BSWAP) not having a ModR/M byte.
2024-01-26LoongArch: gas: Add support for s9 registermengqinggang
In LoongArch ABI, r22 register can be used as frame pointer or static register(s9). Link: https://github.com/loongson/la-abi-specs/blob/release/lapcs.adoc#general-purpose-registers
2024-01-24aarch64: Eliminate unused variable warnings with -DNDEBUGAndrew Carlotti
2024-01-22Updated Serbian translations for th bfd, gold and opcodes directoriesNick Clifton
2024-01-22opcodes: tic4x_disassemble swap xcalloc argumentsMark Wielaard
GCC 14 will detect when the size and count arguments of calloc are swapped. binutils-gdb/opcodes/tic4x-dis.c: In function ‘tic4x_disassemble’: binutils-gdb/opcodes/tic4x-dis.c:710:32: error: ‘xcalloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 710 | optab = xcalloc (sizeof (tic4x_inst_t *), (1 << TIC4X_HASH_SIZE)); | ^~~~~~~~~~~~ binutils-gdb/opcodes/tic4x-dis.c:710:32: note: earlier argument should specify number of elements, later size of each element binutils-gdb/opcodes/tic4x-dis.c:712:40: error: ‘xcalloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 712 | optab_special = xcalloc (sizeof (tic4x_inst_t *), TIC4X_SPESOP_SIZE); | ^~~~~~~~~~~~ binutils-gdb/opcodes/tic4x-dis.c:712:40: note: earlier argument should specify number of elements, later size of each element opcodes/ChangeLog: * /tic4x-dis.c (tic4x_disassemble): Swap size and count xcalloc arguments.
2024-01-19x86-64: Dwarf2 register numbers for %bnd<N>Jan Beulich
I don't see why we shouldn't record them when they have been allocated, even if they're (bogusly) named as reserved in the ABI right now.
2024-01-19x86/APX: VROUND{P,S}{S,D} can generally be encodedJan Beulich
VRNDSCALE{P,S}{S,D} is the AVX512 generalization of these AVX insns. As long as the immediate has the top 4 bits clear, they are equivalent to the earlier VEX-encoded insns, and hence can be used to permit use of eGPR-s in the memory operand. Since this is the normal way of using these insns, also alter the resulting diagnostic to complain about the immediate, not the eGPR use.
2024-01-19x86/APX: be consistent with insn suffixesJan Beulich
When there's a suitably disambiguating register operand, suffixes are generally omitted (unless in suffix-always mode). All NDD insns have a suitable register operand, so they shouldn't have suffixes by default.
2024-01-19x86: drop redundant EVex128 from PUSH2/POP2Jan Beulich
EVexMap4 already covers that.
2024-01-19x86: support APX forms of U{RD,WR}MSRJan Beulich
This was missed in 6177c84d5edc ("Support APX GPR32 with extend evex prefix").
2024-01-18Add note to translators not to translate z/ArchitectureNick Clifton
2024-01-18Updated translations for various sub-directoriesNick Clifton
2024-01-15Change version to 2.42.50 and regenerate filesNick Clifton
2024-01-15Add markers for 2.42 branchNick Clifton
2024-01-15aarch64: rcpc3: Regenerate aarch64-*-2.c filesVictor Do Nascimento
2024-01-15aarch64: rcpc3: Add FP load/store insnsVictor Do Nascimento
Along with the relevant unit-tests, this adds the following rcpc3 instructions: STL1 { <Vt>.D }[<index>], [<Xn|SP>] LDAP1 { <Vt>.D }[<index>], [<Xn|SP>] LDAPUR <Bt>, [<Xn|SP>{, #<simm>}] LDAPUR <Ht>, [<Xn|SP>{, #<simm>}] LDAPUR <St>, [<Xn|SP>{, #<simm>}] LDAPUR <Dt>, [<Xn|SP>{, #<simm>}] LDAPUR <Qt>, [<Xn|SP>{, #<simm>}] STLUR <Bt>, [<Xn|SP>{, #<simm>}] STLUR <Ht>, [<Xn|SP>{, #<simm>}] STLUR <St>, [<Xn|SP>{, #<simm>}] STLUR <Dt>, [<Xn|SP>{, #<simm>}] STLUR <Qt>, [<Xn|SP>{, #<simm>}] with `#<simm>' taking on a signed 8-bit integer value in the range [-256,255] and `index' the values 0 or 1. Co-authored-by: Srinath Parvathaneni <srinath.parvathaneni@arm.com>
2024-01-15aarch64: rcpc3: Add integer load/store insnsVictor Do Nascimento
Along with the relevant unit tests and updates to the existing regression tests, this adds support for the following novel rcpc3 insns: LDIAPP <Wt1>, <Wt2>, [<Xn|SP>] LDIAPP <Wt1>, <Wt2>, [<Xn|SP>], #8 LDIAPP <Xt1>, <Xt2>, [<Xn|SP>] LDIAPP <Xt1>, <Xt2>, [<Xn|SP>], #16 STILP <Wt1>, <Wt2>, [<Xn|SP>] STILP <Wt1>, <Wt2>, [<Xn|SP>, #-8]! STILP <Xt1>, <Xt2>, [<Xn|SP>] STILP <Xt1>, <Xt2>, [<Xn|SP>, #-16]! LDAPR <Wt>, [<Xn|SP>], #4 LDAPR <Xt>, [<Xn|SP>], #8 STLR <Wt>, [<Xn|SP>, #-4]! STLR <Xt>, [<Xn|SP>, #-8]!
2024-01-15aarch64: rcpc3: Define RCPC3_INSN macroVictor Do Nascimento
This patch adds the necessary macro for encoding FEAT_RCPC3-dependent instructions in Binutils.
2024-01-15aarch64: rcpc3: add support in general_constraint_met_pVictor Do Nascimento
Given the introduction of the new address operand types for rcpc3 instructions, this patch adds the necessary logic to teach `general_constraint_met_p` how to proper handle these.
2024-01-15aarch64: rcpc3: New RCPC3_ADDR operand typesVictor Do Nascimento
The particular choices of address indexing, along with their encoding for RCPC3 instructions lead to the requirement of a new set of operand descriptions, along with the relevant inserter/extractor set. That is, for the integer load/stores, there is only a single valid indexing offset quantity and offset mode is allowed - The value is always equivalent to the amount of data read/stored by the operation and the offset is post-indexed for Load-Acquire RCpc, and pre-indexed with writeback for Store-Release insns. This indexing quantity/mode pair is selected by the setting of a single bit in the instruction. To represent these insns, we add the following operand types: - AARCH64_OPND_RCPC3_ADDR_OPT_POSTIND - AARCH64_OPND_RCPC3_ADDR_OPT_PREIND_WB In the case of loads and stores involving SIMD/FP registers, the optional offset is encoded as an 8-bit signed immediate, but neither post-indexing or pre-indexing with writeback is available. This created the need for an operand type similar to AARCH64_OPND_ADDR_OFFSET, with the difference that FLD_index should not be checked. We thus introduce the AARCH64_OPND_RCPC3_ADDR_OFFSET operand, a variant of AARCH64_OPND_ADDR_OFFSET, w/o the FLD_index bitfield.
2024-01-15aarch64: rcpc3: Define address operand fields and inserter/extractorsVictor Do Nascimento
Beyond the need to encode any registers involved in data transfer and the address base register for load/stores, it is necessary to specify the data register addressing mode and whether the address register is to be pre/post-indexed, whereby loads may be post-indexed and stores pre-indexed with write-back. The use of a single bit to specify both the indexing mode and indexing value requires a novel function be written to accommodate this for address operand insertion in assembly and another for extraction in disassembly, along with the definition of two insn fields for use with these instructions. This therefore defines the following functions: - aarch64_ins_rcpc3_addr_opt_offset - aarch64_ins_rcpc3_addr_offset - aarch64_ext_rcpc3_addr_opt_offset - aarch64_ext_rcpc3_addr_offset It extends the `do_special_{encoding|decoding}' functions and defines two rcpc3 instruction fields: - FLD_opc2 - FLD_rcpc3_size
2024-01-15aarch64: rcpc3: Create implicit load/store size calc functionVictor Do Nascimento
The allowed immediate offsets in integer rcpc3 load store instructions are not encoded explicitly in the instruction itself, being rather implicitly equivalent to the amount of data loaded/stored by the instruction. This leads to the requirement that this quantity be calculated based on the number of registers involved in the transfer, either as data source or destination registers and their respective qualifiers. This is done via `calc_ldst_datasize (const aarch64_opnd_info *opnds)' implemented here, using a cumulative sum of qualifier sizes preceding the address operand in the OPNDS operand list argument.
2024-01-15aarch64: rcpc3: Add +rcpc3 architectural feature support flagVictor Do Nascimento
Indicating the presence of the Armv8.2-a feature adding further support for the Release Consistency Model, the `+rcpc3' architectural extension flag is added to the list of possible `-march' options in Binutils, together with the necessary macro for encoding rcpc3 instructions.
2024-01-15aarch64: Fix tlbi and tlbip instructionsAndrew Carlotti
There are some tlbi operations that don't have a corresponding tlbip operation, but we were incorrectly using the same list for both. Add the missing tlbi *nxs operations, and use the F_REG_128 flag to filter tlbi operations that don't have a tlbip analogue. For increased clarity, I have also used a macro to reduce duplication between the 'nxs' and non-'nxs' variants, and added a test to verify that no invalid combinations are accepted. Additionally, fix two missing checks for AARCH64_OPND_SYSREG_TLBIP that were preventing disassembly of tlbip instructions.
2024-01-15aarch64: Refactor aarch64_sys_ins_reg_supported_pAndrew Carlotti
Add an aarch64_feature_set field to aarch64_sys_ins_reg, and use this for feature checks instead of testing against a list of operand codes.
2024-01-15Add generated source files and fix thinko in aarch64-asm.cNick Clifton
2024-01-15aarch64: Add SVE2.1 Contiguous load/store instructions.Srinath Parvathaneni
Hi, This patch add support for SVE2.1 instructions ld1q, ld2q, ld3q and ld4q, st1q, st2q, st3q and st4q. Regression testing for aarch64-none-elf target and found no regressions. Ok for binutils-master? Regards, Srinath.
2024-01-15PATCH 5/6][Binutils] aarch64: Add SVE2.1 fmin and fmax instructions.Srinath Parvathaneni
Hi, This patch add support for SVE2.1 instruction faddqv, fmaxnmqv, fmaxqv, fminnmqv and fminqv. Regression testing for aarch64-none-elf target and found no regressions. Ok for binutils-master? Regards, Srinath.
2024-01-15aarch64: Add SVE2.1 dupq, eorqv and extq instructions.Srinath Parvathaneni
Hi, This patch add support for SVE2.1 instruction dupq, eorqv and extq. Regression testing for aarch64-none-elf target and found no regressions. Ok for binutils-master? Regards, Srinath.
2024-01-15aarch64: Add support for FEAT_SVE2p1.Srinath Parvathaneni
Hi, This patch add support for FEAT_SVE2p1 (SVE2.1 Extension) feature along with +sve2p1 optional flag to enabe this feature. Also support for following SVE2p1 instructions is added addqv, andqv, smaxqv, sminqv, umaxqv, uminqv and uminqv. Regression testing for aarch64-none-elf target and found no regressions. Ok for binutils-master? Regards, Srinath.
2024-01-15aarch64: Add support for FEAT_SME2p1 instructions.Srinath Parvathaneni
Hi, This patch add support for FEAT_SME2p1 and "movaz" instructions along with the optional flag +sme2p1. Following "movaz" instructions are add: Move and zero two ZA tile slices to vector registers. Move and zero four ZA tile slices to vector registers. Regression testing for aarch64-none-elf target and found no regressions. Ok for binutils-master? Regards, Srinath.
2024-01-15aarch64: Add support for FEAT_B16B16 instructions.Srinath Parvathaneni
Hi, This patch add support for SVE2.1 and SME2.1 non-widening BFloat16 (FEAT_B16B16) instructions. Following instructions predicated, unpredicated and indexed variants are added in this patch. bfadd, bfclamp, bfmax bfmaxnm, bfmin,bfminnm, bfmla,bfmls,bfmul and bfsub. Regression testing for aarch64-none-elf target and found no regressions. Ok for binutils-master? Regards, Srinath.
2024-01-15opcodes: i386-reg.tbl: Add a comment to reflect dependency on orderingIndu Bhagat
The ginsn representation keeps the DWARF register number of the operands. The API ginsn_dw2_regnum relies on the the relative ordering of these register entries in the table. Add a comment to make it clear. opcodes/ * i386-reg.tbl: Add a comment.
2024-01-15opcodes: x86: new marker for insns that implicitly update stack pointerIndu Bhagat
Some x86 instructions affect the stack pointer implicitly. Add a new operand constraint to reflect this. This will be useful for SCFI implmentation to ensure its correctness. Mark all push, pop, call, ret, enter, leave, INT, iret instructions. opcodes/ * i386-gen.c: Update opcode_modifiers. * i386-opc.h: Add a new constraint. * i386-opc.tbl: Update the affected instructions. * i386-tbl.h: Regenerated.
2024-01-15opcodes: gas: x86: define and use Rex2 as attribute not constraintIndu Bhagat
Rex2 is currently an operand constraint. For the upcoming SCFI implementation in GAS, we need to identify operations which implicitly update the stack pointer. An operand constraint enumerator for implicit stack op seems more appropriate than an attribute. However, two opcodes currently necessitate both Rex2 and an implicit stack op marker; this prompts revisiting the current representations a bit. Make Rex2 a standalone attribute, so that later a new operand constraint may be added for IMPLICIT_STACK_OP. ChangeLog: * gas/config/tc-i386.c (is_apx_rex2_encoding): Update the check. * opcodes/i386-gen.c: Add a new BITFIELD for Rex2. * opcodes/i386-opc.h (REX2_REQUIRED): Remove. * opcodes/i386-opc.tbl: Remove Rex2 operand constraint. * opcodes/i386-tbl.h: Regenerated.
2024-01-12aarch64: Remove unused codeAndrew Carlotti
Most of this code became redundant in my previous commits, but ARMV8_6A_SVE was already dead when it was first added.
2024-01-12aarch64: Make FEAT_ASMv8p2 instruction aliases always availableAndrew Carlotti
There's no reason to disallow the aliases when the aliased instructions are always available. The new behaviour matches existing LLVM behaviour.
2024-01-12aarch64: Add +xs flag for existing instructionsAndrew Carlotti
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.
2024-01-12aarch64: Add +wfxt flag for existing instructionsAndrew Carlotti
2024-01-12aarch64: Add +rcpc2 flag for existing instructionsAndrew Carlotti
2024-01-12aarch64: Add +jscvt flag for existing fjcvtzs instructionAndrew Carlotti
2024-01-11LoongArch: Discard extra spaces in objdump outputLulu Cai
Due to the formatted output of objdump, some instructions that do not require output operands (such as nop/ret) will have extra spaces added after them. Determine whether to output operands through the format of opcodes. When opc->format is an empty string, no extra spaces are output.
2024-01-10gas: aarch64: Add system registers for Debug and PMU extensionsSaurabh Jha
This patch adds support for the new AArch64 system registers that are part of the following extensions: * FEAT_DEBUGv8p9 * FEAT_PMUv3p9 * FEAT_PMUv3_SS * FEAT_PMUv3_ICNTR * FEAT_SEBEP
2024-01-09x86: add missing APX logic to cpu_flags_match()Jan Beulich
As already indicated during review, we can't get away without certain adjustments here: Without these, respective {evex}-prefixed insns are assembled to APX encodings even when APX_F is turned off. While there also extend the respective comment in the opcode table, to explain why this construct is used.
2024-01-09aarch64: ADD FEAT_THE RCWCAS instructions.Srinath Parvathaneni
This patch adds support for FEAT_THE doubleword and quadword instructions. doubleword insturctions are enabled by "+the" flag whereas quadword instructions are enabled on passing both "+the and +d128" flags. Support for following sets of instructions is added in this patch. Read check write compare and swap doubleword: (rcwcas, rcwcasa, rcwcasal, rcwcasl) Read check write compare and swap quadword: (rcwcasp,rcwcaspa, rcwcaspal, rcwcaspl) Read check write software compare and swap doubleword: (rcwscas, rcwscasa, rcwscasal, rcwscasl) Read check write software compare and swap quadword: (rcwscasp, rcwscaspa, rcwscaspal, rcwscaspl) Read check write atomic bit clear on doubleword: (rcwclr, rcwclra, rcwclral, rcwclrl) Read check write atomic bit clear on quadword: (rcwclrp, rcwclrpa, rcwclrpal, rcwclrpl) Read check write software atomic bit clear on doubleword: (rcwsclr, rcwsclra, rcwsclral, rcwsclrl) Read check write software atomic bit clear on quadword: (rcwsclrp,rcwsclrpa, rcwsclrpal,rcwsclrpl) Read check write atomic bit set on doubleword: (rcwset,rcwseta, rcwsetal,rcwsetl) Read check write atomic bit set on quadword: (rcwsetp,rcwsetpa,rcwsetpal,rcwsetpl) Read check write software atomic bit set on doubleword: (rcwsset,rcwsseta,rcwssetal,rcwssetl) Read check write software atomic bit set on quadword: (rcwssetp,rcwssetpa,rcwssetpal,rcwssetpl) Read check write swap doubleword: (rcwswp,rcwswpa,rcwswpal,rcwswpl) Read check write swap quadword: (rcwswpp,rcwswppa, rcwswppal,rcwswppl) Read check write software swap doubleword: (rcwsswp,rcwsswpa,rcwsswpal,rcwsswpl) Read check write software swap quadword: (rcwsswpp,rcwsswppa,rcwsswppal,rcwsswppl)
2024-01-09aarch64: Regenerate aarch64-*-2.c filesVictor Do Nascimento