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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [opcodes/] [or32.c] - Blame information for rev 1672

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

powered by: WebSVN 2.1.0

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