public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: binutils@sourceware.org
Cc: toolchain-devel@blackfin.uclinux.org
Subject: [PATCH] gas/opcodes: blackfin: move dsp mac func defines to common header
Date: Fri, 11 Feb 2011 22:38:00 -0000	[thread overview]
Message-ID: <1297463882-14788-1-git-send-email-vapier@gentoo.org> (raw)

The mmod field is decoded in a few places (gas/opcodes/sim), so move it to
a common place to avoid duplication.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

include/opcode/:
2011-02-04  Mike Frysinger  <vapier@gentoo.org>

	* bfin.h (M_S2RND, M_T, M_W32, M_FU, M_TFU, M_IS, M_ISS2, M_IH,
	M_IU): Define.
	(is_macmod_pmove, is_macmod_hmove): New functions.

gas/:
2011-02-04  Mike Frysinger  <vapier@gentoo.org>

	* bfin-defs.h: Include opcode/bfin.h.
	(M_S2RND, M_T, M_W32, M_FU, M_TFU, M_IS, M_ISS2, M_IH, M_IU): Delete.

opcodes/:
2011-02-04  Mike Frysinger  <vapier@gentoo.org>

	* bfin-dis.c (M_S2RND, M_T, M_W32, M_FU, M_TFU, M_IS, M_ISS2,
	M_IH, M_IU): Delete.
---
 gas/config/bfin-defs.h |   15 +++------------
 include/opcode/bfin.h  |   23 +++++++++++++++++++++++
 opcodes/bfin-dis.c     |   10 ----------
 3 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/gas/config/bfin-defs.h b/gas/config/bfin-defs.h
index 8217332..b43fe76 100644
--- a/gas/config/bfin-defs.h
+++ b/gas/config/bfin-defs.h
@@ -1,5 +1,5 @@
 /* bfin-defs.h ADI Blackfin gas header file
-   Copyright 2005, 2006, 2007, 2009, 2010
+   Copyright 2005, 2006, 2007, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -22,6 +22,8 @@
 #ifndef BFIN_PARSE_H
 #define BFIN_PARSE_H
 
+#include "opcode/bfin.h"
+
 #define PCREL	1
 #define CODE_FRAG_SIZE 4096  /* 1 page.  */
 
@@ -166,17 +168,6 @@ enum reg_class
   LIM_REG_CLASSES
 };
 
-/* mmod field.  */
-#define M_S2RND 1
-#define M_T     2
-#define M_W32   3
-#define M_FU    4
-#define M_TFU   6
-#define M_IS    8
-#define M_ISS2  9
-#define M_IH    11
-#define M_IU    12
-
 /* Register type checking macros.  */
 
 #define CODE_MASK  0x07
diff --git a/include/opcode/bfin.h b/include/opcode/bfin.h
index 4a8a6bc..730f63c 100755
--- a/include/opcode/bfin.h
+++ b/include/opcode/bfin.h
@@ -30,6 +30,29 @@
 
 /* DSP instructions (32 bit) */
 
+/* mmod field.  */
+#define M_S2RND 1
+#define M_T     2
+#define M_W32   3
+#define M_FU    4
+#define M_TFU   6
+#define M_IS    8
+#define M_ISS2  9
+#define M_IH    11
+#define M_IU    12
+
+static inline int is_macmod_pmove(int x)
+{
+  return (x == 0) || (x == M_IS) || (x == M_FU) || (x == M_S2RND)
+         || (x == M_ISS2) || (x == M_IU);
+}
+
+static inline int is_macmod_hmove(int x)
+{
+  return (x == 0) || (x == M_IS) || (x == M_FU) || (x == M_IU) || (x == M_T)
+         || (x == M_TFU) || (x == M_S2RND) || (x == M_ISS2) || (x == M_IH);
+}
+
 /*   dsp32mac
 +----+----+---+---|---+----+----+---|---+---+---+---|---+---+---+---+
 | 1  | 1  | 0 | 0 |.M.| 0  | 0  |.mmod..........|.MM|.P.|.w1|.op1...|
diff --git a/opcodes/bfin-dis.c b/opcodes/bfin-dis.c
index 58122f0..85b793c 100644
--- a/opcodes/bfin-dis.c
+++ b/opcodes/bfin-dis.c
@@ -25,16 +25,6 @@
 
 #include "opcode/bfin.h"
 
-#define M_S2RND 1
-#define M_T     2
-#define M_W32   3
-#define M_FU    4
-#define M_TFU   6
-#define M_IS    8
-#define M_ISS2  9
-#define M_IH    11
-#define M_IU    12
-
 #ifndef PRINTF
 #define PRINTF printf
 #endif
-- 
1.7.4

                 reply	other threads:[~2011-02-11 22:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1297463882-14788-1-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=binutils@sourceware.org \
    --cc=toolchain-devel@blackfin.uclinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).