From 26bb3ddd506a68a8315a4d4215aaff52260fdf95 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 12 Feb 2011 19:36:31 +0000 Subject: gas/opcodes: blackfin: move dsp mac func defines to common header 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 --- gas/ChangeLog | 5 +++++ gas/config/bfin-defs.h | 15 +++------------ include/opcode/ChangeLog | 5 +++++ include/opcode/bfin.h | 23 +++++++++++++++++++++++ opcodes/ChangeLog | 6 ++++++ opcodes/bfin-dis.c | 10 ---------- 6 files changed, 42 insertions(+), 22 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 062d6cb1a01..656c91212c1 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2011-02-12 Mike Frysinger + + * config/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. + 2011-02-11 Mike Frysinger * doc/c-bfin.texi (Instruction Delimiting): Fix occur typo. diff --git a/gas/config/bfin-defs.h b/gas/config/bfin-defs.h index 8217332c5a3..b43fe76b6e1 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/ChangeLog b/include/opcode/ChangeLog index 968de81bb08..61fcbee5cbe 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,8 @@ +2011-02-12 Mike Frysinger + + * bfin-dis.c (M_S2RND, M_T, M_W32, M_FU, M_TFU, M_IS, M_ISS2, + M_IH, M_IU): Delete. + 2011-02-11 Mike Frysinger * bfin.h: Add OPCODE_BFIN_H ifdef multiple include protection. diff --git a/include/opcode/bfin.h b/include/opcode/bfin.h index 4a8a6bc3ad4..730f63c24c5 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/ChangeLog b/opcodes/ChangeLog index 1088e334a05..eebe2ba1b0f 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2011-02-12 Mike Frysinger + + * 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. + 2011-02-11 Mike Frysinger * bfin-dis.c (reg_names): Add const. diff --git a/opcodes/bfin-dis.c b/opcodes/bfin-dis.c index 58122f0815f..85b793cb743 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 -- cgit v1.2.3