1 /* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */
2 /* Instruction opcode table for or1k.
4 THIS FILE IS MACHINE GENERATED WITH CGEN.
6 Copyright (C) 1996-2018 Free Software Foundation, Inc.
8 This file is part of the GNU Binutils and/or GDB, the GNU debugger.
10 This file is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3, or (at your option)
15 It is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 License for more details.
20 You should have received a copy of the GNU General Public License along
21 with this program; if not, write to the Free Software Foundation, Inc.,
22 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
30 #include "or1k-desc.h"
32 #include "libiberty.h"
36 /* The hash functions are recorded here to help keep assembler code out of
37 the disassembler and vice versa. */
39 static int asm_hash_insn_p (const CGEN_INSN *);
40 static unsigned int asm_hash_insn (const char *);
41 static int dis_hash_insn_p (const CGEN_INSN *);
42 static unsigned int dis_hash_insn (const char *, CGEN_INSN_INT);
44 /* Instruction formats. */
46 #define F(f) & or1k_cgen_ifld_table[OR1K_##f]
47 static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED = {
51 static const CGEN_IFMT ifmt_l_j ATTRIBUTE_UNUSED = {
52 32, 32, 0xfc000000, { { F (F_OPCODE) }, { F (F_DISP26) }, { 0 } }
55 static const CGEN_IFMT ifmt_l_jr ATTRIBUTE_UNUSED = {
56 32, 32, 0xffff07ff, { { F (F_OPCODE) }, { F (F_RESV_25_10) }, { F (F_R3) }, { F (F_RESV_10_11) }, { 0 } }
59 static const CGEN_IFMT ifmt_l_trap ATTRIBUTE_UNUSED = {
60 32, 32, 0xffff0000, { { F (F_OPCODE) }, { F (F_OP_25_5) }, { F (F_RESV_20_5) }, { F (F_UIMM16) }, { 0 } }
63 static const CGEN_IFMT ifmt_l_msync ATTRIBUTE_UNUSED = {
64 32, 32, 0xffffffff, { { F (F_OPCODE) }, { F (F_OP_25_5) }, { F (F_RESV_20_21) }, { 0 } }
67 static const CGEN_IFMT ifmt_l_rfe ATTRIBUTE_UNUSED = {
68 32, 32, 0xffffffff, { { F (F_OPCODE) }, { F (F_RESV_25_26) }, { 0 } }
71 static const CGEN_IFMT ifmt_l_nop_imm ATTRIBUTE_UNUSED = {
72 32, 32, 0xffff0000, { { F (F_OPCODE) }, { F (F_OP_25_2) }, { F (F_RESV_23_8) }, { F (F_UIMM16) }, { 0 } }
75 static const CGEN_IFMT ifmt_l_movhi ATTRIBUTE_UNUSED = {
76 32, 32, 0xfc1f0000, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_RESV_20_4) }, { F (F_OP_16_1) }, { F (F_UIMM16) }, { 0 } }
79 static const CGEN_IFMT ifmt_l_macrc ATTRIBUTE_UNUSED = {
80 32, 32, 0xfc1fffff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_RESV_20_4) }, { F (F_OP_16_1) }, { F (F_UIMM16) }, { 0 } }
83 static const CGEN_IFMT ifmt_l_mfspr ATTRIBUTE_UNUSED = {
84 32, 32, 0xfc000000, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } }
87 static const CGEN_IFMT ifmt_l_mtspr ATTRIBUTE_UNUSED = {
88 32, 32, 0xfc000000, { { F (F_OPCODE) }, { F (F_R2) }, { F (F_R3) }, { F (F_UIMM16_SPLIT) }, { 0 } }
91 static const CGEN_IFMT ifmt_l_lwz ATTRIBUTE_UNUSED = {
92 32, 32, 0xfc000000, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
95 static const CGEN_IFMT ifmt_l_sw ATTRIBUTE_UNUSED = {
96 32, 32, 0xfc000000, { { F (F_OPCODE) }, { F (F_R2) }, { F (F_R3) }, { F (F_SIMM16_SPLIT) }, { 0 } }
99 static const CGEN_IFMT ifmt_l_swa ATTRIBUTE_UNUSED = {
100 32, 32, 0xfc000000, { { F (F_OPCODE) }, { F (F_R2) }, { F (F_R3) }, { F (F_SIMM16) }, { 0 } }
103 static const CGEN_IFMT ifmt_l_sll ATTRIBUTE_UNUSED = {
104 32, 32, 0xfc0007ff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_2) }, { F (F_RESV_5_2) }, { F (F_OP_3_4) }, { 0 } }
107 static const CGEN_IFMT ifmt_l_slli ATTRIBUTE_UNUSED = {
108 32, 32, 0xfc00ffc0, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_RESV_15_8) }, { F (F_OP_7_2) }, { F (F_UIMM6) }, { 0 } }
111 static const CGEN_IFMT ifmt_l_and ATTRIBUTE_UNUSED = {
112 32, 32, 0xfc0007ff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_7) }, { F (F_OP_3_4) }, { 0 } }
115 static const CGEN_IFMT ifmt_l_exths ATTRIBUTE_UNUSED = {
116 32, 32, 0xfc00ffff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_RESV_15_6) }, { F (F_OP_9_4) }, { F (F_RESV_5_2) }, { F (F_OP_3_4) }, { 0 } }
119 static const CGEN_IFMT ifmt_l_cmov ATTRIBUTE_UNUSED = {
120 32, 32, 0xfc0007ff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_1) }, { F (F_OP_9_2) }, { F (F_RESV_7_4) }, { F (F_OP_3_4) }, { 0 } }
123 static const CGEN_IFMT ifmt_l_sfgts ATTRIBUTE_UNUSED = {
124 32, 32, 0xffe007ff, { { F (F_OPCODE) }, { F (F_OP_25_5) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_11) }, { 0 } }
127 static const CGEN_IFMT ifmt_l_sfgtsi ATTRIBUTE_UNUSED = {
128 32, 32, 0xffe00000, { { F (F_OPCODE) }, { F (F_OP_25_5) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
131 static const CGEN_IFMT ifmt_l_mac ATTRIBUTE_UNUSED = {
132 32, 32, 0xffe007ff, { { F (F_OPCODE) }, { F (F_OP_25_5) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_7) }, { F (F_OP_3_4) }, { 0 } }
135 static const CGEN_IFMT ifmt_l_maci ATTRIBUTE_UNUSED = {
136 32, 32, 0xffe00000, { { F (F_OPCODE) }, { F (F_RESV_25_5) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
139 static const CGEN_IFMT ifmt_lf_add_s ATTRIBUTE_UNUSED = {
140 32, 32, 0xfc0007ff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } }
143 static const CGEN_IFMT ifmt_lf_add_d ATTRIBUTE_UNUSED = {
144 32, 32, 0xfc0007ff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R1) }, { F (F_R1) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } }
147 static const CGEN_IFMT ifmt_lf_itof_s ATTRIBUTE_UNUSED = {
148 32, 32, 0xfc00ffff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } }
151 static const CGEN_IFMT ifmt_lf_ftoi_s ATTRIBUTE_UNUSED = {
152 32, 32, 0xfc00ffff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } }
155 static const CGEN_IFMT ifmt_lf_ftoi_d ATTRIBUTE_UNUSED = {
156 32, 32, 0xfc00ffff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R1) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } }
159 static const CGEN_IFMT ifmt_lf_eq_s ATTRIBUTE_UNUSED = {
160 32, 32, 0xffe007ff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } }
163 static const CGEN_IFMT ifmt_lf_cust1_s ATTRIBUTE_UNUSED = {
164 32, 32, 0xffe007ff, { { F (F_OPCODE) }, { F (F_RESV_25_5) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } }
167 static const CGEN_IFMT ifmt_lf_cust1_d ATTRIBUTE_UNUSED = {
168 32, 32, 0xffe007ff, { { F (F_OPCODE) }, { F (F_RESV_25_5) }, { F (F_R1) }, { F (F_R1) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } }
173 #define A(a) (1 << CGEN_INSN_##a)
174 #define OPERAND(op) OR1K_OPERAND_##op
175 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
176 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
178 /* The instruction table. */
180 static const CGEN_OPCODE or1k_cgen_insn_opcode_table[MAX_INSNS] =
182 /* Special null first entry.
183 A `num' value of zero is thus invalid.
184 Also, the special `invalid' insn resides here. */
185 { { 0, 0, 0, 0 }, {{0}}, 0, {0}},
189 { { MNEM, ' ', OP (DISP26), 0 } },
192 /* l.jal ${disp26} */
195 { { MNEM, ' ', OP (DISP26), 0 } },
196 & ifmt_l_j, { 0x4000000 }
201 { { MNEM, ' ', OP (RB), 0 } },
202 & ifmt_l_jr, { 0x44000000 }
207 { { MNEM, ' ', OP (RB), 0 } },
208 & ifmt_l_jr, { 0x48000000 }
210 /* l.bnf ${disp26} */
213 { { MNEM, ' ', OP (DISP26), 0 } },
214 & ifmt_l_j, { 0xc000000 }
219 { { MNEM, ' ', OP (DISP26), 0 } },
220 & ifmt_l_j, { 0x10000000 }
222 /* l.trap ${uimm16} */
225 { { MNEM, ' ', OP (UIMM16), 0 } },
226 & ifmt_l_trap, { 0x21000000 }
228 /* l.sys ${uimm16} */
231 { { MNEM, ' ', OP (UIMM16), 0 } },
232 & ifmt_l_trap, { 0x20000000 }
238 & ifmt_l_msync, { 0x22000000 }
244 & ifmt_l_msync, { 0x22800000 }
250 & ifmt_l_msync, { 0x23000000 }
256 & ifmt_l_rfe, { 0x24000000 }
258 /* l.nop ${uimm16} */
261 { { MNEM, ' ', OP (UIMM16), 0 } },
262 & ifmt_l_nop_imm, { 0x15000000 }
268 & ifmt_l_nop_imm, { 0x15000000 }
270 /* l.movhi $rD,$uimm16 */
273 { { MNEM, ' ', OP (RD), ',', OP (UIMM16), 0 } },
274 & ifmt_l_movhi, { 0x18000000 }
279 { { MNEM, ' ', OP (RD), 0 } },
280 & ifmt_l_macrc, { 0x18010000 }
282 /* l.mfspr $rD,$rA,${uimm16} */
285 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM16), 0 } },
286 & ifmt_l_mfspr, { 0xb4000000 }
288 /* l.mtspr $rA,$rB,${uimm16-split} */
291 { { MNEM, ' ', OP (RA), ',', OP (RB), ',', OP (UIMM16_SPLIT), 0 } },
292 & ifmt_l_mtspr, { 0xc0000000 }
294 /* l.lwz $rD,${simm16}($rA) */
297 { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } },
298 & ifmt_l_lwz, { 0x84000000 }
300 /* l.lws $rD,${simm16}($rA) */
303 { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } },
304 & ifmt_l_lwz, { 0x88000000 }
306 /* l.lwa $rD,${simm16}($rA) */
309 { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } },
310 & ifmt_l_lwz, { 0x6c000000 }
312 /* l.lbz $rD,${simm16}($rA) */
315 { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } },
316 & ifmt_l_lwz, { 0x8c000000 }
318 /* l.lbs $rD,${simm16}($rA) */
321 { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } },
322 & ifmt_l_lwz, { 0x90000000 }
324 /* l.lhz $rD,${simm16}($rA) */
327 { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } },
328 & ifmt_l_lwz, { 0x94000000 }
330 /* l.lhs $rD,${simm16}($rA) */
333 { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } },
334 & ifmt_l_lwz, { 0x98000000 }
336 /* l.sw ${simm16-split}($rA),$rB */
339 { { MNEM, ' ', OP (SIMM16_SPLIT), '(', OP (RA), ')', ',', OP (RB), 0 } },
340 & ifmt_l_sw, { 0xd4000000 }
342 /* l.sb ${simm16-split}($rA),$rB */
345 { { MNEM, ' ', OP (SIMM16_SPLIT), '(', OP (RA), ')', ',', OP (RB), 0 } },
346 & ifmt_l_sw, { 0xd8000000 }
348 /* l.sh ${simm16-split}($rA),$rB */
351 { { MNEM, ' ', OP (SIMM16_SPLIT), '(', OP (RA), ')', ',', OP (RB), 0 } },
352 & ifmt_l_sw, { 0xdc000000 }
354 /* l.swa ${simm16-split}($rA),$rB */
357 { { MNEM, ' ', OP (SIMM16_SPLIT), '(', OP (RA), ')', ',', OP (RB), 0 } },
358 & ifmt_l_swa, { 0xcc000000 }
360 /* l.sll $rD,$rA,$rB */
363 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
364 & ifmt_l_sll, { 0xe0000008 }
366 /* l.slli $rD,$rA,${uimm6} */
369 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM6), 0 } },
370 & ifmt_l_slli, { 0xb8000000 }
372 /* l.srl $rD,$rA,$rB */
375 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
376 & ifmt_l_sll, { 0xe0000048 }
378 /* l.srli $rD,$rA,${uimm6} */
381 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM6), 0 } },
382 & ifmt_l_slli, { 0xb8000040 }
384 /* l.sra $rD,$rA,$rB */
387 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
388 & ifmt_l_sll, { 0xe0000088 }
390 /* l.srai $rD,$rA,${uimm6} */
393 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM6), 0 } },
394 & ifmt_l_slli, { 0xb8000080 }
396 /* l.ror $rD,$rA,$rB */
399 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
400 & ifmt_l_sll, { 0xe00000c8 }
402 /* l.rori $rD,$rA,${uimm6} */
405 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM6), 0 } },
406 & ifmt_l_slli, { 0xb80000c0 }
408 /* l.and $rD,$rA,$rB */
411 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
412 & ifmt_l_and, { 0xe0000003 }
414 /* l.or $rD,$rA,$rB */
417 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
418 & ifmt_l_and, { 0xe0000004 }
420 /* l.xor $rD,$rA,$rB */
423 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
424 & ifmt_l_and, { 0xe0000005 }
426 /* l.add $rD,$rA,$rB */
429 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
430 & ifmt_l_and, { 0xe0000000 }
432 /* l.sub $rD,$rA,$rB */
435 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
436 & ifmt_l_and, { 0xe0000002 }
438 /* l.addc $rD,$rA,$rB */
441 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
442 & ifmt_l_and, { 0xe0000001 }
444 /* l.mul $rD,$rA,$rB */
447 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
448 & ifmt_l_and, { 0xe0000306 }
450 /* l.mulu $rD,$rA,$rB */
453 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
454 & ifmt_l_and, { 0xe000030b }
456 /* l.div $rD,$rA,$rB */
459 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
460 & ifmt_l_and, { 0xe0000309 }
462 /* l.divu $rD,$rA,$rB */
465 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
466 & ifmt_l_and, { 0xe000030a }
471 { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } },
472 & ifmt_l_and, { 0xe000000f }
477 { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } },
478 & ifmt_l_and, { 0xe000010f }
480 /* l.andi $rD,$rA,$uimm16 */
483 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM16), 0 } },
484 & ifmt_l_mfspr, { 0xa4000000 }
486 /* l.ori $rD,$rA,$uimm16 */
489 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM16), 0 } },
490 & ifmt_l_mfspr, { 0xa8000000 }
492 /* l.xori $rD,$rA,$simm16 */
495 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (SIMM16), 0 } },
496 & ifmt_l_lwz, { 0xac000000 }
498 /* l.addi $rD,$rA,$simm16 */
501 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (SIMM16), 0 } },
502 & ifmt_l_lwz, { 0x9c000000 }
504 /* l.addic $rD,$rA,$simm16 */
507 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (SIMM16), 0 } },
508 & ifmt_l_lwz, { 0xa0000000 }
510 /* l.muli $rD,$rA,$simm16 */
513 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (SIMM16), 0 } },
514 & ifmt_l_lwz, { 0xb0000000 }
516 /* l.exths $rD,$rA */
519 { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } },
520 & ifmt_l_exths, { 0xe000000c }
522 /* l.extbs $rD,$rA */
525 { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } },
526 & ifmt_l_exths, { 0xe000004c }
528 /* l.exthz $rD,$rA */
531 { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } },
532 & ifmt_l_exths, { 0xe000008c }
534 /* l.extbz $rD,$rA */
537 { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } },
538 & ifmt_l_exths, { 0xe00000cc }
540 /* l.extws $rD,$rA */
543 { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } },
544 & ifmt_l_exths, { 0xe000000d }
546 /* l.extwz $rD,$rA */
549 { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } },
550 & ifmt_l_exths, { 0xe000004d }
552 /* l.cmov $rD,$rA,$rB */
555 { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
556 & ifmt_l_cmov, { 0xe000000e }
558 /* l.sfgts $rA,$rB */
561 { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
562 & ifmt_l_sfgts, { 0xe5400000 }
564 /* l.sfgtsi $rA,$simm16 */
567 { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } },
568 & ifmt_l_sfgtsi, { 0xbd400000 }
570 /* l.sfgtu $rA,$rB */
573 { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
574 & ifmt_l_sfgts, { 0xe4400000 }
576 /* l.sfgtui $rA,$simm16 */
579 { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } },
580 & ifmt_l_sfgtsi, { 0xbc400000 }
582 /* l.sfges $rA,$rB */
585 { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
586 & ifmt_l_sfgts, { 0xe5600000 }
588 /* l.sfgesi $rA,$simm16 */
591 { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } },
592 & ifmt_l_sfgtsi, { 0xbd600000 }
594 /* l.sfgeu $rA,$rB */
597 { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
598 & ifmt_l_sfgts, { 0xe4600000 }
600 /* l.sfgeui $rA,$simm16 */
603 { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } },
604 & ifmt_l_sfgtsi, { 0xbc600000 }
606 /* l.sflts $rA,$rB */
609 { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
610 & ifmt_l_sfgts, { 0xe5800000 }
612 /* l.sfltsi $rA,$simm16 */
615 { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } },
616 & ifmt_l_sfgtsi, { 0xbd800000 }
618 /* l.sfltu $rA,$rB */
621 { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
622 & ifmt_l_sfgts, { 0xe4800000 }
624 /* l.sfltui $rA,$simm16 */
627 { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } },
628 & ifmt_l_sfgtsi, { 0xbc800000 }
630 /* l.sfles $rA,$rB */
633 { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
634 & ifmt_l_sfgts, { 0xe5a00000 }
636 /* l.sflesi $rA,$simm16 */
639 { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } },
640 & ifmt_l_sfgtsi, { 0xbda00000 }
642 /* l.sfleu $rA,$rB */
645 { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
646 & ifmt_l_sfgts, { 0xe4a00000 }
648 /* l.sfleui $rA,$simm16 */
651 { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } },
652 & ifmt_l_sfgtsi, { 0xbca00000 }
657 { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
658 & ifmt_l_sfgts, { 0xe4000000 }
660 /* l.sfeqi $rA,$simm16 */
663 { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } },
664 & ifmt_l_sfgtsi, { 0xbc000000 }
669 { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
670 & ifmt_l_sfgts, { 0xe4200000 }
672 /* l.sfnei $rA,$simm16 */
675 { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } },
676 & ifmt_l_sfgtsi, { 0xbc200000 }
681 { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
682 & ifmt_l_mac, { 0xc4000001 }
687 { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
688 & ifmt_l_mac, { 0xc4000002 }
690 /* l.maci $rA,${simm16} */
693 { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } },
694 & ifmt_l_maci, { 0x4c000000 }
700 & ifmt_l_rfe, { 0x70000000 }
706 & ifmt_l_rfe, { 0x74000000 }
712 & ifmt_l_rfe, { 0x78000000 }
718 & ifmt_l_rfe, { 0x7c000000 }
724 & ifmt_l_rfe, { 0xf0000000 }
730 & ifmt_l_rfe, { 0xf4000000 }
736 & ifmt_l_rfe, { 0xf8000000 }
742 & ifmt_l_rfe, { 0xfc000000 }
744 /* lf.add.s $rDSF,$rASF,$rBSF */
747 { { MNEM, ' ', OP (RDSF), ',', OP (RASF), ',', OP (RBSF), 0 } },
748 & ifmt_lf_add_s, { 0xc8000000 }
750 /* lf.add.d $rDDF,$rADF,$rBDF */
753 { { MNEM, ' ', OP (RDDF), ',', OP (RADF), ',', OP (RBDF), 0 } },
754 & ifmt_lf_add_d, { 0xc8000010 }
756 /* lf.sub.s $rDSF,$rASF,$rBSF */
759 { { MNEM, ' ', OP (RDSF), ',', OP (RASF), ',', OP (RBSF), 0 } },
760 & ifmt_lf_add_s, { 0xc8000001 }
762 /* lf.sub.d $rDDF,$rADF,$rBDF */
765 { { MNEM, ' ', OP (RDDF), ',', OP (RADF), ',', OP (RBDF), 0 } },
766 & ifmt_lf_add_d, { 0xc8000011 }
768 /* lf.mul.s $rDSF,$rASF,$rBSF */
771 { { MNEM, ' ', OP (RDSF), ',', OP (RASF), ',', OP (RBSF), 0 } },
772 & ifmt_lf_add_s, { 0xc8000002 }
774 /* lf.mul.d $rDDF,$rADF,$rBDF */
777 { { MNEM, ' ', OP (RDDF), ',', OP (RADF), ',', OP (RBDF), 0 } },
778 & ifmt_lf_add_d, { 0xc8000012 }
780 /* lf.div.s $rDSF,$rASF,$rBSF */
783 { { MNEM, ' ', OP (RDSF), ',', OP (RASF), ',', OP (RBSF), 0 } },
784 & ifmt_lf_add_s, { 0xc8000003 }
786 /* lf.div.d $rDDF,$rADF,$rBDF */
789 { { MNEM, ' ', OP (RDDF), ',', OP (RADF), ',', OP (RBDF), 0 } },
790 & ifmt_lf_add_d, { 0xc8000013 }
792 /* lf.rem.s $rDSF,$rASF,$rBSF */
795 { { MNEM, ' ', OP (RDSF), ',', OP (RASF), ',', OP (RBSF), 0 } },
796 & ifmt_lf_add_s, { 0xc8000006 }
798 /* lf.rem.d $rDDF,$rADF,$rBDF */
801 { { MNEM, ' ', OP (RDDF), ',', OP (RADF), ',', OP (RBDF), 0 } },
802 & ifmt_lf_add_d, { 0xc8000016 }
804 /* lf.itof.s $rDSF,$rA */
807 { { MNEM, ' ', OP (RDSF), ',', OP (RA), 0 } },
808 & ifmt_lf_itof_s, { 0xc8000004 }
810 /* lf.itof.d $rDSF,$rA */
813 { { MNEM, ' ', OP (RDSF), ',', OP (RA), 0 } },
814 & ifmt_lf_itof_s, { 0xc8000014 }
816 /* lf.ftoi.s $rD,$rASF */
819 { { MNEM, ' ', OP (RD), ',', OP (RASF), 0 } },
820 & ifmt_lf_ftoi_s, { 0xc8000005 }
822 /* lf.ftoi.d $rD,$rADF */
825 { { MNEM, ' ', OP (RD), ',', OP (RADF), 0 } },
826 & ifmt_lf_ftoi_d, { 0xc8000015 }
828 /* lf.sfeq.s $rASF,$rBSF */
831 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
832 & ifmt_lf_eq_s, { 0xc8000008 }
834 /* lf.sfeq.d $rASF,$rBSF */
837 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
838 & ifmt_lf_eq_s, { 0xc8000018 }
840 /* lf.sfne.s $rASF,$rBSF */
843 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
844 & ifmt_lf_eq_s, { 0xc8000009 }
846 /* lf.sfne.d $rASF,$rBSF */
849 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
850 & ifmt_lf_eq_s, { 0xc8000019 }
852 /* lf.sfge.s $rASF,$rBSF */
855 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
856 & ifmt_lf_eq_s, { 0xc800000b }
858 /* lf.sfge.d $rASF,$rBSF */
861 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
862 & ifmt_lf_eq_s, { 0xc800001b }
864 /* lf.sfgt.s $rASF,$rBSF */
867 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
868 & ifmt_lf_eq_s, { 0xc800000a }
870 /* lf.sfgt.d $rASF,$rBSF */
873 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
874 & ifmt_lf_eq_s, { 0xc800001a }
876 /* lf.sflt.s $rASF,$rBSF */
879 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
880 & ifmt_lf_eq_s, { 0xc800000c }
882 /* lf.sflt.d $rASF,$rBSF */
885 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
886 & ifmt_lf_eq_s, { 0xc800001c }
888 /* lf.sfle.s $rASF,$rBSF */
891 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
892 & ifmt_lf_eq_s, { 0xc800000d }
894 /* lf.sfle.d $rASF,$rBSF */
897 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
898 & ifmt_lf_eq_s, { 0xc800001d }
900 /* lf.madd.s $rDSF,$rASF,$rBSF */
903 { { MNEM, ' ', OP (RDSF), ',', OP (RASF), ',', OP (RBSF), 0 } },
904 & ifmt_lf_add_s, { 0xc8000007 }
906 /* lf.madd.d $rDDF,$rADF,$rBDF */
909 { { MNEM, ' ', OP (RDDF), ',', OP (RADF), ',', OP (RBDF), 0 } },
910 & ifmt_lf_add_d, { 0xc8000017 }
912 /* lf.cust1.s $rASF,$rBSF */
915 { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } },
916 & ifmt_lf_cust1_s, { 0xc80000d0 }
922 & ifmt_lf_cust1_d, { 0xc80000e0 }
931 /* Formats for ALIAS macro-insns. */
933 #define F(f) & or1k_cgen_ifld_table[OR1K_##f]
936 /* Each non-simple macro entry points to an array of expansion possibilities. */
938 #define A(a) (1 << CGEN_INSN_##a)
939 #define OPERAND(op) OR1K_OPERAND_##op
940 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
941 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
943 /* The macro instruction table. */
945 static const CGEN_IBASE or1k_cgen_macro_insn_table[] =
949 /* The macro instruction opcode table. */
951 static const CGEN_OPCODE or1k_cgen_macro_insn_opcode_table[] =
960 #ifndef CGEN_ASM_HASH_P
961 #define CGEN_ASM_HASH_P(insn) 1
964 #ifndef CGEN_DIS_HASH_P
965 #define CGEN_DIS_HASH_P(insn) 1
968 /* Return non-zero if INSN is to be added to the hash table.
969 Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file. */
972 asm_hash_insn_p (const CGEN_INSN *insn ATTRIBUTE_UNUSED)
974 return CGEN_ASM_HASH_P (insn);
978 dis_hash_insn_p (const CGEN_INSN *insn)
980 /* If building the hash table and the NO-DIS attribute is present,
982 if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS))
984 return CGEN_DIS_HASH_P (insn);
987 #ifndef CGEN_ASM_HASH
988 #define CGEN_ASM_HASH_SIZE 127
989 #ifdef CGEN_MNEMONIC_OPERANDS
990 #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)
992 #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) /*FIXME*/
996 /* It doesn't make much sense to provide a default here,
997 but while this is under development we do.
998 BUFFER is a pointer to the bytes of the insn, target order.
999 VALUE is the first base_insn_bitsize bits as an int in host order. */
1001 #ifndef CGEN_DIS_HASH
1002 #define CGEN_DIS_HASH_SIZE 256
1003 #define CGEN_DIS_HASH(buf, value) (*(unsigned char *) (buf))
1006 /* The result is the hash value of the insn.
1007 Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file. */
1010 asm_hash_insn (const char *mnem)
1012 return CGEN_ASM_HASH (mnem);
1015 /* BUF is a pointer to the bytes of the insn, target order.
1016 VALUE is the first base_insn_bitsize bits as an int in host order. */
1019 dis_hash_insn (const char *buf ATTRIBUTE_UNUSED,
1020 CGEN_INSN_INT value ATTRIBUTE_UNUSED)
1022 return CGEN_DIS_HASH (buf, value);
1025 /* Set the recorded length of the insn in the CGEN_FIELDS struct. */
1028 set_fields_bitsize (CGEN_FIELDS *fields, int size)
1030 CGEN_FIELDS_BITSIZE (fields) = size;
1033 /* Function to call before using the operand instance table.
1034 This plugs the opcode entries and macro instructions into the cpu table. */
1037 or1k_cgen_init_opcode_table (CGEN_CPU_DESC cd)
1040 int num_macros = (sizeof (or1k_cgen_macro_insn_table) /
1041 sizeof (or1k_cgen_macro_insn_table[0]));
1042 const CGEN_IBASE *ib = & or1k_cgen_macro_insn_table[0];
1043 const CGEN_OPCODE *oc = & or1k_cgen_macro_insn_opcode_table[0];
1044 CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN));
1046 /* This test has been added to avoid a warning generated
1047 if memset is called with a third argument of value zero. */
1048 if (num_macros >= 1)
1049 memset (insns, 0, num_macros * sizeof (CGEN_INSN));
1050 for (i = 0; i < num_macros; ++i)
1052 insns[i].base = &ib[i];
1053 insns[i].opcode = &oc[i];
1054 or1k_cgen_build_insn_regex (& insns[i]);
1056 cd->macro_insn_table.init_entries = insns;
1057 cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE);
1058 cd->macro_insn_table.num_init_entries = num_macros;
1060 oc = & or1k_cgen_insn_opcode_table[0];
1061 insns = (CGEN_INSN *) cd->insn_table.init_entries;
1062 for (i = 0; i < MAX_INSNS; ++i)
1064 insns[i].opcode = &oc[i];
1065 or1k_cgen_build_insn_regex (& insns[i]);
1068 cd->sizeof_fields = sizeof (CGEN_FIELDS);
1069 cd->set_fields_bitsize = set_fields_bitsize;
1071 cd->asm_hash_p = asm_hash_insn_p;
1072 cd->asm_hash = asm_hash_insn;
1073 cd->asm_hash_size = CGEN_ASM_HASH_SIZE;
1075 cd->dis_hash_p = dis_hash_insn_p;
1076 cd->dis_hash = dis_hash_insn;
1077 cd->dis_hash_size = CGEN_DIS_HASH_SIZE;