* cr16-dis.c (match_opcode): Truncate mcode to 32 bit and

adjusted the mask for 32-bit branch instruction.
This commit is contained in:
M R Swami Reddy 2008-11-27 11:30:33 +00:00
parent e1c93c699b
commit 59b098c970
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2008-11-27 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
* cr16-dis.c (match_opcode): Truncate mcode to 32 bit and
adjusted the mask for 32-bit branch instruction.
2008-11-27 Alan Modra <amodra@bigpond.net.au> 2008-11-27 Alan Modra <amodra@bigpond.net.au>
* ppc-opc.c (extract_sprg): Correct operand range check. * ppc-opc.c (extract_sprg): Correct operand range check.

View file

@ -322,7 +322,7 @@ match_opcode (void)
{ {
unsigned long mask; unsigned long mask;
/* The instruction 'constant' opcode doewsn't exceed 32 bits. */ /* The instruction 'constant' opcode doewsn't exceed 32 bits. */
unsigned long doubleWord = words[1] + (words[0] << 16); unsigned long doubleWord = (words[1] + (words[0] << 16)) & 0xffffffff;
/* Start searching from end of instruction table. */ /* Start searching from end of instruction table. */
instruction = &cr16_instruction[NUMOPCODES - 2]; instruction = &cr16_instruction[NUMOPCODES - 2];
@ -331,6 +331,10 @@ match_opcode (void)
while (instruction >= cr16_instruction) while (instruction >= cr16_instruction)
{ {
mask = build_mask (); mask = build_mask ();
/* Adjust mask for bcond with 32-bit size instruction */
if ((IS_INSN_MNEMONIC("b") && instruction->size == 2))
mask = 0xff0f0000;
if ((doubleWord & mask) == BIN (instruction->match, if ((doubleWord & mask) == BIN (instruction->match,
instruction->match_bits)) instruction->match_bits))
return 1; return 1;