void
md_begin (void)
{
- struct d30v_opcode *opcode;
+ const struct d30v_opcode *opcode;
d30v_hash = str_htab_create ();
/* Insert opcode names into a hash table. */
- for (opcode = (struct d30v_opcode *) d30v_opcode_table; opcode->name; opcode++)
+ for (opcode = d30v_opcode_table; opcode->name; opcode++)
str_hash_insert (d30v_hash, opcode->name, opcode, 0);
fixups = &FixUps[0];
int i, bits, shift, flags;
unsigned long number, id = 0;
long long insn;
- struct d30v_opcode *op = opcode->op;
- struct d30v_format *form = opcode->form;
+ const struct d30v_opcode *op = opcode->op;
+ const struct d30v_format *form = opcode->form;
insn =
opcode->ecc << 28 | op->op1 << 25 | op->op2 << 20 | form->modifier << 18;
int i, j, shift, regno, bits, ecc;
unsigned long flags, mask, flags_set1, flags_set2, flags_used1, flags_used2;
unsigned long ins, mod_reg[2][3], used_reg[2][3], flag_reg[2];
- struct d30v_format *f;
- struct d30v_opcode *op;
+ const struct d30v_format *f;
+ const struct d30v_opcode *op;
/* Section 4.3: Both instructions must not be IU or MU only. */
if ((op1->op->unit == IU && op2->op->unit == IU)
It must look at all formats for an opcode and use the operands
to choose the correct one. Return NULL on error. */
-static struct d30v_format *
-find_format (struct d30v_opcode *opcode,
+static const struct d30v_format *
+find_format (const struct d30v_opcode *opcode,
expressionS myops[],
int fsize,
int cmp_hack)
{
int match, opcode_index, i = 0, j, k;
- struct d30v_format *fm;
+ const struct d30v_format *fm;
if (opcode == NULL)
return NULL;
if (fsize == FORCE_LONG && opcode_index < LONG)
continue;
- fm = (struct d30v_format *) &d30v_format_table[opcode_index];
+ fm = &d30v_format_table[opcode_index];
k = opcode_index;
while (fm->form == opcode_index)
{
return fm;
}
- fm = (struct d30v_format *) &d30v_format_table[++k];
+ fm = &d30v_format_table[++k];
}
}
return NULL;
if (startswith (name, "cmp"))
{
int p, i;
- char **d30v_str = (char **) d30v_cc_names;
+ const char **d30v_str = d30v_cc_names;
if (name[3] == 'u')
p = 4;