summaryrefslogtreecommitdiff
path: root/opcodes/cr16-dis.c
diff options
context:
space:
mode:
authorM R Swami Reddy <MR.Swami.Reddy@nsc.com>2008-11-27 11:30:33 +0000
committerM R Swami Reddy <MR.Swami.Reddy@nsc.com>2008-11-27 11:30:33 +0000
commita03d61fe3104656ec3f7a94ce40adef7d86f9ced (patch)
tree36d9eb465546a9b9f03136d16dddfa4fef7847cf /opcodes/cr16-dis.c
parente56d6aa5442bbcd153073ea3d4391d355d024312 (diff)
downloadbinutils-redhat-a03d61fe3104656ec3f7a94ce40adef7d86f9ced.tar.gz
* cr16-dis.c (match_opcode): Truncate mcode to 32 bit and
adjusted the mask for 32-bit branch instruction.
Diffstat (limited to 'opcodes/cr16-dis.c')
-rw-r--r--opcodes/cr16-dis.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/opcodes/cr16-dis.c b/opcodes/cr16-dis.c
index de3eb753bf..2627141d0f 100644
--- a/opcodes/cr16-dis.c
+++ b/opcodes/cr16-dis.c
@@ -322,7 +322,7 @@ match_opcode (void)
{
unsigned long mask;
/* 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. */
instruction = &cr16_instruction[NUMOPCODES - 2];
@@ -331,6 +331,10 @@ match_opcode (void)
while (instruction >= cr16_instruction)
{
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,
instruction->match_bits))
return 1;