Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static const struct powerpc_opcode *
- svp64_lookup (uint64_t insn, ppc_cpu_t dialect,
- struct svp64_ctx *svp64)
- {
- uint32_t suffix;
- unsigned long op;
- const struct powerpc_opcode *opcode;
- const struct svp64_record *record;
- const struct svp64_record *record_end;
- 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);
- opcode = lookup_powerpc (suffix, dialect & ~PPC_OPCODE_ANY);
- if (opcode == NULL && (dialect & PPC_OPCODE_ANY) != 0)
- opcode = lookup_powerpc (suffix, dialect);
- if (opcode == NULL)
- return NULL;
- op = SVP64_OP (suffix);
- record_end = (svp64_records + svp64_record_indices[op + 1]);
- for (record = svp64_records + svp64_record_indices[op];
- record < record_end;
- ++record)
- {
- /* binutils consider Rc bit to be a part of the mask.
- SVP64, however, has per-instruction mask. */
- if ((record->opcode.value & record->opcode.mask) ==
- ((opcode->opcode & opcode->mask) & record->opcode.mask))
- break;
- }
- if (record == record_end)
- return NULL;
- svp64->desc = &record->desc;
- return opcode;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement