xref: /netbsd-src/external/gpl3/gdb/dist/include/opcode/tic4x.h (revision aab831cebf6361fb2b518a47c70732e608d9abd2)
198b9484cSchristos /* Table of opcodes for the Texas Instruments TMS320C[34]X family.
298b9484cSchristos 
3*aab831ceSchristos    Copyright (C) 2002-2024 Free Software Foundation, Inc.
498b9484cSchristos 
598b9484cSchristos    Contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz)
698b9484cSchristos 
798b9484cSchristos    This program is free software; you can redistribute it and/or modify
898b9484cSchristos    it under the terms of the GNU General Public License as published by
998b9484cSchristos    the Free Software Foundation; either version 3 of the License, or
1098b9484cSchristos    (at your option) any later version.
1198b9484cSchristos 
1298b9484cSchristos    This program is distributed in the hope that it will be useful,
1398b9484cSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1498b9484cSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1598b9484cSchristos    GNU General Public License for more details.
1698b9484cSchristos 
1798b9484cSchristos    You should have received a copy of the GNU General Public License
1898b9484cSchristos    along with this program; if not, write to the Free Software
1998b9484cSchristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
2098b9484cSchristos    MA 02110-1301, USA.  */
2198b9484cSchristos 
2298b9484cSchristos #define IS_CPU_TIC3X(v) ((v) == 30 || (v) == 31 || (v) == 32 || (v) == 33)
2398b9484cSchristos #define IS_CPU_TIC4X(v) ((v) ==  0 || (v) == 40 || (v) == 44)
2498b9484cSchristos 
2598b9484cSchristos /* Define some bitfield extraction/insertion macros.  */
268dffb485Schristos #define EXTRU(inst, m, l) \
278dffb485Schristos   (((inst) >> (l)) & ((2u << ((m) - (l))) - 1))
288dffb485Schristos #define EXTRS(inst, m, l) \
298dffb485Schristos   ((int) ((EXTRU (inst, m, l) ^ (1u << ((m) - (l)))) - (1u << ((m) - (l)))))
308dffb485Schristos #define INSERTU(inst, val, m, l) \
318dffb485Schristos   ((inst) |= ((val) & ((2u << ((m) - (l))) - 1)) << (l))
328dffb485Schristos #define INSERTS INSERTU
3398b9484cSchristos 
3498b9484cSchristos /* Define register numbers.  */
3598b9484cSchristos typedef enum
3698b9484cSchristos   {
3798b9484cSchristos     REG_R0, REG_R1, REG_R2, REG_R3,
3898b9484cSchristos     REG_R4, REG_R5, REG_R6, REG_R7,
3998b9484cSchristos     REG_AR0, REG_AR1, REG_AR2, REG_AR3,
4098b9484cSchristos     REG_AR4, REG_AR5, REG_AR6, REG_AR7,
4198b9484cSchristos     REG_DP, REG_IR0, REG_IR1, REG_BK,
4298b9484cSchristos     REG_SP, REG_ST, REG_DIE, REG_IIE,
4398b9484cSchristos     REG_IIF, REG_RS, REG_RE, REG_RC,
4498b9484cSchristos     REG_R8, REG_R9, REG_R10, REG_R11,
4598b9484cSchristos     REG_IVTP, REG_TVTP
4698b9484cSchristos   }
4798b9484cSchristos c4x_reg_t;
4898b9484cSchristos 
4998b9484cSchristos /* Note that the actual register numbers for IVTP is 0 and TVTP is 1.  */
5098b9484cSchristos 
5198b9484cSchristos #define REG_IE REG_DIE		/* C3x only */
5298b9484cSchristos #define REG_IF REG_IIE		/* C3x only */
5398b9484cSchristos #define REG_IOF REG_IIF		/* C3x only */
5498b9484cSchristos 
5598b9484cSchristos #define TIC3X_REG_MAX REG_RC
5698b9484cSchristos #define TIC4X_REG_MAX REG_TVTP
5798b9484cSchristos 
5898b9484cSchristos /* Register table size including C4x expansion regs.  */
5998b9484cSchristos #define REG_TABLE_SIZE (TIC4X_REG_MAX + 1)
6098b9484cSchristos 
6198b9484cSchristos struct tic4x_register
6298b9484cSchristos {
63ba340e45Schristos   const char *  name;
6498b9484cSchristos   unsigned long regno;
6598b9484cSchristos };
6698b9484cSchristos 
6798b9484cSchristos typedef struct tic4x_register tic4x_register_t;
6898b9484cSchristos 
6998b9484cSchristos /* We could store register synonyms here.  */
7098b9484cSchristos static const tic4x_register_t tic3x_registers[] =
7198b9484cSchristos {
7298b9484cSchristos   {"f0",  REG_R0},
7398b9484cSchristos   {"r0",  REG_R0},
7498b9484cSchristos   {"f1",  REG_R1},
7598b9484cSchristos   {"r1",  REG_R1},
7698b9484cSchristos   {"f2",  REG_R2},
7798b9484cSchristos   {"r2",  REG_R2},
7898b9484cSchristos   {"f3",  REG_R3},
7998b9484cSchristos   {"r3",  REG_R3},
8098b9484cSchristos   {"f4",  REG_R4},
8198b9484cSchristos   {"r4",  REG_R4},
8298b9484cSchristos   {"f5",  REG_R5},
8398b9484cSchristos   {"r5",  REG_R5},
8498b9484cSchristos   {"f6",  REG_R6},
8598b9484cSchristos   {"r6",  REG_R6},
8698b9484cSchristos   {"f7",  REG_R7},
8798b9484cSchristos   {"r7",  REG_R7},
8898b9484cSchristos   {"ar0", REG_AR0},
8998b9484cSchristos   {"ar1", REG_AR1},
9098b9484cSchristos   {"ar2", REG_AR2},
9198b9484cSchristos   {"ar3", REG_AR3},
9298b9484cSchristos   {"ar4", REG_AR4},
9398b9484cSchristos   {"ar5", REG_AR5},
9498b9484cSchristos   {"ar6", REG_AR6},
9598b9484cSchristos   {"ar7", REG_AR7},
9698b9484cSchristos   {"dp",  REG_DP},
9798b9484cSchristos   {"ir0", REG_IR0},
9898b9484cSchristos   {"ir1", REG_IR1},
9998b9484cSchristos   {"bk",  REG_BK},
10098b9484cSchristos   {"sp",  REG_SP},
10198b9484cSchristos   {"st",  REG_ST},
10298b9484cSchristos   {"ie",  REG_IE},
10398b9484cSchristos   {"if",  REG_IF},
10498b9484cSchristos   {"iof", REG_IOF},
10598b9484cSchristos   {"rs",  REG_RS},
10698b9484cSchristos   {"re",  REG_RE},
10798b9484cSchristos   {"rc",  REG_RC},
10898b9484cSchristos   {"", 0}
10998b9484cSchristos };
11098b9484cSchristos 
11198b9484cSchristos const unsigned int tic3x_num_registers = (((sizeof tic3x_registers) / (sizeof tic3x_registers[0])) - 1);
11298b9484cSchristos 
11398b9484cSchristos /* Define C4x registers in addition to C3x registers.  */
11498b9484cSchristos static const tic4x_register_t tic4x_registers[] =
11598b9484cSchristos {
11698b9484cSchristos   {"die", REG_DIE},		/* Clobbers C3x REG_IE */
11798b9484cSchristos   {"iie", REG_IIE},		/* Clobbers C3x REG_IF */
11898b9484cSchristos   {"iif", REG_IIF},		/* Clobbers C3x REG_IOF */
11998b9484cSchristos   {"f8",  REG_R8},
12098b9484cSchristos   {"r8",  REG_R8},
12198b9484cSchristos   {"f9",  REG_R9},
12298b9484cSchristos   {"r9",  REG_R9},
12398b9484cSchristos   {"f10", REG_R10},
12498b9484cSchristos   {"r10", REG_R10},
12598b9484cSchristos   {"f11", REG_R11},
12698b9484cSchristos   {"r11", REG_R11},
12798b9484cSchristos   {"ivtp", REG_IVTP},
12898b9484cSchristos   {"tvtp", REG_TVTP},
12998b9484cSchristos   {"", 0}
13098b9484cSchristos };
13198b9484cSchristos 
13298b9484cSchristos const unsigned int tic4x_num_registers = (((sizeof tic4x_registers) / (sizeof tic4x_registers[0])) - 1);
13398b9484cSchristos 
13498b9484cSchristos struct tic4x_cond
13598b9484cSchristos {
136ba340e45Schristos   const char *  name;
13798b9484cSchristos   unsigned long cond;
13898b9484cSchristos };
13998b9484cSchristos 
14098b9484cSchristos typedef struct tic4x_cond tic4x_cond_t;
14198b9484cSchristos 
14298b9484cSchristos /* Define conditional branch/load suffixes.  Put desired form for
14398b9484cSchristos    disassembler last.  */
14498b9484cSchristos static const tic4x_cond_t tic4x_conds[] =
14598b9484cSchristos {
14698b9484cSchristos   { "u",    0x00 },
14798b9484cSchristos   { "c",    0x01 }, { "lo",  0x01 },
14898b9484cSchristos   { "ls",   0x02 },
14998b9484cSchristos   { "hi",   0x03 },
15098b9484cSchristos   { "nc",   0x04 }, { "hs",  0x04 },
15198b9484cSchristos   { "z",    0x05 }, { "eq",  0x05 },
15298b9484cSchristos   { "nz",   0x06 }, { "ne",  0x06 },
15398b9484cSchristos   { "n",    0x07 }, { "l",   0x07 }, { "lt",  0x07 },
15498b9484cSchristos   { "le",   0x08 },
15598b9484cSchristos   { "p",    0x09 }, { "gt",  0x09 },
15698b9484cSchristos   { "nn",   0x0a }, { "ge",  0x0a },
15798b9484cSchristos   { "nv",   0x0c },
15898b9484cSchristos   { "v",    0x0d },
15998b9484cSchristos   { "nuf",  0x0e },
16098b9484cSchristos   { "uf",   0x0f },
16198b9484cSchristos   { "nlv",  0x10 },
16298b9484cSchristos   { "lv",   0x11 },
16398b9484cSchristos   { "nluf", 0x12 },
16498b9484cSchristos   { "luf",  0x13 },
16598b9484cSchristos   { "zuf",  0x14 },
16698b9484cSchristos   /* Dummy entry, not included in num_conds.  This
16798b9484cSchristos      lets code examine entry i+1 without checking
16898b9484cSchristos      if we've run off the end of the table.  */
16998b9484cSchristos   { "",      0x0}
17098b9484cSchristos };
17198b9484cSchristos 
17298b9484cSchristos const unsigned int tic4x_num_conds = (((sizeof tic4x_conds) / (sizeof tic4x_conds[0])) - 1);
17398b9484cSchristos 
17498b9484cSchristos struct tic4x_indirect
17598b9484cSchristos {
176ba340e45Schristos   const char *  name;
17798b9484cSchristos   unsigned long modn;
17898b9484cSchristos };
17998b9484cSchristos 
18098b9484cSchristos typedef struct tic4x_indirect tic4x_indirect_t;
18198b9484cSchristos 
18298b9484cSchristos /* Define indirect addressing modes where:
18398b9484cSchristos    d displacement (signed)
18498b9484cSchristos    y ir0
18598b9484cSchristos    z ir1  */
18698b9484cSchristos 
18798b9484cSchristos static const tic4x_indirect_t tic4x_indirects[] =
18898b9484cSchristos {
18998b9484cSchristos   { "*+a(d)",   0x00 },
19098b9484cSchristos   { "*-a(d)",   0x01 },
19198b9484cSchristos   { "*++a(d)",  0x02 },
19298b9484cSchristos   { "*--a(d)",  0x03 },
19398b9484cSchristos   { "*a++(d)",  0x04 },
19498b9484cSchristos   { "*a--(d)",  0x05 },
19598b9484cSchristos   { "*a++(d)%", 0x06 },
19698b9484cSchristos   { "*a--(d)%", 0x07 },
19798b9484cSchristos   { "*+a(y)",   0x08 },
19898b9484cSchristos   { "*-a(y)",   0x09 },
19998b9484cSchristos   { "*++a(y)",  0x0a },
20098b9484cSchristos   { "*--a(y)",  0x0b },
20198b9484cSchristos   { "*a++(y)",  0x0c },
20298b9484cSchristos   { "*a--(y)",  0x0d },
20398b9484cSchristos   { "*a++(y)%", 0x0e },
20498b9484cSchristos   { "*a--(y)%", 0x0f },
20598b9484cSchristos   { "*+a(z)",   0x10 },
20698b9484cSchristos   { "*-a(z)",   0x11 },
20798b9484cSchristos   { "*++a(z)",  0x12 },
20898b9484cSchristos   { "*--a(z)",  0x13 },
20998b9484cSchristos   { "*a++(z)",  0x14 },
21098b9484cSchristos   { "*a--(z)",  0x15 },
21198b9484cSchristos   { "*a++(z)%", 0x16 },
21298b9484cSchristos   { "*a--(z)%", 0x17 },
21398b9484cSchristos   { "*a",       0x18 },
21498b9484cSchristos   { "*a++(y)b", 0x19 },
21598b9484cSchristos   /* Dummy entry, not included in num_indirects.  This
21698b9484cSchristos      lets code examine entry i+1 without checking
21798b9484cSchristos      if we've run off the end of the table.  */
21898b9484cSchristos   { "",      0x0}
21998b9484cSchristos };
22098b9484cSchristos 
22198b9484cSchristos #define TIC3X_MODN_MAX 0x19
22298b9484cSchristos 
22398b9484cSchristos const unsigned int tic4x_num_indirects = (((sizeof tic4x_indirects) / (sizeof tic4x_indirects[0])) - 1);
22498b9484cSchristos 
22598b9484cSchristos /* Instruction template.  */
22698b9484cSchristos struct tic4x_inst
22798b9484cSchristos {
228ba340e45Schristos   const char *  name;
22998b9484cSchristos   unsigned long opcode;
23098b9484cSchristos   unsigned long opmask;
231ba340e45Schristos   const char *        args;
23298b9484cSchristos   unsigned long oplevel;
23398b9484cSchristos };
23498b9484cSchristos 
23598b9484cSchristos typedef struct tic4x_inst tic4x_inst_t;
23698b9484cSchristos 
23798b9484cSchristos /* Opcode infix
23898b9484cSchristos    B  condition              16--20   U,C,Z,LO,HI, etc.
23998b9484cSchristos    C  condition              23--27   U,C,Z,LO,HI, etc.
24098b9484cSchristos 
24198b9484cSchristos    Arguments
24298b9484cSchristos    ,  required arg follows
24398b9484cSchristos    ;  optional arg follows
24498b9484cSchristos 
24598b9484cSchristos    Argument types             bits    [classes] - example
24698b9484cSchristos    -----------------------------------------------------------
24798b9484cSchristos    *  indirect (all)          0--15   [A,AB,AU,AF,A2,A3,A6,A7,AY,B,BA,BB,BI,B6,B7] - *+AR0(5), *++AR0(IR0)
24898b9484cSchristos    #  direct (for LDP)        0--15   [Z] - @start, start
24998b9484cSchristos    @  direct                  0--15   [A,AB,AU,AF,A3,A6,A7,AY,B,BA,BB,BI,B6,B7] - @start, start
25098b9484cSchristos    A  address register       22--24   [D] - AR0, AR7
25198b9484cSchristos    B  unsigned integer        0--23   [I,I2] - @start, start  (absolute on C3x, relative on C4x)
25298b9484cSchristos    C  indirect (disp - C4x)   0--7    [S,SC,S2,T,TC,T2,T2C] - *+AR0(5)
25398b9484cSchristos    E  register (all)          0--7    [T,TC,T2,T2C] - R0, R7, R11, AR0, DP
25498b9484cSchristos    e  register (0-11)         0--7    [S,SC,S2] - R0, R7, R11
25598b9484cSchristos    F  short float immediate   0--15   [AF,B,BA,BB] - 3.5, 0e-3.5e-1
25698b9484cSchristos    G  register (all)          8--15   [T,TC,T2,T2C] - R0, R7, R11, AR0, DP
25798b9484cSchristos    g  register (0-11)         0--7    [S,SC,S2] - R0, R7, R11
25898b9484cSchristos    H  register (0-7)         18--16   [LS,M,P,Q] - R0, R7
25998b9484cSchristos    I  indirect (no disp)      0--7    [S,SC,S2,T,TC,T2,T2C] - *+AR0(1), *+AR0(IR0)
26098b9484cSchristos    i  indirect (enhanced)     0--7    [LL,LS,M,P,Q,QC] - *+AR0(1), R5
26198b9484cSchristos    J  indirect (no disp)      8--15   [LL,LS,P,Q,QC,S,SC,S2,T,TC,T2,T2C] - *+AR0(1), *+AR0(IR0)
26298b9484cSchristos    j  indirect (enhanced)     8--15   [M] - *+AR0(1), R5
26398b9484cSchristos    K  register               19--21   [LL,M,Q,QC] - R0, R7
26498b9484cSchristos    L  register               22--24   [LL,LS,P,Q,QC] - R0, R7
26598b9484cSchristos    M  register (R2,R3)       22--22   [M] R2, R3
26698b9484cSchristos    N  register (R0,R1)       23--23   [M] R0, R1
26798b9484cSchristos    O  indirect(disp - C4x)    8--15   [S,SC,S2,T,TC,T2] - *+AR0(5)
26898b9484cSchristos    P  displacement (PC Rel)   0--15   [D,J,JS] - @start, start
26998b9484cSchristos    Q  register (all)          0--15   [A,AB,AU,A2,A3,AY,BA,BI,D,I2,J,JS] - R0, AR0, DP, SP
27098b9484cSchristos    q  register (0-11)         0--15   [AF,B,BB] - R0, R7, R11
27198b9484cSchristos    R  register (all)         16--20   [A,AB,AU,AF,A6,A7,R,T,TC] - R0, AR0, DP, SP
27298b9484cSchristos    r  register (0-11)        16--20   [B,BA,BB,BI,B6,B7,RF,S,SC] - R0, R1, R11
27398b9484cSchristos    S  short int immediate     0--15   [A,AB,AY,BI] - -5, 5
27498b9484cSchristos    T  integer (C4x)          16--20   [Z] - -5, 12
27598b9484cSchristos    U  unsigned integer        0--15   [AU,A3] - 0, 65535
27698b9484cSchristos    V  vector (C4x: 0--8)      0--4    [Z] - 25, 7
27798b9484cSchristos    W  short int (C4x)         0--7    [T,TC,T2,T2C] - -3, 5
27898b9484cSchristos    X  expansion reg (C4x)     0--4    [Z] - IVTP, TVTP
27998b9484cSchristos    Y  address reg (C4x)      16--20   [Z] - AR0, DP, SP, IR0
28098b9484cSchristos    Z  expansion reg (C4x)    16--20   [Z] - IVTP, TVTP
28198b9484cSchristos */
28298b9484cSchristos 
28398b9484cSchristos #define TIC4X_OPERANDS_MAX 7	/* Max number of operands for an inst.  */
28498b9484cSchristos #define TIC4X_NAME_MAX 16	/* Max number of chars in parallel name.  */
28598b9484cSchristos 
28698b9484cSchristos /* Define the instruction level */
28798b9484cSchristos #define OP_C3X   0x1   /* C30 support - supported by all */
28898b9484cSchristos #define OP_C4X   0x2   /* C40 support - C40, C44 */
28998b9484cSchristos #define OP_ENH   0x4   /* Class LL,LS,M,P,Q,QC enhancements. Argument type
29098b9484cSchristos                           I and J is enhanced in these classes - C31>=6.0,
29198b9484cSchristos                           C32>=2.0, C33 */
29298b9484cSchristos #define OP_LPWR  0x8   /* Low power support (LOPOWER, MAXSPEED) - C30>=7.0,
29398b9484cSchristos                           LC31, C31>=5.0, C32 */
29498b9484cSchristos #define OP_IDLE2 0x10  /* Idle2 support (IDLE2) - C30>=7.0, LC31, C31>=5.0,
29598b9484cSchristos                           C32, C33, C40>=5.0, C44 */
29698b9484cSchristos 
29798b9484cSchristos /* The following class definition is a classification scheme for
29898b9484cSchristos    putting instructions with similar type of arguments together. It
29998b9484cSchristos    simplifies the op-code definitions significantly, as we then only
30098b9484cSchristos    need to use the class macroes for 95% of the DSP's opcodes.
30198b9484cSchristos */
30298b9484cSchristos 
30398b9484cSchristos /* A: General 2-operand integer operations
30498b9484cSchristos    Syntax: <i> src, dst
30598b9484cSchristos       src = Register (Q), Direct (@), Indirect (*), Signed immediate (S)
30698b9484cSchristos       dst = Register (R)
30798b9484cSchristos    Instr: 15/8 - ABSI, ADDC, ADDI, ASH, CMPI, LDI, LSH, MPYI, NEGB, NEGI,
30898b9484cSchristos                 SUBB, SUBC, SUBI, SUBRB, SUBRI, C4x: LBn, LHn, LWLn, LWRn,
30998b9484cSchristos                 MBn, MHn, MPYSHI, MPYUHI
31098b9484cSchristos */
31198b9484cSchristos #define A_CLASS_INSN(name, opcode, level) \
31298b9484cSchristos   { name, opcode|0x00000000, 0xffe00000, "Q;R", level }, \
31398b9484cSchristos   { name, opcode|0x00200000, 0xffe00000, "@,R", level }, \
31498b9484cSchristos   { name, opcode|0x00400000, 0xffe00000, "*,R", level }, \
31598b9484cSchristos   { name, opcode|0x00600000, 0xffe00000, "S,R", level }
31698b9484cSchristos 
31798b9484cSchristos /* AB: General 2-operand integer operation with condition
31898b9484cSchristos    Syntax: <i>c src, dst
31998b9484cSchristos        c   = Condition
32098b9484cSchristos        src = Register (Q), Direct (@), Indirect (*), Signed immediate (S)
32198b9484cSchristos        dst = Register (R)
32298b9484cSchristos    Instr: 1/0 - LDIc
32398b9484cSchristos */
32498b9484cSchristos #define AB_CLASS_INSN(name, opcode, level) \
32598b9484cSchristos   { name, opcode|0x40000000, 0xf0600000, "Q;R", level }, \
32698b9484cSchristos   { name, opcode|0x40200000, 0xf0600000, "@,R", level }, \
32798b9484cSchristos   { name, opcode|0x40400000, 0xf0600000, "*,R", level }, \
32898b9484cSchristos   { name, opcode|0x40600000, 0xf0600000, "S,R", level }
32998b9484cSchristos 
33098b9484cSchristos /* AU: General 2-operand unsigned integer operation
33198b9484cSchristos    Syntax: <i> src, dst
33298b9484cSchristos         src = Register (Q), Direct (@), Indirect (*), Unsigned immediate (U)
33398b9484cSchristos         dst = Register (R)
33498b9484cSchristos    Instr: 6/2 - AND, ANDN, NOT, OR, TSTB, XOR, C4x: LBUn, LHUn
33598b9484cSchristos */
33698b9484cSchristos #define AU_CLASS_INSN(name, opcode, level) \
33798b9484cSchristos   { name, opcode|0x00000000, 0xffe00000, "Q;R", level }, \
33898b9484cSchristos   { name, opcode|0x00200000, 0xffe00000, "@,R", level }, \
33998b9484cSchristos   { name, opcode|0x00400000, 0xffe00000, "*,R", level }, \
34098b9484cSchristos   { name, opcode|0x00600000, 0xffe00000, "U,R", level }
34198b9484cSchristos 
34298b9484cSchristos /* AF: General 2-operand float to integer operation
34398b9484cSchristos    Syntax: <i> src, dst
34498b9484cSchristos         src = Register 0-11 (q), Direct (@), Indirect (*), Float immediate (F)
34598b9484cSchristos         dst = Register (R)
34698b9484cSchristos    Instr: 1/0 - FIX
34798b9484cSchristos */
34898b9484cSchristos #define AF_CLASS_INSN(name, opcode, level) \
34998b9484cSchristos   { name, opcode|0x00000000, 0xffe00000, "q;R", level }, \
35098b9484cSchristos   { name, opcode|0x00200000, 0xffe00000, "@,R", level }, \
35198b9484cSchristos   { name, opcode|0x00400000, 0xffe00000, "*,R", level }, \
35298b9484cSchristos   { name, opcode|0x00600000, 0xffe00000, "F,R", level }
35398b9484cSchristos 
35498b9484cSchristos /* A2: Limited 1-operand (integer) operation
35598b9484cSchristos    Syntax: <i> src
35698b9484cSchristos        src = Register (Q), Indirect (*), None
35798b9484cSchristos    Instr: 1/0 - NOP
35898b9484cSchristos */
35998b9484cSchristos #define A2_CLASS_INSN(name, opcode, level) \
36098b9484cSchristos   { name, opcode|0x00000000, 0xffe00000, "Q", level }, \
36198b9484cSchristos   { name, opcode|0x00400000, 0xffe00000, "*", level }, \
36298b9484cSchristos   { name, opcode|0x00000000, 0xffe00000, "" , level }
36398b9484cSchristos 
36498b9484cSchristos /* A3: General 1-operand unsigned integer operation
36598b9484cSchristos    Syntax: <i> src
36698b9484cSchristos         src = Register (Q), Direct (@), Indirect (*), Unsigned immediate (U)
36798b9484cSchristos    Instr: 1/0 - RPTS
36898b9484cSchristos */
36998b9484cSchristos #define A3_CLASS_INSN(name, opcode, level) \
37098b9484cSchristos   { name, opcode|0x00000000, 0xffff0000, "Q", level }, \
37198b9484cSchristos   { name, opcode|0x00200000, 0xffff0000, "@", level }, \
37298b9484cSchristos   { name, opcode|0x00400000, 0xffff0000, "*", level }, \
37398b9484cSchristos   { name, opcode|0x00600000, 0xffff0000, "U", level }
37498b9484cSchristos 
37598b9484cSchristos /* A6: Limited 2-operand integer operation
37698b9484cSchristos    Syntax: <i> src, dst
37798b9484cSchristos        src = Direct (@), Indirect (*)
37898b9484cSchristos        dst = Register (R)
37998b9484cSchristos    Instr: 1/1 - LDII, C4x: SIGI
38098b9484cSchristos */
38198b9484cSchristos #define A6_CLASS_INSN(name, opcode, level) \
38298b9484cSchristos   { name, opcode|0x00200000, 0xffe00000, "@,R", level }, \
38398b9484cSchristos   { name, opcode|0x00400000, 0xffe00000, "*,R", level }
38498b9484cSchristos 
38598b9484cSchristos /* A7: Limited 2-operand integer store operation
38698b9484cSchristos    Syntax: <i> src, dst
38798b9484cSchristos        src = Register (R)
38898b9484cSchristos        dst = Direct (@), Indirect (*)
38998b9484cSchristos    Instr: 2/0 - STI, STII
39098b9484cSchristos */
39198b9484cSchristos #define A7_CLASS_INSN(name, opcode, level) \
39298b9484cSchristos   { name, opcode|0x00200000, 0xffe00000, "R,@", level }, \
39398b9484cSchristos   { name, opcode|0x00400000, 0xffe00000, "R,*", level }
39498b9484cSchristos 
39598b9484cSchristos /* AY: General 2-operand signed address load operation
39698b9484cSchristos    Syntax: <i> src, dst
39798b9484cSchristos         src = Register (Q), Direct (@), Indirect (*), Signed immediate (S)
39898b9484cSchristos         dst = Address register - ARx, IRx, DP, BK, SP (Y)
39998b9484cSchristos    Instr: 0/1 - C4x: LDA
40098b9484cSchristos    Note: Q and Y should *never* be the same register
40198b9484cSchristos */
40298b9484cSchristos #define AY_CLASS_INSN(name, opcode, level) \
40398b9484cSchristos   { name, opcode|0x00000000, 0xffe00000, "Q,Y", level }, \
40498b9484cSchristos   { name, opcode|0x00200000, 0xffe00000, "@,Y", level }, \
40598b9484cSchristos   { name, opcode|0x00400000, 0xffe00000, "*,Y", level }, \
40698b9484cSchristos   { name, opcode|0x00600000, 0xffe00000, "S,Y", level }
40798b9484cSchristos 
40898b9484cSchristos /* B: General 2-operand float operation
40998b9484cSchristos    Syntax: <i> src, dst
41098b9484cSchristos        src = Register 0-11 (q), Direct (@), Indirect (*), Float immediate (F)
41198b9484cSchristos        dst = Register 0-11 (r)
41298b9484cSchristos    Instr: 12/2 - ABSF, ADDF, CMPF, LDE, LDF, LDM, MPYF, NEGF, NORM, RND,
41398b9484cSchristos                  SUBF, SUBRF, C4x: RSQRF, TOIEEE
41498b9484cSchristos */
41598b9484cSchristos #define B_CLASS_INSN(name, opcode, level) \
41698b9484cSchristos   { name, opcode|0x00000000, 0xffe00000, "q;r", level }, \
41798b9484cSchristos   { name, opcode|0x00200000, 0xffe00000, "@,r", level }, \
41898b9484cSchristos   { name, opcode|0x00400000, 0xffe00000, "*,r", level }, \
41998b9484cSchristos   { name, opcode|0x00600000, 0xffe00000, "F,r", level }
42098b9484cSchristos 
42198b9484cSchristos /* BA: General 2-operand integer to float operation
42298b9484cSchristos    Syntax: <i> src, dst
42398b9484cSchristos        src = Register (Q), Direct (@), Indirect (*), Float immediate (F)
42498b9484cSchristos        dst = Register 0-11 (r)
42598b9484cSchristos    Instr: 0/1 - C4x: CRCPF
42698b9484cSchristos */
42798b9484cSchristos #define BA_CLASS_INSN(name, opcode, level) \
42898b9484cSchristos   { name, opcode|0x00000000, 0xffe00000, "Q;r", level }, \
42998b9484cSchristos   { name, opcode|0x00200000, 0xffe00000, "@,r", level }, \
43098b9484cSchristos   { name, opcode|0x00400000, 0xffe00000, "*,r", level }, \
43198b9484cSchristos   { name, opcode|0x00600000, 0xffe00000, "F,r", level }
43298b9484cSchristos 
43398b9484cSchristos /* BB: General 2-operand conditional float operation
43498b9484cSchristos    Syntax: <i>c src, dst
43598b9484cSchristos        c   = Condition
43698b9484cSchristos        src = Register 0-11 (q), Direct (@), Indirect (*), Float immediate (F)
43798b9484cSchristos        dst = Register 0-11 (r)
43898b9484cSchristos    Instr: 1/0 - LDFc
43998b9484cSchristos */
44098b9484cSchristos #define BB_CLASS_INSN(name, opcode, level) \
44198b9484cSchristos   { name, opcode|0x40000000, 0xf0600000, "q;r", level }, \
44298b9484cSchristos   { name, opcode|0x40200000, 0xf0600000, "@,r", level }, \
44398b9484cSchristos   { name, opcode|0x40400000, 0xf0600000, "*,r", level }, \
44498b9484cSchristos   { name, opcode|0x40600000, 0xf0600000, "F,r", level }
44598b9484cSchristos 
44698b9484cSchristos /* BI: General 2-operand integer to float operation (yet different to BA)
44798b9484cSchristos    Syntax: <i> src, dst
44898b9484cSchristos        src = Register (Q), Direct (@), Indirect (*), Signed immediate (S)
44998b9484cSchristos        dst = Register 0-11 (r)
45098b9484cSchristos    Instr: 1/0 - FLOAT
45198b9484cSchristos */
45298b9484cSchristos #define BI_CLASS_INSN(name, opcode, level) \
45398b9484cSchristos   { name, opcode|0x00000000, 0xffe00000, "Q;r", level }, \
45498b9484cSchristos   { name, opcode|0x00200000, 0xffe00000, "@,r", level }, \
45598b9484cSchristos   { name, opcode|0x00400000, 0xffe00000, "*,r", level }, \
45698b9484cSchristos   { name, opcode|0x00600000, 0xffe00000, "S,r", level }
45798b9484cSchristos 
45898b9484cSchristos /* B6: Limited 2-operand float operation
45998b9484cSchristos    Syntax: <i> src, dst
46098b9484cSchristos        src = Direct (@), Indirect (*)
46198b9484cSchristos        dst = Register 0-11 (r)
46298b9484cSchristos    Instr: 1/1 - LDFI, C4x: FRIEEE
46398b9484cSchristos */
46498b9484cSchristos #define B6_CLASS_INSN(name, opcode, level) \
46598b9484cSchristos   { name, opcode|0x00200000, 0xffe00000, "@,r", level }, \
46698b9484cSchristos   { name, opcode|0x00400000, 0xffe00000, "*,r", level }
46798b9484cSchristos 
46898b9484cSchristos /* B7: Limited 2-operand float store operation
46998b9484cSchristos    Syntax: <i> src, dst
47098b9484cSchristos        src = Register 0-11 (r)
47198b9484cSchristos        dst = Direct (@), Indirect (*)
47298b9484cSchristos    Instr: 2/0 - STF, STFI
47398b9484cSchristos */
47498b9484cSchristos #define B7_CLASS_INSN(name, opcode, level) \
47598b9484cSchristos   { name, opcode|0x00200000, 0xffe00000, "r,@", level }, \
47698b9484cSchristos   { name, opcode|0x00400000, 0xffe00000, "r,*", level }
47798b9484cSchristos 
47898b9484cSchristos /* D: Decrement and brach operations
47998b9484cSchristos    Syntax: <i>c ARn, dst
48098b9484cSchristos        c   = condition
48198b9484cSchristos        ARn = AR register 0-7 (A)
48298b9484cSchristos        dst = Register (Q), PC-relative (P)
48398b9484cSchristos    Instr: 2/0 - DBc, DBcD
48498b9484cSchristos    Alias: <name1> <name2>
48598b9484cSchristos */
48698b9484cSchristos #define D_CLASS_INSN(name1, name2, opcode, level) \
48798b9484cSchristos   { name1, opcode|0x00000000, 0xfe200000, "A,Q", level }, \
48898b9484cSchristos   { name1, opcode|0x02000000, 0xfe200000, "A,P", level }, \
48998b9484cSchristos   { name2, opcode|0x00000000, 0xfe200000, "A,Q", level }, \
49098b9484cSchristos   { name2, opcode|0x02000000, 0xfe200000, "A,P", level }
49198b9484cSchristos 
49298b9484cSchristos /* I: General branch operations
49398b9484cSchristos    Syntax: <i> dst
49498b9484cSchristos        dst = Address (B)
49598b9484cSchristos    Instr: 3/1 - BR, BRD, CALL, C4x: LAJ
49698b9484cSchristos */
49798b9484cSchristos 
49898b9484cSchristos /* I2: General branch operations (C4x addition)
49998b9484cSchristos    Syntax: <i> dst
50098b9484cSchristos        dst = Address (B), C4x: Register (Q)
50198b9484cSchristos    Instr: 2/0 - RPTB, RPTBD
50298b9484cSchristos */
50398b9484cSchristos 
50498b9484cSchristos /* J: General conditional branch operations
50598b9484cSchristos    Syntax: <i>c dst
50698b9484cSchristos        c   = Condition
50798b9484cSchristos        dst = Register (Q), PC-relative (P)
50898b9484cSchristos    Instr: 2/3 - Bc, BcD, C4x: BcAF, BcAT, LAJc
50998b9484cSchristos    Alias: <name1> <name2>
51098b9484cSchristos */
51198b9484cSchristos #define J_CLASS_INSN(name1, name2, opcode, level) \
51298b9484cSchristos   { name1, opcode|0x00000000, 0xffe00000, "Q", level }, \
51398b9484cSchristos   { name1, opcode|0x02000000, 0xffe00000, "P", level }, \
51498b9484cSchristos   { name2, opcode|0x00000000, 0xffe00000, "Q", level }, \
51598b9484cSchristos   { name2, opcode|0x02000000, 0xffe00000, "P", level }
51698b9484cSchristos 
51798b9484cSchristos /* JS: General conditional branch operations
51898b9484cSchristos    Syntax: <i>c dst
51998b9484cSchristos        c   = Condition
52098b9484cSchristos        dst = Register (Q), PC-relative (P)
52198b9484cSchristos    Instr: 1/1 - CALLc, C4X: LAJc
52298b9484cSchristos */
52398b9484cSchristos 
52498b9484cSchristos /* LL: Load-load parallell operation
52598b9484cSchristos    Syntax: <i> src2, dst2 || <i> src1, dst1
52698b9484cSchristos        src1 = Indirect 0,1,IR0,IR1 (J)
52798b9484cSchristos        dst1 = Register 0-7 (K)
52898b9484cSchristos        src2 = Indirect 0,1,IR0,IR1, ENH: Register (i)
52998b9484cSchristos        dst2 = Register 0-7 (L)
53098b9484cSchristos    Instr: 2/0 - LDF||LDF, LDI||LDI
53198b9484cSchristos    Alias: i||i, i1||i2, i2||i1
53298b9484cSchristos */
53398b9484cSchristos #define LL_CLASS_INSN(name, opcode, level) \
53498b9484cSchristos   { name "_"  name    , opcode, 0xfe000000, "i;L|J,K", level }, \
53598b9484cSchristos   { name "2_" name "1", opcode, 0xfe000000, "i;L|J,K", level }, \
53698b9484cSchristos   { name "1_" name "2", opcode, 0xfe000000, "J,K|i;L", level }
53798b9484cSchristos 
53898b9484cSchristos /* LS: Store-store parallell operation
53998b9484cSchristos    Syntax: <i> src2, dst2 || <i> src1, dst1
54098b9484cSchristos        src1 = Register 0-7 (H)
54198b9484cSchristos        dst1 = Indirect 0,1,IR0,IR1 (J)
54298b9484cSchristos        src2 = Register 0-7 (L)
54398b9484cSchristos        dst2 = Indirect 0,1,IR0,IR1, ENH: register (i)
54498b9484cSchristos    Instr: 2/0 - STF||STF, STI||STI
54598b9484cSchristos    Alias: i||i, i1||i2, i2||i1.
54698b9484cSchristos */
54798b9484cSchristos #define LS_CLASS_INSN(name, opcode, level) \
54898b9484cSchristos   { name "_"  name    , opcode, 0xfe000000, "L;i|H,J", level }, \
54998b9484cSchristos   { name "2_" name "1", opcode, 0xfe000000, "L;i|H,J", level }, \
55098b9484cSchristos   { name "1_" name "2", opcode, 0xfe000000, "H,J|L;i", level }
55198b9484cSchristos 
55298b9484cSchristos /* M: General multiply and add/sub operations
55398b9484cSchristos    Syntax: <ia> src3,src4,dst1 || <ib> src2,src1,dst2 [00] - Manual
55498b9484cSchristos            <ia> src3,src1,dst1 || <ib> src2,src4,dst2 [01] - Manual
55598b9484cSchristos            <ia> src1,src3,dst1 || <ib> src2,src4,dst2 [01]
55698b9484cSchristos            <ia> src1,src2,dst1 || <ib> src4,src3,dst2 [02] - Manual
55798b9484cSchristos            <ia> src3,src1,dst1 || <ib> src4,src2,dst2 [03] - Manual
55898b9484cSchristos            <ia> src1,src3,dst1 || <ib> src4,src2,dst2 [03]
55998b9484cSchristos        src1 = Register 0-7 (K)
56098b9484cSchristos        src2 = Register 0-7 (H)
56198b9484cSchristos        src3 = Indirect 0,1,IR0,IR1, ENH: register (j)
56298b9484cSchristos        src4 = Indirect 0,1,IR0,IR1, ENH: register (i)
56398b9484cSchristos        dst1 = Register 0-1 (N)
56498b9484cSchristos        dst2 = Register 2-3 (M)
56598b9484cSchristos    Instr: 4/0 - MPYF3||ADDF3, MPYF3||SUBF3, MPYI3||ADDI3, MPYI3||SUBI3
56698b9484cSchristos    Alias: a||b, a3||n, a||b3, a3||b3, b||a, b3||a, b||a3, b3||a3
56798b9484cSchristos */
56898b9484cSchristos #define M_CLASS_INSN(namea, nameb, opcode, level) \
56998b9484cSchristos   { namea "_" nameb, opcode|0x00000000, 0xff000000, "i;j;N|H;K;M", level }, \
57098b9484cSchristos   { namea "_" nameb, opcode|0x01000000, 0xff000000, "j;K;N|H;i;M", level }, \
57198b9484cSchristos   { namea "_" nameb, opcode|0x01000000, 0xff000000, "K;j;N|H;i;M", level }, \
57298b9484cSchristos   { namea "_" nameb, opcode|0x02000000, 0xff000000, "H;K;N|i;j;M", level }, \
57398b9484cSchristos   { namea "_" nameb, opcode|0x03000000, 0xff000000, "j;K;N|i;H;M", level }, \
57498b9484cSchristos   { namea "_" nameb, opcode|0x03000000, 0xff000000, "K;j;N|i;H;M", level }, \
57598b9484cSchristos   { namea "3_" nameb, opcode|0x00000000, 0xff000000, "i;j;N|H;K;M", level }, \
57698b9484cSchristos   { namea "3_" nameb, opcode|0x01000000, 0xff000000, "j;K;N|H;i;M", level }, \
57798b9484cSchristos   { namea "3_" nameb, opcode|0x01000000, 0xff000000, "K;j;N|H;i;M", level }, \
57898b9484cSchristos   { namea "3_" nameb, opcode|0x02000000, 0xff000000, "H;K;N|i;j;M", level }, \
57998b9484cSchristos   { namea "3_" nameb, opcode|0x03000000, 0xff000000, "j;K;N|i;H;M", level }, \
58098b9484cSchristos   { namea "3_" nameb, opcode|0x03000000, 0xff000000, "K;j;N|i;H;M", level }, \
58198b9484cSchristos   { namea "_" nameb "3", opcode|0x00000000, 0xff000000, "i;j;N|H;K;M", level }, \
58298b9484cSchristos   { namea "_" nameb "3", opcode|0x01000000, 0xff000000, "j;K;N|H;i;M", level }, \
58398b9484cSchristos   { namea "_" nameb "3", opcode|0x01000000, 0xff000000, "K;j;N|H;i;M", level }, \
58498b9484cSchristos   { namea "_" nameb "3", opcode|0x02000000, 0xff000000, "H;K;N|i;j;M", level }, \
58598b9484cSchristos   { namea "_" nameb "3", opcode|0x03000000, 0xff000000, "j;K;N|i;H;M", level }, \
58698b9484cSchristos   { namea "_" nameb "3", opcode|0x03000000, 0xff000000, "K;j;N|i;H;M", level }, \
58798b9484cSchristos   { namea "3_" nameb "3", opcode|0x00000000, 0xff000000, "i;j;N|H;K;M", level }, \
58898b9484cSchristos   { namea "3_" nameb "3", opcode|0x01000000, 0xff000000, "j;K;N|H;i;M", level }, \
58998b9484cSchristos   { namea "3_" nameb "3", opcode|0x01000000, 0xff000000, "K;j;N|H;i;M", level }, \
59098b9484cSchristos   { namea "3_" nameb "3", opcode|0x02000000, 0xff000000, "H;K;N|i;j;M", level }, \
59198b9484cSchristos   { namea "3_" nameb "3", opcode|0x03000000, 0xff000000, "j;K;N|i;H;M", level }, \
59298b9484cSchristos   { namea "3_" nameb "3", opcode|0x03000000, 0xff000000, "K;j;N|i;H;M", level }, \
59398b9484cSchristos   { nameb "_" namea, opcode|0x00000000, 0xff000000, "H;K;M|i;j;N", level }, \
59498b9484cSchristos   { nameb "_" namea, opcode|0x01000000, 0xff000000, "H;i;M|j;K;N", level }, \
59598b9484cSchristos   { nameb "_" namea, opcode|0x01000000, 0xff000000, "H;i;M|K;j;N", level }, \
59698b9484cSchristos   { nameb "_" namea, opcode|0x02000000, 0xff000000, "i;j;M|H;K;N", level }, \
59798b9484cSchristos   { nameb "_" namea, opcode|0x03000000, 0xff000000, "i;H;M|j;K;N", level }, \
59898b9484cSchristos   { nameb "_" namea, opcode|0x03000000, 0xff000000, "i;H;M|K;j;N", level }, \
59998b9484cSchristos   { nameb "3_" namea, opcode|0x00000000, 0xff000000, "H;K;M|i;j;N", level }, \
60098b9484cSchristos   { nameb "3_" namea, opcode|0x01000000, 0xff000000, "H;i;M|j;K;N", level }, \
60198b9484cSchristos   { nameb "3_" namea, opcode|0x01000000, 0xff000000, "H;i;M|K;j;N", level }, \
60298b9484cSchristos   { nameb "3_" namea, opcode|0x02000000, 0xff000000, "i;j;M|H;K;N", level }, \
60398b9484cSchristos   { nameb "3_" namea, opcode|0x03000000, 0xff000000, "i;H;M|j;K;N", level }, \
60498b9484cSchristos   { nameb "3_" namea, opcode|0x03000000, 0xff000000, "i;H;M|K;j;N", level }, \
60598b9484cSchristos   { nameb "_" namea "3", opcode|0x00000000, 0xff000000, "H;K;M|i;j;N", level }, \
60698b9484cSchristos   { nameb "_" namea "3", opcode|0x01000000, 0xff000000, "H;i;M|j;K;N", level }, \
60798b9484cSchristos   { nameb "_" namea "3", opcode|0x01000000, 0xff000000, "H;i;M|K;j;N", level }, \
60898b9484cSchristos   { nameb "_" namea "3", opcode|0x02000000, 0xff000000, "i;j;M|H;K;N", level }, \
60998b9484cSchristos   { nameb "_" namea "3", opcode|0x03000000, 0xff000000, "i;H;M|j;K;N", level }, \
61098b9484cSchristos   { nameb "_" namea "3", opcode|0x03000000, 0xff000000, "i;H;M|K;j;N", level }, \
61198b9484cSchristos   { nameb "3_" namea "3", opcode|0x00000000, 0xff000000, "H;K;M|i;j;N", level }, \
61298b9484cSchristos   { nameb "3_" namea "3", opcode|0x01000000, 0xff000000, "H;i;M|j;K;N", level }, \
61398b9484cSchristos   { nameb "3_" namea "3", opcode|0x01000000, 0xff000000, "H;i;M|K;j;N", level }, \
61498b9484cSchristos   { nameb "3_" namea "3", opcode|0x02000000, 0xff000000, "i;j;M|H;K;N", level }, \
61598b9484cSchristos   { nameb "3_" namea "3", opcode|0x03000000, 0xff000000, "i;H;M|j;K;N", level }, \
61698b9484cSchristos   { nameb "3_" namea "3", opcode|0x03000000, 0xff000000, "i;H;M|K;j;N", level }
61798b9484cSchristos 
61898b9484cSchristos /* P: General 2-operand operation with parallell store
61998b9484cSchristos    Syntax: <ia> src2, dst1 || <ib> src3, dst2
62098b9484cSchristos        src2 = Indirect 0,1,IR0,IR1, ENH: register (i)
62198b9484cSchristos        dst1 = Register 0-7 (L)
62298b9484cSchristos        src3 = Register 0-7 (H)
62398b9484cSchristos        dst2 = Indirect 0,1,IR0,IR1 (J)
62498b9484cSchristos    Instr: 9/2 - ABSF||STF, ABSI||STI, FIX||STI, FLOAT||STF, LDF||STF,
62598b9484cSchristos                 LDI||STI, NEGF||STF, NEGI||STI, NOT||STI, C4x: FRIEEE||STF,
62698b9484cSchristos                 TOIEEE||STF
62798b9484cSchristos    Alias: a||b, b||a
62898b9484cSchristos */
62998b9484cSchristos #define P_CLASS_INSN(namea, nameb, opcode, level) \
63098b9484cSchristos   { namea "_" nameb, opcode, 0xfe000000, "i;L|H,J", level }, \
63198b9484cSchristos   { nameb "_" namea, opcode, 0xfe000000, "H,J|i;L", level }
63298b9484cSchristos 
63398b9484cSchristos /* Q: General 3-operand operation with parallell store
63498b9484cSchristos    Syntax: <ia> src1, src2, dst1 || <ib> src3, dst2
63598b9484cSchristos        src1 = Register 0-7 (K)
63698b9484cSchristos        src2 = Indirect 0,1,IR0,IR1, ENH: register (i)
63798b9484cSchristos        dst1 = Register 0-7 (L)
63898b9484cSchristos        src3 = Register 0-7 (H)
63998b9484cSchristos        dst2 = Indirect 0,1,IR0,IR1 (J)
64098b9484cSchristos    Instr: 4/0 - ASH3||STI, LSH3||STI, SUBF3||STF, SUBI3||STI
64198b9484cSchristos    Alias: a||b, b||a, a3||b, b||a3
64298b9484cSchristos */
64398b9484cSchristos #define Q_CLASS_INSN(namea, nameb, opcode, level) \
64498b9484cSchristos   { namea "_"  nameb    , opcode, 0xfe000000, "K,i;L|H,J", level }, \
64598b9484cSchristos   { nameb "_"  namea    , opcode, 0xfe000000, "H,J|K,i;L", level }, \
64698b9484cSchristos   { namea "3_" nameb    , opcode, 0xfe000000, "K,i;L|H,J", level }, \
64798b9484cSchristos   { nameb "_"  namea "3", opcode, 0xfe000000, "H,J|K,i;L", level }
64898b9484cSchristos 
64998b9484cSchristos /* QC: General commutative 3-operand operation with parallell store
65098b9484cSchristos    Syntax: <ia> src2, src1, dst1 || <ib> src3, dst2
65198b9484cSchristos            <ia> src1, src2, dst1 || <ib> src3, dst2 - Manual
65298b9484cSchristos        src1 = Register 0-7 (K)
65398b9484cSchristos        src2 = Indirect 0,1,IR0,IR1, ENH: register (i)
65498b9484cSchristos        dst1 = Register 0-7 (L)
65598b9484cSchristos        src3 = Register 0-7 (H)
65698b9484cSchristos        dst2 = Indirect 0,1,IR0,IR1 (J)
65798b9484cSchristos    Instr: 7/0 - ADDF3||STF, ADDI3||STI, AND3||STI, MPYF3||STF, MPYI3||STI,
65898b9484cSchristos                 OR3||STI, XOR3||STI
65998b9484cSchristos    Alias: a||b, b||a, a3||b, b||a3
66098b9484cSchristos */
66198b9484cSchristos #define QC_CLASS_INSN(namea, nameb, opcode, level) \
66298b9484cSchristos   { namea "_"  nameb    , opcode, 0xfe000000, "i;K;L|H,J", level }, \
66398b9484cSchristos   { namea "_"  nameb    , opcode, 0xfe000000, "K;i;L|H,J", level }, \
66498b9484cSchristos   { nameb "_"  namea    , opcode, 0xfe000000, "H,J|i;K;L", level }, \
66598b9484cSchristos   { nameb "_"  namea    , opcode, 0xfe000000, "H,J|K;i;L", level }, \
66698b9484cSchristos   { namea "3_" nameb    , opcode, 0xfe000000, "i;K;L|H,J", level }, \
66798b9484cSchristos   { namea "3_" nameb    , opcode, 0xfe000000, "K;i;L|H,J", level }, \
66898b9484cSchristos   { nameb "_"  namea "3", opcode, 0xfe000000, "H,J|i;K;L", level }, \
66998b9484cSchristos   { nameb "_"  namea "3", opcode, 0xfe000000, "H,J|K;i;L", level }
67098b9484cSchristos 
67198b9484cSchristos /* R: General register integer operation
67298b9484cSchristos    Syntax: <i> dst
67398b9484cSchristos        dst = Register (R)
67498b9484cSchristos    Instr: 6/0 - POP, PUSH, ROL, ROLC, ROR, RORC
67598b9484cSchristos */
67698b9484cSchristos #define R_CLASS_INSN(name, opcode, level) \
67798b9484cSchristos   { name, opcode, 0xffe0ffff, "R", level }
67898b9484cSchristos 
67998b9484cSchristos /* RF: General register float operation
68098b9484cSchristos    Syntax: <i> dst
68198b9484cSchristos        dst = Register 0-11 (r)
68298b9484cSchristos    Instr: 2/0 - POPF, PUSHF
68398b9484cSchristos */
68498b9484cSchristos #define RF_CLASS_INSN(name, opcode, level) \
68598b9484cSchristos   { name, opcode, 0xffe0ffff, "r", level }
68698b9484cSchristos 
68798b9484cSchristos /* S: General 3-operand float operation
68898b9484cSchristos    Syntax: <i> src2, src1, dst
68998b9484cSchristos        src2 = Register 0-11 (e), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C)
69098b9484cSchristos        src1 = Register 0-11 (g), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (O)
69198b9484cSchristos        dst  = Register 0-11 (r)
69298b9484cSchristos    Instr: 1/0 - SUBF3
69398b9484cSchristos    Alias: i, i3
69498b9484cSchristos */
69598b9484cSchristos #define S_CLASS_INSN(name, opcode, level) \
69698b9484cSchristos   { name, opcode|0x20000000, 0xffe00000, "e,g;r", level  }, \
69798b9484cSchristos   { name, opcode|0x20200000, 0xffe00000, "e,J,r", level  }, \
69898b9484cSchristos   { name, opcode|0x20400000, 0xffe00000, "I,g;r", level  }, \
69998b9484cSchristos   { name, opcode|0x20600000, 0xffe00000, "I,J,r", level  }, \
70098b9484cSchristos   { name, opcode|0x30200000, 0xffe00000, "C,g;r", OP_C4X }, \
70198b9484cSchristos   { name, opcode|0x30600000, 0xffe00000, "C,O,r", OP_C4X }, \
70298b9484cSchristos   { name "3", opcode|0x20000000, 0xffe00000, "e,g;r", level  }, \
70398b9484cSchristos   { name "3", opcode|0x20200000, 0xffe00000, "e,J,r", level  }, \
70498b9484cSchristos   { name "3", opcode|0x20400000, 0xffe00000, "I,g;r", level  }, \
70598b9484cSchristos   { name "3", opcode|0x20600000, 0xffe00000, "I,J,r", level  }, \
70698b9484cSchristos   { name "3", opcode|0x30200000, 0xffe00000, "C,g;r", OP_C4X }, \
70798b9484cSchristos   { name "3", opcode|0x30600000, 0xffe00000, "C,O,r", OP_C4X }
70898b9484cSchristos 
70998b9484cSchristos /* SC: General commutative 3-operand float operation
71098b9484cSchristos    Syntax: <i> src2, src1, dst - Manual
71198b9484cSchristos            <i> src1, src2, dst
71298b9484cSchristos        src2 = Register 0-11 (e), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C)
71398b9484cSchristos        src1 = Register 0-11 (g), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (O)
71498b9484cSchristos        dst  = Register 0-11 (r)
71598b9484cSchristos    Instr: 2/0 - ADDF3, MPYF3
71698b9484cSchristos    Alias: i, i3
71798b9484cSchristos */
71898b9484cSchristos #define SC_CLASS_INSN(name, opcode, level) \
71998b9484cSchristos   { name, opcode|0x20000000, 0xffe00000, "e,g;r", level  }, \
72098b9484cSchristos   { name, opcode|0x20200000, 0xffe00000, "e,J,r", level  }, \
72198b9484cSchristos   { name, opcode|0x20400000, 0xffe00000, "I,g;r", level  }, \
72298b9484cSchristos   { name, opcode|0x20600000, 0xffe00000, "I,J,r", level  }, \
72398b9484cSchristos   { name, opcode|0x30200000, 0xffe00000, "C,g;r", OP_C4X }, \
72498b9484cSchristos   { name, opcode|0x30200000, 0xffe00000, "g,C,r", OP_C4X }, \
72598b9484cSchristos   { name, opcode|0x30600000, 0xffe00000, "C,O,r", OP_C4X }, \
72698b9484cSchristos   { name "3", opcode|0x20000000, 0xffe00000, "e,g;r", level  }, \
72798b9484cSchristos   { name "3", opcode|0x20200000, 0xffe00000, "e,J,r", level  }, \
72898b9484cSchristos   { name "3", opcode|0x20400000, 0xffe00000, "I,g;r", level  }, \
72998b9484cSchristos   { name "3", opcode|0x20600000, 0xffe00000, "I,J,r", level  }, \
73098b9484cSchristos   { name "3", opcode|0x30200000, 0xffe00000, "g,C,r", OP_C4X }, \
73198b9484cSchristos   { name "3", opcode|0x30200000, 0xffe00000, "C,g;r", OP_C4X }, \
73298b9484cSchristos   { name "3", opcode|0x30600000, 0xffe00000, "C,O,r", OP_C4X }
73398b9484cSchristos 
73498b9484cSchristos /* S2: General 3-operand float operation with 2 args
73598b9484cSchristos    Syntax: <i> src2, src1
73698b9484cSchristos        src2 = Register 0-11 (e), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C)
73798b9484cSchristos        src1 = Register 0-11 (g), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (O)
73898b9484cSchristos    Instr: 1/0 - CMPF3
73998b9484cSchristos    Alias: i, i3
74098b9484cSchristos */
74198b9484cSchristos #define S2_CLASS_INSN(name, opcode, level) \
74298b9484cSchristos   { name, opcode|0x20000000, 0xffe00000, "e,g", level  }, \
74398b9484cSchristos   { name, opcode|0x20200000, 0xffe00000, "e,J", level  }, \
74498b9484cSchristos   { name, opcode|0x20400000, 0xffe00000, "I,g", level  }, \
74598b9484cSchristos   { name, opcode|0x20600000, 0xffe00000, "I,J", level  }, \
74698b9484cSchristos   { name, opcode|0x30200000, 0xffe00000, "C,g", OP_C4X }, \
74798b9484cSchristos   { name, opcode|0x30600000, 0xffe00000, "C,O", OP_C4X }, \
74898b9484cSchristos   { name "3", opcode|0x20000000, 0xffe00000, "e,g", level  }, \
74998b9484cSchristos   { name "3", opcode|0x20200000, 0xffe00000, "e,J", level  }, \
75098b9484cSchristos   { name "3", opcode|0x20400000, 0xffe00000, "I,g", level  }, \
75198b9484cSchristos   { name "3", opcode|0x20600000, 0xffe00000, "I,J", level  }, \
75298b9484cSchristos   { name "3", opcode|0x30200000, 0xffe00000, "C,g", OP_C4X }, \
75398b9484cSchristos   { name "3", opcode|0x30600000, 0xffe00000, "C,O", OP_C4X }
75498b9484cSchristos 
75598b9484cSchristos /* T: General 3-operand integer operand
75698b9484cSchristos    Syntax: <i> src2, src1, dst
75798b9484cSchristos        src2 = Register (E), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C), Immediate (W)
75898b9484cSchristos        src1 = Register (G), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (O)
75998b9484cSchristos        dst  = Register (R)
76098b9484cSchristos    Instr: 5/0 - ANDN3, ASH3, LSH3, SUBB3, SUBI3
76198b9484cSchristos    Alias: i, i3
76298b9484cSchristos */
76398b9484cSchristos #define T_CLASS_INSN(name, opcode, level) \
76498b9484cSchristos   { name, opcode|0x20000000, 0xffe00000, "E,G;R", level  }, \
76598b9484cSchristos   { name, opcode|0x20200000, 0xffe00000, "E,J,R", level  }, \
76698b9484cSchristos   { name, opcode|0x20400000, 0xffe00000, "I,G;R", level  }, \
76798b9484cSchristos   { name, opcode|0x20600000, 0xffe00000, "I,J,R", level  }, \
76898b9484cSchristos   { name, opcode|0x30000000, 0xffe00000, "W,G;R", OP_C4X }, \
76998b9484cSchristos   { name, opcode|0x30200000, 0xffe00000, "C,G;R", OP_C4X }, \
77098b9484cSchristos   { name, opcode|0x30400000, 0xffe00000, "W,O,R", OP_C4X }, \
77198b9484cSchristos   { name, opcode|0x30600000, 0xffe00000, "C,O,R", OP_C4X }, \
77298b9484cSchristos   { name "3", opcode|0x20000000, 0xffe00000, "E,G;R", level  }, \
77398b9484cSchristos   { name "3", opcode|0x20200000, 0xffe00000, "E,J,R", level  }, \
77498b9484cSchristos   { name "3", opcode|0x20400000, 0xffe00000, "I,G;R", level  }, \
77598b9484cSchristos   { name "3", opcode|0x20600000, 0xffe00000, "I,J,R", level  }, \
77698b9484cSchristos   { name "3", opcode|0x30000000, 0xffe00000, "W,G;R", OP_C4X }, \
77798b9484cSchristos   { name "3", opcode|0x30200000, 0xffe00000, "C,G;R", OP_C4X }, \
77898b9484cSchristos   { name "3", opcode|0x30400000, 0xffe00000, "W,O,R", OP_C4X }, \
77998b9484cSchristos   { name "3", opcode|0x30600000, 0xffe00000, "C,O,R", OP_C4X }
78098b9484cSchristos 
78198b9484cSchristos /* TC: General commutative 3-operand integer operation
78298b9484cSchristos    Syntax: <i> src2, src1, dst
78398b9484cSchristos            <i> src1, src2, dst
78498b9484cSchristos        src2 = Register (E), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C), Immediate (W)
78598b9484cSchristos        src1 = Register (G), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (O)
78698b9484cSchristos        dst  = Register (R)
78798b9484cSchristos    Instr: 6/2 - ADDC3, ADDI3, AND3, MPYI3, OR3, XOR3, C4x: MPYSHI, MPYUHI
78898b9484cSchristos    Alias: i, i3
78998b9484cSchristos */
79098b9484cSchristos #define TC_CLASS_INSN(name, opcode, level) \
79198b9484cSchristos   { name, opcode|0x20000000, 0xffe00000, "E,G;R", level  }, \
79298b9484cSchristos   { name, opcode|0x20200000, 0xffe00000, "E,J,R", level  }, \
79398b9484cSchristos   { name, opcode|0x20400000, 0xffe00000, "I,G;R", level  }, \
79498b9484cSchristos   { name, opcode|0x20600000, 0xffe00000, "I,J,R", level  }, \
79598b9484cSchristos   { name, opcode|0x30000000, 0xffe00000, "W,G;R", OP_C4X }, \
79698b9484cSchristos   { name, opcode|0x30000000, 0xffe00000, "G,W,R", OP_C4X }, \
79798b9484cSchristos   { name, opcode|0x30200000, 0xffe00000, "C,G;R", OP_C4X }, \
79898b9484cSchristos   { name, opcode|0x30200000, 0xffe00000, "G,C,R", OP_C4X }, \
79998b9484cSchristos   { name, opcode|0x30400000, 0xffe00000, "W,O,R", OP_C4X }, \
80098b9484cSchristos   { name, opcode|0x30400000, 0xffe00000, "O,W,R", OP_C4X }, \
80198b9484cSchristos   { name, opcode|0x30600000, 0xffe00000, "C,O,R", OP_C4X }, \
80298b9484cSchristos   { name "3", opcode|0x20000000, 0xffe00000, "E,G;R", level  }, \
80398b9484cSchristos   { name "3", opcode|0x20200000, 0xffe00000, "E,J,R", level  }, \
80498b9484cSchristos   { name "3", opcode|0x20400000, 0xffe00000, "I,G;R", level  }, \
80598b9484cSchristos   { name "3", opcode|0x20600000, 0xffe00000, "I,J,R", level  }, \
80698b9484cSchristos   { name "3", opcode|0x30000000, 0xffe00000, "W,G;R", OP_C4X }, \
80798b9484cSchristos   { name "3", opcode|0x30000000, 0xffe00000, "G,W,R", OP_C4X }, \
80898b9484cSchristos   { name "3", opcode|0x30200000, 0xffe00000, "C,G;R", OP_C4X }, \
80998b9484cSchristos   { name "3", opcode|0x30200000, 0xffe00000, "G,C,R", OP_C4X }, \
81098b9484cSchristos   { name "3", opcode|0x30400000, 0xffe00000, "W,O,R", OP_C4X }, \
81198b9484cSchristos   { name "3", opcode|0x30400000, 0xffe00000, "O,W,R", OP_C4X }, \
81298b9484cSchristos   { name "3", opcode|0x30600000, 0xffe00000, "C,O,R", OP_C4X }
81398b9484cSchristos 
81498b9484cSchristos /* T2: General 3-operand integer operation with 2 args
81598b9484cSchristos    Syntax: <i> src2, src1
81698b9484cSchristos        src2 = Register (E), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C), Immediate (W)
81798b9484cSchristos        src1 = Register (G), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (O)
81898b9484cSchristos    Instr: 1/0 - CMPI3
81998b9484cSchristos    Alias: i, i3
82098b9484cSchristos */
82198b9484cSchristos #define T2_CLASS_INSN(name, opcode, level) \
82298b9484cSchristos   { name, opcode|0x20000000, 0xffe00000, "E,G", level  }, \
82398b9484cSchristos   { name, opcode|0x20200000, 0xffe00000, "E,J", level  }, \
82498b9484cSchristos   { name, opcode|0x20400000, 0xffe00000, "I,G", level  }, \
82598b9484cSchristos   { name, opcode|0x20600000, 0xffe00000, "I,J", level  }, \
82698b9484cSchristos   { name, opcode|0x30000000, 0xffe00000, "W,G", OP_C4X }, \
82798b9484cSchristos   { name, opcode|0x30200000, 0xffe00000, "C,G", OP_C4X }, \
82898b9484cSchristos   { name, opcode|0x30400000, 0xffe00000, "W,O", OP_C4X }, \
82998b9484cSchristos   { name, opcode|0x30600000, 0xffe00000, "C,O", OP_C4X }, \
83098b9484cSchristos   { name "3", opcode|0x20000000, 0xffe00000, "E,G", level  }, \
83198b9484cSchristos   { name "3", opcode|0x20200000, 0xffe00000, "E,J", level  }, \
83298b9484cSchristos   { name "3", opcode|0x20400000, 0xffe00000, "I,G", level  }, \
83398b9484cSchristos   { name "3", opcode|0x20600000, 0xffe00000, "I,J", level  }, \
83498b9484cSchristos   { name "3", opcode|0x30000000, 0xffe00000, "W,G", OP_C4X }, \
83598b9484cSchristos   { name "3", opcode|0x30200000, 0xffe00000, "C,G", OP_C4X }, \
83698b9484cSchristos   { name "3", opcode|0x30400000, 0xffe00000, "W,O", OP_C4X }, \
83798b9484cSchristos   { name "3", opcode|0x30600000, 0xffe00000, "C,O", OP_C4X }
83898b9484cSchristos 
83998b9484cSchristos /* T2C: General commutative 3-operand integer operation with 2 args
84098b9484cSchristos    Syntax: <i> src2, src1 - Manual
84198b9484cSchristos            <i> src1, src2
84298b9484cSchristos        src2 = Register (E), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C), Immediate (W)
84398b9484cSchristos        src1 = Register (G), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (0)
84498b9484cSchristos    Instr: 1/0 - TSTB3
84598b9484cSchristos    Alias: i, i3
84698b9484cSchristos */
84798b9484cSchristos #define T2C_CLASS_INSN(name, opcode, level) \
84898b9484cSchristos   { name, opcode|0x20000000, 0xffe00000, "E,G", level  }, \
84998b9484cSchristos   { name, opcode|0x20200000, 0xffe00000, "E,J", level  }, \
85098b9484cSchristos   { name, opcode|0x20400000, 0xffe00000, "I,G", level  }, \
85198b9484cSchristos   { name, opcode|0x20600000, 0xffe00000, "I,J", level  }, \
85298b9484cSchristos   { name, opcode|0x30000000, 0xffe00000, "W,G", OP_C4X }, \
85398b9484cSchristos   { name, opcode|0x30000000, 0xffe00000, "G,W", OP_C4X }, \
85498b9484cSchristos   { name, opcode|0x30200000, 0xffe00000, "C,G", OP_C4X }, \
85598b9484cSchristos   { name, opcode|0x30200000, 0xffe00000, "G,C", OP_C4X }, \
85698b9484cSchristos   { name, opcode|0x30400000, 0xffe00000, "W,O", OP_C4X }, \
85798b9484cSchristos   { name, opcode|0x30400000, 0xffe00000, "O,W", OP_C4X }, \
85898b9484cSchristos   { name, opcode|0x30600000, 0xffe00000, "C,O", OP_C4X }, \
85998b9484cSchristos   { name "3", opcode|0x20000000, 0xffe00000, "E,G", level  }, \
86098b9484cSchristos   { name "3", opcode|0x20200000, 0xffe00000, "E,J", level  }, \
86198b9484cSchristos   { name "3", opcode|0x20400000, 0xffe00000, "I,G", level  }, \
86298b9484cSchristos   { name "3", opcode|0x20600000, 0xffe00000, "I,J", level  }, \
86398b9484cSchristos   { name "3", opcode|0x30000000, 0xffe00000, "W,G", OP_C4X }, \
86498b9484cSchristos   { name "3", opcode|0x30000000, 0xffe00000, "G,W", OP_C4X }, \
86598b9484cSchristos   { name "3", opcode|0x30200000, 0xffe00000, "C,G", OP_C4X }, \
86698b9484cSchristos   { name "3", opcode|0x30200000, 0xffe00000, "G,C", OP_C4X }, \
86798b9484cSchristos   { name "3", opcode|0x30400000, 0xffe00000, "W,O", OP_C4X }, \
86898b9484cSchristos   { name "3", opcode|0x30400000, 0xffe00000, "O,W", OP_C4X }, \
86998b9484cSchristos   { name "3", opcode|0x30600000, 0xffe00000, "C,O", OP_C4X }
87098b9484cSchristos 
87198b9484cSchristos /* Z: Misc operations with or without arguments
87298b9484cSchristos    Syntax: <i> <arg1>,...
87398b9484cSchristos    Instr: 16 - RETIc, RETSc, SIGI(c3X), SWI, IDLE, IDLE2, RETIcD,
87498b9484cSchristos                TRAPc, LATc, LDEP, LDEHI, LDEPE, LDPK, STIK, LDP, IACK
87598b9484cSchristos */
87698b9484cSchristos 
87798b9484cSchristos 
87898b9484cSchristos /* Define tic4x opcodes for assembler and disassembler.  */
87998b9484cSchristos static const tic4x_inst_t tic4x_insts[] =
88098b9484cSchristos {
88198b9484cSchristos   /* Put synonyms after the desired forms in table so that they get
88298b9484cSchristos      overwritten in the lookup table.  The disassembler will thus
88398b9484cSchristos      print the `proper' mnemonics.  Note that the disassembler
88498b9484cSchristos      only decodes the 11 MSBs, so instructions like ldp @0x500 will
88598b9484cSchristos      be printed as ldiu 5, dp.  Note that with parallel instructions,
88698b9484cSchristos      the second part is executed before the first part, unless
88798b9484cSchristos      the sti1||sti2 form is used.  We also allow sti2||sti1
88898b9484cSchristos      which is equivalent to the default sti||sti form.
88998b9484cSchristos   */
89098b9484cSchristos   B_CLASS_INSN(  "absf",          0x00000000, OP_C3X   ),
89198b9484cSchristos   P_CLASS_INSN(  "absf",  "stf",  0xc8000000, OP_C3X   ),
89298b9484cSchristos   A_CLASS_INSN(  "absi",          0x00800000, OP_C3X   ),
89398b9484cSchristos   P_CLASS_INSN(  "absi",  "sti",  0xca000000, OP_C3X   ),
89498b9484cSchristos   A_CLASS_INSN(  "addc",          0x01000000, OP_C3X   ),
89598b9484cSchristos   TC_CLASS_INSN( "addc",          0x00000000, OP_C3X   ),
89698b9484cSchristos   B_CLASS_INSN(  "addf",          0x01800000, OP_C3X   ),
89798b9484cSchristos   SC_CLASS_INSN( "addf",          0x00800000, OP_C3X   ),
89898b9484cSchristos   QC_CLASS_INSN( "addf",  "stf",  0xcc000000, OP_C3X   ),
89998b9484cSchristos   A_CLASS_INSN(  "addi",          0x02000000, OP_C3X   ),
90098b9484cSchristos   TC_CLASS_INSN( "addi",          0x01000000, OP_C3X   ),
90198b9484cSchristos   QC_CLASS_INSN( "addi",  "sti",  0xce000000, OP_C3X   ),
90298b9484cSchristos   AU_CLASS_INSN( "and",           0x02800000, OP_C3X   ),
90398b9484cSchristos   TC_CLASS_INSN( "and",           0x01800000, OP_C3X   ),
90498b9484cSchristos   QC_CLASS_INSN( "and",   "sti",  0xd0000000, OP_C3X   ),
90598b9484cSchristos   AU_CLASS_INSN( "andn",          0x03000000, OP_C3X   ),
90698b9484cSchristos   T_CLASS_INSN(  "andn",          0x02000000, OP_C3X   ),
90798b9484cSchristos   A_CLASS_INSN(  "ash",           0x03800000, OP_C3X   ),
90898b9484cSchristos   T_CLASS_INSN(  "ash",           0x02800000, OP_C3X   ),
90998b9484cSchristos   Q_CLASS_INSN(  "ash",   "sti",  0xd2000000, OP_C3X   ),
91098b9484cSchristos   J_CLASS_INSN(  "bB",    "b",    0x68000000, OP_C3X   ),
91198b9484cSchristos   J_CLASS_INSN(  "bBd",   "bd",   0x68200000, OP_C3X   ),
91298b9484cSchristos   J_CLASS_INSN(  "bBaf",  "baf",  0x68a00000, OP_C4X   ),
91398b9484cSchristos   J_CLASS_INSN(  "bBat",  "bat",  0x68600000, OP_C4X   ),
91498b9484cSchristos   { "br",     0x60000000, 0xff000000, "B"   , OP_C3X   },  /* I_CLASS */
91598b9484cSchristos   { "brd",    0x61000000, 0xff000000, "B"   , OP_C3X   },  /* I_CLASS */
91698b9484cSchristos   { "call",   0x62000000, 0xff000000, "B"   , OP_C3X   },  /* I_CLASS */
91798b9484cSchristos   { "callB",  0x70000000, 0xffe00000, "Q"   , OP_C3X   },  /* JS_CLASS */
91898b9484cSchristos   { "callB",  0x72000000, 0xffe00000, "P"   , OP_C3X   },  /* JS_CLASS */
91998b9484cSchristos   B_CLASS_INSN(  "cmpf",          0x04000000, OP_C3X   ),
92098b9484cSchristos   S2_CLASS_INSN( "cmpf",          0x03000000, OP_C3X   ),
92198b9484cSchristos   A_CLASS_INSN(  "cmpi",          0x04800000, OP_C3X   ),
92298b9484cSchristos   T2_CLASS_INSN( "cmpi",          0x03800000, OP_C3X   ),
92398b9484cSchristos   D_CLASS_INSN(  "dbB",   "db",   0x6c000000, OP_C3X   ),
92498b9484cSchristos   D_CLASS_INSN(  "dbBd",  "dbd",  0x6c200000, OP_C3X   ),
92598b9484cSchristos   AF_CLASS_INSN( "fix",           0x05000000, OP_C3X   ),
92698b9484cSchristos   P_CLASS_INSN(  "fix",   "sti",  0xd4000000, OP_C3X   ),
92798b9484cSchristos   BI_CLASS_INSN( "float",         0x05800000, OP_C3X   ),
92898b9484cSchristos   P_CLASS_INSN(  "float", "stf",  0xd6000000, OP_C3X   ),
92998b9484cSchristos   B6_CLASS_INSN( "frieee",        0x1c000000, OP_C4X   ),
93098b9484cSchristos   P_CLASS_INSN(  "frieee","stf",  0xf2000000, OP_C4X   ),
93198b9484cSchristos   { "iack",   0x1b200000, 0xffe00000, "@"   , OP_C3X   },  /* Z_CLASS */
93298b9484cSchristos   { "iack",   0x1b400000, 0xffe00000, "*"   , OP_C3X   },  /* Z_CLASS */
93398b9484cSchristos   { "idle",   0x06000000, 0xffffffff, ""    , OP_C3X   },  /* Z_CLASS */
93498b9484cSchristos   { "idlez",  0x06000000, 0xffffffff, ""    , OP_C3X   },  /* Z_CLASS */
93598b9484cSchristos   { "idle2",  0x06000001, 0xffffffff, ""    , OP_IDLE2 },  /* Z_CLASS */
93698b9484cSchristos   { "laj",    0x63000000, 0xff000000, "B"   , OP_C4X   },  /* I_CLASS */
93798b9484cSchristos   { "lajB",   0x70200000, 0xffe00000, "Q"   , OP_C4X   },  /* JS_CLASS */
93898b9484cSchristos   { "lajB",   0x72200000, 0xffe00000, "P"   , OP_C4X   },  /* JS_CLASS */
93998b9484cSchristos   { "latB",   0x74800000, 0xffe00000, "V"   , OP_C4X   },  /* Z_CLASS */
94098b9484cSchristos   A_CLASS_INSN(  "lb0",           0xb0000000, OP_C4X   ),
94198b9484cSchristos   A_CLASS_INSN(  "lb1",           0xb0800000, OP_C4X   ),
94298b9484cSchristos   A_CLASS_INSN(  "lb2",           0xb1000000, OP_C4X   ),
94398b9484cSchristos   A_CLASS_INSN(  "lb3",           0xb1800000, OP_C4X   ),
94498b9484cSchristos   AU_CLASS_INSN( "lbu0",          0xb2000000, OP_C4X   ),
94598b9484cSchristos   AU_CLASS_INSN( "lbu1",          0xb2800000, OP_C4X   ),
94698b9484cSchristos   AU_CLASS_INSN( "lbu2",          0xb3000000, OP_C4X   ),
94798b9484cSchristos   AU_CLASS_INSN( "lbu3",          0xb3800000, OP_C4X   ),
94898b9484cSchristos   AY_CLASS_INSN( "lda",           0x1e800000, OP_C4X   ),
94998b9484cSchristos   B_CLASS_INSN(  "lde",           0x06800000, OP_C3X   ),
95098b9484cSchristos   { "ldep",   0x76000000, 0xffe00000, "X,R" , OP_C4X   },  /* Z_CLASS */
95198b9484cSchristos   B_CLASS_INSN(  "ldf",           0x07000000, OP_C3X   ),
95298b9484cSchristos   LL_CLASS_INSN( "ldf",           0xc4000000, OP_C3X   ),
95398b9484cSchristos   P_CLASS_INSN(  "ldf",   "stf",  0xd8000000, OP_C3X   ),
95498b9484cSchristos   BB_CLASS_INSN( "ldfC",          0x00000000, OP_C3X   ),
95598b9484cSchristos   B6_CLASS_INSN( "ldfi",          0x07800000, OP_C3X   ),
95698b9484cSchristos   { "ldhi",   0x1fe00000, 0xffe00000, "U,R" , OP_C4X   },  /* Z_CLASS */
95798b9484cSchristos   { "ldhi",   0x1fe00000, 0xffe00000, "#,R" , OP_C4X   },  /* Z_CLASS */
95898b9484cSchristos   A_CLASS_INSN(  "ldi",           0x08000000, OP_C3X   ),
95998b9484cSchristos   LL_CLASS_INSN( "ldi",           0xc6000000, OP_C3X   ),
96098b9484cSchristos   P_CLASS_INSN(  "ldi",   "sti",  0xda000000, OP_C3X   ),
96198b9484cSchristos   AB_CLASS_INSN( "ldiC",          0x10000000, OP_C3X   ),
96298b9484cSchristos   A6_CLASS_INSN( "ldii",          0x08800000, OP_C3X   ),
96398b9484cSchristos   { "ldp",    0x50700000, 0xffff0000, "#"   , OP_C3X   },  /* Z_CLASS - synonym for ldiu #,dp */
96498b9484cSchristos   B_CLASS_INSN(  "ldm",           0x09000000, OP_C3X   ),
96598b9484cSchristos   { "ldpe",   0x76800000, 0xffe00000, "Q,Z" , OP_C4X   },  /* Z_CLASS */
96698b9484cSchristos   { "ldpk",   0x1F700000, 0xffff0000, "#"   , OP_C4X   },  /* Z_CLASS */
96798b9484cSchristos   A_CLASS_INSN(  "lh0",           0xba000000, OP_C4X   ),
96898b9484cSchristos   A_CLASS_INSN(  "lh1",           0xba800000, OP_C4X   ),
96998b9484cSchristos   AU_CLASS_INSN( "lhu0",          0xbb000000, OP_C4X   ),
97098b9484cSchristos   AU_CLASS_INSN( "lhu1",          0xbb800000, OP_C4X   ),
97198b9484cSchristos   { "lopower", 0x10800001,0xffffffff, ""    , OP_LPWR  },  /* Z_CLASS */
97298b9484cSchristos   A_CLASS_INSN(  "lsh",           0x09800000, OP_C3X   ),
97398b9484cSchristos   T_CLASS_INSN(  "lsh",           0x04000000, OP_C3X   ),
97498b9484cSchristos   Q_CLASS_INSN(  "lsh",   "sti",  0xdc000000, OP_C3X   ),
97598b9484cSchristos   A_CLASS_INSN(  "lwl0",          0xb4000000, OP_C4X   ),
97698b9484cSchristos   A_CLASS_INSN(  "lwl1",          0xb4800000, OP_C4X   ),
97798b9484cSchristos   A_CLASS_INSN(  "lwl2",          0xb5000000, OP_C4X   ),
97898b9484cSchristos   A_CLASS_INSN(  "lwl3",          0xb5800000, OP_C4X   ),
97998b9484cSchristos   A_CLASS_INSN(  "lwr0",          0xb6000000, OP_C4X   ),
98098b9484cSchristos   A_CLASS_INSN(  "lwr1",          0xb6800000, OP_C4X   ),
98198b9484cSchristos   A_CLASS_INSN(  "lwr2",          0xb7000000, OP_C4X   ),
98298b9484cSchristos   A_CLASS_INSN(  "lwr3",          0xb7800000, OP_C4X   ),
98398b9484cSchristos   { "maxspeed",0x10800000,0xffffffff, ""    , OP_LPWR  },  /* Z_CLASS */
98498b9484cSchristos   A_CLASS_INSN(  "mb0",           0xb8000000, OP_C4X   ),
98598b9484cSchristos   A_CLASS_INSN(  "mb1",           0xb8800000, OP_C4X   ),
98698b9484cSchristos   A_CLASS_INSN(  "mb2",           0xb9000000, OP_C4X   ),
98798b9484cSchristos   A_CLASS_INSN(  "mb3",           0xb9800000, OP_C4X   ),
98898b9484cSchristos   A_CLASS_INSN(  "mh0",           0xbc000000, OP_C4X   ),
98998b9484cSchristos   A_CLASS_INSN(  "mh1",           0xbc800000, OP_C4X   ),
99098b9484cSchristos   A_CLASS_INSN(  "mh2",           0xbd000000, OP_C4X   ),
99198b9484cSchristos   A_CLASS_INSN(  "mh3",           0xbd800000, OP_C4X   ),
99298b9484cSchristos   B_CLASS_INSN(  "mpyf",          0x0a000000, OP_C3X   ),
99398b9484cSchristos   SC_CLASS_INSN( "mpyf",          0x04800000, OP_C3X   ),
99498b9484cSchristos   M_CLASS_INSN(  "mpyf",  "addf", 0x80000000, OP_C3X   ),
99598b9484cSchristos   QC_CLASS_INSN( "mpyf",  "stf",  0xde000000, OP_C3X   ),
99698b9484cSchristos   M_CLASS_INSN(  "mpyf",  "subf", 0x84000000, OP_C3X   ),
99798b9484cSchristos   A_CLASS_INSN(  "mpyi",          0x0a800000, OP_C3X   ),
99898b9484cSchristos   TC_CLASS_INSN( "mpyi",          0x05000000, OP_C3X   ),
99998b9484cSchristos   M_CLASS_INSN(  "mpyi",  "addi", 0x88000000, OP_C3X   ),
100098b9484cSchristos   QC_CLASS_INSN( "mpyi",  "sti",  0xe0000000, OP_C3X   ),
100198b9484cSchristos   M_CLASS_INSN(  "mpyi",  "subi", 0x8c000000, OP_C3X   ),
100298b9484cSchristos   A_CLASS_INSN(  "mpyshi",        0x1d800000, OP_C4X   ),
100398b9484cSchristos   TC_CLASS_INSN( "mpyshi",        0x28800000, OP_C4X   ),
100498b9484cSchristos   A_CLASS_INSN(  "mpyuhi",        0x1e000000, OP_C4X   ),
100598b9484cSchristos   TC_CLASS_INSN( "mpyuhi",        0x29000000, OP_C4X   ),
100698b9484cSchristos   A_CLASS_INSN(  "negb",          0x0b000000, OP_C3X   ),
100798b9484cSchristos   B_CLASS_INSN(  "negf",          0x0b800000, OP_C3X   ),
100898b9484cSchristos   P_CLASS_INSN(  "negf",  "stf",  0xe2000000, OP_C3X   ),
100998b9484cSchristos   A_CLASS_INSN(  "negi",          0x0c000000, OP_C3X   ),
101098b9484cSchristos   P_CLASS_INSN(  "negi",  "sti",  0xe4000000, OP_C3X   ),
101198b9484cSchristos   A2_CLASS_INSN( "nop",           0x0c800000, OP_C3X   ),
101298b9484cSchristos   B_CLASS_INSN(  "norm",          0x0d000000, OP_C3X   ),
101398b9484cSchristos   AU_CLASS_INSN( "not",           0x0d800000, OP_C3X   ),
101498b9484cSchristos   P_CLASS_INSN(  "not",   "sti",  0xe6000000, OP_C3X   ),
101598b9484cSchristos   AU_CLASS_INSN( "or",            0x10000000, OP_C3X   ),
101698b9484cSchristos   TC_CLASS_INSN( "or",            0x05800000, OP_C3X   ),
101798b9484cSchristos   QC_CLASS_INSN( "or",    "sti",  0xe8000000, OP_C3X   ),
101898b9484cSchristos   R_CLASS_INSN(  "pop",           0x0e200000, OP_C3X   ),
101998b9484cSchristos   RF_CLASS_INSN( "popf",          0x0ea00000, OP_C3X   ),
102098b9484cSchristos   R_CLASS_INSN(  "push",          0x0f200000, OP_C3X   ),
102198b9484cSchristos   RF_CLASS_INSN( "pushf",         0x0fa00000, OP_C3X   ),
102298b9484cSchristos   BA_CLASS_INSN( "rcpf",          0x1d000000, OP_C4X   ),
102398b9484cSchristos   { "retiB",  0x78000000, 0xffe00000, ""    , OP_C3X   },  /* Z_CLASS */
102498b9484cSchristos   { "reti",   0x78000000, 0xffe00000, ""    , OP_C3X   },  /* Z_CLASS  - Alias for retiu */
102598b9484cSchristos   { "retiBd", 0x78200000, 0xffe00000, ""    , OP_C4X   },  /* Z_CLASS */
102698b9484cSchristos   { "retid",  0x78200000, 0xffe00000, ""    , OP_C4X   },  /* Z_CLASS - Alias for retiud */
102798b9484cSchristos   { "retsB",  0x78800000, 0xffe00000, ""    , OP_C3X   },  /* Z_CLASS */
102898b9484cSchristos   { "rets",   0x78800000, 0xffe00000, ""    , OP_C3X   },  /* Z_CLASS  - Alias for retsu */
102998b9484cSchristos   B_CLASS_INSN(  "rnd",           0x11000000, OP_C3X   ),
103098b9484cSchristos   R_CLASS_INSN(  "rol",           0x11e00001, OP_C3X   ),
103198b9484cSchristos   R_CLASS_INSN(  "rolc",          0x12600001, OP_C3X   ),
103298b9484cSchristos   R_CLASS_INSN(  "ror",           0x12e0ffff, OP_C3X   ),
103398b9484cSchristos   R_CLASS_INSN(  "rorc",          0x1360ffff, OP_C3X   ),
103498b9484cSchristos   { "rptb",   0x64000000, 0xff000000, "B"   , OP_C3X   },  /* I2_CLASS */
103598b9484cSchristos   { "rptb",   0x79000000, 0xff000000, "Q"   , OP_C4X   },  /* I2_CLASS */
103698b9484cSchristos   { "rptbd",  0x65000000, 0xff000000, "B"   , OP_C4X   },  /* I2_CLASS */
103798b9484cSchristos   { "rptbd",  0x79800000, 0xff000000, "Q"   , OP_C4X   },  /* I2_CLASS */
103898b9484cSchristos   A3_CLASS_INSN( "rpts",          0x139b0000, OP_C3X   ),
103998b9484cSchristos   B_CLASS_INSN(  "rsqrf",         0x1c800000, OP_C4X   ),
104098b9484cSchristos   { "sigi",   0x16000000, 0xffe00000, ""    , OP_C3X   },  /* Z_CLASS */
104198b9484cSchristos   A6_CLASS_INSN( "sigi",          0x16000000, OP_C4X   ),
104298b9484cSchristos   B7_CLASS_INSN( "stf",           0x14000000, OP_C3X   ),
104398b9484cSchristos   LS_CLASS_INSN( "stf",           0xc0000000, OP_C3X   ),
104498b9484cSchristos   B7_CLASS_INSN( "stfi",          0x14800000, OP_C3X   ),
104598b9484cSchristos   A7_CLASS_INSN( "sti",           0x15000000, OP_C3X   ),
104698b9484cSchristos   { "sti",    0x15000000, 0xffe00000, "T,@" , OP_C4X   },  /* Class A7 - Alias for stik */
104798b9484cSchristos   { "sti",    0x15600000, 0xffe00000, "T,*" , OP_C4X   },  /* Class A7 */
104898b9484cSchristos   LS_CLASS_INSN( "sti",           0xc2000000, OP_C3X   ),
104998b9484cSchristos   A7_CLASS_INSN( "stii",          0x15800000, OP_C3X   ),
105098b9484cSchristos   { "stik",   0x15000000, 0xffe00000, "T,@" , OP_C4X   },  /* Z_CLASS */
105198b9484cSchristos   { "stik",   0x15600000, 0xffe00000, "T,*" , OP_C4X   },  /* Z_CLASS */
105298b9484cSchristos   A_CLASS_INSN(  "subb",          0x16800000, OP_C3X   ),
105398b9484cSchristos   T_CLASS_INSN(  "subb",          0x06000000, OP_C3X   ),
105498b9484cSchristos   A_CLASS_INSN(  "subc",          0x17000000, OP_C3X   ),
105598b9484cSchristos   B_CLASS_INSN(  "subf",          0x17800000, OP_C3X   ),
105698b9484cSchristos   S_CLASS_INSN(  "subf",          0x06800000, OP_C3X   ),
105798b9484cSchristos   Q_CLASS_INSN(  "subf",  "stf",  0xea000000, OP_C3X   ),
105898b9484cSchristos   A_CLASS_INSN(  "subi",          0x18000000, OP_C3X   ),
105998b9484cSchristos   T_CLASS_INSN(  "subi",          0x07000000, OP_C3X   ),
106098b9484cSchristos   Q_CLASS_INSN(  "subi",  "sti",  0xec000000, OP_C3X   ),
106198b9484cSchristos   A_CLASS_INSN(  "subrb",         0x18800000, OP_C3X   ),
106298b9484cSchristos   B_CLASS_INSN(  "subrf",         0x19000000, OP_C3X   ),
106398b9484cSchristos   A_CLASS_INSN(  "subri",         0x19800000, OP_C3X   ),
106498b9484cSchristos   { "swi",    0x66000000, 0xffffffff, ""    , OP_C3X   },  /* Z_CLASS */
106598b9484cSchristos   B_CLASS_INSN(  "toieee",        0x1b800000, OP_C4X   ),
106698b9484cSchristos   P_CLASS_INSN(  "toieee","stf",  0xf0000000, OP_C4X   ),
106798b9484cSchristos   { "trapB",  0x74000000, 0xffe00000, "V"   , OP_C3X   },  /* Z_CLASS */
106898b9484cSchristos   { "trap",   0x74000000, 0xffe00000, "V"   , OP_C3X   },  /* Z_CLASS - Alias for trapu */
106998b9484cSchristos   AU_CLASS_INSN( "tstb",          0x1a000000, OP_C3X   ),
107098b9484cSchristos   T2C_CLASS_INSN("tstb",          0x07800000, OP_C3X   ),
107198b9484cSchristos   AU_CLASS_INSN( "xor",           0x1a800000, OP_C3X   ),
107298b9484cSchristos   TC_CLASS_INSN( "xor",           0x08000000, OP_C3X   ),
107398b9484cSchristos   QC_CLASS_INSN( "xor",   "sti",  0xee000000, OP_C3X   ),
107498b9484cSchristos 
107598b9484cSchristos   /* Dummy entry, not included in tic4x_num_insts.  This
107698b9484cSchristos      lets code examine entry i + 1 without checking
107798b9484cSchristos      if we've run off the end of the table.  */
107898b9484cSchristos   { "",      0x0, 0x00, "", 0 }
107998b9484cSchristos };
108098b9484cSchristos 
108198b9484cSchristos const unsigned int tic4x_num_insts = (((sizeof tic4x_insts) / (sizeof tic4x_insts[0])) - 1);
1082