OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1ksim/] [cpu/] [or32/] [or32.c] - Blame information for rev 1656

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 133 markom
/* Table of opcodes for the OpenRISC 1000 ISA.
2
   Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
3
   Contributed by Damjan Lampret (lampret@opencores.org).
4
 
5 717 markom
This file is part of gen_or1k_isa, or1ksim, GDB and GAS.
6 133 markom
 
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or
10
(at your option) any later version.
11
 
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
GNU General Public License for more details.
16
 
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
20
 
21 1114 lampret
/*
22
 * $Log: not supported by cvs2svn $
23 1656 nogj
 * Revision 1.50  2005/11/18 18:15:21  nogj
24
 * Execute l.ff1 instruction
25
 *
26 1605 nogj
 * Revision 1.49  2005/11/06 16:23:07  nogj
27
 * Fix parsing the destination register
28
 *
29 1597 nogj
 * Revision 1.48  2005/11/03 19:01:50  lampret
30
 * Added l.fl1
31
 *
32 1590 lampret
 * Revision 1.47  2005/09/05 08:47:44  nogj
33
 * Fix most warnings issued by gcc4
34
 *
35 1557 nogj
 * Revision 1.46  2005/08/18 22:13:27  phoenix
36
 * fixed l.maci encoding
37
 *
38 1554 phoenix
 * Revision 1.45  2005/04/27 19:13:13  nogj
39
 * l.rfe does not have a delay slot.  Don't mark it as such.
40
 *
41 1475 nogj
 * Revision 1.44  2005/03/31 16:09:57  nogj
42
 * Implement a dynamic recompiler to speed up the execution
43
 *
44 1452 nogj
 * Revision 1.43  2005/03/31 16:01:59  nogj
45
 * Reclasify l.trap and l.sys to be an exception instruction
46
 *
47 1440 nogj
 * Revision 1.42  2005/03/16 12:25:56  nogj
48
 * Fix the parameters to the l.ff1/l.maci instructions
49
 *
50 1384 nogj
 * Revision 1.41  2005/02/09 17:41:03  nogj
51
 * Mark a simulated cpu address as such, by introducing the new oraddr_t type
52
 *
53 1350 nogj
 * Revision 1.40  2005/01/27 14:14:13  nogj
54
 * Remove the global op structure
55
 *
56 1346 nogj
 * Revision 1.39  2005/01/27 13:35:40  nogj
57
 *  * Fix generate.c to produce a execgen.c with less warnings.
58
 *  * Fix the --enable-simple configure option.
59
 *
60 1342 nogj
 * Revision 1.38  2005/01/27 13:15:50  nogj
61
 * Mark wich operand is the destination operand in the architechture definition
62
 *
63 1341 nogj
 * Revision 1.37  2005/01/11 15:41:58  andreje
64
 * l.ff1 instruction added
65
 *
66 1338 andreje
 * Revision 1.36  2004/07/22 20:17:23  phoenix
67
 * removed includes
68
 *
69 1309 phoenix
 * Revision 1.35  2004/07/19 23:07:37  phoenix
70
 * Gyorgy Jeney: extensive cleanup
71
 *
72 1308 phoenix
 * Revision 1.34  2004/06/27 22:56:48  lampret
73
 * Updated instruction set descriptions. Changed FP instructions encoding.
74
 *
75 1295 lampret
 * Revision 1.33  2004/05/09 19:52:31  lampret
76
 * Changed desciption of the l.cust5 insns
77
 *
78 1285 lampret
 * Revision 1.31  2003/07/01 19:34:49  csanchez
79
 * Added support for l.addc instruction.
80
 *
81 1169 csanchez
 * Revision 1.30  2003/01/28 03:49:24  lampret
82
 * Added cvs log keywords
83
 *
84 1114 lampret
 */
85
 
86 133 markom
#include <string.h>
87
#include <stdio.h>
88
#include <stdlib.h>
89 371 markom
#include <ctype.h>
90 133 markom
 
91 371 markom
 
92 138 markom
#ifdef HAVE_CONFIG_H
93
# include "config.h"
94
#endif
95 1342 nogj
#ifdef HAS_EXECUTION
96 1350 nogj
# ifdef HAVE_INTTYPES_H
97
#  include <inttypes.h> /* ...but to get arch.h we need uint{8,16,32}_t... */
98
# endif
99
# include "port.h"
100
# include "arch.h" /* ...but to get abstract.h, we need oraddr_t... */
101
# include "abstract.h" /* To get struct iqueue_entry... */
102 1557 nogj
# include "debug.h" /* To get debug() */
103 1342 nogj
#endif
104 133 markom
#include "opcode/or32.h"
105
 
106
/* **INDENT-OFF** */
107
 
108 1342 nogj
/* We treat all letters the same in encode/decode routines so
109
   we need to assign some characteristics to them like signess etc.*/
110 133 markom
CONST struct or32_letter or32_letters[] =
111
{
112
{ 'A', NUM_UNSIGNED },
113
{ 'B', NUM_UNSIGNED },
114
{ 'D', NUM_UNSIGNED },
115
{ 'I', NUM_SIGNED },
116
{ 'K', NUM_UNSIGNED },
117
{ 'L', NUM_UNSIGNED },
118
{ 'N', NUM_SIGNED },
119
{ '0', NUM_UNSIGNED },
120
{ '\0', 0 }     /* dummy entry */
121
};
122
 
123
/* Opcode encoding:
124
   machine[31:30]: first two bits of opcode
125
                   00 - neither of source operands is GPR
126
                   01 - second source operand is GPR (rB)
127
                   10 - first source operand is GPR (rA)
128
                   11 - both source operands are GPRs (rA and rB)
129
   machine[29:26]: next four bits of opcode
130
   machine[25:00]: instruction operands (specific to individual instruction)
131
 
132
  Recommendation: irrelevant instruction bits should be set with a value of
133
  bits in same positions of instruction preceding current instruction in the
134
  code (when assembling).
135
*/
136
 
137 1341 nogj
#ifdef HAS_EXECUTION
138
# if SIMPLE_EXECUTION
139
#  define EFN &l_none
140
#  define EF(func) &(func)
141
#  define EFI &l_invalid
142 1452 nogj
# elif COMPLEX_EXECUTION
143 1341 nogj
#  define EFN "l_none"
144
#  define EFI "l_invalid"
145
#  ifdef __GNUC__
146
#   define EF(func) #func
147
#  else
148
#   define EF(func) "func"
149
#  endif
150 1452 nogj
# else /* DYNAMIC_EXECUTION */
151
#  define EFN &l_none
152
#  define EF(func) &(gen_ ##func)
153
#  define EFI &gen_l_invalid
154
# endif
155 1341 nogj
#else /* HAS_EXECUTION */
156
# define EFN &l_none
157
# define EF(func) EFN
158
# define EFI EFN
159 133 markom
#endif /* HAS_EXECUTION */
160
 
161
CONST struct or32_opcode or32_opcodes[] =
162
{
163
 
164 1346 nogj
{ "l.j",       "N",            "00 0x0  NNNNN NNNNN NNNN NNNN NNNN NNNN",
165
  EF(l_j), OR32_IF_DELAY, it_jump },
166
{ "l.jal",     "N",            "00 0x1  NNNNN NNNNN NNNN NNNN NNNN NNNN",
167
  EF(l_jal), OR32_IF_DELAY, it_jump },
168
{ "l.bnf",     "N",            "00 0x3  NNNNN NNNNN NNNN NNNN NNNN NNNN",
169
  EF(l_bnf), OR32_IF_DELAY | OR32_R_FLAG, it_branch },
170
{ "l.bf",      "N",            "00 0x4  NNNNN NNNNN NNNN NNNN NNNN NNNN",
171
  EF(l_bf), OR32_IF_DELAY | OR32_R_FLAG, it_branch },
172
{ "l.nop",     "K",            "00 0x5  01--- ----- KKKK KKKK KKKK KKKK",
173
  EF(l_nop), 0, it_nop },
174
{ "l.movhi",   "rD,K",         "00 0x6  DDDDD ----0 KKKK KKKK KKKK KKKK",
175
  EF(l_movhi), 0, it_movimm },
176
{ "l.macrc",   "rD",           "00 0x6  DDDDD ----1 0000 0000 0000 0000",
177
  EF(l_macrc), 0, it_mac },
178
{ "l.sys",     "K",            "00 0x8  00000 00000 KKKK KKKK KKKK KKKK",
179 1440 nogj
  EF(l_sys), 0, it_exception },
180 1346 nogj
{ "l.trap",    "K",            "00 0x8  01000 00000 KKKK KKKK KKKK KKKK",
181 1440 nogj
  EF(l_trap), 0, it_exception },
182 1346 nogj
{ "l.msync",   "",             "00 0x8  10000 00000 0000 0000 0000 0000", EFN,
183
  0, it_unknown },
184
{ "l.psync",   "",             "00 0x8  10100 00000 0000 0000 0000 0000", EFN,
185
  0, it_unknown },
186
{ "l.csync",   "",             "00 0x8  11000 00000 0000 0000 0000 0000", EFN,
187
  0, it_unknown },
188
{ "l.rfe",     "",             "00 0x9  ----- ----- ---- ---- ---- ----",
189 1475 nogj
  EF(l_rfe), 0, it_exception },
190 1346 nogj
{ "lv.all_eq.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x1 0x0", EFI, 0,
191
  it_unknown },
192
{ "lv.all_eq.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x1 0x1", EFI, 0,
193
  it_unknown },
194
{ "lv.all_ge.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x1 0x2", EFI, 0,
195
  it_unknown },
196
{ "lv.all_ge.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x1 0x3", EFI, 0,
197
  it_unknown },
198
{ "lv.all_gt.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x1 0x4", EFI, 0,
199
  it_unknown },
200
{ "lv.all_gt.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x1 0x5", EFI, 0,
201
  it_unknown },
202
{ "lv.all_le.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x1 0x6", EFI, 0,
203
  it_unknown },
204
{ "lv.all_le.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x1 0x7", EFI, 0,
205
  it_unknown },
206
{ "lv.all_lt.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x1 0x8", EFI, 0,
207
  it_unknown },
208
{ "lv.all_lt.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x1 0x9", EFI, 0,
209
  it_unknown },
210
{ "lv.all_ne.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x1 0xA", EFI, 0,
211
  it_unknown },
212
{ "lv.all_ne.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x1 0xB", EFI, 0,
213
  it_unknown },
214
{ "lv.any_eq.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x2 0x0", EFI, 0,
215
  it_unknown },
216
{ "lv.any_eq.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x2 0x1", EFI, 0,
217
  it_unknown },
218
{ "lv.any_ge.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x2 0x2", EFI, 0,
219
  it_unknown },
220
{ "lv.any_ge.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x2 0x3", EFI, 0,
221
  it_unknown },
222
{ "lv.any_gt.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x2 0x4", EFI, 0,
223
  it_unknown },
224
{ "lv.any_gt.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x2 0x5", EFI, 0,
225
  it_unknown },
226
{ "lv.any_le.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x2 0x6", EFI, 0,
227
  it_unknown },
228
{ "lv.any_le.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x2 0x7", EFI, 0,
229
  it_unknown },
230
{ "lv.any_lt.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x2 0x8", EFI, 0,
231
  it_unknown },
232
{ "lv.any_lt.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x2 0x9", EFI, 0,
233
  it_unknown },
234
{ "lv.any_ne.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x2 0xA", EFI, 0,
235
  it_unknown },
236
{ "lv.any_ne.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x2 0xB", EFI, 0,
237
  it_unknown },
238
{ "lv.add.b",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x3 0x0", EFI, 0,
239
  it_unknown },
240
{ "lv.add.h",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x3 0x1", EFI, 0,
241
  it_unknown },
242
{ "lv.adds.b", "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x3 0x2", EFI, 0,
243
  it_unknown },
244
{ "lv.adds.h", "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x3 0x3", EFI, 0,
245
  it_unknown },
246
{ "lv.addu.b", "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x3 0x4", EFI, 0,
247
  it_unknown },
248
{ "lv.addu.h", "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x3 0x5", EFI, 0,
249
  it_unknown },
250
{ "lv.addus.b","rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x3 0x6", EFI, 0,
251
  it_unknown },
252
{ "lv.addus.h","rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x3 0x7", EFI, 0,
253
  it_unknown },
254
{ "lv.and",    "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x3 0x8", EFI, 0,
255
  it_unknown },
256
{ "lv.avg.b",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x3 0x9", EFI, 0,
257
  it_unknown },
258
{ "lv.avg.h",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x3 0xA", EFI, 0,
259
  it_unknown },
260
{ "lv.cmp_eq.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x4 0x0", EFI, 0,
261
  it_unknown },
262
{ "lv.cmp_eq.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x4 0x1", EFI, 0,
263
  it_unknown },
264
{ "lv.cmp_ge.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x4 0x2", EFI, 0,
265
  it_unknown },
266
{ "lv.cmp_ge.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x4 0x3", EFI, 0,
267
  it_unknown },
268
{ "lv.cmp_gt.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x4 0x4", EFI, 0,
269
  it_unknown },
270
{ "lv.cmp_gt.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x4 0x5", EFI, 0,
271
  it_unknown },
272
{ "lv.cmp_le.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x4 0x6", EFI, 0,
273
  it_unknown },
274
{ "lv.cmp_le.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x4 0x7", EFI, 0,
275
  it_unknown },
276
{ "lv.cmp_lt.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x4 0x8", EFI, 0,
277
  it_unknown },
278
{ "lv.cmp_lt.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x4 0x9", EFI, 0,
279
  it_unknown },
280
{ "lv.cmp_ne.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x4 0xA", EFI, 0,
281
  it_unknown },
282
{ "lv.cmp_ne.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x4 0xB", EFI, 0,
283
  it_unknown },
284
{ "lv.madds.h","rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x5 0x4", EFI, 0,
285
  it_unknown },
286
{ "lv.max.b",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x5 0x5", EFI, 0,
287
  it_unknown },
288
{ "lv.max.h",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x5 0x6", EFI, 0,
289
  it_unknown },
290
{ "lv.merge.b","rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x5 0x7", EFI, 0,
291
  it_unknown },
292
{ "lv.merge.h","rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x5 0x8", EFI, 0,
293
  it_unknown },
294
{ "lv.min.b",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x5 0x9", EFI, 0,
295
  it_unknown },
296
{ "lv.min.h",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x5 0xA", EFI, 0,
297
  it_unknown },
298
{ "lv.msubs.h","rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x5 0xB", EFI, 0,
299
  it_unknown },
300
{ "lv.muls.h", "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x5 0xC", EFI, 0,
301
  it_unknown },
302
{ "lv.nand",   "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x5 0xD", EFI, 0,
303
  it_unknown },
304
{ "lv.nor",    "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x5 0xE", EFI, 0,
305
  it_unknown },
306
{ "lv.or",     "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x5 0xF", EFI, 0,
307
  it_unknown },
308
{ "lv.pack.b", "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0x0", EFI, 0,
309
  it_unknown },
310
{ "lv.pack.h", "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0x1", EFI, 0,
311
  it_unknown },
312
{ "lv.packs.b","rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0x2", EFI, 0,
313
  it_unknown },
314
{ "lv.packs.h","rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0x3", EFI, 0,
315
  it_unknown },
316
{ "lv.packus.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0x4", EFI, 0,
317
  it_unknown },
318
{ "lv.packus.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0x5", EFI, 0,
319
  it_unknown },
320
{ "lv.perm.n", "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0x6", EFI, 0,
321
  it_unknown },
322
{ "lv.rl.b",   "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0x7", EFI, 0,
323
  it_unknown },
324
{ "lv.rl.h",   "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0x8", EFI, 0,
325
  it_unknown },
326
{ "lv.sll.b",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0x9", EFI, 0,
327
  it_unknown },
328
{ "lv.sll.h",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0xA", EFI, 0,
329
  it_unknown },
330
{ "lv.sll",    "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0xB", EFI, 0,
331
  it_unknown },
332
{ "lv.srl.b",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0xC", EFI, 0,
333
  it_unknown },
334
{ "lv.srl.h",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0xD", EFI, 0,
335
  it_unknown },
336
{ "lv.sra.b",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0xE", EFI, 0,
337
  it_unknown },
338
{ "lv.sra.h",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x6 0xF", EFI, 0,
339
  it_unknown },
340
{ "lv.srl",    "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x7 0x0", EFI, 0,
341
  it_unknown },
342
{ "lv.sub.b",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x7 0x1", EFI, 0,
343
  it_unknown },
344
{ "lv.sub.h",  "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x7 0x2", EFI, 0,
345
  it_unknown },
346
{ "lv.subs.b", "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x7 0x3", EFI, 0,
347
  it_unknown },
348
{ "lv.subs.h", "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x7 0x4", EFI, 0,
349
  it_unknown },
350
{ "lv.subu.b", "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x7 0x5", EFI, 0,
351
  it_unknown },
352
{ "lv.subu.h", "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x7 0x6", EFI, 0,
353
  it_unknown },
354
{ "lv.subus.b","rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x7 0x7", EFI, 0,
355
  it_unknown },
356
{ "lv.subus.h","rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x7 0x8", EFI, 0,
357
  it_unknown },
358
{ "lv.unpack.b","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x7 0x9", EFI, 0,
359
  it_unknown },
360
{ "lv.unpack.h","rD,rA,rB",    "00 0xA  DDDDD AAAAA BBBB B--- 0x7 0xA", EFI, 0,
361
  it_unknown },
362
{ "lv.xor",    "rD,rA,rB",     "00 0xA  DDDDD AAAAA BBBB B--- 0x7 0xB", EFI, 0,
363
  it_unknown },
364
{ "lv.cust1",  "",             "00 0xA  ----- ----- ---- ---- 0xC ----", EFI, 0,
365
  it_unknown },
366
{ "lv.cust2",  "",             "00 0xA  ----- ----- ---- ---- 0xD ----", EFI, 0,
367
  it_unknown },
368
{ "lv.cust3",  "",             "00 0xA  ----- ----- ---- ---- 0xE ----", EFI, 0,
369
  it_unknown },
370
{ "lv.cust4",  "",             "00 0xA  ----- ----- ---- ---- 0xF ----", EFI, 0,
371
  it_unknown },
372 676 markom
 
373 1346 nogj
{ "l.jr",      "rB",           "01 0x1  ----- ----- BBBB B--- ---- ----",
374
  EF(l_jr), OR32_IF_DELAY, it_jump },
375
{ "l.jalr",    "rB",           "01 0x2  ----- ----- BBBB B--- ---- ----",
376
  EF(l_jalr), OR32_IF_DELAY, it_jump },
377 1554 phoenix
{ "l.maci",    "rA,I",         "01 0x3  IIIII AAAAA ---- -III IIII IIII",
378 1346 nogj
  EF(l_mac), 0, it_mac },
379
{ "l.cust1",   "",             "01 0xC  ----- ----- ---- ---- ---- ----",
380
  EF(l_cust1), 0, it_unknown },
381
{ "l.cust2",   "",             "01 0xD  ----- ----- ---- ---- ---- ----",
382
  EF(l_cust2), 0, it_unknown },
383
{ "l.cust3",   "",             "01 0xE  ----- ----- ---- ---- ---- ----",
384
  EF(l_cust3), 0, it_unknown },
385
{ "l.cust4",   "",             "01 0xF  ----- ----- ---- ---- ---- ----",
386
  EF(l_cust4), 0, it_unknown },
387 133 markom
 
388 1346 nogj
{ "l.ld",      "rD,I(rA)",     "10 0x0  DDDDD AAAAA IIII IIII IIII IIII", EFI,
389
  0, it_load },
390
{ "l.lwz",     "rD,I(rA)",     "10 0x1  DDDDD AAAAA IIII IIII IIII IIII",
391
  EF(l_lwz), 0, it_load },
392
{ "l.lws",     "rD,I(rA)",     "10 0x2  DDDDD AAAAA IIII IIII IIII IIII", EFI,
393
  0, it_load },
394
{ "l.lbz",     "rD,I(rA)",     "10 0x3  DDDDD AAAAA IIII IIII IIII IIII",
395
  EF(l_lbz), 0, it_load },
396
{ "l.lbs",     "rD,I(rA)",     "10 0x4  DDDDD AAAAA IIII IIII IIII IIII",
397
  EF(l_lbs), 0, it_load },
398
{ "l.lhz",     "rD,I(rA)",     "10 0x5  DDDDD AAAAA IIII IIII IIII IIII",
399
  EF(l_lhz), 0, it_load },
400
{ "l.lhs",     "rD,I(rA)",     "10 0x6  DDDDD AAAAA IIII IIII IIII IIII",
401
  EF(l_lhs), 0, it_load },
402 133 markom
 
403 1346 nogj
{ "l.addi",    "rD,rA,I",      "10 0x7  DDDDD AAAAA IIII IIII IIII IIII",
404
  EF(l_add), OR32_W_FLAG, it_arith },
405
{ "l.addic",   "rD,rA,I",      "10 0x8  DDDDD AAAAA IIII IIII IIII IIII", EFI,
406
  0, it_arith },
407
{ "l.andi",    "rD,rA,K",      "10 0x9  DDDDD AAAAA KKKK KKKK KKKK KKKK",
408
  EF(l_and), OR32_W_FLAG, it_arith },
409
{ "l.ori",     "rD,rA,K",      "10 0xA  DDDDD AAAAA KKKK KKKK KKKK KKKK",
410
  EF(l_or), 0, it_arith },
411
{ "l.xori",    "rD,rA,I",      "10 0xB  DDDDD AAAAA IIII IIII IIII IIII",
412
  EF(l_xor), 0, it_arith },
413
{ "l.muli",    "rD,rA,I",      "10 0xC  DDDDD AAAAA IIII IIII IIII IIII",
414
  EF(l_mul), 0, it_arith },
415
{ "l.mfspr",   "rD,rA,K",      "10 0xD  DDDDD AAAAA KKKK KKKK KKKK KKKK",
416
  EF(l_mfspr), 0, it_move },
417
{ "l.slli",    "rD,rA,L",      "10 0xE  DDDDD AAAAA ---- ---- 00LL LLLL",
418
  EF(l_sll), 0, it_shift },
419
{ "l.srli",    "rD,rA,L",      "10 0xE  DDDDD AAAAA ---- ---- 01LL LLLL",
420
  EF(l_srl), 0, it_shift },
421
{ "l.srai",    "rD,rA,L",      "10 0xE  DDDDD AAAAA ---- ---- 10LL LLLL",
422
  EF(l_sra), 0, it_shift },
423
{ "l.rori",    "rD,rA,L",      "10 0xE  DDDDD AAAAA ---- ---- 11LL LLLL", EFI,
424
  0, it_shift },
425 133 markom
 
426 1346 nogj
{ "l.sfeqi",   "rA,I",         "10 0xF  00000 AAAAA IIII IIII IIII IIII",
427
  EF(l_sfeq), OR32_W_FLAG, it_compare },
428
{ "l.sfnei",   "rA,I",         "10 0xF  00001 AAAAA IIII IIII IIII IIII",
429
  EF(l_sfne), OR32_W_FLAG, it_compare },
430
{ "l.sfgtui",  "rA,I",         "10 0xF  00010 AAAAA IIII IIII IIII IIII",
431
  EF(l_sfgtu), OR32_W_FLAG, it_compare },
432
{ "l.sfgeui",  "rA,I",         "10 0xF  00011 AAAAA IIII IIII IIII IIII",
433
  EF(l_sfgeu), OR32_W_FLAG, it_compare },
434
{ "l.sfltui",  "rA,I",         "10 0xF  00100 AAAAA IIII IIII IIII IIII",
435
  EF(l_sfltu), OR32_W_FLAG, it_compare },
436
{ "l.sfleui",  "rA,I",         "10 0xF  00101 AAAAA IIII IIII IIII IIII",
437
  EF(l_sfleu), OR32_W_FLAG, it_compare },
438
{ "l.sfgtsi",  "rA,I",         "10 0xF  01010 AAAAA IIII IIII IIII IIII",
439
  EF(l_sfgts), OR32_W_FLAG, it_compare },
440
{ "l.sfgesi",  "rA,I",         "10 0xF  01011 AAAAA IIII IIII IIII IIII",
441
  EF(l_sfges), OR32_W_FLAG, it_compare },
442
{ "l.sfltsi",  "rA,I",         "10 0xF  01100 AAAAA IIII IIII IIII IIII",
443
  EF(l_sflts), OR32_W_FLAG, it_compare },
444
{ "l.sflesi",  "rA,I",         "10 0xF  01101 AAAAA IIII IIII IIII IIII",
445
  EF(l_sfles), OR32_W_FLAG, it_compare },
446 133 markom
 
447 1346 nogj
{ "l.mtspr",   "rA,rB,K",      "11 0x0  KKKKK AAAAA BBBB BKKK KKKK KKKK",
448
  EF(l_mtspr), 0, it_move },
449
{ "l.mac",     "rA,rB",        "11 0x1  ----- AAAAA BBBB B--- ---- 0x1",
450
  EF(l_mac), 0, it_mac },
451
{ "l.msb",     "rA,rB",        "11 0x1  ----- AAAAA BBBB B--- ---- 0x2",
452
  EF(l_msb), 0, it_mac },
453 133 markom
 
454 1346 nogj
{ "lf.add.s",   "rD,rA,rB",    "11 0x2  DDDDD AAAAA BBBB B--- 0x0 0x0",
455
  EF(lf_add_s), 0, it_float },
456
{ "lf.sub.s",   "rD,rA,rB",    "11 0x2  DDDDD AAAAA BBBB B--- 0x0 0x1",
457
  EF(lf_sub_s), 0, it_float },
458
{ "lf.mul.s",   "rD,rA,rB",    "11 0x2  DDDDD AAAAA BBBB B--- 0x0 0x2",
459
  EF(lf_mul_s), 0, it_float },
460
{ "lf.div.s",   "rD,rA,rB",    "11 0x2  DDDDD AAAAA BBBB B--- 0x0 0x3",
461
  EF(lf_div_s), 0, it_float },
462
{ "lf.itof.s",  "rD,rA",       "11 0x2  DDDDD AAAAA 0000 0--- 0x0 0x4",
463
  EF(lf_itof_s), 0, it_float },
464
{ "lf.ftoi.s",  "rD,rA",       "11 0x2  DDDDD AAAAA 0000 0--- 0x0 0x5",
465
  EF(lf_ftoi_s), 0, it_float },
466
{ "lf.rem.s",   "rD,rA,rB",    "11 0x2  DDDDD AAAAA BBBB B--- 0x0 0x6",
467
  EF(lf_rem_s), 0, it_float },
468
{ "lf.madd.s",  "rD,rA,rB",    "11 0x2  DDDDD AAAAA BBBB B--- 0x0 0x7",
469
  EF(lf_madd_s), 0, it_float },
470
{ "lf.sfeq.s",  "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0x0 0x8",
471
  EF(lf_sfeq_s), 0, it_float },
472
{ "lf.sfne.s",  "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0x0 0x9",
473
  EF(lf_sfne_s), 0, it_float },
474
{ "lf.sfgt.s",  "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0x0 0xA",
475
  EF(lf_sfgt_s), 0, it_float },
476
{ "lf.sfge.s",  "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0x0 0xB",
477
  EF(lf_sfge_s), 0, it_float },
478
{ "lf.sflt.s",  "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0x0 0xC",
479
  EF(lf_sflt_s), 0, it_float },
480
{ "lf.sfle.s",  "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0x0 0xD",
481
  EF(lf_sfle_s), 0, it_float },
482
{ "lf.cust1.s", "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0xD ----", EFI,
483
  0, it_float },
484 133 markom
 
485 1346 nogj
{ "lf.add.d",   "rD,rA,rB",    "11 0x2  DDDDD AAAAA BBBB B--- 0x1 0x0", EFI, 0,
486
  it_float },
487
{ "lf.sub.d",   "rD,rA,rB",    "11 0x2  DDDDD AAAAA BBBB B--- 0x1 0x1", EFI, 0,
488
  it_float },
489
{ "lf.mul.d",   "rD,rA,rB",    "11 0x2  DDDDD AAAAA BBBB B--- 0x1 0x2", EFI, 0,
490
  it_float },
491
{ "lf.div.d",   "rD,rA,rB",    "11 0x2  DDDDD AAAAA BBBB B--- 0x1 0x3", EFI, 0,
492
  it_float },
493
{ "lf.itof.d",  "rD,rA",       "11 0x2  DDDDD AAAAA 0000 0--- 0x1 0x4", EFI, 0,
494
  it_float },
495
{ "lf.ftoi.d",  "rD,rA",       "11 0x2  DDDDD AAAAA 0000 0--- 0x1 0x5", EFI, 0,
496
  it_float },
497
{ "lf.rem.d",   "rD,rA,rB",    "11 0x2  DDDDD AAAAA BBBB B--- 0x1 0x6", EFI, 0,
498
  it_float },
499
{ "lf.madd.d",  "rD,rA,rB",    "11 0x2  DDDDD AAAAA BBBB B--- 0x1 0x7", EFI, 0,
500
  it_float },
501
{ "lf.sfeq.d",  "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0x1 0x8", EFI, 0,
502
  it_float },
503
{ "lf.sfne.d",  "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0x1 0x9", EFI, 0,
504
  it_float },
505
{ "lf.sfgt.d",  "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0x1 0xA", EFI, 0,
506
  it_float },
507
{ "lf.sfge.d",  "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0x1 0xB", EFI, 0,
508
  it_float },
509
{ "lf.sflt.d",  "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0x1 0xC", EFI, 0,
510
  it_float },
511
{ "lf.sfle.d",  "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0x1 0xD", EFI, 0,
512
  it_float },
513
{ "lf.cust1.d", "rA,rB",       "11 0x2  ----- AAAAA BBBB B--- 0xE ----", EFI, 0,
514
  it_float },
515 676 markom
 
516 1346 nogj
{ "l.sd",      "I(rD),rB",     "11 0x4  IIIII DDDDD BBBB BIII IIII IIII", EFI,
517
  0, it_store },
518
{ "l.sw",      "I(rD),rB",     "11 0x5  IIIII DDDDD BBBB BIII IIII IIII",
519
  EF(l_sw), 0, it_store },
520
{ "l.sb",      "I(rD),rB",     "11 0x6  IIIII DDDDD BBBB BIII IIII IIII",
521
  EF(l_sb), 0, it_store },
522
{ "l.sh",      "I(rD),rB",     "11 0x7  IIIII DDDDD BBBB BIII IIII IIII",
523
  EF(l_sh), 0, it_store },
524 1295 lampret
 
525 1346 nogj
{ "l.add",     "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-00 ---- 0x0",
526
  EF(l_add), OR32_W_FLAG, it_arith },
527
{ "l.addc",    "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-00 ---- 0x1",
528
  EF(l_addc), OR32_W_FLAG, it_arith },
529
{ "l.sub",     "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-00 ---- 0x2",
530
  EF(l_sub), 0, it_arith },
531
{ "l.and",     "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-00 ---- 0x3",
532
  EF(l_and), OR32_W_FLAG, it_arith },
533
{ "l.or",      "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-00 ---- 0x4",
534
  EF(l_or), 0, it_arith },
535
{ "l.xor",     "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-00 ---- 0x5",
536
  EF(l_xor), 0, it_arith },
537
{ "l.mul",     "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-11 ---- 0x6",
538
  EF(l_mul), 0, it_arith },
539 1295 lampret
 
540 1346 nogj
{ "l.sll",     "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-00 00-- 0x8",
541
  EF(l_sll), 0, it_shift },
542
{ "l.srl",     "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-00 01-- 0x8",
543
  EF(l_srl), 0, it_shift },
544
{ "l.sra",     "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-00 10-- 0x8",
545
  EF(l_sra), 0, it_shift },
546
{ "l.ror",     "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-00 11-- 0x8", EFI,
547
  0, it_shift },
548
{ "l.div",     "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-11 ---- 0x9",
549
  EF(l_div), 0, it_arith },
550
{ "l.divu",    "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-11 ---- 0xA",
551
  EF(l_divu), 0, it_arith },
552
{ "l.mulu",    "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-11 ---- 0xB", EFI,
553
  0, it_arith },
554
{ "l.extbs",   "rD,rA",     "11 0x8  DDDDD AAAAA ---- --00 01-- 0xC",
555
  EF(l_extbs), 0, it_move },
556
{ "l.exths",   "rD,rA",     "11 0x8  DDDDD AAAAA ---- --00 00-- 0xC",
557
  EF(l_exths), 0, it_move },
558
{ "l.extws",   "rD,rA",     "11 0x8  DDDDD AAAAA ---- --00 00-- 0xD",
559
  EF(l_extws), 0, it_move },
560
{ "l.extbz",   "rD,rA",     "11 0x8  DDDDD AAAAA ---- --00 11-- 0xC",
561
  EF(l_extbz), 0, it_move },
562
{ "l.exthz",   "rD,rA",     "11 0x8  DDDDD AAAAA ---- --00 10-- 0xC",
563
  EF(l_exthz), 0, it_move },
564
{ "l.extwz",   "rD,rA",     "11 0x8  DDDDD AAAAA ---- --00 01-- 0xD",
565
  EF(l_extwz), 0, it_move },
566
{ "l.cmov",    "rD,rA,rB",     "11 0x8  DDDDD AAAAA BBBB B-00 ---- 0xE",
567
  EF(l_cmov), OR32_R_FLAG, it_move },
568 1605 nogj
{ "l.ff1",     "rD,rA",     "11 0x8  DDDDD AAAAA ---- --00 ---- 0xF",
569
  EF(l_ff1), 0, it_arith },
570 1590 lampret
{ "l.fl1",     "rD,rA",     "11 0x8  DDDDD AAAAA ---- --01 ---- 0xF", EFI, 0,
571
  it_arith },
572 133 markom
 
573 1346 nogj
{ "l.sfeq",    "rA,rB",        "11 0x9  00000 AAAAA BBBB B--- ---- ----",
574
  EF(l_sfeq), OR32_W_FLAG, it_compare },
575
{ "l.sfne",    "rA,rB",        "11 0x9  00001 AAAAA BBBB B--- ---- ----",
576
  EF(l_sfne), OR32_W_FLAG, it_compare },
577
{ "l.sfgtu",   "rA,rB",        "11 0x9  00010 AAAAA BBBB B--- ---- ----",
578
  EF(l_sfgtu), OR32_W_FLAG, it_compare },
579
{ "l.sfgeu",   "rA,rB",        "11 0x9  00011 AAAAA BBBB B--- ---- ----",
580
  EF(l_sfgeu), OR32_W_FLAG, it_compare },
581
{ "l.sfltu",   "rA,rB",        "11 0x9  00100 AAAAA BBBB B--- ---- ----",
582
  EF(l_sfltu), OR32_W_FLAG, it_compare },
583
{ "l.sfleu",   "rA,rB",        "11 0x9  00101 AAAAA BBBB B--- ---- ----",
584
  EF(l_sfleu), OR32_W_FLAG, it_compare },
585
{ "l.sfgts",   "rA,rB",        "11 0x9  01010 AAAAA BBBB B--- ---- ----",
586
  EF(l_sfgts), OR32_W_FLAG, it_compare },
587
{ "l.sfges",   "rA,rB",        "11 0x9  01011 AAAAA BBBB B--- ---- ----",
588
  EF(l_sfges), OR32_W_FLAG, it_compare },
589
{ "l.sflts",   "rA,rB",        "11 0x9  01100 AAAAA BBBB B--- ---- ----",
590
  EF(l_sflts), OR32_W_FLAG, it_compare },
591
{ "l.sfles",   "rA,rB",        "11 0x9  01101 AAAAA BBBB B--- ---- ----",
592
  EF(l_sfles), OR32_W_FLAG, it_compare },
593 676 markom
 
594 1346 nogj
{ "l.cust5",   "rD,rA,rB,L,K", "11 0xC  DDDDD AAAAA BBBB BLLL LLLK KKKK", EFI,
595
  0, it_unknown },
596
{ "l.cust6",   "",             "11 0xD  ----- ----- ---- ---- ---- ----", EFI,
597
  0, it_unknown },
598
{ "l.cust7",   "",             "11 0xE  ----- ----- ---- ---- ---- ----", EFI,
599
  0, it_unknown },
600
{ "l.cust8",   "",             "11 0xF  ----- ----- ---- ---- ---- ----", EFI,
601
  0, it_unknown },
602 133 markom
 
603 221 markom
/* This section should not be defined in or1ksim, since it contains duplicates,
604
   which would cause machine builder to complain.  */
605 374 simons
#ifdef HAS_CUST
606 1346 nogj
{ "l.cust5_1",   "rD",         "11 0xC  DDDDD ----- ---- ---- ---- ----", EFI,
607
  0, it_unknown },
608
{ "l.cust5_2",   "rD,rA"   ,   "11 0xC  DDDDD AAAAA ---- ---- ---- ----", EFI,
609
  0, it_unknown },
610
{ "l.cust5_3",   "rD,rA,rB",   "11 0xC  DDDDD AAAAA BBBB B--- ---- ----", EFI,
611
  0, it_unknown },
612 221 markom
 
613 1346 nogj
{ "l.cust6_1",   "rD",         "11 0xD  DDDDD ----- ---- ---- ---- ----", EFI,
614
  0, it_unknown },
615
{ "l.cust6_2",   "rD,rA"   ,   "11 0xD  DDDDD AAAAA ---- ---- ---- ----", EFI,
616
  0, it_unknown },
617
{ "l.cust6_3",   "rD,rA,rB",   "11 0xD  DDDDD AAAAA BBBB B--- ---- ----", EFI,
618
  0, it_unknown },
619 221 markom
 
620 1346 nogj
{ "l.cust7_1",   "rD",         "11 0xE  DDDDD ----- ---- ---- ---- ----", EFI,
621
  0, it_unknown },
622
{ "l.cust7_2",   "rD,rA"   ,   "11 0xE  DDDDD AAAAA ---- ---- ---- ----", EFI,
623
  0, it_unknown },
624
{ "l.cust7_3",   "rD,rA,rB",   "11 0xE  DDDDD AAAAA BBBB B--- ---- ----", EFI,
625
  0, it_unknown },
626 221 markom
 
627 1346 nogj
{ "l.cust8_1",   "rD",         "11 0xF  DDDDD ----- ---- ---- ---- ----", EFI,
628
  0, it_unknown },
629
{ "l.cust8_2",   "rD,rA"   ,   "11 0xF  DDDDD AAAAA ---- ---- ---- ----", EFI,
630
  0, it_unknown },
631
{ "l.cust8_3",   "rD,rA,rB",   "11 0xF  DDDDD AAAAA BBBB B--- ---- ----", EFI,
632
  0, it_unknown },
633 221 markom
#endif
634
 
635 1346 nogj
{ "", "", "", EFI, 0, 0 }  /* Dummy entry, not included in num_opcodes.  This
636
                            * lets code examine entry i+1 without checking
637
                            * if we've run off the end of the table.  */
638 133 markom
};
639
 
640
#undef EFI
641
#undef EFN
642
#undef EF 
643
 
644
/* **INDENT-ON** */
645
 
646 371 markom
/* Define dummy, if debug is not defined.  */
647 1341 nogj
#ifndef HAS_DEBUG
648
#define debug(l, fmt...) ;
649 371 markom
#endif
650 133 markom
 
651 371 markom
CONST int num_opcodes = ((sizeof(or32_opcodes)) / (sizeof(struct or32_opcode))) - 1;
652
 
653 138 markom
/* Calculates instruction length in bytes. Always 4 for OR32. */
654
int
655
insn_len(int insn_index)
656 133 markom
{
657
  insn_index = 0; /* Just to get rid that warning.  */
658
  return 4;
659
}
660
 
661
/* Is individual insn's operand signed or unsigned? */
662 138 markom
int
663
letter_signed(char l)
664 133 markom
{
665
  CONST struct or32_letter *pletter;
666
 
667
  for(pletter = or32_letters; pletter->letter != '\0'; pletter++)
668
    if (pletter->letter == l)
669
      return pletter->sign;
670
 
671
  printf("letter_signed(%c): Unknown letter.\n", l);
672
  return 0;
673
}
674
 
675 703 markom
/* Simple cache for letter ranges */
676
static int range_cache[256] = {0};
677
 
678 133 markom
/* Number of letters in the individual lettered operand. */
679 138 markom
int
680
letter_range(char l)
681 133 markom
{
682
  CONST struct or32_opcode *pinsn;
683
  char *enc;
684
  int range = 0;
685 703 markom
 
686
  /* Is value cached? */
687 1308 phoenix
  if ((range = range_cache[(unsigned char)l])) return range;
688 133 markom
 
689 138 markom
  for(pinsn = or32_opcodes; strlen(pinsn->name); pinsn++)
690
    {
691
      if (strchr(pinsn->encoding,l))
692
        {
693
          for (enc = pinsn->encoding; *enc != '\0'; enc++)
694
            if ((*enc == '0') && (*(enc+1) == 'x'))
695
              enc += 2;
696
            else if (*enc == l)
697
              range++;
698 703 markom
          return range_cache[(unsigned char)l] = range;
699 133 markom
        }
700
    }
701 703 markom
 
702 133 markom
  printf("\nABORT: letter_range(%c): Never used letter.\n", l);
703
  exit(1);
704
}
705
 
706
/* MM: Returns index of given instruction name.  */
707 138 markom
int
708
insn_index (char *insn)
709
{
710 133 markom
  int i, found = -1;
711 371 markom
  for (i = 0; i < num_opcodes; i++)
712 138 markom
    if (!strcmp (or32_opcodes[i].name, insn))
713
      {
714
        found = i;
715
        break;
716
      }
717 133 markom
  return found;
718
}
719
 
720 717 markom
/* Returns name of the specified instruction index */
721
CONST char *
722
insn_name(int index)
723 138 markom
{
724 371 markom
  if (index >= 0 && index < num_opcodes)
725 133 markom
    return or32_opcodes[index].name;
726
  else
727
    return "???";
728
}
729
 
730 1342 nogj
#if defined(HAS_EXECUTION) && SIMPLE_EXECUTION
731 717 markom
void
732 1342 nogj
l_none(struct iqueue_entry *current)
733
{
734
}
735 1452 nogj
#elif defined(HAS_EXECUTION) && DYNAMIC_EXECUTION
736
void
737 1656 nogj
l_none(struct op_queue *opq, int *param_t, int delay_slot)
738 1452 nogj
{
739
}
740 1342 nogj
#else
741
void
742 717 markom
l_none()
743 138 markom
{
744 133 markom
}
745 1342 nogj
#endif
746 133 markom
 
747
/*** Finite automata for instruction decoding building code ***/
748
 
749 1341 nogj
/* Find symbols in encoding.  */
750 706 markom
unsigned long
751 133 markom
insn_extract(param_ch, enc_initial)
752
     char param_ch;
753
     char *enc_initial;
754
{
755
  char *enc;
756
  unsigned long ret = 0;
757
  unsigned opc_pos = 32;
758
  for (enc = enc_initial; *enc != '\0'; )
759
    if ((*enc == '0') && (*(enc+1) == 'x'))
760
      {
761
        unsigned long tmp = strtol(enc+2, NULL, 16);
762
        opc_pos -= 4;
763 138 markom
        if (param_ch == '0' || param_ch == '1')
764
          {
765
            if (param_ch == '0')
766
              tmp = 15 - tmp;
767
            ret |= tmp << opc_pos;
768
          }
769 133 markom
        enc += 3;
770
      }
771 138 markom
    else
772
      {
773
        if (*enc == '0' || *enc == '1' || *enc == '-' || isalpha(*enc) )
774
          {
775
            opc_pos--;
776
            if (param_ch == *enc)
777
              ret |= 1 << opc_pos;
778
          }
779
        enc++;
780 133 markom
      }
781
  return ret;
782
}
783
 
784 138 markom
#define MAX_AUTOMATA_SIZE (1200)
785
#define MAX_OP_TABLE_SIZE (1200)
786 133 markom
#define MAX_LEN           (8)
787
 
788
#ifndef MIN
789
# define MIN(x,y)          ((x) < (y) ? (x) : (y))
790
#endif
791
 
792
unsigned long *automata;
793
int nuncovered;
794
int curpass = 0;
795
 
796 1341 nogj
/* MM: Struct that holds runtime build information about instructions.  */
797 1342 nogj
struct temp_insn_struct *ti;
798 138 markom
 
799
struct insn_op_struct *op_data, **op_start;
800
 
801
/* Recursive utility function used to find best match and to build automata.  */
802
 
803
static unsigned long *
804
cover_insn (unsigned long *cur, int pass, unsigned int mask)
805
{
806 133 markom
  int best_first = 0, best_len = 0, i, last_match = -1, ninstr = 0;
807
  unsigned long cur_mask = mask;
808
  unsigned long *next;
809
 
810
  for (i = 0; i < num_opcodes; i++)
811 138 markom
    if (ti[i].in_pass == pass)
812
      {
813
        cur_mask &= ti[i].insn_mask;
814
        ninstr++;
815
        last_match = i;
816
      }
817
 
818 344 markom
  debug(8, "%08X %08X\n", mask, cur_mask);
819 138 markom
  if (ninstr == 0)
820
    return 0;
821
  if (ninstr == 1)
822
    {
823
      /* Leaf holds instruction index. */
824 344 markom
      debug(8, "%i>I%i %s\n", cur - automata, last_match, or32_opcodes[last_match].name);
825 138 markom
      *cur = LEAF_FLAG | last_match;
826
      cur++;
827
      nuncovered--;
828
    } else {
829
      /* Find longest match.  */
830
      for (i = 0; i < 32; i++)
831
        {
832
          int len;
833
          for (len = best_len + 1; len < MIN(MAX_LEN, 33 - i); len++)
834
            {
835
              unsigned long m = (1UL << ((unsigned long)len)) - 1;
836 344 markom
              debug(9, " (%i(%08X & %08X>>%i = %08X, %08X)",len,m, cur_mask, i, (cur_mask >> (unsigned)i), (cur_mask >> (unsigned)i) & m);
837 138 markom
              if ((m & (cur_mask >> (unsigned)i)) == m)
838
                {
839
                  best_len = len;
840
                  best_first = i;
841 344 markom
                  debug(9, "!");
842 138 markom
                }
843
              else
844
                break;
845
            }
846
        }
847 344 markom
      debug(9, "\n");
848 138 markom
      if (!best_len)
849
        {
850
          fprintf (stderr, "%i instructions match mask 0x%08X:\n", ninstr, mask);
851
          for (i = 0; i < num_opcodes; i++)
852
            if (ti[i].in_pass == pass)
853
              fprintf (stderr, "%s ", or32_opcodes[i].name);
854
 
855
          fprintf (stderr, "\n");
856
          exit (1);
857
        }
858 344 markom
      debug(8, "%i> #### %i << %i (%i) ####\n", cur - automata, best_len, best_first, ninstr);
859 138 markom
      *cur = best_first;
860
      cur++;
861
      *cur = (1 << best_len) - 1;
862
      cur++;
863
      next = cur;
864
      /* Allocate space for pointers.  */
865
      cur += 1 << best_len;
866
      cur_mask = (1 << (unsigned long)best_len) - 1;
867
 
868
      for (i = 0; i < (1 << (unsigned long)best_len); i++)
869
        {
870
          int j;
871
          unsigned long *c;
872
          curpass++;
873
          for (j = 0; j < num_opcodes; j++)
874
            if (ti[j].in_pass == pass
875 371 markom
                && ((ti[j].insn >> best_first) & cur_mask) == (unsigned long) i
876 138 markom
                && ((ti[j].insn_mask >> best_first) & cur_mask) == cur_mask)
877
              ti[j].in_pass = curpass;
878
 
879 344 markom
          debug(9, "%08X %08X %i\n", mask, cur_mask, best_first);
880 138 markom
          c = cover_insn (cur, curpass, mask & (~(cur_mask << best_first)));
881
          if (c)
882
            {
883 344 markom
              debug(8, "%i> #%X -> %u\n", next - automata, i, cur - automata);
884 138 markom
              *next = cur - automata;
885
              cur = c;
886
            }
887
          else
888
            {
889 344 markom
              debug(8, "%i> N/A\n", next - automata);
890 138 markom
              *next = 0;
891
            }
892
          next++;
893
        }
894 133 markom
    }
895 138 markom
  return cur;
896
}
897 133 markom
 
898 138 markom
/* Returns number of nonzero bits. */
899
static int
900
num_ones (unsigned long value)
901
{
902
  int c = 0;
903
  while (value)
904
    {
905
      if (value & 1)
906
        c++;
907
      value >>= 1;
908 133 markom
    }
909 138 markom
  return c;
910
}
911 133 markom
 
912 138 markom
/* Utility function, which converts parameters from or32_opcode format to more binary form.
913
   Parameters are stored in ti struct.  */
914
 
915
static struct insn_op_struct *
916
parse_params (CONST struct or32_opcode *opcode, struct insn_op_struct *cur)
917
{
918
  char *args = opcode->args;
919
  int i, type;
920 1346 nogj
  int num_cur_op = 0;;
921 138 markom
 
922
  i = 0;
923
  type = 0;
924 262 markom
  /* In case we don't have any parameters, we add dummy read from r0.  */
925
  if (!(*args)) {
926 263 markom
    cur->type = OPTYPE_REG | OPTYPE_OP | OPTYPE_LAST;
927 262 markom
    cur->data = 0;
928 355 markom
    debug(9, "#%08X %08X\n", cur->type, cur->data);
929 262 markom
    cur++;
930
    return cur;
931
  }
932
 
933 138 markom
  while (*args != '\0')
934
    {
935
      if (*args == 'r')
936
        {
937
          args++;
938
          type |= OPTYPE_REG;
939 1597 nogj
          if(*args == 'D')
940 1341 nogj
            type |= OPTYPE_DST;
941 133 markom
        }
942 138 markom
      else if (isalpha (*args))
943
        {
944
          unsigned long arg;
945
          arg = insn_extract(*args, opcode->encoding);
946 355 markom
          debug(9, "%s : %08X ------\n", opcode->name, arg);
947 138 markom
          if (letter_signed (*args))
948
            {
949
              type |= OPTYPE_SIG;
950
              type |= ((num_ones (arg) - 1) << OPTYPE_SBIT_SHR) & OPTYPE_SBIT;
951
            }
952
 
953 1346 nogj
          num_cur_op = 0;
954 138 markom
          /* Split argument to sequences of consecutive ones.  */
955
          while (arg)
956
            {
957
              int shr = 0;
958
              unsigned long tmp = arg, mask = 0;
959
              while ((tmp & 1) == 0)
960
                {
961
                  shr++;
962
                  tmp >>= 1;
963
                }
964
              while (tmp & 1)
965
                {
966
                  mask++;
967
                  tmp >>= 1;
968
                }
969
              cur->type = type | shr;
970
              cur->data = mask;
971
              arg &= ~(((1 << mask) - 1) << shr);
972 355 markom
              debug(6, "|%08X %08X\n", cur->type, cur->data);
973 138 markom
              cur++;
974 1346 nogj
              num_cur_op++;
975 138 markom
            }
976
          args++;
977
        }
978
      else if (*args == '(')
979
        {
980
          /* Next param is displacement.  Later we will treat them as one operand.  */
981 1346 nogj
          /* Set the OPTYPE_DIS flag on all insn_op_structs that belong to this
982
           * operand */
983
          while(num_cur_op > 0) {
984
            cur[-num_cur_op].type |= type | OPTYPE_DIS;
985
            num_cur_op--;
986
          }
987
          cur[-1].type |= OPTYPE_OP;
988 355 markom
          debug(9, ">%08X %08X\n", cur->type, cur->data);
989 138 markom
          type = 0;
990
          i++;
991
          args++;
992
        }
993
      else if (*args == OPERAND_DELIM)
994
        {
995
          cur--;
996
          cur->type = type | cur->type | OPTYPE_OP;
997 355 markom
          debug(9, ">%08X %08X\n", cur->type, cur->data);
998 138 markom
          cur++;
999
          type = 0;
1000
          i++;
1001
          args++;
1002
        }
1003
      else if (*args == '0')
1004
        {
1005
          cur->type = type;
1006
          cur->data = 0;
1007 355 markom
          debug(9, ">%08X %08X\n", cur->type, cur->data);
1008 138 markom
          cur++;
1009
          type = 0;
1010
          i++;
1011
          args++;
1012
        }
1013
      else if (*args == ')')
1014
        args++;
1015
      else
1016
        {
1017
          fprintf (stderr, "%s : parse error in args.\n", opcode->name);
1018
          exit (1);
1019
        }
1020 133 markom
    }
1021 138 markom
  cur--;
1022
  cur->type = type | cur->type | OPTYPE_OP | OPTYPE_LAST;
1023 355 markom
  debug(9, "#%08X %08X\n", cur->type, cur->data);
1024 138 markom
  cur++;
1025 133 markom
  return cur;
1026
}
1027
 
1028 138 markom
/* Constructs new automata based on or32_opcodes array.  */
1029
 
1030
void
1031
build_automata()
1032
{
1033 371 markom
  int i;
1034 133 markom
  unsigned long *end;
1035 138 markom
  struct insn_op_struct *cur;
1036
 
1037 133 markom
  automata = (unsigned long *) malloc (MAX_AUTOMATA_SIZE * sizeof (unsigned long));
1038 138 markom
  ti = (struct temp_insn_struct *) malloc (sizeof (struct temp_insn_struct) * num_opcodes);
1039 133 markom
 
1040
  nuncovered = num_opcodes;
1041 709 markom
 
1042
#ifdef HAS_EXECUTION
1043 138 markom
  printf("Building automata... ");
1044 709 markom
#endif
1045
 
1046 133 markom
  /* Build temporary information about instructions.  */
1047 138 markom
  for (i = 0; i < num_opcodes; i++)
1048
    {
1049
      unsigned long ones, zeros;
1050
      char *encoding = or32_opcodes[i].encoding;
1051
      ones  = insn_extract('1', encoding);
1052
      zeros = insn_extract('0', encoding);
1053
      ti[i].insn_mask = ones | zeros;
1054
      ti[i].insn = ones;
1055
      ti[i].in_pass = curpass = 0;
1056 344 markom
      /*debug(9, "%s: %s %08X %08X\n", or32_opcodes[i].name,
1057 138 markom
        or32_opcodes[i].encoding, ti[i].insn_mask, ti[i].insn);*/
1058
    }
1059 133 markom
 
1060
  /* Until all are covered search for best criteria to separate them.  */
1061 138 markom
  end = cover_insn (automata, curpass, 0xFFFFFFFF);
1062
  if (end - automata > MAX_AUTOMATA_SIZE)
1063
    {
1064
      fprintf (stderr, "Automata too large. Increase MAX_AUTOMATA_SIZE.");
1065
      exit (1);
1066
    }
1067 709 markom
#ifdef HAS_EXECUTION
1068 138 markom
  printf("done, num uncovered: %i/%i.\n", nuncovered, num_opcodes);
1069 709 markom
#endif
1070 371 markom
 
1071 709 markom
#ifdef HAS_EXECUTION
1072 138 markom
  printf("Parsing operands data... ");
1073 709 markom
#endif
1074 138 markom
  op_data = (struct insn_op_struct *) malloc (MAX_OP_TABLE_SIZE * sizeof (struct insn_op_struct));
1075
  op_start = (struct insn_op_struct **) malloc (num_opcodes * sizeof (struct insn_op_struct *));
1076
  cur = op_data;
1077
  for (i = 0; i < num_opcodes; i++)
1078
    {
1079
      op_start[i] = cur;
1080
      cur = parse_params (&or32_opcodes[i], cur);
1081
      if (cur - op_data > MAX_OP_TABLE_SIZE)
1082
        {
1083
          fprintf (stderr, "Operands table too small, increase MAX_OP_TABLE_SIZE.\n");
1084
          exit (1);
1085
        }
1086
    }
1087 709 markom
#ifdef HAS_EXECUTION
1088 138 markom
  printf("done.\n");
1089 709 markom
#endif
1090 133 markom
}
1091
 
1092 138 markom
void destruct_automata ()
1093
{
1094
  free (ti);
1095 133 markom
  free (automata);
1096 138 markom
  free (op_data);
1097
  free (op_start);
1098 133 markom
}
1099
 
1100
/* Decodes instruction and returns instruction index.  */
1101 138 markom
int insn_decode (unsigned int insn)
1102
{
1103 133 markom
  unsigned long *a = automata;
1104 138 markom
  int i;
1105
  while (!(*a & LEAF_FLAG))
1106
    {
1107
      unsigned int first = *a;
1108 703 markom
      //debug(9, "%i ", a - automata);
1109 138 markom
      a++;
1110
      i = (insn >> first) & *a;
1111
      a++;
1112
      if (!*(a + i))
1113
        { /* Invalid instruction found?  */
1114 703 markom
          //debug(9, "XXX\n", i);
1115 138 markom
          return -1;
1116
        }
1117
      a = automata + *(a + i);
1118
    }
1119
  i = *a & ~LEAF_FLAG;
1120 703 markom
  //debug(9, "%i\n", i);
1121 138 markom
  /* Final check - do we have direct match?
1122
     (based on or32_opcodes this should be the only possibility,
1123
     but in case of invalid/missing instruction we must perform a check)  */
1124
  if ((ti[i].insn_mask & insn) == ti[i].insn)
1125
    return i;
1126
  else
1127
    return -1;
1128 133 markom
}
1129 371 markom
 
1130
static char disassembled_str[50];
1131
char *disassembled = &disassembled_str[0];
1132
 
1133
/* Automagically does zero- or sign- extension and also finds correct
1134
   sign bit position if sign extension is correct extension. Which extension
1135
   is proper is figured out from letter description. */
1136
 
1137 879 markom
unsigned long
1138 371 markom
extend_imm(unsigned long imm, char l)
1139
{
1140
  unsigned long mask;
1141
  int letter_bits;
1142
 
1143
  /* First truncate all bits above valid range for this letter
1144
     in case it is zero extend. */
1145
  letter_bits = letter_range(l);
1146
  mask = (1 << letter_bits) - 1;
1147
  imm &= mask;
1148
 
1149
  /* Do sign extend if this is the right one. */
1150
  if (letter_signed(l) && (imm >> (letter_bits - 1)))
1151
    imm |= (~mask);
1152
 
1153
  return imm;
1154
}
1155
 
1156 879 markom
unsigned long
1157 371 markom
or32_extract(param_ch, enc_initial, insn)
1158
     char param_ch;
1159
     char *enc_initial;
1160
     unsigned long insn;
1161
{
1162
  char *enc;
1163
  unsigned long ret = 0;
1164
  int opc_pos = 0;
1165
  int param_pos = 0;
1166
 
1167
  for (enc = enc_initial; *enc != '\0'; enc++)
1168
    if (*enc == param_ch)
1169
      {
1170
        if (enc - 2 >= enc_initial && (*(enc - 2) == '0') && (*(enc - 1) == 'x'))
1171
          continue;
1172
        else
1173
          param_pos++;
1174
      }
1175
 
1176
#if DEBUG
1177
  printf("or32_extract: %x ", param_pos);
1178
#endif
1179
  opc_pos = 32;
1180
  for (enc = enc_initial; *enc != '\0'; )
1181
    if ((*enc == '0') && (*(enc+1) == 'x'))
1182
      {
1183
        opc_pos -= 4;
1184
        if ((param_ch == '0') || (param_ch == '1'))
1185
          {
1186
            unsigned long tmp = strtol(enc, NULL, 16);
1187
#if DEBUG
1188
            printf(" enc=%s, tmp=%x ", enc, tmp);
1189
#endif
1190
            if (param_ch == '0')
1191
              tmp = 15 - tmp;
1192
            ret |= tmp << opc_pos;
1193
          }
1194
        enc += 3;
1195
      }
1196
    else if ((*enc == '0') || (*enc == '1'))
1197
      {
1198
        opc_pos--;
1199
        if (param_ch == *enc)
1200
          ret |= 1 << opc_pos;
1201
        enc++;
1202
      }
1203
    else if (*enc == param_ch)
1204
      {
1205
        opc_pos--;
1206
        param_pos--;
1207
#if DEBUG
1208
        printf("\n  ret=%x opc_pos=%x, param_pos=%x\n", ret, opc_pos, param_pos);
1209
#endif  
1210
        if (islower(param_ch))
1211
          ret -= ((insn >> opc_pos) & 0x1) << param_pos;
1212
        else
1213
          ret += ((insn >> opc_pos) & 0x1) << param_pos;
1214
        enc++;
1215
      }
1216
    else if (isalpha(*enc))
1217
      {
1218
        opc_pos--;
1219
        enc++;
1220
      }
1221
    else if (*enc == '-')
1222
      {
1223
        opc_pos--;
1224
        enc++;
1225
      }
1226
    else
1227
      enc++;
1228
 
1229
#if DEBUG
1230
  printf ("ret=%x\n", ret);
1231
#endif
1232
  return ret;
1233
}
1234
 
1235
/* Print register. Used only by print_insn. */
1236
 
1237 703 markom
static char *
1238
or32_print_register (dest, param_ch, encoding, insn)
1239
     char *dest;
1240 371 markom
     char param_ch;
1241
     char *encoding;
1242
     unsigned long insn;
1243
{
1244
  int regnum = or32_extract(param_ch, encoding, insn);
1245
 
1246 703 markom
  sprintf (dest, "r%d", regnum);
1247
  while (*dest) dest++;
1248
  return dest;
1249 371 markom
}
1250
 
1251
/* Print immediate. Used only by print_insn. */
1252
 
1253 703 markom
static char *
1254
or32_print_immediate (dest, param_ch, encoding, insn)
1255
     char *dest;
1256 371 markom
     char param_ch;
1257
     char *encoding;
1258
     unsigned long insn;
1259
{
1260
  int imm = or32_extract (param_ch, encoding, insn);
1261
 
1262
  imm = extend_imm(imm, param_ch);
1263
 
1264
  if (letter_signed(param_ch))
1265
    {
1266
      if (imm < 0)
1267 703 markom
        sprintf (dest, "%d", imm);
1268 371 markom
      else
1269 703 markom
        sprintf (dest, "0x%x", imm);
1270 371 markom
    }
1271
  else
1272 703 markom
    sprintf (dest, "%#x", imm);
1273
  while (*dest) dest++;
1274
  return dest;
1275 371 markom
}
1276
 
1277
/* Disassemble one instruction from insn to disassemble.
1278
   Return the size of the instruction.  */
1279
 
1280
int
1281
disassemble_insn (insn)
1282
     unsigned long insn;
1283
{
1284 703 markom
  return disassemble_index (insn, insn_decode (insn));
1285
}
1286 371 markom
 
1287 703 markom
/* Disassemble one instruction from insn index.
1288
   Return the size of the instruction.  */
1289
 
1290
int
1291
disassemble_index (insn, index)
1292
     unsigned long insn;
1293
     int index;
1294
{
1295
  char *dest = disassembled;
1296 371 markom
  if (index >= 0)
1297
    {
1298
      struct or32_opcode const *opcode = &or32_opcodes[index];
1299
      char *s;
1300
 
1301 703 markom
      strcpy (dest, opcode->name);
1302
      while (*dest) dest++;
1303
      *dest++ = ' ';
1304
      *dest = 0;
1305
 
1306 371 markom
      for (s = opcode->args; *s != '\0'; ++s)
1307
        {
1308
          switch (*s)
1309
            {
1310
            case '\0':
1311 703 markom
              return insn_len (insn);
1312 714 markom
 
1313 371 markom
            case 'r':
1314 703 markom
              dest = or32_print_register(dest, *++s, opcode->encoding, insn);
1315 371 markom
              break;
1316 714 markom
 
1317 371 markom
            default:
1318
              if (strchr (opcode->encoding, *s))
1319 703 markom
                dest = or32_print_immediate (dest, *s, opcode->encoding, insn);
1320
              else {
1321
                *dest++ = *s;
1322
                *dest = 0;
1323
              }
1324 371 markom
            }
1325
        }
1326
    }
1327
  else
1328
    {
1329
      /* This used to be %8x for binutils.  */
1330 1308 phoenix
      sprintf(dest, ".word 0x%08lx", insn);
1331 703 markom
      while (*dest) dest++;
1332 371 markom
    }
1333
  return insn_len (insn);
1334
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.