Statistics
| Branch: | Revision:

root / target-cris / crisv32-decode.h @ 94cff60a

History | View | Annotate | Download (5.4 kB)

1 5478670f ths
/*
2 5478670f ths
 *  CRIS insn decoding macros.
3 5478670f ths
 *
4 5478670f ths
 *  Copyright (c) 2007 AXIS Communications AB
5 5478670f ths
 *  Written by Edgar E. Iglesias.
6 5478670f ths
 *
7 5478670f ths
 * This library is free software; you can redistribute it and/or
8 5478670f ths
 * modify it under the terms of the GNU Lesser General Public
9 5478670f ths
 * License as published by the Free Software Foundation; either
10 5478670f ths
 * version 2 of the License, or (at your option) any later version.
11 5478670f ths
 *
12 5478670f ths
 * This library is distributed in the hope that it will be useful,
13 5478670f ths
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 5478670f ths
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 5478670f ths
 * Lesser General Public License for more details.
16 5478670f ths
 *
17 5478670f ths
 * You should have received a copy of the GNU Lesser General Public
18 5478670f ths
 * License along with this library; if not, write to the Free Software
19 5478670f ths
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20 5478670f ths
 */
21 5478670f ths
22 5478670f ths
/* Convenient binary macros.  */
23 5478670f ths
#define HEX__(n) 0x##n##LU
24 5478670f ths
#define B8__(x) ((x&0x0000000FLU)?1:0) \
25 5478670f ths
                 + ((x&0x000000F0LU)?2:0) \
26 5478670f ths
                 + ((x&0x00000F00LU)?4:0) \
27 5478670f ths
                 + ((x&0x0000F000LU)?8:0) \
28 5478670f ths
                 + ((x&0x000F0000LU)?16:0) \
29 5478670f ths
                 + ((x&0x00F00000LU)?32:0) \
30 5478670f ths
                 + ((x&0x0F000000LU)?64:0) \
31 5478670f ths
                 + ((x&0xF0000000LU)?128:0)
32 5478670f ths
#define B8(d) ((unsigned char)B8__(HEX__(d)))
33 5478670f ths
34 5478670f ths
/* Quick imm.  */
35 5478670f ths
#define DEC_BCCQ     {B8(00000000), B8(11110000)}
36 5478670f ths
#define DEC_ADDOQ    {B8(00010000), B8(11110000)}
37 5478670f ths
#define DEC_ADDQ     {B8(00100000), B8(11111100)}
38 5478670f ths
#define DEC_MOVEQ    {B8(00100100), B8(11111100)}
39 5478670f ths
#define DEC_SUBQ     {B8(00101000), B8(11111100)}
40 5478670f ths
#define DEC_CMPQ     {B8(00101100), B8(11111100)}
41 5478670f ths
#define DEC_ANDQ     {B8(00110000), B8(11111100)}
42 5478670f ths
#define DEC_ORQ      {B8(00110100), B8(11111100)}
43 5478670f ths
#define DEC_BTSTQ    {B8(00111000), B8(11111110)}
44 5478670f ths
#define DEC_ASRQ     {B8(00111010), B8(11111110)}
45 5478670f ths
#define DEC_LSLQ     {B8(00111100), B8(11111110)}
46 5478670f ths
#define DEC_LSRQ     {B8(00111110), B8(11111110)}
47 5478670f ths
48 5478670f ths
/* Register.  */
49 5478670f ths
#define DEC_MOVU_R   {B8(01000100), B8(11111110)}
50 5478670f ths
#define DEC_MOVU_R   {B8(01000100), B8(11111110)}
51 5478670f ths
#define DEC_MOVS_R   {B8(01000110), B8(11111110)}
52 5478670f ths
#define DEC_MOVE_R   {B8(01100100), B8(11111100)}
53 5478670f ths
#define DEC_MOVE_RP  {B8(01100011), B8(11111111)}
54 5478670f ths
#define DEC_MOVE_PR  {B8(01100111), B8(11111111)}
55 5478670f ths
#define DEC_DSTEP_R  {B8(01101111), B8(11111111)}
56 5478670f ths
#define DEC_MOVE_RS  {B8(10110111), B8(11111111)}
57 5478670f ths
#define DEC_MOVE_SR  {B8(11110111), B8(11111111)}
58 5478670f ths
#define DEC_ADDU_R   {B8(01000000), B8(11111110)}
59 5478670f ths
#define DEC_ADDS_R   {B8(01000010), B8(11111110)}
60 5478670f ths
#define DEC_ADD_R    {B8(01100000), B8(11111100)}
61 5478670f ths
#define DEC_ADDI_R   {B8(01010000), B8(11111100)}
62 5478670f ths
#define DEC_MULS_R   {B8(11010000), B8(11111100)}
63 5478670f ths
#define DEC_MULU_R   {B8(10010000), B8(11111100)}
64 5478670f ths
#define DEC_ADDI_ACR {B8(01010100), B8(11111100)}
65 5478670f ths
#define DEC_NEG_R    {B8(01011000), B8(11111100)}
66 5478670f ths
#define DEC_BOUND_R  {B8(01011100), B8(11111100)}
67 5478670f ths
#define DEC_SUBU_R   {B8(01001000), B8(11111110)}
68 5478670f ths
#define DEC_SUBS_R   {B8(01001010), B8(11111110)}
69 5478670f ths
#define DEC_SUB_R    {B8(01101000), B8(11111100)}
70 5478670f ths
#define DEC_CMP_R    {B8(01101100), B8(11111100)}
71 5478670f ths
#define DEC_AND_R    {B8(01110000), B8(11111100)}
72 5478670f ths
#define DEC_ABS_R    {B8(01101011), B8(11111111)}
73 5478670f ths
#define DEC_LZ_R     {B8(01110011), B8(11111111)}
74 5478670f ths
#define DEC_MCP_R    {B8(01111111), B8(11111111)}
75 5478670f ths
#define DEC_SWAP_R   {B8(01110111), B8(11111111)}
76 5478670f ths
#define DEC_XOR_R    {B8(01111011), B8(11111111)}
77 5478670f ths
#define DEC_LSL_R    {B8(01001100), B8(11111100)}
78 5478670f ths
#define DEC_LSR_R    {B8(01111100), B8(11111100)}
79 5478670f ths
#define DEC_ASR_R    {B8(01111000), B8(11111100)}
80 5478670f ths
#define DEC_OR_R     {B8(01110100), B8(11111100)}
81 5478670f ths
#define DEC_BTST_R   {B8(01001111), B8(11111111)}
82 5478670f ths
83 5478670f ths
/* Fixed.  */
84 5478670f ths
#define DEC_SETF     {B8(01011011), B8(11111111)}
85 5478670f ths
#define DEC_CLEARF   {B8(01011111), B8(11111111)}
86 5478670f ths
87 5478670f ths
/* Memory.  */
88 5478670f ths
#define DEC_ADDU_M   {B8(10000000), B8(10111110)}
89 5478670f ths
#define DEC_ADDS_M   {B8(10000010), B8(10111110)}
90 5478670f ths
#define DEC_MOVU_M   {B8(10000100), B8(10111110)}
91 5478670f ths
#define DEC_MOVS_M   {B8(10000110), B8(10111110)}
92 5478670f ths
#define DEC_SUBU_M   {B8(10001000), B8(10111110)}
93 5478670f ths
#define DEC_SUBS_M   {B8(10001010), B8(10111110)}
94 5478670f ths
#define DEC_CMPU_M   {B8(10001100), B8(10111110)}
95 5478670f ths
#define DEC_CMPS_M   {B8(10001110), B8(10111110)}
96 5478670f ths
#define DEC_ADDO_M   {B8(10010100), B8(10111100)}
97 5478670f ths
#define DEC_BOUND_M  {B8(10011100), B8(10111100)}
98 5478670f ths
#define DEC_ADD_M    {B8(10100000), B8(10111100)}
99 5478670f ths
#define DEC_MOVE_MR  {B8(10100100), B8(10111100)}
100 5478670f ths
#define DEC_SUB_M    {B8(10101000), B8(10111100)}
101 5478670f ths
#define DEC_CMP_M    {B8(10101100), B8(10111100)}
102 5478670f ths
#define DEC_AND_M    {B8(10110000), B8(10111100)}
103 5478670f ths
#define DEC_OR_M     {B8(10110100), B8(10111100)}
104 5478670f ths
#define DEC_TEST_M   {B8(10111000), B8(10111100)}
105 5478670f ths
#define DEC_MOVE_RM  {B8(10111100), B8(10111100)}
106 5478670f ths
107 5478670f ths
#define DEC_ADDC_R   {B8(01010111), B8(11111111)}
108 5478670f ths
#define DEC_ADDC_MR  {B8(10011010), B8(10111111)}
109 5478670f ths
#define DEC_LAPCQ    {B8(10010111), B8(11111111)}
110 5478670f ths
#define DEC_LAPC_IM  {B8(11010111), B8(11111111)}
111 5478670f ths
112 5478670f ths
#define DEC_MOVE_MP  {B8(10100011), B8(10111111)}
113 5478670f ths
#define DEC_MOVE_PM  {B8(10100111), B8(10111111)}
114 5478670f ths
115 5478670f ths
#define DEC_SCC_R    {B8(01010011), B8(11111111)}
116 5478670f ths
#define DEC_RFE_ETC  {B8(10010011), B8(11111111)}
117 5478670f ths
#define DEC_JUMP_P   {B8(10011111), B8(11111111)}
118 5478670f ths
#define DEC_BCC_IM   {B8(11011111), B8(11111111)}
119 5478670f ths
#define DEC_JAS_R    {B8(10011011), B8(11111111)}
120 5478670f ths
#define DEC_JASC_R   {B8(10110011), B8(11111111)}
121 5478670f ths
#define DEC_JAS_IM   {B8(11011011), B8(11111111)}
122 5478670f ths
#define DEC_JASC_IM  {B8(11110011), B8(11111111)}
123 5478670f ths
#define DEC_BAS_IM   {B8(11101011), B8(11111111)}
124 5478670f ths
#define DEC_BASC_IM  {B8(11101111), B8(11111111)}
125 5478670f ths
#define DEC_MOVEM_MR {B8(10111011), B8(10111111)}
126 5478670f ths
#define DEC_MOVEM_RM {B8(10111111), B8(10111111)}