+2005-06-08 Tomas Hurka <tom@hukatronic.cz>
+
+ PR991
+ * config/tc-m68k.c (m68k_ip): Test for insn compatiblity using a
+ temporary copy of the operands array so that changes can be safely
+ backed out if the insn does not match.
+ (m68k_compare_opcode): Shortcut the test when the parameters are
+ the same. Return 1 if the names match but the second opcode is
+ further on in the array than the first.
+
2005-06-08 Nick Clifton <nickc@redhat.com>
PR 994
char c;
int losing;
int opsfound;
+ struct m68k_op operands_backup[6];
LITTLENUM_TYPE words[6];
LITTLENUM_TYPE *wordp;
unsigned long ok_arch = 0;
++losing;
else
{
- for (s = opcode->m_operands, opP = &the_ins.operands[0];
+ int i;
+
+ /* Make a copy of the operands of this insn so that
+ we can modify them safely, should we want to. */
+ assert (opsfound <= (int) ARRAY_SIZE (operands_backup));
+ for (i = 0; i < opsfound; i++)
+ operands_backup[i] = the_ins.operands[i];
+
+ for (s = opcode->m_operands, opP = &operands_backup[0];
*s && !losing;
s += 2, opP++)
{
if (losing)
break;
}
+
+ /* Since we have found the correct instruction, copy
+ in the modifications that we may have made. */
+ if (!losing)
+ for (i = 0; i < opsfound; i++)
+ the_ins.operands[i] = operands_backup[i];
}
if (!losing)
struct m68k_opcode * op1, * op2;
int ret;
+ if (v1 == v2)
+ return 0;
+
op1 = *(struct m68k_opcode **) v1;
op2 = *(struct m68k_opcode **) v2;
return ret;
if (op1 < op2)
return -1;
- return 0;
+ return 1;
}
void