aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-02-05 16:47:02 -0500
committerMike Frysinger <vapier@gentoo.org>2014-08-14 09:07:37 -0400
commita4e600b22e938e766fefa9bd0ab111e262e639a6 (patch)
tree86eecd66fb47180f236dfb8504e232550efb5867
parent513ea82edf8533e3483073561c06be97de035c83 (diff)
downloadfsf-binutils-gdb-a4e600b22e938e766fefa9bd0ab111e262e639a6.zip
fsf-binutils-gdb-a4e600b22e938e766fefa9bd0ab111e262e639a6.tar.gz
fsf-binutils-gdb-a4e600b22e938e766fefa9bd0ab111e262e639a6.tar.bz2
opcodes: blackfin: avoid duplicate memory reads
Rather than reading the same memory twice, pass the value back up. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--opcodes/ChangeLog6
-rw-r--r--opcodes/bfin-dis.c10
2 files changed, 10 insertions, 6 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 4e7c93a..5157099 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
+2014-08-14 Mike Frysinger <vapier@gentoo.org>
+
+ * bfin-dis.c (struct private): Add iw0.
+ (_print_insn_bfin): Assign iw0 to priv.iw0.
+ (print_insn_bfin): Drop ifetch and use priv.iw0.
+
2014-08-13 Mike Frysinger <vapier@gentoo.org>
* bfin-dis.c (comment, parallel): Move from global scope ...
diff --git a/opcodes/bfin-dis.c b/opcodes/bfin-dis.c
index b8bc087..e7d6706 100644
--- a/opcodes/bfin-dis.c
+++ b/opcodes/bfin-dis.c
@@ -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;