aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-aarch64.c
diff options
context:
space:
mode:
authorVictor Do Nascimento <victor.donascimento@arm.com>2024-01-05 17:26:09 +0000
committerVictor Do Nascimento <victor.donascimento@arm.com>2024-01-15 13:11:48 +0000
commit51bb8593e6f533970385ca64f40a5bbfc82285da (patch)
tree4f3c00dfd49d72c17c344221c2cff2accdf1d31e /gas/config/tc-aarch64.c
parentc35460087723932ba7300072099bd0d65d9ce6d2 (diff)
downloadgdb-51bb8593e6f533970385ca64f40a5bbfc82285da.zip
gdb-51bb8593e6f533970385ca64f40a5bbfc82285da.tar.gz
gdb-51bb8593e6f533970385ca64f40a5bbfc82285da.tar.bz2
aarch64: rcpc3: New RCPC3_ADDR operand types
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.
Diffstat (limited to 'gas/config/tc-aarch64.c')
-rw-r--r--gas/config/tc-aarch64.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 6b29683..0c6de28 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -7269,7 +7269,52 @@ parse_operands (char *str, const aarch64_opcode *opcode)
inst.reloc.pc_rel = 1;
}
break;
+ case AARCH64_OPND_RCPC3_ADDR_PREIND_WB:
+ case AARCH64_OPND_RCPC3_ADDR_POSTIND:
+ po_misc_or_fail (parse_address (&str, info));
+ if (info->addr.writeback)
+ {
+ assign_imm_if_const_or_fixup_later (&inst.reloc, info,
+ /* addr_off_p */ 1,
+ /* need_libopcodes_p */ 1,
+ /* skip_p */ 0);
+ break;
+ }
+ set_syntax_error (_("invalid addressing mode"));
+ goto failure;
+ case AARCH64_OPND_RCPC3_ADDR_OPT_PREIND_WB:
+ case AARCH64_OPND_RCPC3_ADDR_OPT_POSTIND:
+ {
+ char *start = str;
+ /* First use the normal address-parsing routines, to get
+ the usual syntax errors. */
+ po_misc_or_fail (parse_address (&str, info));
+ if ((operands[i] == AARCH64_OPND_RCPC3_ADDR_OPT_PREIND_WB
+ && info->addr.writeback && info->addr.preind)
+ || (operands[i] == AARCH64_OPND_RCPC3_ADDR_OPT_POSTIND
+ && info->addr.writeback && info->addr.postind))
+ {
+ assign_imm_if_const_or_fixup_later (&inst.reloc, info,
+ /* addr_off_p */ 1,
+ /* need_libopcodes_p */ 1,
+ /* skip_p */ 0);
+ break;
+ }
+ if (info->addr.pcrel || info->addr.offset.is_reg
+ || !info->addr.preind || info->addr.postind
+ || info->addr.writeback)
+ {
+ set_syntax_error (_("invalid addressing mode"));
+ goto failure;
+ }
+ /* Then retry, matching the specific syntax of these addresses. */
+ str = start;
+ po_char_or_fail ('[');
+ po_reg_or_fail (REG_TYPE_R64_SP);
+ po_char_or_fail (']');
+ break;
+ }
case AARCH64_OPND_ADDR_SIMPLE:
case AARCH64_OPND_SIMD_ADDR_SIMPLE:
{
@@ -7390,6 +7435,26 @@ parse_operands (char *str, const aarch64_opcode *opcode)
/* skip_p */ 0);
break;
+ case AARCH64_OPND_RCPC3_ADDR_OFFSET:
+ po_misc_or_fail (parse_address (&str, info));
+ if (info->addr.pcrel || info->addr.offset.is_reg
+ || !info->addr.preind || info->addr.postind
+ || info->addr.writeback)
+ {
+ set_syntax_error (_("invalid addressing mode"));
+ goto failure;
+ }
+ if (inst.reloc.type != BFD_RELOC_UNUSED)
+ {
+ set_syntax_error (_("relocation not allowed"));
+ goto failure;
+ }
+ assign_imm_if_const_or_fixup_later (&inst.reloc, info,
+ /* addr_off_p */ 1,
+ /* need_libopcodes_p */ 1,
+ /* skip_p */ 0);
+ break;
+
case AARCH64_OPND_ADDR_UIMM12:
po_misc_or_fail (parse_address (&str, info));
if (info->addr.pcrel || info->addr.offset.is_reg