Home | History | Annotate | Line # | Download | only in opcodes
      1   1.6  christos /* DO NOT EDIT!  -*- buffer-read-only: t -*- vi:set ro:  */
      2   1.1  christos /* Instruction opcode table for xstormy16.
      3   1.1  christos 
      4   1.1  christos THIS FILE IS MACHINE GENERATED WITH CGEN.
      5   1.1  christos 
      6  1.10  christos Copyright (C) 1996-2025 Free Software Foundation, Inc.
      7   1.1  christos 
      8   1.1  christos This file is part of the GNU Binutils and/or GDB, the GNU debugger.
      9   1.1  christos 
     10   1.1  christos    This file is free software; you can redistribute it and/or modify
     11   1.1  christos    it under the terms of the GNU General Public License as published by
     12   1.1  christos    the Free Software Foundation; either version 3, or (at your option)
     13   1.1  christos    any later version.
     14   1.1  christos 
     15   1.1  christos    It is distributed in the hope that it will be useful, but WITHOUT
     16   1.1  christos    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
     17   1.1  christos    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
     18   1.1  christos    License for more details.
     19   1.1  christos 
     20   1.1  christos    You should have received a copy of the GNU General Public License along
     21   1.1  christos    with this program; if not, write to the Free Software Foundation, Inc.,
     22   1.1  christos    51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
     23   1.1  christos 
     24   1.1  christos */
     25   1.1  christos 
     26   1.1  christos #include "sysdep.h"
     27   1.1  christos #include "ansidecl.h"
     28   1.1  christos #include "bfd.h"
     29   1.1  christos #include "symcat.h"
     30   1.1  christos #include "xstormy16-desc.h"
     31   1.1  christos #include "xstormy16-opc.h"
     32   1.1  christos #include "libiberty.h"
     33   1.1  christos 
     34   1.1  christos /* The hash functions are recorded here to help keep assembler code out of
     35   1.1  christos    the disassembler and vice versa.  */
     36   1.1  christos 
     37   1.1  christos static int asm_hash_insn_p        (const CGEN_INSN *);
     38   1.1  christos static unsigned int asm_hash_insn (const char *);
     39   1.1  christos static int dis_hash_insn_p        (const CGEN_INSN *);
     40   1.1  christos static unsigned int dis_hash_insn (const char *, CGEN_INSN_INT);
     41   1.1  christos 
     42   1.1  christos /* Instruction formats.  */
     43   1.1  christos 
     44   1.1  christos #define F(f) & xstormy16_cgen_ifld_table[XSTORMY16_##f]
     45   1.1  christos static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED = {
     46   1.1  christos   0, 0, 0x0, { { 0 } }
     47   1.1  christos };
     48   1.1  christos 
     49   1.1  christos static const CGEN_IFMT ifmt_movlmemimm ATTRIBUTE_UNUSED = {
     50   1.1  christos   32, 32, 0xfe000000, { { F (F_OP1) }, { F (F_OP2A) }, { F (F_OP2M) }, { F (F_LMEM8) }, { F (F_IMM16) }, { 0 } }
     51   1.1  christos };
     52   1.1  christos 
     53   1.1  christos static const CGEN_IFMT ifmt_movhmemimm ATTRIBUTE_UNUSED = {
     54   1.1  christos   32, 32, 0xfe000000, { { F (F_OP1) }, { F (F_OP2A) }, { F (F_OP2M) }, { F (F_HMEM8) }, { F (F_IMM16) }, { 0 } }
     55   1.1  christos };
     56   1.1  christos 
     57   1.1  christos static const CGEN_IFMT ifmt_movlgrmem ATTRIBUTE_UNUSED = {
     58   1.1  christos   16, 16, 0xf000, { { F (F_OP1) }, { F (F_RM) }, { F (F_OP2M) }, { F (F_LMEM8) }, { 0 } }
     59   1.1  christos };
     60   1.1  christos 
     61   1.1  christos static const CGEN_IFMT ifmt_movhgrmem ATTRIBUTE_UNUSED = {
     62   1.1  christos   16, 16, 0xf000, { { F (F_OP1) }, { F (F_RM) }, { F (F_OP2M) }, { F (F_HMEM8) }, { 0 } }
     63   1.1  christos };
     64   1.1  christos 
     65   1.1  christos static const CGEN_IFMT ifmt_movgrgri ATTRIBUTE_UNUSED = {
     66   1.1  christos   16, 16, 0xfe08, { { F (F_OP1) }, { F (F_OP2A) }, { F (F_OP2M) }, { F (F_RS) }, { F (F_OP4M) }, { F (F_RDM) }, { 0 } }
     67   1.1  christos };
     68   1.1  christos 
     69   1.1  christos static const CGEN_IFMT ifmt_movgrgrii ATTRIBUTE_UNUSED = {
     70   1.1  christos   32, 32, 0xfe08f000, { { F (F_OP1) }, { F (F_OP2A) }, { F (F_OP2M) }, { F (F_RS) }, { F (F_OP4M) }, { F (F_RDM) }, { F (F_OP5) }, { F (F_IMM12) }, { 0 } }
     71   1.1  christos };
     72   1.1  christos 
     73   1.1  christos static const CGEN_IFMT ifmt_movgrgr ATTRIBUTE_UNUSED = {
     74   1.1  christos   16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_RS) }, { F (F_RD) }, { 0 } }
     75   1.1  christos };
     76   1.1  christos 
     77   1.1  christos static const CGEN_IFMT ifmt_movwimm8 ATTRIBUTE_UNUSED = {
     78   1.1  christos   16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_IMM8) }, { 0 } }
     79   1.1  christos };
     80   1.1  christos 
     81   1.1  christos static const CGEN_IFMT ifmt_movwgrimm8 ATTRIBUTE_UNUSED = {
     82   1.1  christos   16, 16, 0xf100, { { F (F_OP1) }, { F (F_RM) }, { F (F_OP2M) }, { F (F_IMM8) }, { 0 } }
     83   1.1  christos };
     84   1.1  christos 
     85   1.1  christos static const CGEN_IFMT ifmt_movwgrimm16 ATTRIBUTE_UNUSED = {
     86   1.1  christos   32, 32, 0xfff00000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_OP3) }, { F (F_RD) }, { F (F_IMM16) }, { 0 } }
     87   1.1  christos };
     88   1.1  christos 
     89   1.1  christos static const CGEN_IFMT ifmt_movlowgr ATTRIBUTE_UNUSED = {
     90   1.1  christos   16, 16, 0xfff0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_OP3) }, { F (F_RD) }, { 0 } }
     91   1.1  christos };
     92   1.1  christos 
     93   1.1  christos static const CGEN_IFMT ifmt_movfgrgrii ATTRIBUTE_UNUSED = {
     94   1.1  christos   32, 32, 0xfe088000, { { F (F_OP1) }, { F (F_OP2A) }, { F (F_OP2M) }, { F (F_RS) }, { F (F_OP4M) }, { F (F_RDM) }, { F (F_OP5A) }, { F (F_RB) }, { F (F_IMM12) }, { 0 } }
     95   1.1  christos };
     96   1.1  christos 
     97   1.1  christos static const CGEN_IFMT ifmt_addgrimm4 ATTRIBUTE_UNUSED = {
     98   1.1  christos   16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_IMM4) }, { F (F_RD) }, { 0 } }
     99   1.1  christos };
    100   1.1  christos 
    101   1.1  christos static const CGEN_IFMT ifmt_incgrimm2 ATTRIBUTE_UNUSED = {
    102   1.1  christos   16, 16, 0xffc0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_OP3A) }, { F (F_IMM2) }, { F (F_RD) }, { 0 } }
    103   1.1  christos };
    104   1.1  christos 
    105   1.1  christos static const CGEN_IFMT ifmt_set1lmemimm ATTRIBUTE_UNUSED = {
    106   1.1  christos   16, 16, 0xf100, { { F (F_OP1) }, { F (F_IMM3) }, { F (F_OP2M) }, { F (F_LMEM8) }, { 0 } }
    107   1.1  christos };
    108   1.1  christos 
    109   1.1  christos static const CGEN_IFMT ifmt_set1hmemimm ATTRIBUTE_UNUSED = {
    110   1.1  christos   16, 16, 0xf100, { { F (F_OP1) }, { F (F_IMM3) }, { F (F_OP2M) }, { F (F_HMEM8) }, { 0 } }
    111   1.1  christos };
    112   1.1  christos 
    113   1.1  christos static const CGEN_IFMT ifmt_bccgrgr ATTRIBUTE_UNUSED = {
    114   1.1  christos   32, 32, 0xff000000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_RS) }, { F (F_RD) }, { F (F_OP5) }, { F (F_REL12) }, { 0 } }
    115   1.1  christos };
    116   1.1  christos 
    117   1.1  christos static const CGEN_IFMT ifmt_bccgrimm8 ATTRIBUTE_UNUSED = {
    118   1.1  christos   32, 32, 0xf1000000, { { F (F_OP1) }, { F (F_RM) }, { F (F_OP2M) }, { F (F_IMM8) }, { F (F_OP5) }, { F (F_REL12) }, { 0 } }
    119   1.1  christos };
    120   1.1  christos 
    121   1.1  christos static const CGEN_IFMT ifmt_bccimm16 ATTRIBUTE_UNUSED = {
    122   1.1  christos   32, 32, 0xf0000000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_REL8_4) }, { F (F_IMM16) }, { 0 } }
    123   1.1  christos };
    124   1.1  christos 
    125   1.1  christos static const CGEN_IFMT ifmt_bngrimm4 ATTRIBUTE_UNUSED = {
    126   1.1  christos   32, 32, 0xff00f000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_IMM4) }, { F (F_RD) }, { F (F_OP5) }, { F (F_REL12) }, { 0 } }
    127   1.1  christos };
    128   1.1  christos 
    129   1.1  christos static const CGEN_IFMT ifmt_bngrgr ATTRIBUTE_UNUSED = {
    130   1.1  christos   32, 32, 0xff00f000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_RS) }, { F (F_RD) }, { F (F_OP5) }, { F (F_REL12) }, { 0 } }
    131   1.1  christos };
    132   1.1  christos 
    133   1.1  christos static const CGEN_IFMT ifmt_bnlmemimm ATTRIBUTE_UNUSED = {
    134   1.1  christos   32, 32, 0xff008000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_LMEM8) }, { F (F_OP5A) }, { F (F_IMM3B) }, { F (F_REL12) }, { 0 } }
    135   1.1  christos };
    136   1.1  christos 
    137   1.1  christos static const CGEN_IFMT ifmt_bnhmemimm ATTRIBUTE_UNUSED = {
    138   1.1  christos   32, 32, 0xff008000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_HMEM8) }, { F (F_OP5A) }, { F (F_IMM3B) }, { F (F_REL12) }, { 0 } }
    139   1.1  christos };
    140   1.1  christos 
    141   1.1  christos static const CGEN_IFMT ifmt_bcc ATTRIBUTE_UNUSED = {
    142   1.1  christos   16, 16, 0xf000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_REL8_2) }, { 0 } }
    143   1.1  christos };
    144   1.1  christos 
    145   1.1  christos static const CGEN_IFMT ifmt_br ATTRIBUTE_UNUSED = {
    146   1.1  christos   16, 16, 0xf001, { { F (F_OP1) }, { F (F_REL12A) }, { F (F_OP4B) }, { 0 } }
    147   1.1  christos };
    148   1.1  christos 
    149   1.1  christos static const CGEN_IFMT ifmt_jmp ATTRIBUTE_UNUSED = {
    150   1.1  christos   16, 16, 0xffe0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_OP3B) }, { F (F_RBJ) }, { F (F_RD) }, { 0 } }
    151   1.1  christos };
    152   1.1  christos 
    153   1.1  christos static const CGEN_IFMT ifmt_jmpf ATTRIBUTE_UNUSED = {
    154   1.1  christos   32, 32, 0xff000000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_ABS24) }, { 0 } }
    155   1.1  christos };
    156   1.1  christos 
    157   1.1  christos static const CGEN_IFMT ifmt_iret ATTRIBUTE_UNUSED = {
    158   1.1  christos   16, 16, 0xffff, { { F (F_OP) }, { 0 } }
    159   1.1  christos };
    160   1.1  christos 
    161   1.1  christos #undef F
    162   1.1  christos 
    163   1.1  christos #define A(a) (1 << CGEN_INSN_##a)
    164   1.1  christos #define OPERAND(op) XSTORMY16_OPERAND_##op
    165   1.1  christos #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
    166   1.1  christos #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
    167   1.1  christos 
    168   1.1  christos /* The instruction table.  */
    169   1.1  christos 
    170   1.1  christos static const CGEN_OPCODE xstormy16_cgen_insn_opcode_table[MAX_INSNS] =
    171   1.1  christos {
    172   1.1  christos   /* Special null first entry.
    173   1.1  christos      A `num' value of zero is thus invalid.
    174   1.1  christos      Also, the special `invalid' insn resides here.  */
    175   1.1  christos   { { 0, 0, 0, 0 }, {{0}}, 0, {0}},
    176   1.1  christos /* mov$ws2 $lmem8,#$imm16 */
    177   1.1  christos   {
    178   1.1  christos     { 0, 0, 0, 0 },
    179   1.1  christos     { { MNEM, OP (WS2), ' ', OP (LMEM8), ',', '#', OP (IMM16), 0 } },
    180   1.1  christos     & ifmt_movlmemimm, { 0x78000000 }
    181   1.1  christos   },
    182   1.1  christos /* mov$ws2 $hmem8,#$imm16 */
    183   1.1  christos   {
    184   1.1  christos     { 0, 0, 0, 0 },
    185   1.1  christos     { { MNEM, OP (WS2), ' ', OP (HMEM8), ',', '#', OP (IMM16), 0 } },
    186   1.1  christos     & ifmt_movhmemimm, { 0x7a000000 }
    187   1.1  christos   },
    188   1.1  christos /* mov$ws2 $Rm,$lmem8 */
    189   1.1  christos   {
    190   1.1  christos     { 0, 0, 0, 0 },
    191   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RM), ',', OP (LMEM8), 0 } },
    192   1.1  christos     & ifmt_movlgrmem, { 0x8000 }
    193   1.1  christos   },
    194   1.1  christos /* mov$ws2 $Rm,$hmem8 */
    195   1.1  christos   {
    196   1.1  christos     { 0, 0, 0, 0 },
    197   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RM), ',', OP (HMEM8), 0 } },
    198   1.1  christos     & ifmt_movhgrmem, { 0xa000 }
    199   1.1  christos   },
    200   1.1  christos /* mov$ws2 $lmem8,$Rm */
    201   1.1  christos   {
    202   1.1  christos     { 0, 0, 0, 0 },
    203   1.1  christos     { { MNEM, OP (WS2), ' ', OP (LMEM8), ',', OP (RM), 0 } },
    204   1.1  christos     & ifmt_movlgrmem, { 0x9000 }
    205   1.1  christos   },
    206   1.1  christos /* mov$ws2 $hmem8,$Rm */
    207   1.1  christos   {
    208   1.1  christos     { 0, 0, 0, 0 },
    209   1.1  christos     { { MNEM, OP (WS2), ' ', OP (HMEM8), ',', OP (RM), 0 } },
    210   1.1  christos     & ifmt_movhgrmem, { 0xb000 }
    211   1.1  christos   },
    212   1.1  christos /* mov$ws2 $Rdm,($Rs) */
    213   1.1  christos   {
    214   1.1  christos     { 0, 0, 0, 0 },
    215   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RDM), ',', '(', OP (RS), ')', 0 } },
    216   1.1  christos     & ifmt_movgrgri, { 0x7000 }
    217   1.1  christos   },
    218   1.1  christos /* mov$ws2 $Rdm,($Rs++) */
    219   1.1  christos   {
    220   1.1  christos     { 0, 0, 0, 0 },
    221   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RDM), ',', '(', OP (RS), '+', '+', ')', 0 } },
    222   1.1  christos     & ifmt_movgrgri, { 0x6000 }
    223   1.1  christos   },
    224   1.1  christos /* mov$ws2 $Rdm,(--$Rs) */
    225   1.1  christos   {
    226   1.1  christos     { 0, 0, 0, 0 },
    227   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RDM), ',', '(', '-', '-', OP (RS), ')', 0 } },
    228   1.1  christos     & ifmt_movgrgri, { 0x6800 }
    229   1.1  christos   },
    230   1.1  christos /* mov$ws2 ($Rs),$Rdm */
    231   1.1  christos   {
    232   1.1  christos     { 0, 0, 0, 0 },
    233   1.1  christos     { { MNEM, OP (WS2), ' ', '(', OP (RS), ')', ',', OP (RDM), 0 } },
    234   1.1  christos     & ifmt_movgrgri, { 0x7200 }
    235   1.1  christos   },
    236   1.1  christos /* mov$ws2 ($Rs++),$Rdm */
    237   1.1  christos   {
    238   1.1  christos     { 0, 0, 0, 0 },
    239   1.1  christos     { { MNEM, OP (WS2), ' ', '(', OP (RS), '+', '+', ')', ',', OP (RDM), 0 } },
    240   1.1  christos     & ifmt_movgrgri, { 0x6200 }
    241   1.1  christos   },
    242   1.1  christos /* mov$ws2 (--$Rs),$Rdm */
    243   1.1  christos   {
    244   1.1  christos     { 0, 0, 0, 0 },
    245   1.1  christos     { { MNEM, OP (WS2), ' ', '(', '-', '-', OP (RS), ')', ',', OP (RDM), 0 } },
    246   1.1  christos     & ifmt_movgrgri, { 0x6a00 }
    247   1.1  christos   },
    248   1.1  christos /* mov$ws2 $Rdm,($Rs,$imm12) */
    249   1.1  christos   {
    250   1.1  christos     { 0, 0, 0, 0 },
    251   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RDM), ',', '(', OP (RS), ',', OP (IMM12), ')', 0 } },
    252   1.1  christos     & ifmt_movgrgrii, { 0x70080000 }
    253   1.1  christos   },
    254   1.1  christos /* mov$ws2 $Rdm,($Rs++,$imm12) */
    255   1.1  christos   {
    256   1.1  christos     { 0, 0, 0, 0 },
    257   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RDM), ',', '(', OP (RS), '+', '+', ',', OP (IMM12), ')', 0 } },
    258   1.1  christos     & ifmt_movgrgrii, { 0x60080000 }
    259   1.1  christos   },
    260   1.1  christos /* mov$ws2 $Rdm,(--$Rs,$imm12) */
    261   1.1  christos   {
    262   1.1  christos     { 0, 0, 0, 0 },
    263   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RDM), ',', '(', '-', '-', OP (RS), ',', OP (IMM12), ')', 0 } },
    264   1.1  christos     & ifmt_movgrgrii, { 0x68080000 }
    265   1.1  christos   },
    266   1.1  christos /* mov$ws2 ($Rs,$imm12),$Rdm */
    267   1.1  christos   {
    268   1.1  christos     { 0, 0, 0, 0 },
    269   1.1  christos     { { MNEM, OP (WS2), ' ', '(', OP (RS), ',', OP (IMM12), ')', ',', OP (RDM), 0 } },
    270   1.1  christos     & ifmt_movgrgrii, { 0x72080000 }
    271   1.1  christos   },
    272   1.1  christos /* mov$ws2 ($Rs++,$imm12),$Rdm */
    273   1.1  christos   {
    274   1.1  christos     { 0, 0, 0, 0 },
    275   1.1  christos     { { MNEM, OP (WS2), ' ', '(', OP (RS), '+', '+', ',', OP (IMM12), ')', ',', OP (RDM), 0 } },
    276   1.1  christos     & ifmt_movgrgrii, { 0x62080000 }
    277   1.1  christos   },
    278   1.1  christos /* mov$ws2 (--$Rs,$imm12),$Rdm */
    279   1.1  christos   {
    280   1.1  christos     { 0, 0, 0, 0 },
    281   1.1  christos     { { MNEM, OP (WS2), ' ', '(', '-', '-', OP (RS), ',', OP (IMM12), ')', ',', OP (RDM), 0 } },
    282   1.1  christos     & ifmt_movgrgrii, { 0x6a080000 }
    283   1.1  christos   },
    284   1.1  christos /* mov $Rd,$Rs */
    285   1.1  christos   {
    286   1.1  christos     { 0, 0, 0, 0 },
    287   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    288   1.1  christos     & ifmt_movgrgr, { 0x4600 }
    289   1.1  christos   },
    290   1.1  christos /* mov.w Rx,#$imm8 */
    291   1.1  christos   {
    292   1.1  christos     { 0, 0, 0, 0 },
    293   1.1  christos     { { MNEM, ' ', 'R', 'x', ',', '#', OP (IMM8), 0 } },
    294   1.1  christos     & ifmt_movwimm8, { 0x4700 }
    295   1.1  christos   },
    296   1.1  christos /* mov.w $Rm,#$imm8small */
    297   1.1  christos   {
    298   1.1  christos     { 0, 0, 0, 0 },
    299   1.1  christos     { { MNEM, ' ', OP (RM), ',', '#', OP (IMM8SMALL), 0 } },
    300   1.1  christos     & ifmt_movwgrimm8, { 0x2100 }
    301   1.1  christos   },
    302   1.1  christos /* mov.w $Rd,#$imm16 */
    303   1.1  christos   {
    304   1.1  christos     { 0, 0, 0, 0 },
    305   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM16), 0 } },
    306   1.1  christos     & ifmt_movwgrimm16, { 0x31300000 }
    307   1.1  christos   },
    308   1.1  christos /* mov.b $Rd,RxL */
    309   1.1  christos   {
    310   1.1  christos     { 0, 0, 0, 0 },
    311   1.1  christos     { { MNEM, ' ', OP (RD), ',', 'R', 'x', 'L', 0 } },
    312   1.1  christos     & ifmt_movlowgr, { 0x30c0 }
    313   1.1  christos   },
    314   1.1  christos /* mov.b $Rd,RxH */
    315   1.1  christos   {
    316   1.1  christos     { 0, 0, 0, 0 },
    317   1.1  christos     { { MNEM, ' ', OP (RD), ',', 'R', 'x', 'H', 0 } },
    318   1.1  christos     & ifmt_movlowgr, { 0x30d0 }
    319   1.1  christos   },
    320   1.1  christos /* movf$ws2 $Rdm,($Rs) */
    321   1.1  christos   {
    322   1.1  christos     { 0, 0, 0, 0 },
    323   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RDM), ',', '(', OP (RS), ')', 0 } },
    324   1.1  christos     & ifmt_movgrgri, { 0x7400 }
    325   1.1  christos   },
    326   1.1  christos /* movf$ws2 $Rdm,($Rs++) */
    327   1.1  christos   {
    328   1.1  christos     { 0, 0, 0, 0 },
    329   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RDM), ',', '(', OP (RS), '+', '+', ')', 0 } },
    330   1.1  christos     & ifmt_movgrgri, { 0x6400 }
    331   1.1  christos   },
    332   1.1  christos /* movf$ws2 $Rdm,(--$Rs) */
    333   1.1  christos   {
    334   1.1  christos     { 0, 0, 0, 0 },
    335   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RDM), ',', '(', '-', '-', OP (RS), ')', 0 } },
    336   1.1  christos     & ifmt_movgrgri, { 0x6c00 }
    337   1.1  christos   },
    338   1.1  christos /* movf$ws2 ($Rs),$Rdm */
    339   1.1  christos   {
    340   1.1  christos     { 0, 0, 0, 0 },
    341   1.1  christos     { { MNEM, OP (WS2), ' ', '(', OP (RS), ')', ',', OP (RDM), 0 } },
    342   1.1  christos     & ifmt_movgrgri, { 0x7600 }
    343   1.1  christos   },
    344   1.1  christos /* movf$ws2 ($Rs++),$Rdm */
    345   1.1  christos   {
    346   1.1  christos     { 0, 0, 0, 0 },
    347   1.1  christos     { { MNEM, OP (WS2), ' ', '(', OP (RS), '+', '+', ')', ',', OP (RDM), 0 } },
    348   1.1  christos     & ifmt_movgrgri, { 0x6600 }
    349   1.1  christos   },
    350   1.1  christos /* movf$ws2 (--$Rs),$Rdm */
    351   1.1  christos   {
    352   1.1  christos     { 0, 0, 0, 0 },
    353   1.1  christos     { { MNEM, OP (WS2), ' ', '(', '-', '-', OP (RS), ')', ',', OP (RDM), 0 } },
    354   1.1  christos     & ifmt_movgrgri, { 0x6e00 }
    355   1.1  christos   },
    356   1.1  christos /* movf$ws2 $Rdm,($Rb,$Rs,$imm12) */
    357   1.1  christos   {
    358   1.1  christos     { 0, 0, 0, 0 },
    359   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RDM), ',', '(', OP (RB), ',', OP (RS), ',', OP (IMM12), ')', 0 } },
    360   1.1  christos     & ifmt_movfgrgrii, { 0x74080000 }
    361   1.1  christos   },
    362   1.1  christos /* movf$ws2 $Rdm,($Rb,$Rs++,$imm12) */
    363   1.1  christos   {
    364   1.1  christos     { 0, 0, 0, 0 },
    365   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RDM), ',', '(', OP (RB), ',', OP (RS), '+', '+', ',', OP (IMM12), ')', 0 } },
    366   1.1  christos     & ifmt_movfgrgrii, { 0x64080000 }
    367   1.1  christos   },
    368   1.1  christos /* movf$ws2 $Rdm,($Rb,--$Rs,$imm12) */
    369   1.1  christos   {
    370   1.1  christos     { 0, 0, 0, 0 },
    371   1.1  christos     { { MNEM, OP (WS2), ' ', OP (RDM), ',', '(', OP (RB), ',', '-', '-', OP (RS), ',', OP (IMM12), ')', 0 } },
    372   1.1  christos     & ifmt_movfgrgrii, { 0x6c080000 }
    373   1.1  christos   },
    374   1.1  christos /* movf$ws2 ($Rb,$Rs,$imm12),$Rdm */
    375   1.1  christos   {
    376   1.1  christos     { 0, 0, 0, 0 },
    377   1.1  christos     { { MNEM, OP (WS2), ' ', '(', OP (RB), ',', OP (RS), ',', OP (IMM12), ')', ',', OP (RDM), 0 } },
    378   1.1  christos     & ifmt_movfgrgrii, { 0x76080000 }
    379   1.1  christos   },
    380   1.1  christos /* movf$ws2 ($Rb,$Rs++,$imm12),$Rdm */
    381   1.1  christos   {
    382   1.1  christos     { 0, 0, 0, 0 },
    383   1.1  christos     { { MNEM, OP (WS2), ' ', '(', OP (RB), ',', OP (RS), '+', '+', ',', OP (IMM12), ')', ',', OP (RDM), 0 } },
    384   1.1  christos     & ifmt_movfgrgrii, { 0x66080000 }
    385   1.1  christos   },
    386   1.1  christos /* movf$ws2 ($Rb,--$Rs,$imm12),$Rdm */
    387   1.1  christos   {
    388   1.1  christos     { 0, 0, 0, 0 },
    389   1.1  christos     { { MNEM, OP (WS2), ' ', '(', OP (RB), ',', '-', '-', OP (RS), ',', OP (IMM12), ')', ',', OP (RDM), 0 } },
    390   1.1  christos     & ifmt_movfgrgrii, { 0x6e080000 }
    391   1.1  christos   },
    392   1.1  christos /* mask $Rd,$Rs */
    393   1.1  christos   {
    394   1.1  christos     { 0, 0, 0, 0 },
    395   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    396   1.1  christos     & ifmt_movgrgr, { 0x3300 }
    397   1.1  christos   },
    398   1.1  christos /* mask $Rd,#$imm16 */
    399   1.1  christos   {
    400   1.1  christos     { 0, 0, 0, 0 },
    401   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM16), 0 } },
    402   1.1  christos     & ifmt_movwgrimm16, { 0x30e00000 }
    403   1.1  christos   },
    404   1.1  christos /* push $Rd */
    405   1.1  christos   {
    406   1.1  christos     { 0, 0, 0, 0 },
    407   1.1  christos     { { MNEM, ' ', OP (RD), 0 } },
    408   1.1  christos     & ifmt_movlowgr, { 0x80 }
    409   1.1  christos   },
    410   1.1  christos /* pop $Rd */
    411   1.1  christos   {
    412   1.1  christos     { 0, 0, 0, 0 },
    413   1.1  christos     { { MNEM, ' ', OP (RD), 0 } },
    414   1.1  christos     & ifmt_movlowgr, { 0x90 }
    415   1.1  christos   },
    416   1.1  christos /* swpn $Rd */
    417   1.1  christos   {
    418   1.1  christos     { 0, 0, 0, 0 },
    419   1.1  christos     { { MNEM, ' ', OP (RD), 0 } },
    420   1.1  christos     & ifmt_movlowgr, { 0x3090 }
    421   1.1  christos   },
    422   1.1  christos /* swpb $Rd */
    423   1.1  christos   {
    424   1.1  christos     { 0, 0, 0, 0 },
    425   1.1  christos     { { MNEM, ' ', OP (RD), 0 } },
    426   1.1  christos     & ifmt_movlowgr, { 0x3080 }
    427   1.1  christos   },
    428   1.1  christos /* swpw $Rd,$Rs */
    429   1.1  christos   {
    430   1.1  christos     { 0, 0, 0, 0 },
    431   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    432   1.1  christos     & ifmt_movgrgr, { 0x3200 }
    433   1.1  christos   },
    434   1.1  christos /* and $Rd,$Rs */
    435   1.1  christos   {
    436   1.1  christos     { 0, 0, 0, 0 },
    437   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    438   1.1  christos     & ifmt_movgrgr, { 0x4000 }
    439   1.1  christos   },
    440   1.1  christos /* and Rx,#$imm8 */
    441   1.1  christos   {
    442   1.1  christos     { 0, 0, 0, 0 },
    443   1.1  christos     { { MNEM, ' ', 'R', 'x', ',', '#', OP (IMM8), 0 } },
    444   1.1  christos     & ifmt_movwimm8, { 0x4100 }
    445   1.1  christos   },
    446   1.1  christos /* and $Rd,#$imm16 */
    447   1.1  christos   {
    448   1.1  christos     { 0, 0, 0, 0 },
    449   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM16), 0 } },
    450   1.1  christos     & ifmt_movwgrimm16, { 0x31000000 }
    451   1.1  christos   },
    452   1.1  christos /* or $Rd,$Rs */
    453   1.1  christos   {
    454   1.1  christos     { 0, 0, 0, 0 },
    455   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    456   1.1  christos     & ifmt_movgrgr, { 0x4200 }
    457   1.1  christos   },
    458   1.1  christos /* or Rx,#$imm8 */
    459   1.1  christos   {
    460   1.1  christos     { 0, 0, 0, 0 },
    461   1.1  christos     { { MNEM, ' ', 'R', 'x', ',', '#', OP (IMM8), 0 } },
    462   1.1  christos     & ifmt_movwimm8, { 0x4300 }
    463   1.1  christos   },
    464   1.1  christos /* or $Rd,#$imm16 */
    465   1.1  christos   {
    466   1.1  christos     { 0, 0, 0, 0 },
    467   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM16), 0 } },
    468   1.1  christos     & ifmt_movwgrimm16, { 0x31100000 }
    469   1.1  christos   },
    470   1.1  christos /* xor $Rd,$Rs */
    471   1.1  christos   {
    472   1.1  christos     { 0, 0, 0, 0 },
    473   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    474   1.1  christos     & ifmt_movgrgr, { 0x4400 }
    475   1.1  christos   },
    476   1.1  christos /* xor Rx,#$imm8 */
    477   1.1  christos   {
    478   1.1  christos     { 0, 0, 0, 0 },
    479   1.1  christos     { { MNEM, ' ', 'R', 'x', ',', '#', OP (IMM8), 0 } },
    480   1.1  christos     & ifmt_movwimm8, { 0x4500 }
    481   1.1  christos   },
    482   1.1  christos /* xor $Rd,#$imm16 */
    483   1.1  christos   {
    484   1.1  christos     { 0, 0, 0, 0 },
    485   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM16), 0 } },
    486   1.1  christos     & ifmt_movwgrimm16, { 0x31200000 }
    487   1.1  christos   },
    488   1.1  christos /* not $Rd */
    489   1.1  christos   {
    490   1.1  christos     { 0, 0, 0, 0 },
    491   1.1  christos     { { MNEM, ' ', OP (RD), 0 } },
    492   1.1  christos     & ifmt_movlowgr, { 0x30b0 }
    493   1.1  christos   },
    494   1.1  christos /* add $Rd,$Rs */
    495   1.1  christos   {
    496   1.1  christos     { 0, 0, 0, 0 },
    497   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    498   1.1  christos     & ifmt_movgrgr, { 0x4900 }
    499   1.1  christos   },
    500   1.1  christos /* add $Rd,#$imm4 */
    501   1.1  christos   {
    502   1.1  christos     { 0, 0, 0, 0 },
    503   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), 0 } },
    504   1.1  christos     & ifmt_addgrimm4, { 0x5100 }
    505   1.1  christos   },
    506   1.1  christos /* add Rx,#$imm8 */
    507   1.1  christos   {
    508   1.1  christos     { 0, 0, 0, 0 },
    509   1.1  christos     { { MNEM, ' ', 'R', 'x', ',', '#', OP (IMM8), 0 } },
    510   1.1  christos     & ifmt_movwimm8, { 0x5900 }
    511   1.1  christos   },
    512   1.1  christos /* add $Rd,#$imm16 */
    513   1.1  christos   {
    514   1.1  christos     { 0, 0, 0, 0 },
    515   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM16), 0 } },
    516   1.1  christos     & ifmt_movwgrimm16, { 0x31400000 }
    517   1.1  christos   },
    518   1.1  christos /* adc $Rd,$Rs */
    519   1.1  christos   {
    520   1.1  christos     { 0, 0, 0, 0 },
    521   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    522   1.1  christos     & ifmt_movgrgr, { 0x4b00 }
    523   1.1  christos   },
    524   1.1  christos /* adc $Rd,#$imm4 */
    525   1.1  christos   {
    526   1.1  christos     { 0, 0, 0, 0 },
    527   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), 0 } },
    528   1.1  christos     & ifmt_addgrimm4, { 0x5300 }
    529   1.1  christos   },
    530   1.1  christos /* adc Rx,#$imm8 */
    531   1.1  christos   {
    532   1.1  christos     { 0, 0, 0, 0 },
    533   1.1  christos     { { MNEM, ' ', 'R', 'x', ',', '#', OP (IMM8), 0 } },
    534   1.1  christos     & ifmt_movwimm8, { 0x5b00 }
    535   1.1  christos   },
    536   1.1  christos /* adc $Rd,#$imm16 */
    537   1.1  christos   {
    538   1.1  christos     { 0, 0, 0, 0 },
    539   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM16), 0 } },
    540   1.1  christos     & ifmt_movwgrimm16, { 0x31500000 }
    541   1.1  christos   },
    542   1.1  christos /* sub $Rd,$Rs */
    543   1.1  christos   {
    544   1.1  christos     { 0, 0, 0, 0 },
    545   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    546   1.1  christos     & ifmt_movgrgr, { 0x4d00 }
    547   1.1  christos   },
    548   1.1  christos /* sub $Rd,#$imm4 */
    549   1.1  christos   {
    550   1.1  christos     { 0, 0, 0, 0 },
    551   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), 0 } },
    552   1.1  christos     & ifmt_addgrimm4, { 0x5500 }
    553   1.1  christos   },
    554   1.1  christos /* sub Rx,#$imm8 */
    555   1.1  christos   {
    556   1.1  christos     { 0, 0, 0, 0 },
    557   1.1  christos     { { MNEM, ' ', 'R', 'x', ',', '#', OP (IMM8), 0 } },
    558   1.1  christos     & ifmt_movwimm8, { 0x5d00 }
    559   1.1  christos   },
    560   1.1  christos /* sub $Rd,#$imm16 */
    561   1.1  christos   {
    562   1.1  christos     { 0, 0, 0, 0 },
    563   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM16), 0 } },
    564   1.1  christos     & ifmt_movwgrimm16, { 0x31600000 }
    565   1.1  christos   },
    566   1.1  christos /* sbc $Rd,$Rs */
    567   1.1  christos   {
    568   1.1  christos     { 0, 0, 0, 0 },
    569   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    570   1.1  christos     & ifmt_movgrgr, { 0x4f00 }
    571   1.1  christos   },
    572   1.1  christos /* sbc $Rd,#$imm4 */
    573   1.1  christos   {
    574   1.1  christos     { 0, 0, 0, 0 },
    575   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), 0 } },
    576   1.1  christos     & ifmt_addgrimm4, { 0x5700 }
    577   1.1  christos   },
    578   1.1  christos /* sbc Rx,#$imm8 */
    579   1.1  christos   {
    580   1.1  christos     { 0, 0, 0, 0 },
    581   1.1  christos     { { MNEM, ' ', 'R', 'x', ',', '#', OP (IMM8), 0 } },
    582   1.1  christos     & ifmt_movwimm8, { 0x5f00 }
    583   1.1  christos   },
    584   1.1  christos /* sbc $Rd,#$imm16 */
    585   1.1  christos   {
    586   1.1  christos     { 0, 0, 0, 0 },
    587   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM16), 0 } },
    588   1.1  christos     & ifmt_movwgrimm16, { 0x31700000 }
    589   1.1  christos   },
    590   1.1  christos /* inc $Rd,#$imm2 */
    591   1.1  christos   {
    592   1.1  christos     { 0, 0, 0, 0 },
    593   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM2), 0 } },
    594   1.1  christos     & ifmt_incgrimm2, { 0x3000 }
    595   1.1  christos   },
    596   1.1  christos /* dec $Rd,#$imm2 */
    597   1.1  christos   {
    598   1.1  christos     { 0, 0, 0, 0 },
    599   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM2), 0 } },
    600   1.1  christos     & ifmt_incgrimm2, { 0x3040 }
    601   1.1  christos   },
    602   1.1  christos /* rrc $Rd,$Rs */
    603   1.1  christos   {
    604   1.1  christos     { 0, 0, 0, 0 },
    605   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    606   1.1  christos     & ifmt_movgrgr, { 0x3800 }
    607   1.1  christos   },
    608   1.1  christos /* rrc $Rd,#$imm4 */
    609   1.1  christos   {
    610   1.1  christos     { 0, 0, 0, 0 },
    611   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), 0 } },
    612   1.1  christos     & ifmt_addgrimm4, { 0x3900 }
    613   1.1  christos   },
    614   1.1  christos /* rlc $Rd,$Rs */
    615   1.1  christos   {
    616   1.1  christos     { 0, 0, 0, 0 },
    617   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    618   1.1  christos     & ifmt_movgrgr, { 0x3a00 }
    619   1.1  christos   },
    620   1.1  christos /* rlc $Rd,#$imm4 */
    621   1.1  christos   {
    622   1.1  christos     { 0, 0, 0, 0 },
    623   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), 0 } },
    624   1.1  christos     & ifmt_addgrimm4, { 0x3b00 }
    625   1.1  christos   },
    626   1.1  christos /* shr $Rd,$Rs */
    627   1.1  christos   {
    628   1.1  christos     { 0, 0, 0, 0 },
    629   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    630   1.1  christos     & ifmt_movgrgr, { 0x3c00 }
    631   1.1  christos   },
    632   1.1  christos /* shr $Rd,#$imm4 */
    633   1.1  christos   {
    634   1.1  christos     { 0, 0, 0, 0 },
    635   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), 0 } },
    636   1.1  christos     & ifmt_addgrimm4, { 0x3d00 }
    637   1.1  christos   },
    638   1.1  christos /* shl $Rd,$Rs */
    639   1.1  christos   {
    640   1.1  christos     { 0, 0, 0, 0 },
    641   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    642   1.1  christos     & ifmt_movgrgr, { 0x3e00 }
    643   1.1  christos   },
    644   1.1  christos /* shl $Rd,#$imm4 */
    645   1.1  christos   {
    646   1.1  christos     { 0, 0, 0, 0 },
    647   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), 0 } },
    648   1.1  christos     & ifmt_addgrimm4, { 0x3f00 }
    649   1.1  christos   },
    650   1.1  christos /* asr $Rd,$Rs */
    651   1.1  christos   {
    652   1.1  christos     { 0, 0, 0, 0 },
    653   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    654   1.1  christos     & ifmt_movgrgr, { 0x3600 }
    655   1.1  christos   },
    656   1.1  christos /* asr $Rd,#$imm4 */
    657   1.1  christos   {
    658   1.1  christos     { 0, 0, 0, 0 },
    659   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), 0 } },
    660   1.1  christos     & ifmt_addgrimm4, { 0x3700 }
    661   1.1  christos   },
    662   1.1  christos /* set1 $Rd,#$imm4 */
    663   1.1  christos   {
    664   1.1  christos     { 0, 0, 0, 0 },
    665   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), 0 } },
    666   1.1  christos     & ifmt_addgrimm4, { 0x900 }
    667   1.1  christos   },
    668   1.1  christos /* set1 $Rd,$Rs */
    669   1.1  christos   {
    670   1.1  christos     { 0, 0, 0, 0 },
    671   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    672   1.1  christos     & ifmt_movgrgr, { 0xb00 }
    673   1.1  christos   },
    674   1.1  christos /* set1 $lmem8,#$imm3 */
    675   1.1  christos   {
    676   1.1  christos     { 0, 0, 0, 0 },
    677   1.1  christos     { { MNEM, ' ', OP (LMEM8), ',', '#', OP (IMM3), 0 } },
    678   1.1  christos     & ifmt_set1lmemimm, { 0xe100 }
    679   1.1  christos   },
    680   1.1  christos /* set1 $hmem8,#$imm3 */
    681   1.1  christos   {
    682   1.1  christos     { 0, 0, 0, 0 },
    683   1.1  christos     { { MNEM, ' ', OP (HMEM8), ',', '#', OP (IMM3), 0 } },
    684   1.1  christos     & ifmt_set1hmemimm, { 0xf100 }
    685   1.1  christos   },
    686   1.1  christos /* clr1 $Rd,#$imm4 */
    687   1.1  christos   {
    688   1.1  christos     { 0, 0, 0, 0 },
    689   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), 0 } },
    690   1.1  christos     & ifmt_addgrimm4, { 0x800 }
    691   1.1  christos   },
    692   1.1  christos /* clr1 $Rd,$Rs */
    693   1.1  christos   {
    694   1.1  christos     { 0, 0, 0, 0 },
    695   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), 0 } },
    696   1.1  christos     & ifmt_movgrgr, { 0xa00 }
    697   1.1  christos   },
    698   1.1  christos /* clr1 $lmem8,#$imm3 */
    699   1.1  christos   {
    700   1.1  christos     { 0, 0, 0, 0 },
    701   1.1  christos     { { MNEM, ' ', OP (LMEM8), ',', '#', OP (IMM3), 0 } },
    702   1.1  christos     & ifmt_set1lmemimm, { 0xe000 }
    703   1.1  christos   },
    704   1.1  christos /* clr1 $hmem8,#$imm3 */
    705   1.1  christos   {
    706   1.1  christos     { 0, 0, 0, 0 },
    707   1.1  christos     { { MNEM, ' ', OP (HMEM8), ',', '#', OP (IMM3), 0 } },
    708   1.1  christos     & ifmt_set1hmemimm, { 0xf000 }
    709   1.1  christos   },
    710   1.1  christos /* cbw $Rd */
    711   1.1  christos   {
    712   1.1  christos     { 0, 0, 0, 0 },
    713   1.1  christos     { { MNEM, ' ', OP (RD), 0 } },
    714   1.1  christos     & ifmt_movlowgr, { 0x30a0 }
    715   1.1  christos   },
    716   1.1  christos /* rev $Rd */
    717   1.1  christos   {
    718   1.1  christos     { 0, 0, 0, 0 },
    719   1.1  christos     { { MNEM, ' ', OP (RD), 0 } },
    720   1.1  christos     & ifmt_movlowgr, { 0x30f0 }
    721   1.1  christos   },
    722   1.1  christos /* b$bcond5 $Rd,$Rs,$rel12 */
    723   1.1  christos   {
    724   1.1  christos     { 0, 0, 0, 0 },
    725   1.1  christos     { { MNEM, OP (BCOND5), ' ', OP (RD), ',', OP (RS), ',', OP (REL12), 0 } },
    726   1.1  christos     & ifmt_bccgrgr, { 0xd000000 }
    727   1.1  christos   },
    728   1.1  christos /* b$bcond5 $Rm,#$imm8,$rel12 */
    729   1.1  christos   {
    730   1.1  christos     { 0, 0, 0, 0 },
    731   1.1  christos     { { MNEM, OP (BCOND5), ' ', OP (RM), ',', '#', OP (IMM8), ',', OP (REL12), 0 } },
    732   1.1  christos     & ifmt_bccgrimm8, { 0x20000000 }
    733   1.1  christos   },
    734   1.1  christos /* b$bcond2 Rx,#$imm16,${rel8-4} */
    735   1.1  christos   {
    736   1.1  christos     { 0, 0, 0, 0 },
    737   1.1  christos     { { MNEM, OP (BCOND2), ' ', 'R', 'x', ',', '#', OP (IMM16), ',', OP (REL8_4), 0 } },
    738   1.1  christos     & ifmt_bccimm16, { 0xc0000000 }
    739   1.1  christos   },
    740   1.1  christos /* bn $Rd,#$imm4,$rel12 */
    741   1.1  christos   {
    742   1.1  christos     { 0, 0, 0, 0 },
    743   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), ',', OP (REL12), 0 } },
    744   1.1  christos     & ifmt_bngrimm4, { 0x4000000 }
    745   1.1  christos   },
    746   1.1  christos /* bn $Rd,$Rs,$rel12 */
    747   1.1  christos   {
    748   1.1  christos     { 0, 0, 0, 0 },
    749   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), ',', OP (REL12), 0 } },
    750   1.1  christos     & ifmt_bngrgr, { 0x6000000 }
    751   1.1  christos   },
    752   1.1  christos /* bn $lmem8,#$imm3b,$rel12 */
    753   1.1  christos   {
    754   1.1  christos     { 0, 0, 0, 0 },
    755   1.1  christos     { { MNEM, ' ', OP (LMEM8), ',', '#', OP (IMM3B), ',', OP (REL12), 0 } },
    756   1.1  christos     & ifmt_bnlmemimm, { 0x7c000000 }
    757   1.1  christos   },
    758   1.1  christos /* bn $hmem8,#$imm3b,$rel12 */
    759   1.1  christos   {
    760   1.1  christos     { 0, 0, 0, 0 },
    761   1.1  christos     { { MNEM, ' ', OP (HMEM8), ',', '#', OP (IMM3B), ',', OP (REL12), 0 } },
    762   1.1  christos     & ifmt_bnhmemimm, { 0x7e000000 }
    763   1.1  christos   },
    764   1.1  christos /* bp $Rd,#$imm4,$rel12 */
    765   1.1  christos   {
    766   1.1  christos     { 0, 0, 0, 0 },
    767   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM4), ',', OP (REL12), 0 } },
    768   1.1  christos     & ifmt_bngrimm4, { 0x5000000 }
    769   1.1  christos   },
    770   1.1  christos /* bp $Rd,$Rs,$rel12 */
    771   1.1  christos   {
    772   1.1  christos     { 0, 0, 0, 0 },
    773   1.1  christos     { { MNEM, ' ', OP (RD), ',', OP (RS), ',', OP (REL12), 0 } },
    774   1.1  christos     & ifmt_bngrgr, { 0x7000000 }
    775   1.1  christos   },
    776   1.1  christos /* bp $lmem8,#$imm3b,$rel12 */
    777   1.1  christos   {
    778   1.1  christos     { 0, 0, 0, 0 },
    779   1.1  christos     { { MNEM, ' ', OP (LMEM8), ',', '#', OP (IMM3B), ',', OP (REL12), 0 } },
    780   1.1  christos     & ifmt_bnlmemimm, { 0x7d000000 }
    781   1.1  christos   },
    782   1.1  christos /* bp $hmem8,#$imm3b,$rel12 */
    783   1.1  christos   {
    784   1.1  christos     { 0, 0, 0, 0 },
    785   1.1  christos     { { MNEM, ' ', OP (HMEM8), ',', '#', OP (IMM3B), ',', OP (REL12), 0 } },
    786   1.1  christos     & ifmt_bnhmemimm, { 0x7f000000 }
    787   1.1  christos   },
    788   1.1  christos /* b$bcond2 ${rel8-2} */
    789   1.1  christos   {
    790   1.1  christos     { 0, 0, 0, 0 },
    791   1.1  christos     { { MNEM, OP (BCOND2), ' ', OP (REL8_2), 0 } },
    792   1.1  christos     & ifmt_bcc, { 0xd000 }
    793   1.1  christos   },
    794   1.1  christos /* br $Rd */
    795   1.1  christos   {
    796   1.1  christos     { 0, 0, 0, 0 },
    797   1.1  christos     { { MNEM, ' ', OP (RD), 0 } },
    798   1.1  christos     & ifmt_movlowgr, { 0x20 }
    799   1.1  christos   },
    800   1.1  christos /* br $rel12a */
    801   1.1  christos   {
    802   1.1  christos     { 0, 0, 0, 0 },
    803   1.1  christos     { { MNEM, ' ', OP (REL12A), 0 } },
    804   1.1  christos     & ifmt_br, { 0x1000 }
    805   1.1  christos   },
    806   1.1  christos /* jmp $Rbj,$Rd */
    807   1.1  christos   {
    808   1.1  christos     { 0, 0, 0, 0 },
    809   1.1  christos     { { MNEM, ' ', OP (RBJ), ',', OP (RD), 0 } },
    810   1.1  christos     & ifmt_jmp, { 0x40 }
    811   1.1  christos   },
    812   1.1  christos /* jmpf $abs24 */
    813   1.1  christos   {
    814   1.1  christos     { 0, 0, 0, 0 },
    815   1.1  christos     { { MNEM, ' ', OP (ABS24), 0 } },
    816   1.1  christos     & ifmt_jmpf, { 0x2000000 }
    817   1.1  christos   },
    818   1.1  christos /* callr $Rd */
    819   1.1  christos   {
    820   1.1  christos     { 0, 0, 0, 0 },
    821   1.1  christos     { { MNEM, ' ', OP (RD), 0 } },
    822   1.1  christos     & ifmt_movlowgr, { 0x10 }
    823   1.1  christos   },
    824   1.1  christos /* callr $rel12a */
    825   1.1  christos   {
    826   1.1  christos     { 0, 0, 0, 0 },
    827   1.1  christos     { { MNEM, ' ', OP (REL12A), 0 } },
    828   1.1  christos     & ifmt_br, { 0x1001 }
    829   1.1  christos   },
    830   1.1  christos /* call $Rbj,$Rd */
    831   1.1  christos   {
    832   1.1  christos     { 0, 0, 0, 0 },
    833   1.1  christos     { { MNEM, ' ', OP (RBJ), ',', OP (RD), 0 } },
    834   1.1  christos     & ifmt_jmp, { 0xa0 }
    835   1.1  christos   },
    836   1.1  christos /* callf $abs24 */
    837   1.1  christos   {
    838   1.1  christos     { 0, 0, 0, 0 },
    839   1.1  christos     { { MNEM, ' ', OP (ABS24), 0 } },
    840   1.1  christos     & ifmt_jmpf, { 0x1000000 }
    841   1.1  christos   },
    842   1.1  christos /* icallr $Rd */
    843   1.1  christos   {
    844   1.1  christos     { 0, 0, 0, 0 },
    845   1.1  christos     { { MNEM, ' ', OP (RD), 0 } },
    846   1.1  christos     & ifmt_movlowgr, { 0x30 }
    847   1.1  christos   },
    848   1.1  christos /* icall $Rbj,$Rd */
    849   1.1  christos   {
    850   1.1  christos     { 0, 0, 0, 0 },
    851   1.1  christos     { { MNEM, ' ', OP (RBJ), ',', OP (RD), 0 } },
    852   1.1  christos     & ifmt_jmp, { 0x60 }
    853   1.1  christos   },
    854   1.1  christos /* icallf $abs24 */
    855   1.1  christos   {
    856   1.1  christos     { 0, 0, 0, 0 },
    857   1.1  christos     { { MNEM, ' ', OP (ABS24), 0 } },
    858   1.1  christos     & ifmt_jmpf, { 0x3000000 }
    859   1.1  christos   },
    860   1.1  christos /* iret */
    861   1.1  christos   {
    862   1.1  christos     { 0, 0, 0, 0 },
    863   1.1  christos     { { MNEM, 0 } },
    864   1.1  christos     & ifmt_iret, { 0x2 }
    865   1.1  christos   },
    866   1.1  christos /* ret */
    867   1.1  christos   {
    868   1.1  christos     { 0, 0, 0, 0 },
    869   1.1  christos     { { MNEM, 0 } },
    870   1.1  christos     & ifmt_iret, { 0x3 }
    871   1.1  christos   },
    872   1.1  christos /* mul */
    873   1.1  christos   {
    874   1.1  christos     { 0, 0, 0, 0 },
    875   1.1  christos     { { MNEM, 0 } },
    876   1.1  christos     & ifmt_iret, { 0xd0 }
    877   1.1  christos   },
    878   1.1  christos /* div */
    879   1.1  christos   {
    880   1.1  christos     { 0, 0, 0, 0 },
    881   1.1  christos     { { MNEM, 0 } },
    882   1.1  christos     & ifmt_iret, { 0xc0 }
    883   1.1  christos   },
    884   1.1  christos /* sdiv */
    885   1.1  christos   {
    886   1.1  christos     { 0, 0, 0, 0 },
    887   1.1  christos     { { MNEM, 0 } },
    888   1.1  christos     & ifmt_iret, { 0xc8 }
    889   1.1  christos   },
    890   1.1  christos /* sdivlh */
    891   1.1  christos   {
    892   1.1  christos     { 0, 0, 0, 0 },
    893   1.1  christos     { { MNEM, 0 } },
    894   1.1  christos     & ifmt_iret, { 0xe8 }
    895   1.1  christos   },
    896   1.1  christos /* divlh */
    897   1.1  christos   {
    898   1.1  christos     { 0, 0, 0, 0 },
    899   1.1  christos     { { MNEM, 0 } },
    900   1.1  christos     & ifmt_iret, { 0xe0 }
    901   1.1  christos   },
    902   1.1  christos /* reset */
    903   1.1  christos   {
    904   1.1  christos     { 0, 0, 0, 0 },
    905   1.1  christos     { { MNEM, 0 } },
    906   1.1  christos     & ifmt_iret, { 0xf }
    907   1.1  christos   },
    908   1.1  christos /* nop */
    909   1.1  christos   {
    910   1.1  christos     { 0, 0, 0, 0 },
    911   1.1  christos     { { MNEM, 0 } },
    912   1.1  christos     & ifmt_iret, { 0x0 }
    913   1.1  christos   },
    914   1.1  christos /* halt */
    915   1.1  christos   {
    916   1.1  christos     { 0, 0, 0, 0 },
    917   1.1  christos     { { MNEM, 0 } },
    918   1.1  christos     & ifmt_iret, { 0x8 }
    919   1.1  christos   },
    920   1.1  christos /* hold */
    921   1.1  christos   {
    922   1.1  christos     { 0, 0, 0, 0 },
    923   1.1  christos     { { MNEM, 0 } },
    924   1.1  christos     & ifmt_iret, { 0xa }
    925   1.1  christos   },
    926   1.1  christos /* holdx */
    927   1.1  christos   {
    928   1.1  christos     { 0, 0, 0, 0 },
    929   1.1  christos     { { MNEM, 0 } },
    930   1.1  christos     & ifmt_iret, { 0xb }
    931   1.1  christos   },
    932   1.1  christos /* brk */
    933   1.1  christos   {
    934   1.1  christos     { 0, 0, 0, 0 },
    935   1.1  christos     { { MNEM, 0 } },
    936   1.1  christos     & ifmt_iret, { 0x5 }
    937   1.1  christos   },
    938   1.1  christos /* --unused-- */
    939   1.1  christos   {
    940   1.1  christos     { 0, 0, 0, 0 },
    941   1.1  christos     { { MNEM, 0 } },
    942   1.1  christos     & ifmt_iret, { 0x1 }
    943   1.1  christos   },
    944   1.1  christos };
    945   1.1  christos 
    946   1.1  christos #undef A
    947   1.1  christos #undef OPERAND
    948   1.1  christos #undef MNEM
    949   1.1  christos #undef OP
    950   1.1  christos 
    951   1.1  christos /* Formats for ALIAS macro-insns.  */
    952   1.1  christos 
    953   1.1  christos #define F(f) & xstormy16_cgen_ifld_table[XSTORMY16_##f]
    954   1.1  christos static const CGEN_IFMT ifmt_movimm8 ATTRIBUTE_UNUSED = {
    955   1.1  christos   16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_IMM8) }, { 0 } }
    956   1.1  christos };
    957   1.1  christos 
    958   1.1  christos static const CGEN_IFMT ifmt_movgrimm8 ATTRIBUTE_UNUSED = {
    959   1.1  christos   16, 16, 0xf100, { { F (F_OP1) }, { F (F_RM) }, { F (F_OP2M) }, { F (F_IMM8) }, { 0 } }
    960   1.1  christos };
    961   1.1  christos 
    962   1.1  christos static const CGEN_IFMT ifmt_movgrimm16 ATTRIBUTE_UNUSED = {
    963   1.1  christos   32, 32, 0xfff00000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_OP3) }, { F (F_RD) }, { F (F_IMM16) }, { 0 } }
    964   1.1  christos };
    965   1.1  christos 
    966   1.1  christos static const CGEN_IFMT ifmt_incgr ATTRIBUTE_UNUSED = {
    967   1.1  christos   16, 16, 0xfff0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_OP3A) }, { F (F_IMM2) }, { F (F_RD) }, { 0 } }
    968   1.1  christos };
    969   1.1  christos 
    970   1.1  christos static const CGEN_IFMT ifmt_decgr ATTRIBUTE_UNUSED = {
    971   1.1  christos   16, 16, 0xfff0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_OP3A) }, { F (F_IMM2) }, { F (F_RD) }, { 0 } }
    972   1.1  christos };
    973   1.1  christos 
    974   1.1  christos #undef F
    975   1.1  christos 
    976   1.1  christos /* Each non-simple macro entry points to an array of expansion possibilities.  */
    977   1.1  christos 
    978   1.1  christos #define A(a) (1 << CGEN_INSN_##a)
    979   1.1  christos #define OPERAND(op) XSTORMY16_OPERAND_##op
    980   1.1  christos #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
    981   1.1  christos #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
    982   1.1  christos 
    983   1.1  christos /* The macro instruction table.  */
    984   1.1  christos 
    985   1.1  christos static const CGEN_IBASE xstormy16_cgen_macro_insn_table[] =
    986   1.1  christos {
    987   1.1  christos /* mov Rx,#$imm8 */
    988   1.1  christos   {
    989   1.1  christos     -1, "movimm8", "mov", 16,
    990   1.1  christos     { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
    991   1.1  christos   },
    992   1.1  christos /* mov $Rm,#$imm8small */
    993   1.1  christos   {
    994   1.1  christos     -1, "movgrimm8", "mov", 16,
    995   1.1  christos     { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
    996   1.1  christos   },
    997   1.1  christos /* mov $Rd,#$imm16 */
    998   1.1  christos   {
    999   1.1  christos     -1, "movgrimm16", "mov", 32,
   1000   1.1  christos     { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
   1001   1.1  christos   },
   1002   1.1  christos /* inc $Rd */
   1003   1.1  christos   {
   1004   1.1  christos     -1, "incgr", "inc", 16,
   1005   1.1  christos     { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
   1006   1.1  christos   },
   1007   1.1  christos /* dec $Rd */
   1008   1.1  christos   {
   1009   1.1  christos     -1, "decgr", "dec", 16,
   1010   1.1  christos     { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
   1011   1.1  christos   },
   1012   1.1  christos };
   1013   1.1  christos 
   1014   1.1  christos /* The macro instruction opcode table.  */
   1015   1.1  christos 
   1016   1.1  christos static const CGEN_OPCODE xstormy16_cgen_macro_insn_opcode_table[] =
   1017   1.1  christos {
   1018   1.1  christos /* mov Rx,#$imm8 */
   1019   1.1  christos   {
   1020   1.1  christos     { 0, 0, 0, 0 },
   1021   1.1  christos     { { MNEM, ' ', 'R', 'x', ',', '#', OP (IMM8), 0 } },
   1022   1.1  christos     & ifmt_movimm8, { 0x4700 }
   1023   1.1  christos   },
   1024   1.1  christos /* mov $Rm,#$imm8small */
   1025   1.1  christos   {
   1026   1.1  christos     { 0, 0, 0, 0 },
   1027   1.1  christos     { { MNEM, ' ', OP (RM), ',', '#', OP (IMM8SMALL), 0 } },
   1028   1.1  christos     & ifmt_movgrimm8, { 0x2100 }
   1029   1.1  christos   },
   1030   1.1  christos /* mov $Rd,#$imm16 */
   1031   1.1  christos   {
   1032   1.1  christos     { 0, 0, 0, 0 },
   1033   1.1  christos     { { MNEM, ' ', OP (RD), ',', '#', OP (IMM16), 0 } },
   1034   1.1  christos     & ifmt_movgrimm16, { 0x31300000 }
   1035   1.1  christos   },
   1036   1.1  christos /* inc $Rd */
   1037   1.1  christos   {
   1038   1.1  christos     { 0, 0, 0, 0 },
   1039   1.1  christos     { { MNEM, ' ', OP (RD), 0 } },
   1040   1.1  christos     & ifmt_incgr, { 0x3000 }
   1041   1.1  christos   },
   1042   1.1  christos /* dec $Rd */
   1043   1.1  christos   {
   1044   1.1  christos     { 0, 0, 0, 0 },
   1045   1.1  christos     { { MNEM, ' ', OP (RD), 0 } },
   1046   1.1  christos     & ifmt_decgr, { 0x3040 }
   1047   1.1  christos   },
   1048   1.1  christos };
   1049   1.1  christos 
   1050   1.1  christos #undef A
   1051   1.1  christos #undef OPERAND
   1052   1.1  christos #undef MNEM
   1053   1.1  christos #undef OP
   1054   1.1  christos 
   1055   1.1  christos #ifndef CGEN_ASM_HASH_P
   1056   1.1  christos #define CGEN_ASM_HASH_P(insn) 1
   1057   1.1  christos #endif
   1058   1.1  christos 
   1059   1.1  christos #ifndef CGEN_DIS_HASH_P
   1060   1.1  christos #define CGEN_DIS_HASH_P(insn) 1
   1061   1.1  christos #endif
   1062   1.1  christos 
   1063   1.1  christos /* Return non-zero if INSN is to be added to the hash table.
   1064   1.1  christos    Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file.  */
   1065   1.1  christos 
   1066   1.1  christos static int
   1067   1.5  christos asm_hash_insn_p (const CGEN_INSN *insn ATTRIBUTE_UNUSED)
   1068   1.1  christos {
   1069   1.1  christos   return CGEN_ASM_HASH_P (insn);
   1070   1.1  christos }
   1071   1.1  christos 
   1072   1.1  christos static int
   1073   1.5  christos dis_hash_insn_p (const CGEN_INSN *insn)
   1074   1.1  christos {
   1075   1.1  christos   /* If building the hash table and the NO-DIS attribute is present,
   1076   1.1  christos      ignore.  */
   1077   1.1  christos   if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS))
   1078   1.1  christos     return 0;
   1079   1.1  christos   return CGEN_DIS_HASH_P (insn);
   1080   1.1  christos }
   1081   1.1  christos 
   1082   1.1  christos #ifndef CGEN_ASM_HASH
   1083   1.1  christos #define CGEN_ASM_HASH_SIZE 127
   1084   1.1  christos #ifdef CGEN_MNEMONIC_OPERANDS
   1085   1.1  christos #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)
   1086   1.1  christos #else
   1087   1.1  christos #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) /*FIXME*/
   1088   1.1  christos #endif
   1089   1.1  christos #endif
   1090   1.1  christos 
   1091   1.1  christos /* It doesn't make much sense to provide a default here,
   1092   1.1  christos    but while this is under development we do.
   1093   1.1  christos    BUFFER is a pointer to the bytes of the insn, target order.
   1094   1.1  christos    VALUE is the first base_insn_bitsize bits as an int in host order.  */
   1095   1.1  christos 
   1096   1.1  christos #ifndef CGEN_DIS_HASH
   1097   1.1  christos #define CGEN_DIS_HASH_SIZE 256
   1098   1.1  christos #define CGEN_DIS_HASH(buf, value) (*(unsigned char *) (buf))
   1099   1.1  christos #endif
   1100   1.1  christos 
   1101   1.1  christos /* The result is the hash value of the insn.
   1102   1.1  christos    Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file.  */
   1103   1.1  christos 
   1104   1.1  christos static unsigned int
   1105   1.5  christos asm_hash_insn (const char *mnem)
   1106   1.1  christos {
   1107   1.1  christos   return CGEN_ASM_HASH (mnem);
   1108   1.1  christos }
   1109   1.1  christos 
   1110   1.1  christos /* BUF is a pointer to the bytes of the insn, target order.
   1111   1.1  christos    VALUE is the first base_insn_bitsize bits as an int in host order.  */
   1112   1.1  christos 
   1113   1.1  christos static unsigned int
   1114   1.5  christos dis_hash_insn (const char *buf ATTRIBUTE_UNUSED,
   1115   1.5  christos 		     CGEN_INSN_INT value ATTRIBUTE_UNUSED)
   1116   1.1  christos {
   1117   1.1  christos   return CGEN_DIS_HASH (buf, value);
   1118   1.1  christos }
   1119   1.1  christos 
   1120   1.1  christos /* Set the recorded length of the insn in the CGEN_FIELDS struct.  */
   1121   1.1  christos 
   1122   1.1  christos static void
   1123   1.1  christos set_fields_bitsize (CGEN_FIELDS *fields, int size)
   1124   1.1  christos {
   1125   1.1  christos   CGEN_FIELDS_BITSIZE (fields) = size;
   1126   1.1  christos }
   1127   1.1  christos 
   1128   1.1  christos /* Function to call before using the operand instance table.
   1129   1.1  christos    This plugs the opcode entries and macro instructions into the cpu table.  */
   1130   1.1  christos 
   1131   1.1  christos void
   1132   1.1  christos xstormy16_cgen_init_opcode_table (CGEN_CPU_DESC cd)
   1133   1.1  christos {
   1134   1.1  christos   int i;
   1135   1.1  christos   int num_macros = (sizeof (xstormy16_cgen_macro_insn_table) /
   1136   1.1  christos 		    sizeof (xstormy16_cgen_macro_insn_table[0]));
   1137   1.1  christos   const CGEN_IBASE *ib = & xstormy16_cgen_macro_insn_table[0];
   1138   1.1  christos   const CGEN_OPCODE *oc = & xstormy16_cgen_macro_insn_opcode_table[0];
   1139   1.1  christos   CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN));
   1140   1.1  christos 
   1141   1.1  christos   /* This test has been added to avoid a warning generated
   1142   1.1  christos      if memset is called with a third argument of value zero.  */
   1143   1.1  christos   if (num_macros >= 1)
   1144   1.1  christos     memset (insns, 0, num_macros * sizeof (CGEN_INSN));
   1145   1.1  christos   for (i = 0; i < num_macros; ++i)
   1146   1.1  christos     {
   1147   1.1  christos       insns[i].base = &ib[i];
   1148   1.1  christos       insns[i].opcode = &oc[i];
   1149   1.1  christos       xstormy16_cgen_build_insn_regex (& insns[i]);
   1150   1.1  christos     }
   1151   1.1  christos   cd->macro_insn_table.init_entries = insns;
   1152   1.1  christos   cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE);
   1153   1.1  christos   cd->macro_insn_table.num_init_entries = num_macros;
   1154   1.1  christos 
   1155   1.1  christos   oc = & xstormy16_cgen_insn_opcode_table[0];
   1156   1.1  christos   insns = (CGEN_INSN *) cd->insn_table.init_entries;
   1157   1.1  christos   for (i = 0; i < MAX_INSNS; ++i)
   1158   1.1  christos     {
   1159   1.1  christos       insns[i].opcode = &oc[i];
   1160   1.1  christos       xstormy16_cgen_build_insn_regex (& insns[i]);
   1161   1.1  christos     }
   1162   1.1  christos 
   1163   1.1  christos   cd->sizeof_fields = sizeof (CGEN_FIELDS);
   1164   1.1  christos   cd->set_fields_bitsize = set_fields_bitsize;
   1165   1.1  christos 
   1166   1.1  christos   cd->asm_hash_p = asm_hash_insn_p;
   1167   1.1  christos   cd->asm_hash = asm_hash_insn;
   1168   1.1  christos   cd->asm_hash_size = CGEN_ASM_HASH_SIZE;
   1169   1.1  christos 
   1170   1.1  christos   cd->dis_hash_p = dis_hash_insn_p;
   1171   1.1  christos   cd->dis_hash = dis_hash_insn;
   1172   1.1  christos   cd->dis_hash_size = CGEN_DIS_HASH_SIZE;
   1173   1.1  christos }
   1174