static void
print_insn_powerpc_opcode (struct disassemble_info *info,
bfd_vma memaddr, uint64_t insn, ppc_cpu_t dialect,
- const struct powerpc_opcode *opcode)
+ const struct powerpc_opcode *opcode,
+ const struct svp64_ctx *svp64 ATTRIBUTE_UNUSED)
{
const ppc_opindex_t *opindex;
const struct powerpc_operand *operand;
bfd_byte buffer[4];
int status;
uint64_t insn;
+ struct svp64_ctx svp64_ctx;
+ const struct svp64_ctx *svp64;
const struct powerpc_opcode *opcode;
int insn_length = 4; /* Assume we have a normal 4-byte instruction. */
insn = bfd_getl32 (buffer);
/* Get the major opcode of the insn. */
+ svp64 = NULL;
opcode = NULL;
if ((dialect & (PPC_OPCODE_POWER10 | PPC_OPCODE_SVP64)) != 0
&& PPC_OP (insn) == 0x1)
if ((dialect & PPC_OPCODE_SVP64) != 0)
{
- opcode = svp64_lookup (temp_insn, dialect);
+ opcode = svp64_lookup (temp_insn, dialect, &svp64_ctx);
if (opcode != NULL)
{
+ svp64 = &svp64_ctx;
insn = temp_insn;
insn_length = 8;
}
(unsigned int) insn);
}
else
- print_insn_powerpc_opcode (info, memaddr, insn, dialect, opcode);
+ print_insn_powerpc_opcode (info, memaddr, insn, dialect, opcode, svp64);
return insn_length;
}
}
static const struct powerpc_opcode *
-svp64_lookup (uint64_t insn, ppc_cpu_t dialect)
+svp64_lookup (uint64_t insn, ppc_cpu_t dialect,
+ struct svp64_ctx *svp64)
{
uint32_t suffix;
unsigned long op;
const struct svp64_record *record;
const struct svp64_record *record_start;
const struct svp64_record *record_end;
- struct svp64_insn svp64_insn = {insn};
- if ((svp64_insn_get_prefix_PO (&svp64_insn) != 0x1) ||
- (svp64_insn_get_prefix_id (&svp64_insn) != 0x3))
+ svp64_insn_set (&svp64->insn, insn);
+
+ if ((svp64_insn_get_prefix_PO (&svp64->insn) != 0x1) ||
+ (svp64_insn_get_prefix_id (&svp64->insn) != 0x3))
return NULL;
- suffix = (uint32_t)svp64_insn_get_suffix (&svp64_insn);
+ suffix = (uint32_t)svp64_insn_get_suffix (&svp64->insn);
opcode = lookup_powerpc (suffix, dialect & ~PPC_OPCODE_ANY);
if (opcode == NULL && (dialect & PPC_OPCODE_ANY) != 0)
opcode = lookup_powerpc (suffix, dialect);
if (record == NULL)
return NULL;
+ svp64->name = record->name;
+ svp64->desc = &record->desc;
+
return opcode;
}