comparison packages/hal/mips/arch/current/include/mips_opcode.h @ 2:443894e2e912 ecos-v1_2_1-release

Block commit of eCos version 1.2.1
author jlarmour
date Tue, 11 May 1999 12:24:34 +0000
parents 3111d98ba7b3
children
comparison
equal deleted inserted replaced
1:72f549f0d891 2:443894e2e912
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution. 15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software 16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement: 17 * must display the following acknowledgement:
18 * This product includes software developed by the University of 18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors. 19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors 20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software 21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission. 22 * without specific prior written permission.
23 * 23 *
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE. 34 * SUCH DAMAGE.
35 * 35 *
36 * from: @(#)mips_opcode.h 7.1 (Berkeley) 3/19/92 36 * from: @(#)mips_opcode.h 7.1 (Berkeley) 3/19/92
37 * via: mips_opcode.h,v 1.1 1994/03/10 16:15:10 (algorithmics) 37 * via: mips_opcode.h,v 1.1 1994/03/10 16:15:10 (algorithmics)
38 */ 38 */
39 39
40 /* 40 /*
41 * Define the instruction formats and opcode values for the 41 * Define the instruction formats and opcode values for the
51 typedef union { 51 typedef union {
52 unsigned word; 52 unsigned word;
53 53
54 #ifdef MIPSEL 54 #ifdef MIPSEL
55 struct { 55 struct {
56 unsigned imm: 16; 56 unsigned imm: 16;
57 unsigned rt: 5; 57 unsigned rt: 5;
58 unsigned rs: 5; 58 unsigned rs: 5;
59 unsigned op: 6; 59 unsigned op: 6;
60 } IType; 60 } IType;
61 61
62 struct { 62 struct {
63 unsigned target: 26; 63 unsigned target: 26;
64 unsigned op: 6; 64 unsigned op: 6;
65 } JType; 65 } JType;
66 66
67 struct { 67 struct {
68 unsigned func: 6; 68 unsigned func: 6;
69 unsigned shamt: 5; 69 unsigned shamt: 5;
70 unsigned rd: 5; 70 unsigned rd: 5;
71 unsigned rt: 5; 71 unsigned rt: 5;
72 unsigned rs: 5; 72 unsigned rs: 5;
73 unsigned op: 6; 73 unsigned op: 6;
74 } RType; 74 } RType;
75 75
76 struct { 76 struct {
77 unsigned func: 6; 77 unsigned func: 6;
78 unsigned fd: 5; 78 unsigned fd: 5;
79 unsigned fs: 5; 79 unsigned fs: 5;
80 unsigned ft: 5; 80 unsigned ft: 5;
81 unsigned fmt: 4; 81 unsigned fmt: 4;
82 unsigned : 1; /* always '1' */ 82 unsigned : 1; /* always '1' */
83 unsigned op: 6; /* always '0x11' */ 83 unsigned op: 6; /* always '0x11' */
84 } FRType; 84 } FRType;
85 #else 85 #else
86 struct { 86 struct {
87 unsigned op: 6; 87 unsigned op: 6;
88 unsigned rs: 5; 88 unsigned rs: 5;
89 unsigned rt: 5; 89 unsigned rt: 5;
90 unsigned imm: 16; 90 unsigned imm: 16;
91 } IType; 91 } IType;
92 92
93 struct { 93 struct {
94 unsigned op: 6; 94 unsigned op: 6;
95 unsigned target: 26; 95 unsigned target: 26;
96 } JType; 96 } JType;
97 97
98 struct { 98 struct {
99 unsigned op: 6; 99 unsigned op: 6;
100 unsigned rs: 5; 100 unsigned rs: 5;
101 unsigned rt: 5; 101 unsigned rt: 5;
102 unsigned rd: 5; 102 unsigned rd: 5;
103 unsigned shamt: 5; 103 unsigned shamt: 5;
104 unsigned func: 6; 104 unsigned func: 6;
105 } RType; 105 } RType;
106 106
107 struct { 107 struct {
108 unsigned op: 6; /* always '0x11' */ 108 unsigned op: 6; /* always '0x11' */
109 unsigned : 1; /* always '1' */ 109 unsigned : 1; /* always '1' */
110 unsigned fmt: 4; 110 unsigned fmt: 4;
111 unsigned func: 6; 111 unsigned func: 6;
112 unsigned ft: 5; 112 unsigned ft: 5;
113 unsigned fs: 5; 113 unsigned fs: 5;
114 unsigned fd: 5; 114 unsigned fd: 5;
115 } FRType; 115 } FRType;
116 #endif 116 #endif
117 } InstFmt; 117 } InstFmt;
118 118
119 /* 119 /*
120 * Values for the 'op' field. 120 * Values for the 'op' field.
121 */ 121 */
122 #define OP_SPECIAL 000 122 #define OP_SPECIAL 000
123 #define OP_REGIMM 001 123 #define OP_REGIMM 001
124 #define OP_J 002 124 #define OP_J 002
125 #define OP_JAL 003 125 #define OP_JAL 003
126 #define OP_BEQ 004 126 #define OP_BEQ 004
127 #define OP_BNE 005 127 #define OP_BNE 005
128 #define OP_BLEZ 006 128 #define OP_BLEZ 006
129 #define OP_BGTZ 007 129 #define OP_BGTZ 007
130 130
131 #define OP_ADDI 010 131 #define OP_ADDI 010
132 #define OP_ADDIU 011 132 #define OP_ADDIU 011
133 #define OP_SLTI 012 133 #define OP_SLTI 012
134 #define OP_SLTIU 013 134 #define OP_SLTIU 013
135 #define OP_ANDI 014 135 #define OP_ANDI 014
136 #define OP_ORI 015 136 #define OP_ORI 015
137 #define OP_XORI 016 137 #define OP_XORI 016
138 #define OP_LUI 017 138 #define OP_LUI 017
139 139
140 #define OP_COP0 020 140 #define OP_COP0 020
141 #define OP_COP1 021 141 #define OP_COP1 021
142 #define OP_COP2 022 142 #define OP_COP2 022
143 #define OP_BEQL 024 143 #define OP_BEQL 024
144 #define OP_BNEL 025 144 #define OP_BNEL 025
145 #define OP_BLEZL 026 145 #define OP_BLEZL 026
146 #define OP_BGTZL 027 146 #define OP_BGTZL 027
147 147
148 #define OP_DADDI 030 148 #define OP_DADDI 030
149 #define OP_DADDIU 031 149 #define OP_DADDIU 031
150 #define OP_LDL 032 150 #define OP_LDL 032
151 #define OP_LDR 033 151 #define OP_LDR 033
152 152
153 #define OP_LB 040 153 #define OP_LB 040
154 #define OP_LH 041 154 #define OP_LH 041
155 #define OP_LWL 042 155 #define OP_LWL 042
156 #define OP_LW 043 156 #define OP_LW 043
157 #define OP_LBU 044 157 #define OP_LBU 044
158 #define OP_LHU 045 158 #define OP_LHU 045
159 #define OP_LWR 046 159 #define OP_LWR 046
160 #define OP_LWU 047 160 #define OP_LWU 047
161 161
162 #define OP_SB 050 162 #define OP_SB 050
163 #define OP_SH 051 163 #define OP_SH 051
164 #define OP_SWL 052 164 #define OP_SWL 052
165 #define OP_SW 053 165 #define OP_SW 053
166 #define OP_SDL 054 166 #define OP_SDL 054
167 #define OP_SDR 055 167 #define OP_SDR 055
168 #define OP_SWR 056 168 #define OP_SWR 056
169 #define OP_CACHE 057 169 #define OP_CACHE 057
170 170
171 #define OP_LL 060 171 #define OP_LL 060
172 #define OP_LWC1 061 172 #define OP_LWC1 061
173 #define OP_LWC2 062 173 #define OP_LWC2 062
174 #define OP_LLD 064 174 #define OP_LLD 064
175 #define OP_LDC1 065 175 #define OP_LDC1 065
176 #define OP_LDC2 066 176 #define OP_LDC2 066
177 #define OP_LD 067 177 #define OP_LD 067
178 178
179 #define OP_SC 070 179 #define OP_SC 070
180 #define OP_SWC1 071 180 #define OP_SWC1 071
181 #define OP_SWC2 072 181 #define OP_SWC2 072
182 #define OP_SCD 074 182 #define OP_SCD 074
183 #define OP_SDC1 075 183 #define OP_SDC1 075
184 #define OP_SDC2 076 184 #define OP_SDC2 076
185 #define OP_SD 077 185 #define OP_SD 077
186 186
187 /* 187 /*
188 * Values for the 'func' field when 'op' == OP_SPECIAL. 188 * Values for the 'func' field when 'op' == OP_SPECIAL.
189 */ 189 */
190 #define OP_SLL 000 190 #define OP_SLL 000
191 #define OP_SRL 002 191 #define OP_SRL 002
192 #define OP_SRA 003 192 #define OP_SRA 003
193 #define OP_SLLV 004 193 #define OP_SLLV 004
194 #define OP_SRLV 006 194 #define OP_SRLV 006
195 #define OP_SRAV 007 195 #define OP_SRAV 007
196 196
197 #define OP_JR 010 197 #define OP_JR 010
198 #define OP_JALR 011 198 #define OP_JALR 011
199 #define OP_SYSCALL 014 199 #define OP_SYSCALL 014
200 #define OP_BREAK 015 200 #define OP_BREAK 015
201 #define OP_SYNC 017 201 #define OP_SYNC 017
202 202
203 #define OP_MFHI 020 203 #define OP_MFHI 020
204 #define OP_MTHI 021 204 #define OP_MTHI 021
205 #define OP_MFLO 022 205 #define OP_MFLO 022
206 #define OP_MTLO 023 206 #define OP_MTLO 023
207 #define OP_DSLLV 024 207 #define OP_DSLLV 024
208 #define OP_DSRLV 026 208 #define OP_DSRLV 026
209 #define OP_DSRAV 027 209 #define OP_DSRAV 027
210 210
211 #define OP_MULT 030 211 #define OP_MULT 030
212 #define OP_MULTU 031 212 #define OP_MULTU 031
213 #define OP_DIV 032 213 #define OP_DIV 032
214 #define OP_DIVU 033 214 #define OP_DIVU 033
215 #define OP_DMULT 034 215 #define OP_DMULT 034
216 #define OP_DMULTU 035 216 #define OP_DMULTU 035
217 #define OP_DDIV 036 217 #define OP_DDIV 036
218 #define OP_DDIVU 037 218 #define OP_DDIVU 037
219 219
220 #define OP_ADD 040 220 #define OP_ADD 040
221 #define OP_ADDU 041 221 #define OP_ADDU 041
222 #define OP_SUB 042 222 #define OP_SUB 042
223 #define OP_SUBU 043 223 #define OP_SUBU 043
224 #define OP_AND 044 224 #define OP_AND 044
225 #define OP_OR 045 225 #define OP_OR 045
226 #define OP_XOR 046 226 #define OP_XOR 046
227 #define OP_NOR 047 227 #define OP_NOR 047
228 228
229 #define OP_SLT 052 229 #define OP_SLT 052
230 #define OP_SLTU 053 230 #define OP_SLTU 053
231 #define OP_DADD 054 231 #define OP_DADD 054
232 #define OP_DADDU 055 232 #define OP_DADDU 055
233 #define OP_DSUB 056 233 #define OP_DSUB 056
234 #define OP_DSUBU 057 234 #define OP_DSUBU 057
235 235
236 #define OP_TGE 060 236 #define OP_TGE 060
237 #define OP_TGEU 061 237 #define OP_TGEU 061
238 #define OP_TLT 062 238 #define OP_TLT 062
239 #define OP_TLTU 063 239 #define OP_TLTU 063
240 #define OP_TEQ 064 240 #define OP_TEQ 064
241 #define OP_TNE 066 241 #define OP_TNE 066
242 242
243 #define OP_DSLL 070 243 #define OP_DSLL 070
244 #define OP_DSRL 072 244 #define OP_DSRL 072
245 #define OP_DSRA 073 245 #define OP_DSRA 073
246 #define OP_DSLL32 074 246 #define OP_DSLL32 074
247 #define OP_DSRL32 076 247 #define OP_DSRL32 076
248 #define OP_DSRA32 077 248 #define OP_DSRA32 077
249 249
250 /* 250 /*
251 * Values for the 'func' field when 'op' == OP_REGIMM. 251 * Values for the 'func' field when 'op' == OP_REGIMM.
252 */ 252 */
253 #define OP_BLTZ 000 253 #define OP_BLTZ 000
254 #define OP_BGEZ 001 254 #define OP_BGEZ 001
255 #define OP_BLTZL 002 255 #define OP_BLTZL 002
256 #define OP_BGEZL 003 256 #define OP_BGEZL 003
257 257
258 #define OP_TGEI 010 258 #define OP_TGEI 010
259 #define OP_TGEIU 011 259 #define OP_TGEIU 011
260 #define OP_TLTI 012 260 #define OP_TLTI 012
261 #define OP_TLTIU 013 261 #define OP_TLTIU 013
262 #define OP_TEQI 014 262 #define OP_TEQI 014
263 #define OP_TNEI 016 263 #define OP_TNEI 016
264 264
265 #define OP_BLTZAL 020 265 #define OP_BLTZAL 020
266 #define OP_BGEZAL 021 266 #define OP_BGEZAL 021
267 #define OP_BLTZALL 022 267 #define OP_BLTZALL 022
268 #define OP_BGEZALL 023 268 #define OP_BGEZALL 023
269 269
270 /* 270 /*
271 * Values for the 'rs' field when 'op' == OP_COPz. 271 * Values for the 'rs' field when 'op' == OP_COPz.
272 */ 272 */
273 #define OP_MF 000 273 #define OP_MF 000
274 #define OP_DMF 001 274 #define OP_DMF 001
275 #define OP_CF 002 275 #define OP_CF 002
276 #define OP_MT 004 276 #define OP_MT 004
277 #define OP_DMT 005 277 #define OP_DMT 005
278 #define OP_CT 006 278 #define OP_CT 006
279 #define OP_BC 010 279 #define OP_BC 010
280 280
281 /* 281 /*
282 * Values for the 'rt' field when 'op' == OP_COPz and 'rt' == OP_BC. 282 * Values for the 'rt' field when 'op' == OP_COPz and 'rt' == OP_BC.
283 */ 283 */
284 #define COPz_BCF 0x00 284 #define COPz_BCF 0x00
285 #define COPz_BCT 0x01 285 #define COPz_BCT 0x01
286 #define COPz_BCFL 0x02 286 #define COPz_BCFL 0x02
287 #define COPz_BCTL 0x03 287 #define COPz_BCTL 0x03
288 288
289 /* 289 /*
290 * Instructions with specal significance to debuggers. 290 * Instructions with specal significance to debuggers.
291 */ 291 */
292 #define BREAK_INSTR 0x0005000d /* instruction code for break */ 292 #define BREAK_INSTR 0x0005000d /* instruction code for break */
293 #define NOP_INSTR 0x00000000 /* instruction code for no-op */ 293 #define NOP_INSTR 0x00000000 /* instruction code for no-op */
294 294
295 #endif /* _MIPS_OPCODE_H */ 295 #endif /* _MIPS_OPCODE_H */