X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=opcodes%2Faarch64-asm.c;h=3dcd84a5cb72af95f93223df129f7d9a5370c626;hb=2480b6fa946bb2d2dc993b1c4a83a8e1258a75e8;hp=fd356f44691093c205640c8d3b5f579df9c58cc1;hpb=165d4950855493dd904a7996e7fcf58880d54219;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/aarch64-asm.c b/opcodes/aarch64-asm.c index fd356f4469..3dcd84a5cb 100644 --- a/opcodes/aarch64-asm.c +++ b/opcodes/aarch64-asm.c @@ -1,5 +1,5 @@ /* aarch64-asm.c -- AArch64 assembler support. - Copyright (C) 2012-2016 Free Software Foundation, Inc. + Copyright (C) 2012-2019 Free Software Foundation, Inc. Contributed by ARM Ltd. This file is part of the GNU opcodes library. @@ -22,6 +22,7 @@ #include #include "libiberty.h" #include "aarch64-asm.h" +#include "opintl.h" /* Utilities. */ @@ -78,21 +79,23 @@ insert_all_fields (const aarch64_operand *self, aarch64_insn *code, /* Operand inserters. */ /* Insert register number. */ -const char * +bfd_boolean aarch64_ins_regno (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { insert_field (self->fields[0], code, info->reg.regno, 0); - return NULL; + return TRUE; } /* Insert register number, index and/or other data for SIMD register element operand, e.g. the last source operand in SQDMLAL , , .[]. */ -const char * +bfd_boolean aarch64_ins_reglane (const aarch64_operand *self, const aarch64_opnd_info *info, - aarch64_insn *code, const aarch64_inst *inst) + aarch64_insn *code, const aarch64_inst *inst, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { /* regno */ insert_field (self->fields[0], code, info->reglane.regno, inst->opcode->mask); @@ -121,50 +124,83 @@ aarch64_ins_reglane (const aarch64_operand *self, const aarch64_opnd_info *info, insert_field (FLD_imm5, code, value, 0); } } + else if (inst->opcode->iclass == dotproduct) + { + unsigned reglane_index = info->reglane.index; + switch (info->qualifier) + { + case AARCH64_OPND_QLF_S_4B: + case AARCH64_OPND_QLF_S_2H: + /* L:H */ + assert (reglane_index < 4); + insert_fields (code, reglane_index, 0, 2, FLD_L, FLD_H); + break; + default: + assert (0); + } + } + else if (inst->opcode->iclass == cryptosm3) + { + /* index for e.g. SM3TT2A .4S, .4S, S[]. */ + unsigned reglane_index = info->reglane.index; + assert (reglane_index < 4); + insert_field (FLD_SM3_imm2, code, reglane_index, 0); + } else { /* index for e.g. SQDMLAL , , .[] or SQDMLAL , , .[]. */ + unsigned reglane_index = info->reglane.index; + + if (inst->opcode->op == OP_FCMLA_ELEM) + /* Complex operand takes two elements. */ + reglane_index *= 2; + switch (info->qualifier) { case AARCH64_OPND_QLF_S_H: /* H:L:M */ - insert_fields (code, info->reglane.index, 0, 3, FLD_M, FLD_L, FLD_H); + assert (reglane_index < 8); + insert_fields (code, reglane_index, 0, 3, FLD_M, FLD_L, FLD_H); break; case AARCH64_OPND_QLF_S_S: /* H:L */ - insert_fields (code, info->reglane.index, 0, 2, FLD_L, FLD_H); + assert (reglane_index < 4); + insert_fields (code, reglane_index, 0, 2, FLD_L, FLD_H); break; case AARCH64_OPND_QLF_S_D: /* H */ - insert_field (FLD_H, code, info->reglane.index, 0); + assert (reglane_index < 2); + insert_field (FLD_H, code, reglane_index, 0); break; default: assert (0); } } - return NULL; + return TRUE; } /* Insert regno and len field of a register list operand, e.g. Vn in TBL. */ -const char * +bfd_boolean aarch64_ins_reglist (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { /* R */ insert_field (self->fields[0], code, info->reglist.first_regno, 0); /* len */ insert_field (FLD_len, code, info->reglist.num_regs - 1, 0); - return NULL; + return TRUE; } /* Insert Rt and opcode fields for a register list operand, e.g. Vt in AdvSIMD load/store instructions. */ -const char * +bfd_boolean aarch64_ins_ldst_reglist (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst) + const aarch64_inst *inst, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { aarch64_insn value = 0; /* Number of elements in each structure to be loaded/stored. */ @@ -199,15 +235,16 @@ aarch64_ins_ldst_reglist (const aarch64_operand *self ATTRIBUTE_UNUSED, } insert_field (FLD_opcode, code, value, 0); - return NULL; + return TRUE; } /* Insert Rt and S fields for a register list operand, e.g. Vt in AdvSIMD load single structure to all lanes instructions. */ -const char * +bfd_boolean aarch64_ins_ldst_reglist_r (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst) + const aarch64_inst *inst, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { aarch64_insn value; /* The opcode dependent area stores the number of elements in @@ -224,15 +261,16 @@ aarch64_ins_ldst_reglist_r (const aarch64_operand *self ATTRIBUTE_UNUSED, value = (aarch64_insn) 1; insert_field (FLD_S, code, value, 0); - return NULL; + return TRUE; } /* Insert Q, opcode<2:1>, S, size and Rt fields for a register element list operand e.g. Vt in AdvSIMD load/store single element instructions. */ -const char * +bfd_boolean aarch64_ins_ldst_elemlist (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { aarch64_field field = {0, 0}; aarch64_insn QSsize = 0; /* fields Q:S:size. */ @@ -272,16 +310,17 @@ aarch64_ins_ldst_elemlist (const aarch64_operand *self ATTRIBUTE_UNUSED, gen_sub_field (FLD_asisdlso_opcode, 1, 2, &field); insert_field_2 (&field, code, opcodeh2, 0); - return NULL; + return TRUE; } /* Insert fields immh:immb and/or Q for e.g. the shift immediate in SSHR ., ., # or SSHR , , #. */ -const char * +bfd_boolean aarch64_ins_advsimd_imm_shift (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, - aarch64_insn *code, const aarch64_inst *inst) + aarch64_insn *code, const aarch64_inst *inst, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { unsigned val = aarch64_get_qualifier_standard_value (info->qualifier); aarch64_insn Q, imm; @@ -327,45 +366,51 @@ aarch64_ins_advsimd_imm_shift (const aarch64_operand *self ATTRIBUTE_UNUSED, imm = info->imm.value + (8 << (unsigned)val); insert_fields (code, imm, 0, 2, FLD_immb, FLD_immh); - return NULL; + return TRUE; } /* Insert fields for e.g. the immediate operands in BFM , , #, #. */ -const char * +bfd_boolean aarch64_ins_imm (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { int64_t imm; imm = info->imm.value; if (operand_need_shift_by_two (self)) imm >>= 2; + if (operand_need_shift_by_four (self)) + imm >>= 4; insert_all_fields (self, code, imm); - return NULL; + return TRUE; } /* Insert immediate and its shift amount for e.g. the last operand in MOVZ , #{, LSL #}. */ -const char * +bfd_boolean aarch64_ins_imm_half (const aarch64_operand *self, const aarch64_opnd_info *info, - aarch64_insn *code, const aarch64_inst *inst) + aarch64_insn *code, const aarch64_inst *inst, + aarch64_operand_error *errors) { /* imm16 */ - aarch64_ins_imm (self, info, code, inst); + aarch64_ins_imm (self, info, code, inst, errors); /* hw */ insert_field (FLD_hw, code, info->shifter.amount >> 4, 0); - return NULL; + return TRUE; } /* Insert cmode and "a:b:c:d:e:f:g:h" fields for e.g. the last operand in MOVI ., # {, LSL #}. */ -const char * +bfd_boolean aarch64_ins_advsimd_imm_modified (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors + ATTRIBUTE_UNUSED) { enum aarch64_opnd_qualifier opnd0_qualifier = inst->operands[0].qualifier; uint64_t imm = info->imm.value; @@ -387,7 +432,7 @@ aarch64_ins_advsimd_imm_modified (const aarch64_operand *self ATTRIBUTE_UNUSED, insert_fields (code, imm, 0, 2, FLD_defgh, FLD_abc); if (kind == AARCH64_MOD_NONE) - return NULL; + return TRUE; /* shift amount partially in cmode */ assert (kind == AARCH64_MOD_LSL || kind == AARCH64_MOD_MSL); @@ -399,7 +444,7 @@ aarch64_ins_advsimd_imm_modified (const aarch64_operand *self ATTRIBUTE_UNUSED, /* For 8-bit move immediate, the optional LSL #0 does not require encoding. */ if (esize == 1) - return NULL; + return TRUE; amount >>= 3; if (esize == 4) gen_sub_field (FLD_cmode, 1, 2, &field); /* per word */ @@ -414,50 +459,80 @@ aarch64_ins_advsimd_imm_modified (const aarch64_operand *self ATTRIBUTE_UNUSED, } insert_field_2 (&field, code, amount, 0); - return NULL; + return TRUE; } /* Insert fields for an 8-bit floating-point immediate. */ -const char * +bfd_boolean aarch64_ins_fpimm (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { insert_all_fields (self, code, info->imm.value); - return NULL; + return TRUE; +} + +/* Insert 1-bit rotation immediate (#90 or #270). */ +bfd_boolean +aarch64_ins_imm_rotate1 (const aarch64_operand *self, + const aarch64_opnd_info *info, + aarch64_insn *code, const aarch64_inst *inst, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) +{ + uint64_t rot = (info->imm.value - 90) / 180; + assert (rot < 2U); + insert_field (self->fields[0], code, rot, inst->opcode->mask); + return TRUE; +} + +/* Insert 2-bit rotation immediate (#0, #90, #180 or #270). */ +bfd_boolean +aarch64_ins_imm_rotate2 (const aarch64_operand *self, + const aarch64_opnd_info *info, + aarch64_insn *code, const aarch64_inst *inst, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) +{ + uint64_t rot = info->imm.value / 90; + assert (rot < 4U); + insert_field (self->fields[0], code, rot, inst->opcode->mask); + return TRUE; } /* Insert # for the immediate operand in fp fix-point instructions, e.g. SCVTF
, , #. */ -const char * +bfd_boolean aarch64_ins_fbits (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { insert_field (self->fields[0], code, 64 - info->imm.value, 0); - return NULL; + return TRUE; } /* Insert arithmetic immediate for e.g. the last operand in SUBS , , # {, }. */ -const char * +bfd_boolean aarch64_ins_aimm (const aarch64_operand *self, const aarch64_opnd_info *info, - aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED) + aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { /* shift */ aarch64_insn value = info->shifter.amount ? 1 : 0; insert_field (self->fields[0], code, value, 0); /* imm12 (unsigned) */ insert_field (self->fields[1], code, info->imm.value, 0); - return NULL; + return TRUE; } /* Common routine shared by aarch64_ins{,_inv}_limm. INVERT_P says whether the operand should be inverted before encoding. */ -static const char * +static bfd_boolean aarch64_ins_limm_1 (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst, bfd_boolean invert_p) + const aarch64_inst *inst, bfd_boolean invert_p, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { aarch64_insn value; uint64_t imm = info->imm.value; @@ -465,46 +540,48 @@ aarch64_ins_limm_1 (const aarch64_operand *self, if (invert_p) imm = ~imm; - if (aarch64_logical_immediate_p (imm, esize, &value) == FALSE) - /* The constraint check should have guaranteed this wouldn't happen. */ - assert (0); + /* The constraint check should have guaranteed this wouldn't happen. */ + assert (aarch64_logical_immediate_p (imm, esize, &value)); insert_fields (code, value, 0, 3, self->fields[2], self->fields[1], self->fields[0]); - return NULL; + return TRUE; } /* Insert logical/bitmask immediate for e.g. the last operand in ORR , , #. */ -const char * +bfd_boolean aarch64_ins_limm (const aarch64_operand *self, const aarch64_opnd_info *info, - aarch64_insn *code, const aarch64_inst *inst) + aarch64_insn *code, const aarch64_inst *inst, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { return aarch64_ins_limm_1 (self, info, code, inst, - inst->opcode->op == OP_BIC); + inst->opcode->op == OP_BIC, errors); } /* Insert a logical/bitmask immediate for the BIC alias of AND (etc.). */ -const char * +bfd_boolean aarch64_ins_inv_limm (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst) + const aarch64_inst *inst, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { - return aarch64_ins_limm_1 (self, info, code, inst, TRUE); + return aarch64_ins_limm_1 (self, info, code, inst, TRUE, errors); } /* Encode Ft for e.g. STR , [, {, {}}] or LDP , , [], #. */ -const char * +bfd_boolean aarch64_ins_ft (const aarch64_operand *self, const aarch64_opnd_info *info, - aarch64_insn *code, const aarch64_inst *inst) + aarch64_insn *code, const aarch64_inst *inst, + aarch64_operand_error *errors) { aarch64_insn value = 0; assert (info->idx == 0); /* Rt */ - aarch64_ins_regno (self, info, code, inst); + aarch64_ins_regno (self, info, code, inst, errors); if (inst->opcode->iclass == ldstpair_indexed || inst->opcode->iclass == ldstnapair_offs || inst->opcode->iclass == ldstpair_off @@ -527,26 +604,28 @@ aarch64_ins_ft (const aarch64_operand *self, const aarch64_opnd_info *info, insert_fields (code, value, 0, 2, FLD_ldst_size, FLD_opc1); } - return NULL; + return TRUE; } /* Encode the address operand for e.g. STXRB , , [{,#0}]. */ -const char * +bfd_boolean aarch64_ins_addr_simple (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { /* Rn */ insert_field (FLD_Rn, code, info->addr.base_regno, 0); - return NULL; + return TRUE; } /* Encode the address operand for e.g. STR , [, {, {}}]. */ -const char * +bfd_boolean aarch64_ins_addr_regoff (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { aarch64_insn S; enum aarch64_modifier_kind kind = info->shifter.kind; @@ -571,15 +650,40 @@ aarch64_ins_addr_regoff (const aarch64_operand *self ATTRIBUTE_UNUSED, S = info->shifter.operator_present && info->shifter.amount_present; insert_field (FLD_S, code, S, 0); - return NULL; + return TRUE; +} + +/* Encode the address operand for e.g. + stlur , [{, }]. */ +bfd_boolean +aarch64_ins_addr_offset (const aarch64_operand *self ATTRIBUTE_UNUSED, + const aarch64_opnd_info *info, aarch64_insn *code, + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) +{ + /* Rn */ + insert_field (self->fields[0], code, info->addr.base_regno, 0); + + /* simm9 */ + int imm = info->addr.offset.imm; + insert_field (self->fields[1], code, imm, 0); + + /* writeback */ + if (info->addr.writeback) + { + assert (info->addr.preind == 1 && info->addr.postind == 0); + insert_field (self->fields[2], code, 1, 0); + } + return TRUE; } /* Encode the address operand for e.g. LDRSW , [, #]!. */ -const char * +bfd_boolean aarch64_ins_addr_simm (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { int imm; @@ -587,7 +691,8 @@ aarch64_ins_addr_simm (const aarch64_operand *self, insert_field (FLD_Rn, code, info->addr.base_regno, 0); /* simm (imm9 or imm7) */ imm = info->addr.offset.imm; - if (self->fields[0] == FLD_imm7) + if (self->fields[0] == FLD_imm7 + || info->qualifier == AARCH64_OPND_QLF_imm_tag) /* scaled immediate in ld/st pair instructions.. */ imm >>= get_logsz (aarch64_get_qualifier_esize (info->qualifier)); insert_field (self->fields[0], code, imm, 0); @@ -603,15 +708,41 @@ aarch64_ins_addr_simm (const aarch64_operand *self, insert_field (self->fields[1], code, 1, 0); } - return NULL; + return TRUE; +} + +/* Encode the address operand for e.g. LDRAA , [{, #}]. */ +bfd_boolean +aarch64_ins_addr_simm10 (const aarch64_operand *self, + const aarch64_opnd_info *info, + aarch64_insn *code, + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) +{ + int imm; + + /* Rn */ + insert_field (self->fields[0], code, info->addr.base_regno, 0); + /* simm10 */ + imm = info->addr.offset.imm >> 3; + insert_field (self->fields[1], code, imm >> 9, 0); + insert_field (self->fields[2], code, imm, 0); + /* writeback */ + if (info->addr.writeback) + { + assert (info->addr.preind == 1 && info->addr.postind == 0); + insert_field (self->fields[3], code, 1, 0); + } + return TRUE; } /* Encode the address operand for e.g. LDRSW , [{, #}]. */ -const char * +bfd_boolean aarch64_ins_addr_uimm12 (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { int shift = get_logsz (aarch64_get_qualifier_esize (info->qualifier)); @@ -619,15 +750,16 @@ aarch64_ins_addr_uimm12 (const aarch64_operand *self, insert_field (self->fields[0], code, info->addr.base_regno, 0); /* uimm12 */ insert_field (self->fields[1], code,info->addr.offset.imm >> shift, 0); - return NULL; + return TRUE; } /* Encode the address operand for e.g. LD1 {., ., .}, [], >. */ -const char * +bfd_boolean aarch64_ins_simd_addr_post (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { /* Rn */ insert_field (FLD_Rn, code, info->addr.base_regno, 0); @@ -636,100 +768,138 @@ aarch64_ins_simd_addr_post (const aarch64_operand *self ATTRIBUTE_UNUSED, insert_field (FLD_Rm, code, info->addr.offset.regno, 0); else insert_field (FLD_Rm, code, 0x1f, 0); - return NULL; + return TRUE; } /* Encode the condition operand for e.g. CSEL , , , . */ -const char * +bfd_boolean aarch64_ins_cond (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { /* cond */ insert_field (FLD_cond, code, info->cond->value, 0); - return NULL; + return TRUE; } /* Encode the system register operand for e.g. MRS , . */ -const char * +bfd_boolean aarch64_ins_sysreg (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) -{ + const aarch64_inst *inst, + aarch64_operand_error *detail ATTRIBUTE_UNUSED) +{ + /* If a system instruction check if we have any restrictions on which + registers it can use. */ + if (inst->opcode->iclass == ic_system) + { + uint64_t opcode_flags + = inst->opcode->flags & (F_SYS_READ | F_SYS_WRITE); + uint32_t sysreg_flags + = info->sysreg.flags & (F_REG_READ | F_REG_WRITE); + + /* Check to see if it's read-only, else check if it's write only. + if it's both or unspecified don't care. */ + if (opcode_flags == F_SYS_READ + && sysreg_flags + && sysreg_flags != F_REG_READ) + { + detail->kind = AARCH64_OPDE_SYNTAX_ERROR; + detail->error = _("specified register cannot be read from"); + detail->index = info->idx; + detail->non_fatal = TRUE; + } + else if (opcode_flags == F_SYS_WRITE + && sysreg_flags + && sysreg_flags != F_REG_WRITE) + { + detail->kind = AARCH64_OPDE_SYNTAX_ERROR; + detail->error = _("specified register cannot be written to"); + detail->index = info->idx; + detail->non_fatal = TRUE; + } + } /* op0:op1:CRn:CRm:op2 */ - insert_fields (code, info->sysreg, inst->opcode->mask, 5, + insert_fields (code, info->sysreg.value, inst->opcode->mask, 5, FLD_op2, FLD_CRm, FLD_CRn, FLD_op1, FLD_op0); - return NULL; + return TRUE; } /* Encode the PSTATE field operand for e.g. MSR , #. */ -const char * +bfd_boolean aarch64_ins_pstatefield (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { /* op1:op2 */ insert_fields (code, info->pstatefield, inst->opcode->mask, 2, FLD_op2, FLD_op1); - return NULL; + return TRUE; } /* Encode the system instruction op operand for e.g. AT , . */ -const char * +bfd_boolean aarch64_ins_sysins_op (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst ATTRIBUTE_UNUSED) + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) { /* op1:CRn:CRm:op2 */ insert_fields (code, info->sysins_op->value, inst->opcode->mask, 4, FLD_op2, FLD_CRm, FLD_CRn, FLD_op1); - return NULL; + return TRUE; } /* Encode the memory barrier option operand for e.g. DMB