This commit was generated by cvs2svn to track changes on a CVS vendor
[platform/upstream/binutils.git] / opcodes / mcore-opc.h
1 /* Assembler instructions for Motorolla's Mcore processor
2    Copyright (C) 1999 Free Software Foundation, Inc.
3
4    
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
18
19 #include "ansidecl.h"
20
21 typedef enum
22 {
23   O0,    OT,   O1,   OC,   O2,    X1,    OI,    OB,
24   OMa,   SI,   I7,   LS,   BR,    BL,    LR,    LJ,
25   RM,    RQ,   JSR,  JMP,  OBRa,  OBRb,  OBRc,  OBR2,
26   O1R1,  OMb,  OMc,  SIa,
27   /* start-sanitize-m340 */  
28   MULSH,
29   /* end-sanitize-m340 */  
30   JC,    JU,   JL,   RSI,  DO21,  OB2
31 }
32 mcore_opclass;
33
34 typedef struct inst
35 {
36   char *         name;
37   mcore_opclass  opclass;
38   unsigned char  transfer;
39   unsigned short inst;
40 }
41 mcore_opcode_info;
42
43 #ifdef DEFINE_TABLE
44 mcore_opcode_info mcore_table[] =
45 {
46   { "bkpt",     O0,     0,      0x0000 },
47   { "sync",     O0,     0,      0x0001 },
48   { "rte",      O0,     1,      0x0002 },
49   { "rfe",      O0,     1,      0x0002 },
50   { "rfi",      O0,     1,      0x0003 },
51   { "stop",     O0,     0,      0x0004 },
52   { "wait",     O0,     0,      0x0005 },
53   { "doze",     O0,     0,      0x0006 },
54   /* start-sanitize-m340 */
55   { "idly4",    O0,     0,      0x0007 },
56   /* end-sanitize-m340 */
57   { "trap",     OT,     0,      0x0008 },
58 /* SPACE:                       0x000C - 0x000F */
59 /* SPACE:                       0x0010 - 0x001F */
60   { "mvc",      O1,     0,      0x0020 },
61   { "mvcv",     O1,     0,      0x0030 },
62   { "ldq",      RQ,     0,      0x0040 },
63   { "stq",      RQ,     0,      0x0050 },
64   { "ldm",      RM,     0,      0x0060 },
65   { "stm",      RM,     0,      0x0070 },
66   { "dect",     O1,     0,      0x0080 },
67   { "decf",     O1,     0,      0x0090 },
68   { "inct",     O1,     0,      0x00A0 },
69   { "incf",     O1,     0,      0x00B0 },
70   { "jmp",      JMP,    2,      0x00C0 },
71 #define MCORE_INST_JMP  0x00C0
72   { "jsr",      JSR,    0,      0x00D0 },
73 #define MCORE_INST_JSR  0x00E0
74   { "ff1",      O1,     0,      0x00E0 },
75   { "brev",     O1,     0,      0x00F0 },
76   { "xtrb3",    X1,     0,      0x0100 },
77   { "xtrb2",    X1,     0,      0x0110 },
78   { "xtrb1",    X1,     0,      0x0120 },
79   { "xtrb0",    X1,     0,      0x0130 },
80   { "zextb",    O1,     0,      0x0140 },
81   { "sextb",    O1,     0,      0x0150 },
82   { "zexth",    O1,     0,      0x0160 },
83   { "sexth",    O1,     0,      0x0170 },
84   { "declt",    O1,     0,      0x0180 },
85   { "tstnbz",   O1,     0,      0x0190 },
86   { "decgt",    O1,     0,      0x01A0 },
87   { "decne",    O1,     0,      0x01B0 },
88   { "clrt",     O1,     0,      0x01C0 },
89   { "clrf",     O1,     0,      0x01D0 },
90   { "abs",      O1,     0,      0x01E0 },
91   { "not",      O1,     0,      0x01F0 },
92   { "movt",     O2,     0,      0x0200 },
93   { "mult",     O2,     0,      0x0300 },
94   { "loopt",    BL,     0,      0x0400 },
95   { "subu",     O2,     0,      0x0500 },
96   { "sub",      O2,     0,      0x0500 }, /* Official alias.  */
97   { "addc",     O2,     0,      0x0600 },
98   { "subc",     O2,     0,      0x0700 },
99 /* SPACE: 0x0800-0x08ff for a diadic operation */
100 /* SPACE: 0x0900-0x09ff for a diadic operation */
101   { "movf",     O2,     0,      0x0A00 },
102   { "lsr",      O2,     0,      0x0B00 },
103   { "cmphs",    O2,     0,      0x0C00 },
104   { "cmplt",    O2,     0,      0x0D00 },
105   { "tst",      O2,     0,      0x0E00 },
106   { "cmpne",    O2,     0,      0x0F00 },
107   { "mfcr",     OC,     0,      0x1000 },
108   { "mov",      O2,     0,      0x1200 },
109   { "bgenr",    O2,     0,      0x1300 },
110   { "rsub",     O2,     0,      0x1400 },
111   { "ixw",      O2,     0,      0x1500 },
112   { "and",      O2,     0,      0x1600 },
113   { "xor",      O2,     0,      0x1700 },
114   { "mtcr",     OC,     0,      0x1800 },
115   { "asr",      O2,     0,      0x1A00 },
116   { "lsl",      O2,     0,      0x1B00 },
117   { "addu",     O2,     0,      0x1C00 },
118   { "ixh",      O2,     0,      0x1D00 },
119   { "or",       O2,     0,      0x1E00 },
120   { "andn",     O2,     0,      0x1F00 },
121   { "addi",     OI,     0,      0x2000 },
122 #define MCORE_INST_ADDI 0x2000
123   { "cmplti",   OI,     0,      0x2200 },
124   { "subi",     OI,     0,      0x2400 },
125 /* SPACE: 0x2600-0x27ff open for a register+immediate  operation */
126   { "rsubi",    OB,     0,      0x2800 },
127   { "cmpnei",   OB,     0,      0x2A00 },
128   { "bmaski",   OMa,    0,      0x2C00 },
129   { "divu",     O1R1,   0,      0x2C10 },
130 /* SPACE:                       0x2c20 - 0x2c7f */  
131   { "bmaski",   OMb,    0,      0x2C80 },
132   { "bmaski",   OMc,    0,      0x2D00 },
133   { "andi",     OB,     0,      0x2E00 },
134   { "bclri",    OB,     0,      0x3000 },
135 /* SPACE:                       0x3200 - 0x320f */
136   { "divs",     O1R1,   0,      0x3210 },
137 /* SPACE:                       0x3220 - 0x326f */  
138   { "bgeni",    OBRa,   0,      0x3270 },
139   { "bgeni",    OBRb,   0,      0x3280 },
140   { "bgeni",    OBRc,   0,      0x3300 },
141   { "bseti",    OB,     0,      0x3400 },
142   { "btsti",    OB,     0,      0x3600 },
143   { "xsr",      O1,     0,      0x3800 },
144   { "rotli",    SIa,    0,      0x3800 },
145   { "asrc",     O1,     0,      0x3A00 },
146   { "asri",     SIa,    0,      0x3A00 },
147   { "lslc",     O1,     0,      0x3C00 },
148   { "lsli",     SIa,    0,      0x3C00 },
149   { "lsrc",     O1,     0,      0x3E00 },
150   { "lsri",     SIa,    0,      0x3E00 },
151 /* SPACE:                       0x4000 - 0x5fff */
152   { "movi",     I7,     0,      0x6000 },
153 #define MCORE_INST_BMASKI_ALT   0x6000
154 #define MCORE_INST_BGENI_ALT    0x6000
155 /* start-sanitize-m340 */
156   { "mulsh",    MULSH,  0,      0x6800 },
157   { "muls.h",   MULSH,  0,      0x6800 },
158 /* end-sanitize-m340 */
159 /* SPACE:                       0x6900 - 0x6FFF */
160   { "jmpi",     LJ,     1,      0x7000 },
161   { "jsri",     LJ,     0,      0x7F00 },
162 #define MCORE_INST_JMPI 0x7000
163   { "lrw",      LR,     0,      0x7000 },
164 #define MCORE_INST_JSRI 0x7F00
165   { "ld",       LS,     0,      0x8000 },
166   { "ldw",      LS,     0,      0x8000 },
167   { "ld.w",     LS,     0,      0x8000 },
168   { "st",       LS,     0,      0x9000 },
169   { "stw",      LS,     0,      0x9000 },
170   { "st.w",     LS,     0,      0x9000 },
171   { "ldb",      LS,     0,      0xA000 },
172   { "ld.b",     LS,     0,      0xA000 },
173   { "stb",      LS,     0,      0xB000 },
174   { "st.b",     LS,     0,      0xB000 },
175   { "ldh",      LS,     0,      0xC000 },
176   { "ld.h",     LS,     0,      0xC000 },
177   { "sth",      LS,     0,      0xD000 },
178   { "st.h",     LS,     0,      0xD000 },
179   { "bt",       BR,     0,      0xE000 },
180   { "bf",       BR,     0,      0xE800 },
181   { "br",       BR,     1,      0xF000 },
182 #define MCORE_INST_BR   0xF000
183   { "bsr",      BR,     0,      0xF800 },
184 #define MCORE_INST_BSR  0xF800
185
186 /* The following are relaxable branches */
187   { "jbt",      JC,     0,      0xE000 },
188   { "jbf",      JC,     0,      0xE800 },
189   { "jbr",      JU,     1,      0xF000 },
190   { "jbsr",     JL,     0,      0xF800 },
191
192 /* The following are aliases for other instructions */
193   { "rts",      O0,     2,      0x00CF },  /* jmp r15 */
194   { "rolc",     DO21,   0,      0x0600 },  /* addc rd,rd */
195   { "rotlc",    DO21,   0,      0x0600 },  /* addc rd,rd */
196   { "setc",     O0,     0,      0x0C00 },  /* cmphs r0,r0 */
197   { "clrc",     O0,     0,      0x0F00 },  /* cmpne r0,r0 */
198   { "tstle",    O1,     0,      0x2200 },  /* cmplti rd,1 */
199   { "cmplei",   OB,     0,      0x2200 },  /* cmplei rd,X -> cmplti rd,X+1 */
200   { "neg",      O1,     0,      0x2800 },  /* rsubi rd,0 */
201   { "tstne",    O1,     0,      0x2A00 },  /* cmpnei rd,0 */
202   { "tstlt",    O1,     0,      0x37F0 },  /* btsti rx,31 */
203   { "mclri",    OB2,    0,      0x3000 },  /* bclri rx,log2(imm) */
204   { "mgeni",    OBR2,   0,      0x3200 },  /* bgeni rx,log2(imm) */
205   { "mseti",    OB2,    0,      0x3400 },  /* bseti rx,log2(imm) */
206   { "mtsti",    OB2,    0,      0x3600 },  /* btsti rx,log2(imm) */
207   { "rori",     RSI,    0,      0x3800 },
208   { "rotri",    RSI,    0,      0x3800 },
209   { "nop",      O0,     0,      0x1200 },  /* mov r0, r0 */
210   { 0,          0,      0,      0 }
211 };
212 #endif