summaryrefslogtreecommitdiff
path: root/include/opcode/bfin.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-06-18 19:42:54 +0000
committerMike Frysinger <vapier@gentoo.org>2011-06-18 19:42:54 +0000
commitc30bf4601d21d93ae0f9ed31e237b0b8c03822c9 (patch)
tree16e70283a61fb47f5d52426f761f02ed6df258a9 /include/opcode/bfin.h
parentf720bcda3e9d8725627934b8bd69245ac9dd8df6 (diff)
downloadgdb-c30bf4601d21d93ae0f9ed31e237b0b8c03822c9.tar.gz
sim: bfin: fix sign extension in dsp insns with MM flag
After testing the hardware with all the different dsp flags, the MM flag triggers sign extension in all modes. So drop the limited use of it, and the local custom helper that was also extending unsigned values. We also can see that the flag checks in the mult/mac insns have the same behavior with sign extending, so add a helper func to keep the logic the same in both places. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'include/opcode/bfin.h')
-rwxr-xr-xinclude/opcode/bfin.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/opcode/bfin.h b/include/opcode/bfin.h
index 30bb90d26c5..26f019381b3 100755
--- a/include/opcode/bfin.h
+++ b/include/opcode/bfin.h
@@ -53,6 +53,12 @@ static inline int is_macmod_hmove (int x)
|| (x == M_TFU) || (x == M_S2RND) || (x == M_ISS2) || (x == M_IH);
}
+static inline int is_macmod_signed (int x)
+{
+ return (x == 0) || (x == M_IS) || (x == M_T) || (x == M_S2RND)
+ || (x == M_ISS2) || (x == M_IH) || (x == M_W32);
+}
+
/* dsp32mac
+----+----+---+---|---+----+----+---|---+---+---+---|---+---+---+---+
| 1 | 1 | 0 | 0 |.M.| 0 | 0 |.mmod..........|.MM|.P.|.w1|.op1...|