opcodes: blackfin: avoid duplicate memory reads
[deliverable/binutils-gdb.git] / opcodes / bfin-dis.c
index b8bc08788f5049edd4b94af497ec69ccb01d4b4b..e7d6706a95283b6b672bb68ce455d3233260bf32 100644 (file)
@@ -44,6 +44,7 @@ typedef unsigned int bu32;
 
 struct private
 {
+  TIword iw0;
   int comment, parallel;
 };
 
@@ -4697,6 +4698,7 @@ _print_insn_bfin (bfd_vma pc, disassemble_info *outf)
 
   if (ifetch (pc, outf, &iw0))
     return -1;
+  priv->iw0 = iw0;
 
   if ((iw0 & 0xc000) == 0xc000)
     {
@@ -4803,12 +4805,8 @@ int
 print_insn_bfin (bfd_vma pc, disassemble_info *outf)
 {
   struct private priv;
-  TIword iw0;
   int count;
 
-  if (ifetch (pc, outf, &iw0) == -1)
-    return -1;
-
   priv.parallel = 0;
   priv.comment = 0;
   outf->private_data = &priv;
@@ -4819,8 +4817,8 @@ print_insn_bfin (bfd_vma pc, disassemble_info *outf)
 
   /* Proper display of multiple issue instructions.  */
 
-  if (count == 4 && (iw0 & 0xc000) == 0xc000 && (iw0 & BIT_MULTI_INS)
-      && ((iw0 & 0xe800) != 0xe800 /* Not Linkage.  */ ))
+  if (count == 4 && (priv.iw0 & 0xc000) == 0xc000 && (priv.iw0 & BIT_MULTI_INS)
+      && ((priv.iw0 & 0xe800) != 0xe800 /* Not Linkage.  */ ))
     {
       int legal = 1;
       int len;
This page took 0.023665 seconds and 4 git commands to generate.