-/* Find long instructions matching values in INSN array. */
-
-static const struct arc_long_opcode *
-find_format_long_instructions (unsigned *insn,
- unsigned int *insn_len,
- unsigned isa_mask,
- bfd_vma memaddr,
- struct disassemble_info *info)
-{
- unsigned int i;
- unsigned limm = 0;
- bfd_boolean limm_loaded = FALSE;
-
- for (i = 0; i < arc_num_long_opcodes; ++i)
- {
- bfd_byte buffer[4];
- int status;
- const struct arc_opcode *opcode;
-
- opcode = &arc_long_opcodes[i].base_opcode;
-
- if (ARC_SHORT (opcode->mask) && (*insn_len == 2))
- {
- if (OPCODE_AC (opcode->opcode) != OPCODE_AC (insn[0]))
- continue;
- }
- else if (!ARC_SHORT (opcode->mask) && (*insn_len == 4))
- {
- if (OPCODE (opcode->opcode) != OPCODE (insn[0]))
- continue;
- }
- else
- continue;
-
- if ((insn[0] ^ opcode->opcode) & opcode->mask)
- continue;
-
- if (!(opcode->cpu & isa_mask))
- continue;
-
- if (!limm_loaded)
- {
- status = (*info->read_memory_func) (memaddr + *insn_len, buffer,
- 4, info);
- if (status != 0)
- return NULL;
-
- limm = ARRANGE_ENDIAN (info, buffer);
- limm_loaded = TRUE;
- }
-
- /* Check the second word using the mask and template. */
- if ((limm & arc_long_opcodes[i].limm_mask)
- != arc_long_opcodes[i].limm_template)
- continue;
-
- (*insn_len) += 4;
- insn[1] = limm;
- return &arc_long_opcodes[i];
- }
-
- return NULL;
-}
-