1*3d8817e4Smiod /* Table of opcodes for the Texas Instruments TMS320C[34]X family. 2*3d8817e4Smiod 3*3d8817e4Smiod Copyright (C) 2002, 2003 Free Software Foundation. 4*3d8817e4Smiod 5*3d8817e4Smiod Contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz) 6*3d8817e4Smiod 7*3d8817e4Smiod This program is free software; you can redistribute it and/or modify 8*3d8817e4Smiod it under the terms of the GNU General Public License as published by 9*3d8817e4Smiod the Free Software Foundation; either version 2 of the License, or 10*3d8817e4Smiod (at your option) any later version. 11*3d8817e4Smiod 12*3d8817e4Smiod This program is distributed in the hope that it will be useful, 13*3d8817e4Smiod but WITHOUT ANY WARRANTY; without even the implied warranty of 14*3d8817e4Smiod MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15*3d8817e4Smiod GNU General Public License for more details. 16*3d8817e4Smiod 17*3d8817e4Smiod You should have received a copy of the GNU General Public License 18*3d8817e4Smiod along with this program; if not, write to the Free Software 19*3d8817e4Smiod Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 20*3d8817e4Smiod */ 21*3d8817e4Smiod 22*3d8817e4Smiod #define IS_CPU_TIC3X(v) ((v) == 30 || (v) == 31 || (v) == 32 || (v) == 33) 23*3d8817e4Smiod #define IS_CPU_TIC4X(v) ((v) == 0 || (v) == 40 || (v) == 44) 24*3d8817e4Smiod 25*3d8817e4Smiod /* Define some bitfield extraction/insertion macros. */ 26*3d8817e4Smiod #define EXTR(inst, m, l) ((inst) << (31 - (m)) >> (31 - ((m) - (l)))) 27*3d8817e4Smiod #define EXTRU(inst, m, l) EXTR ((unsigned long)(inst), (m), (l)) 28*3d8817e4Smiod #define EXTRS(inst, m, l) EXTR ((long)(inst), (m), (l)) 29*3d8817e4Smiod #define INSERTU(inst, val, m, l) (inst |= ((val) << (l))) 30*3d8817e4Smiod #define INSERTS(inst, val, m, l) INSERTU (inst, ((val) & ((1 << ((m) - (l) + 1)) - 1)), m, l) 31*3d8817e4Smiod 32*3d8817e4Smiod /* Define register numbers. */ 33*3d8817e4Smiod typedef enum 34*3d8817e4Smiod { 35*3d8817e4Smiod REG_R0, REG_R1, REG_R2, REG_R3, 36*3d8817e4Smiod REG_R4, REG_R5, REG_R6, REG_R7, 37*3d8817e4Smiod REG_AR0, REG_AR1, REG_AR2, REG_AR3, 38*3d8817e4Smiod REG_AR4, REG_AR5, REG_AR6, REG_AR7, 39*3d8817e4Smiod REG_DP, REG_IR0, REG_IR1, REG_BK, 40*3d8817e4Smiod REG_SP, REG_ST, REG_DIE, REG_IIE, 41*3d8817e4Smiod REG_IIF, REG_RS, REG_RE, REG_RC, 42*3d8817e4Smiod REG_R8, REG_R9, REG_R10, REG_R11, 43*3d8817e4Smiod REG_IVTP, REG_TVTP 44*3d8817e4Smiod } 45*3d8817e4Smiod c4x_reg_t; 46*3d8817e4Smiod 47*3d8817e4Smiod /* Note that the actual register numbers for IVTP is 0 and TVTP is 1. */ 48*3d8817e4Smiod 49*3d8817e4Smiod #define REG_IE REG_DIE /* C3x only */ 50*3d8817e4Smiod #define REG_IF REG_IIE /* C3x only */ 51*3d8817e4Smiod #define REG_IOF REG_IIF /* C3x only */ 52*3d8817e4Smiod 53*3d8817e4Smiod #define TIC3X_REG_MAX REG_RC 54*3d8817e4Smiod #define TIC4X_REG_MAX REG_TVTP 55*3d8817e4Smiod 56*3d8817e4Smiod /* Register table size including C4x expansion regs. */ 57*3d8817e4Smiod #define REG_TABLE_SIZE (TIC4X_REG_MAX + 1) 58*3d8817e4Smiod 59*3d8817e4Smiod struct tic4x_register 60*3d8817e4Smiod { 61*3d8817e4Smiod char * name; 62*3d8817e4Smiod unsigned long regno; 63*3d8817e4Smiod }; 64*3d8817e4Smiod 65*3d8817e4Smiod typedef struct tic4x_register tic4x_register_t; 66*3d8817e4Smiod 67*3d8817e4Smiod /* We could store register synonyms here. */ 68*3d8817e4Smiod static const tic4x_register_t tic3x_registers[] = 69*3d8817e4Smiod { 70*3d8817e4Smiod {"f0", REG_R0}, 71*3d8817e4Smiod {"r0", REG_R0}, 72*3d8817e4Smiod {"f1", REG_R1}, 73*3d8817e4Smiod {"r1", REG_R1}, 74*3d8817e4Smiod {"f2", REG_R2}, 75*3d8817e4Smiod {"r2", REG_R2}, 76*3d8817e4Smiod {"f3", REG_R3}, 77*3d8817e4Smiod {"r3", REG_R3}, 78*3d8817e4Smiod {"f4", REG_R4}, 79*3d8817e4Smiod {"r4", REG_R4}, 80*3d8817e4Smiod {"f5", REG_R5}, 81*3d8817e4Smiod {"r5", REG_R5}, 82*3d8817e4Smiod {"f6", REG_R6}, 83*3d8817e4Smiod {"r6", REG_R6}, 84*3d8817e4Smiod {"f7", REG_R7}, 85*3d8817e4Smiod {"r7", REG_R7}, 86*3d8817e4Smiod {"ar0", REG_AR0}, 87*3d8817e4Smiod {"ar1", REG_AR1}, 88*3d8817e4Smiod {"ar2", REG_AR2}, 89*3d8817e4Smiod {"ar3", REG_AR3}, 90*3d8817e4Smiod {"ar4", REG_AR4}, 91*3d8817e4Smiod {"ar5", REG_AR5}, 92*3d8817e4Smiod {"ar6", REG_AR6}, 93*3d8817e4Smiod {"ar7", REG_AR7}, 94*3d8817e4Smiod {"dp", REG_DP}, 95*3d8817e4Smiod {"ir0", REG_IR0}, 96*3d8817e4Smiod {"ir1", REG_IR1}, 97*3d8817e4Smiod {"bk", REG_BK}, 98*3d8817e4Smiod {"sp", REG_SP}, 99*3d8817e4Smiod {"st", REG_ST}, 100*3d8817e4Smiod {"ie", REG_IE}, 101*3d8817e4Smiod {"if", REG_IF}, 102*3d8817e4Smiod {"iof", REG_IOF}, 103*3d8817e4Smiod {"rs", REG_RS}, 104*3d8817e4Smiod {"re", REG_RE}, 105*3d8817e4Smiod {"rc", REG_RC}, 106*3d8817e4Smiod {"", 0} 107*3d8817e4Smiod }; 108*3d8817e4Smiod 109*3d8817e4Smiod const unsigned int tic3x_num_registers = (((sizeof tic3x_registers) / (sizeof tic3x_registers[0])) - 1); 110*3d8817e4Smiod 111*3d8817e4Smiod /* Define C4x registers in addition to C3x registers. */ 112*3d8817e4Smiod static const tic4x_register_t tic4x_registers[] = 113*3d8817e4Smiod { 114*3d8817e4Smiod {"die", REG_DIE}, /* Clobbers C3x REG_IE */ 115*3d8817e4Smiod {"iie", REG_IIE}, /* Clobbers C3x REG_IF */ 116*3d8817e4Smiod {"iif", REG_IIF}, /* Clobbers C3x REG_IOF */ 117*3d8817e4Smiod {"f8", REG_R8}, 118*3d8817e4Smiod {"r8", REG_R8}, 119*3d8817e4Smiod {"f9", REG_R9}, 120*3d8817e4Smiod {"r9", REG_R9}, 121*3d8817e4Smiod {"f10", REG_R10}, 122*3d8817e4Smiod {"r10", REG_R10}, 123*3d8817e4Smiod {"f11", REG_R11}, 124*3d8817e4Smiod {"r11", REG_R11}, 125*3d8817e4Smiod {"ivtp", REG_IVTP}, 126*3d8817e4Smiod {"tvtp", REG_TVTP}, 127*3d8817e4Smiod {"", 0} 128*3d8817e4Smiod }; 129*3d8817e4Smiod 130*3d8817e4Smiod const unsigned int tic4x_num_registers = (((sizeof tic4x_registers) / (sizeof tic4x_registers[0])) - 1); 131*3d8817e4Smiod 132*3d8817e4Smiod struct tic4x_cond 133*3d8817e4Smiod { 134*3d8817e4Smiod char * name; 135*3d8817e4Smiod unsigned long cond; 136*3d8817e4Smiod }; 137*3d8817e4Smiod 138*3d8817e4Smiod typedef struct tic4x_cond tic4x_cond_t; 139*3d8817e4Smiod 140*3d8817e4Smiod /* Define conditional branch/load suffixes. Put desired form for 141*3d8817e4Smiod disassembler last. */ 142*3d8817e4Smiod static const tic4x_cond_t tic4x_conds[] = 143*3d8817e4Smiod { 144*3d8817e4Smiod { "u", 0x00 }, 145*3d8817e4Smiod { "c", 0x01 }, { "lo", 0x01 }, 146*3d8817e4Smiod { "ls", 0x02 }, 147*3d8817e4Smiod { "hi", 0x03 }, 148*3d8817e4Smiod { "nc", 0x04 }, { "hs", 0x04 }, 149*3d8817e4Smiod { "z", 0x05 }, { "eq", 0x05 }, 150*3d8817e4Smiod { "nz", 0x06 }, { "ne", 0x06 }, 151*3d8817e4Smiod { "n", 0x07 }, { "l", 0x07 }, { "lt", 0x07 }, 152*3d8817e4Smiod { "le", 0x08 }, 153*3d8817e4Smiod { "p", 0x09 }, { "gt", 0x09 }, 154*3d8817e4Smiod { "nn", 0x0a }, { "ge", 0x0a }, 155*3d8817e4Smiod { "nv", 0x0c }, 156*3d8817e4Smiod { "v", 0x0d }, 157*3d8817e4Smiod { "nuf", 0x0e }, 158*3d8817e4Smiod { "uf", 0x0f }, 159*3d8817e4Smiod { "nlv", 0x10 }, 160*3d8817e4Smiod { "lv", 0x11 }, 161*3d8817e4Smiod { "nluf", 0x12 }, 162*3d8817e4Smiod { "luf", 0x13 }, 163*3d8817e4Smiod { "zuf", 0x14 }, 164*3d8817e4Smiod /* Dummy entry, not included in num_conds. This 165*3d8817e4Smiod lets code examine entry i+1 without checking 166*3d8817e4Smiod if we've run off the end of the table. */ 167*3d8817e4Smiod { "", 0x0} 168*3d8817e4Smiod }; 169*3d8817e4Smiod 170*3d8817e4Smiod const unsigned int tic4x_num_conds = (((sizeof tic4x_conds) / (sizeof tic4x_conds[0])) - 1); 171*3d8817e4Smiod 172*3d8817e4Smiod struct tic4x_indirect 173*3d8817e4Smiod { 174*3d8817e4Smiod char * name; 175*3d8817e4Smiod unsigned long modn; 176*3d8817e4Smiod }; 177*3d8817e4Smiod 178*3d8817e4Smiod typedef struct tic4x_indirect tic4x_indirect_t; 179*3d8817e4Smiod 180*3d8817e4Smiod /* Define indirect addressing modes where: 181*3d8817e4Smiod d displacement (signed) 182*3d8817e4Smiod y ir0 183*3d8817e4Smiod z ir1 */ 184*3d8817e4Smiod 185*3d8817e4Smiod static const tic4x_indirect_t tic4x_indirects[] = 186*3d8817e4Smiod { 187*3d8817e4Smiod { "*+a(d)", 0x00 }, 188*3d8817e4Smiod { "*-a(d)", 0x01 }, 189*3d8817e4Smiod { "*++a(d)", 0x02 }, 190*3d8817e4Smiod { "*--a(d)", 0x03 }, 191*3d8817e4Smiod { "*a++(d)", 0x04 }, 192*3d8817e4Smiod { "*a--(d)", 0x05 }, 193*3d8817e4Smiod { "*a++(d)%", 0x06 }, 194*3d8817e4Smiod { "*a--(d)%", 0x07 }, 195*3d8817e4Smiod { "*+a(y)", 0x08 }, 196*3d8817e4Smiod { "*-a(y)", 0x09 }, 197*3d8817e4Smiod { "*++a(y)", 0x0a }, 198*3d8817e4Smiod { "*--a(y)", 0x0b }, 199*3d8817e4Smiod { "*a++(y)", 0x0c }, 200*3d8817e4Smiod { "*a--(y)", 0x0d }, 201*3d8817e4Smiod { "*a++(y)%", 0x0e }, 202*3d8817e4Smiod { "*a--(y)%", 0x0f }, 203*3d8817e4Smiod { "*+a(z)", 0x10 }, 204*3d8817e4Smiod { "*-a(z)", 0x11 }, 205*3d8817e4Smiod { "*++a(z)", 0x12 }, 206*3d8817e4Smiod { "*--a(z)", 0x13 }, 207*3d8817e4Smiod { "*a++(z)", 0x14 }, 208*3d8817e4Smiod { "*a--(z)", 0x15 }, 209*3d8817e4Smiod { "*a++(z)%", 0x16 }, 210*3d8817e4Smiod { "*a--(z)%", 0x17 }, 211*3d8817e4Smiod { "*a", 0x18 }, 212*3d8817e4Smiod { "*a++(y)b", 0x19 }, 213*3d8817e4Smiod /* Dummy entry, not included in num_indirects. This 214*3d8817e4Smiod lets code examine entry i+1 without checking 215*3d8817e4Smiod if we've run off the end of the table. */ 216*3d8817e4Smiod { "", 0x0} 217*3d8817e4Smiod }; 218*3d8817e4Smiod 219*3d8817e4Smiod #define TIC3X_MODN_MAX 0x19 220*3d8817e4Smiod 221*3d8817e4Smiod const unsigned int tic4x_num_indirects = (((sizeof tic4x_indirects) / (sizeof tic4x_indirects[0])) - 1); 222*3d8817e4Smiod 223*3d8817e4Smiod /* Instruction template. */ 224*3d8817e4Smiod struct tic4x_inst 225*3d8817e4Smiod { 226*3d8817e4Smiod char * name; 227*3d8817e4Smiod unsigned long opcode; 228*3d8817e4Smiod unsigned long opmask; 229*3d8817e4Smiod char * args; 230*3d8817e4Smiod unsigned long oplevel; 231*3d8817e4Smiod }; 232*3d8817e4Smiod 233*3d8817e4Smiod typedef struct tic4x_inst tic4x_inst_t; 234*3d8817e4Smiod 235*3d8817e4Smiod /* Opcode infix 236*3d8817e4Smiod B condition 16--20 U,C,Z,LO,HI, etc. 237*3d8817e4Smiod C condition 23--27 U,C,Z,LO,HI, etc. 238*3d8817e4Smiod 239*3d8817e4Smiod Arguments 240*3d8817e4Smiod , required arg follows 241*3d8817e4Smiod ; optional arg follows 242*3d8817e4Smiod 243*3d8817e4Smiod Argument types bits [classes] - example 244*3d8817e4Smiod ----------------------------------------------------------- 245*3d8817e4Smiod * indirect (all) 0--15 [A,AB,AU,AF,A2,A3,A6,A7,AY,B,BA,BB,BI,B6,B7] - *+AR0(5), *++AR0(IR0) 246*3d8817e4Smiod # direct (for LDP) 0--15 [Z] - @start, start 247*3d8817e4Smiod @ direct 0--15 [A,AB,AU,AF,A3,A6,A7,AY,B,BA,BB,BI,B6,B7] - @start, start 248*3d8817e4Smiod A address register 22--24 [D] - AR0, AR7 249*3d8817e4Smiod B unsigned integer 0--23 [I,I2] - @start, start (absolute on C3x, relative on C4x) 250*3d8817e4Smiod C indirect (disp - C4x) 0--7 [S,SC,S2,T,TC,T2,T2C] - *+AR0(5) 251*3d8817e4Smiod E register (all) 0--7 [T,TC,T2,T2C] - R0, R7, R11, AR0, DP 252*3d8817e4Smiod e register (0-11) 0--7 [S,SC,S2] - R0, R7, R11 253*3d8817e4Smiod F short float immediate 0--15 [AF,B,BA,BB] - 3.5, 0e-3.5e-1 254*3d8817e4Smiod G register (all) 8--15 [T,TC,T2,T2C] - R0, R7, R11, AR0, DP 255*3d8817e4Smiod g register (0-11) 0--7 [S,SC,S2] - R0, R7, R11 256*3d8817e4Smiod H register (0-7) 18--16 [LS,M,P,Q] - R0, R7 257*3d8817e4Smiod I indirect (no disp) 0--7 [S,SC,S2,T,TC,T2,T2C] - *+AR0(1), *+AR0(IR0) 258*3d8817e4Smiod i indirect (enhanced) 0--7 [LL,LS,M,P,Q,QC] - *+AR0(1), R5 259*3d8817e4Smiod J indirect (no disp) 8--15 [LL,LS,P,Q,QC,S,SC,S2,T,TC,T2,T2C] - *+AR0(1), *+AR0(IR0) 260*3d8817e4Smiod j indirect (enhanced) 8--15 [M] - *+AR0(1), R5 261*3d8817e4Smiod K register 19--21 [LL,M,Q,QC] - R0, R7 262*3d8817e4Smiod L register 22--24 [LL,LS,P,Q,QC] - R0, R7 263*3d8817e4Smiod M register (R2,R3) 22--22 [M] R2, R3 264*3d8817e4Smiod N register (R0,R1) 23--23 [M] R0, R1 265*3d8817e4Smiod O indirect(disp - C4x) 8--15 [S,SC,S2,T,TC,T2] - *+AR0(5) 266*3d8817e4Smiod P displacement (PC Rel) 0--15 [D,J,JS] - @start, start 267*3d8817e4Smiod Q register (all) 0--15 [A,AB,AU,A2,A3,AY,BA,BI,D,I2,J,JS] - R0, AR0, DP, SP 268*3d8817e4Smiod q register (0-11) 0--15 [AF,B,BB] - R0, R7, R11 269*3d8817e4Smiod R register (all) 16--20 [A,AB,AU,AF,A6,A7,R,T,TC] - R0, AR0, DP, SP 270*3d8817e4Smiod r register (0-11) 16--20 [B,BA,BB,BI,B6,B7,RF,S,SC] - R0, R1, R11 271*3d8817e4Smiod S short int immediate 0--15 [A,AB,AY,BI] - -5, 5 272*3d8817e4Smiod T integer (C4x) 16--20 [Z] - -5, 12 273*3d8817e4Smiod U unsigned integer 0--15 [AU,A3] - 0, 65535 274*3d8817e4Smiod V vector (C4x: 0--8) 0--4 [Z] - 25, 7 275*3d8817e4Smiod W short int (C4x) 0--7 [T,TC,T2,T2C] - -3, 5 276*3d8817e4Smiod X expansion reg (C4x) 0--4 [Z] - IVTP, TVTP 277*3d8817e4Smiod Y address reg (C4x) 16--20 [Z] - AR0, DP, SP, IR0 278*3d8817e4Smiod Z expansion reg (C4x) 16--20 [Z] - IVTP, TVTP 279*3d8817e4Smiod */ 280*3d8817e4Smiod 281*3d8817e4Smiod #define TIC4X_OPERANDS_MAX 7 /* Max number of operands for an inst. */ 282*3d8817e4Smiod #define TIC4X_NAME_MAX 16 /* Max number of chars in parallel name. */ 283*3d8817e4Smiod 284*3d8817e4Smiod /* Define the instruction level */ 285*3d8817e4Smiod #define OP_C3X 0x1 /* C30 support - supported by all */ 286*3d8817e4Smiod #define OP_C4X 0x2 /* C40 support - C40, C44 */ 287*3d8817e4Smiod #define OP_ENH 0x4 /* Class LL,LS,M,P,Q,QC enhancements. Argument type 288*3d8817e4Smiod I and J is enhanced in these classes - C31>=6.0, 289*3d8817e4Smiod C32>=2.0, C33 */ 290*3d8817e4Smiod #define OP_LPWR 0x8 /* Low power support (LOPOWER, MAXSPEED) - C30>=7.0, 291*3d8817e4Smiod LC31, C31>=5.0, C32 */ 292*3d8817e4Smiod #define OP_IDLE2 0x10 /* Idle2 support (IDLE2) - C30>=7.0, LC31, C31>=5.0, 293*3d8817e4Smiod C32, C33, C40>=5.0, C44 */ 294*3d8817e4Smiod 295*3d8817e4Smiod /* The following class definition is a classification scheme for 296*3d8817e4Smiod putting instructions with similar type of arguments together. It 297*3d8817e4Smiod simplifies the op-code definitions significantly, as we then only 298*3d8817e4Smiod need to use the class macroes for 95% of the DSP's opcodes. 299*3d8817e4Smiod */ 300*3d8817e4Smiod 301*3d8817e4Smiod /* A: General 2-operand integer operations 302*3d8817e4Smiod Syntax: <i> src, dst 303*3d8817e4Smiod src = Register (Q), Direct (@), Indirect (*), Signed immediate (S) 304*3d8817e4Smiod dst = Register (R) 305*3d8817e4Smiod Instr: 15/8 - ABSI, ADDC, ADDI, ASH, CMPI, LDI, LSH, MPYI, NEGB, NEGI, 306*3d8817e4Smiod SUBB, SUBC, SUBI, SUBRB, SUBRI, C4x: LBn, LHn, LWLn, LWRn, 307*3d8817e4Smiod MBn, MHn, MPYSHI, MPYUHI 308*3d8817e4Smiod */ 309*3d8817e4Smiod #define A_CLASS_INSN(name, opcode, level) \ 310*3d8817e4Smiod { name, opcode|0x00000000, 0xffe00000, "Q;R", level }, \ 311*3d8817e4Smiod { name, opcode|0x00200000, 0xffe00000, "@,R", level }, \ 312*3d8817e4Smiod { name, opcode|0x00400000, 0xffe00000, "*,R", level }, \ 313*3d8817e4Smiod { name, opcode|0x00600000, 0xffe00000, "S,R", level } 314*3d8817e4Smiod 315*3d8817e4Smiod /* AB: General 2-operand integer operation with condition 316*3d8817e4Smiod Syntax: <i>c src, dst 317*3d8817e4Smiod c = Condition 318*3d8817e4Smiod src = Register (Q), Direct (@), Indirect (*), Signed immediate (S) 319*3d8817e4Smiod dst = Register (R) 320*3d8817e4Smiod Instr: 1/0 - LDIc 321*3d8817e4Smiod */ 322*3d8817e4Smiod #define AB_CLASS_INSN(name, opcode, level) \ 323*3d8817e4Smiod { name, opcode|0x40000000, 0xf0600000, "Q;R", level }, \ 324*3d8817e4Smiod { name, opcode|0x40200000, 0xf0600000, "@,R", level }, \ 325*3d8817e4Smiod { name, opcode|0x40400000, 0xf0600000, "*,R", level }, \ 326*3d8817e4Smiod { name, opcode|0x40600000, 0xf0600000, "S,R", level } 327*3d8817e4Smiod 328*3d8817e4Smiod /* AU: General 2-operand unsigned integer operation 329*3d8817e4Smiod Syntax: <i> src, dst 330*3d8817e4Smiod src = Register (Q), Direct (@), Indirect (*), Unsigned immediate (U) 331*3d8817e4Smiod dst = Register (R) 332*3d8817e4Smiod Instr: 6/2 - AND, ANDN, NOT, OR, TSTB, XOR, C4x: LBUn, LHUn 333*3d8817e4Smiod */ 334*3d8817e4Smiod #define AU_CLASS_INSN(name, opcode, level) \ 335*3d8817e4Smiod { name, opcode|0x00000000, 0xffe00000, "Q;R", level }, \ 336*3d8817e4Smiod { name, opcode|0x00200000, 0xffe00000, "@,R", level }, \ 337*3d8817e4Smiod { name, opcode|0x00400000, 0xffe00000, "*,R", level }, \ 338*3d8817e4Smiod { name, opcode|0x00600000, 0xffe00000, "U,R", level } 339*3d8817e4Smiod 340*3d8817e4Smiod /* AF: General 2-operand float to integer operation 341*3d8817e4Smiod Syntax: <i> src, dst 342*3d8817e4Smiod src = Register 0-11 (q), Direct (@), Indirect (*), Float immediate (F) 343*3d8817e4Smiod dst = Register (R) 344*3d8817e4Smiod Instr: 1/0 - FIX 345*3d8817e4Smiod */ 346*3d8817e4Smiod #define AF_CLASS_INSN(name, opcode, level) \ 347*3d8817e4Smiod { name, opcode|0x00000000, 0xffe00000, "q;R", level }, \ 348*3d8817e4Smiod { name, opcode|0x00200000, 0xffe00000, "@,R", level }, \ 349*3d8817e4Smiod { name, opcode|0x00400000, 0xffe00000, "*,R", level }, \ 350*3d8817e4Smiod { name, opcode|0x00600000, 0xffe00000, "F,R", level } 351*3d8817e4Smiod 352*3d8817e4Smiod /* A2: Limited 1-operand (integer) operation 353*3d8817e4Smiod Syntax: <i> src 354*3d8817e4Smiod src = Register (Q), Indirect (*), None 355*3d8817e4Smiod Instr: 1/0 - NOP 356*3d8817e4Smiod */ 357*3d8817e4Smiod #define A2_CLASS_INSN(name, opcode, level) \ 358*3d8817e4Smiod { name, opcode|0x00000000, 0xffe00000, "Q", level }, \ 359*3d8817e4Smiod { name, opcode|0x00400000, 0xffe00000, "*", level }, \ 360*3d8817e4Smiod { name, opcode|0x00000000, 0xffe00000, "" , level } 361*3d8817e4Smiod 362*3d8817e4Smiod /* A3: General 1-operand unsigned integer operation 363*3d8817e4Smiod Syntax: <i> src 364*3d8817e4Smiod src = Register (Q), Direct (@), Indirect (*), Unsigned immediate (U) 365*3d8817e4Smiod Instr: 1/0 - RPTS 366*3d8817e4Smiod */ 367*3d8817e4Smiod #define A3_CLASS_INSN(name, opcode, level) \ 368*3d8817e4Smiod { name, opcode|0x00000000, 0xffff0000, "Q", level }, \ 369*3d8817e4Smiod { name, opcode|0x00200000, 0xffff0000, "@", level }, \ 370*3d8817e4Smiod { name, opcode|0x00400000, 0xffff0000, "*", level }, \ 371*3d8817e4Smiod { name, opcode|0x00600000, 0xffff0000, "U", level } 372*3d8817e4Smiod 373*3d8817e4Smiod /* A6: Limited 2-operand integer operation 374*3d8817e4Smiod Syntax: <i> src, dst 375*3d8817e4Smiod src = Direct (@), Indirect (*) 376*3d8817e4Smiod dst = Register (R) 377*3d8817e4Smiod Instr: 1/1 - LDII, C4x: SIGI 378*3d8817e4Smiod */ 379*3d8817e4Smiod #define A6_CLASS_INSN(name, opcode, level) \ 380*3d8817e4Smiod { name, opcode|0x00200000, 0xffe00000, "@,R", level }, \ 381*3d8817e4Smiod { name, opcode|0x00400000, 0xffe00000, "*,R", level } 382*3d8817e4Smiod 383*3d8817e4Smiod /* A7: Limited 2-operand integer store operation 384*3d8817e4Smiod Syntax: <i> src, dst 385*3d8817e4Smiod src = Register (R) 386*3d8817e4Smiod dst = Direct (@), Indirect (*) 387*3d8817e4Smiod Instr: 2/0 - STI, STII 388*3d8817e4Smiod */ 389*3d8817e4Smiod #define A7_CLASS_INSN(name, opcode, level) \ 390*3d8817e4Smiod { name, opcode|0x00200000, 0xffe00000, "R,@", level }, \ 391*3d8817e4Smiod { name, opcode|0x00400000, 0xffe00000, "R,*", level } 392*3d8817e4Smiod 393*3d8817e4Smiod /* AY: General 2-operand signed address load operation 394*3d8817e4Smiod Syntax: <i> src, dst 395*3d8817e4Smiod src = Register (Q), Direct (@), Indirect (*), Signed immediate (S) 396*3d8817e4Smiod dst = Address register - ARx, IRx, DP, BK, SP (Y) 397*3d8817e4Smiod Instr: 0/1 - C4x: LDA 398*3d8817e4Smiod Note: Q and Y should *never* be the same register 399*3d8817e4Smiod */ 400*3d8817e4Smiod #define AY_CLASS_INSN(name, opcode, level) \ 401*3d8817e4Smiod { name, opcode|0x00000000, 0xffe00000, "Q,Y", level }, \ 402*3d8817e4Smiod { name, opcode|0x00200000, 0xffe00000, "@,Y", level }, \ 403*3d8817e4Smiod { name, opcode|0x00400000, 0xffe00000, "*,Y", level }, \ 404*3d8817e4Smiod { name, opcode|0x00600000, 0xffe00000, "S,Y", level } 405*3d8817e4Smiod 406*3d8817e4Smiod /* B: General 2-operand float operation 407*3d8817e4Smiod Syntax: <i> src, dst 408*3d8817e4Smiod src = Register 0-11 (q), Direct (@), Indirect (*), Float immediate (F) 409*3d8817e4Smiod dst = Register 0-11 (r) 410*3d8817e4Smiod Instr: 12/2 - ABSF, ADDF, CMPF, LDE, LDF, LDM, MPYF, NEGF, NORM, RND, 411*3d8817e4Smiod SUBF, SUBRF, C4x: RSQRF, TOIEEE 412*3d8817e4Smiod */ 413*3d8817e4Smiod #define B_CLASS_INSN(name, opcode, level) \ 414*3d8817e4Smiod { name, opcode|0x00000000, 0xffe00000, "q;r", level }, \ 415*3d8817e4Smiod { name, opcode|0x00200000, 0xffe00000, "@,r", level }, \ 416*3d8817e4Smiod { name, opcode|0x00400000, 0xffe00000, "*,r", level }, \ 417*3d8817e4Smiod { name, opcode|0x00600000, 0xffe00000, "F,r", level } 418*3d8817e4Smiod 419*3d8817e4Smiod /* BA: General 2-operand integer to float operation 420*3d8817e4Smiod Syntax: <i> src, dst 421*3d8817e4Smiod src = Register (Q), Direct (@), Indirect (*), Float immediate (F) 422*3d8817e4Smiod dst = Register 0-11 (r) 423*3d8817e4Smiod Instr: 0/1 - C4x: CRCPF 424*3d8817e4Smiod */ 425*3d8817e4Smiod #define BA_CLASS_INSN(name, opcode, level) \ 426*3d8817e4Smiod { name, opcode|0x00000000, 0xffe00000, "Q;r", level }, \ 427*3d8817e4Smiod { name, opcode|0x00200000, 0xffe00000, "@,r", level }, \ 428*3d8817e4Smiod { name, opcode|0x00400000, 0xffe00000, "*,r", level }, \ 429*3d8817e4Smiod { name, opcode|0x00600000, 0xffe00000, "F,r", level } 430*3d8817e4Smiod 431*3d8817e4Smiod /* BB: General 2-operand conditional float operation 432*3d8817e4Smiod Syntax: <i>c src, dst 433*3d8817e4Smiod c = Condition 434*3d8817e4Smiod src = Register 0-11 (q), Direct (@), Indirect (*), Float immediate (F) 435*3d8817e4Smiod dst = Register 0-11 (r) 436*3d8817e4Smiod Instr: 1/0 - LDFc 437*3d8817e4Smiod */ 438*3d8817e4Smiod #define BB_CLASS_INSN(name, opcode, level) \ 439*3d8817e4Smiod { name, opcode|0x40000000, 0xf0600000, "q;r", level }, \ 440*3d8817e4Smiod { name, opcode|0x40200000, 0xf0600000, "@,r", level }, \ 441*3d8817e4Smiod { name, opcode|0x40400000, 0xf0600000, "*,r", level }, \ 442*3d8817e4Smiod { name, opcode|0x40600000, 0xf0600000, "F,r", level } 443*3d8817e4Smiod 444*3d8817e4Smiod /* BI: General 2-operand integer to float operation (yet different to BA) 445*3d8817e4Smiod Syntax: <i> src, dst 446*3d8817e4Smiod src = Register (Q), Direct (@), Indirect (*), Signed immediate (S) 447*3d8817e4Smiod dst = Register 0-11 (r) 448*3d8817e4Smiod Instr: 1/0 - FLOAT 449*3d8817e4Smiod */ 450*3d8817e4Smiod #define BI_CLASS_INSN(name, opcode, level) \ 451*3d8817e4Smiod { name, opcode|0x00000000, 0xffe00000, "Q;r", level }, \ 452*3d8817e4Smiod { name, opcode|0x00200000, 0xffe00000, "@,r", level }, \ 453*3d8817e4Smiod { name, opcode|0x00400000, 0xffe00000, "*,r", level }, \ 454*3d8817e4Smiod { name, opcode|0x00600000, 0xffe00000, "S,r", level } 455*3d8817e4Smiod 456*3d8817e4Smiod /* B6: Limited 2-operand float operation 457*3d8817e4Smiod Syntax: <i> src, dst 458*3d8817e4Smiod src = Direct (@), Indirect (*) 459*3d8817e4Smiod dst = Register 0-11 (r) 460*3d8817e4Smiod Instr: 1/1 - LDFI, C4x: FRIEEE 461*3d8817e4Smiod */ 462*3d8817e4Smiod #define B6_CLASS_INSN(name, opcode, level) \ 463*3d8817e4Smiod { name, opcode|0x00200000, 0xffe00000, "@,r", level }, \ 464*3d8817e4Smiod { name, opcode|0x00400000, 0xffe00000, "*,r", level } 465*3d8817e4Smiod 466*3d8817e4Smiod /* B7: Limited 2-operand float store operation 467*3d8817e4Smiod Syntax: <i> src, dst 468*3d8817e4Smiod src = Register 0-11 (r) 469*3d8817e4Smiod dst = Direct (@), Indirect (*) 470*3d8817e4Smiod Instr: 2/0 - STF, STFI 471*3d8817e4Smiod */ 472*3d8817e4Smiod #define B7_CLASS_INSN(name, opcode, level) \ 473*3d8817e4Smiod { name, opcode|0x00200000, 0xffe00000, "r,@", level }, \ 474*3d8817e4Smiod { name, opcode|0x00400000, 0xffe00000, "r,*", level } 475*3d8817e4Smiod 476*3d8817e4Smiod /* D: Decrement and brach operations 477*3d8817e4Smiod Syntax: <i>c ARn, dst 478*3d8817e4Smiod c = condition 479*3d8817e4Smiod ARn = AR register 0-7 (A) 480*3d8817e4Smiod dst = Register (Q), PC-relative (P) 481*3d8817e4Smiod Instr: 2/0 - DBc, DBcD 482*3d8817e4Smiod Alias: <name1> <name2> 483*3d8817e4Smiod */ 484*3d8817e4Smiod #define D_CLASS_INSN(name1, name2, opcode, level) \ 485*3d8817e4Smiod { name1, opcode|0x00000000, 0xfe200000, "A,Q", level }, \ 486*3d8817e4Smiod { name1, opcode|0x02000000, 0xfe200000, "A,P", level }, \ 487*3d8817e4Smiod { name2, opcode|0x00000000, 0xfe200000, "A,Q", level }, \ 488*3d8817e4Smiod { name2, opcode|0x02000000, 0xfe200000, "A,P", level } 489*3d8817e4Smiod 490*3d8817e4Smiod /* I: General branch operations 491*3d8817e4Smiod Syntax: <i> dst 492*3d8817e4Smiod dst = Address (B) 493*3d8817e4Smiod Instr: 3/1 - BR, BRD, CALL, C4x: LAJ 494*3d8817e4Smiod */ 495*3d8817e4Smiod 496*3d8817e4Smiod /* I2: General branch operations (C4x addition) 497*3d8817e4Smiod Syntax: <i> dst 498*3d8817e4Smiod dst = Address (B), C4x: Register (Q) 499*3d8817e4Smiod Instr: 2/0 - RPTB, RPTBD 500*3d8817e4Smiod */ 501*3d8817e4Smiod 502*3d8817e4Smiod /* J: General conditional branch operations 503*3d8817e4Smiod Syntax: <i>c dst 504*3d8817e4Smiod c = Condition 505*3d8817e4Smiod dst = Register (Q), PC-relative (P) 506*3d8817e4Smiod Instr: 2/3 - Bc, BcD, C4x: BcAF, BcAT, LAJc 507*3d8817e4Smiod Alias: <name1> <name2> 508*3d8817e4Smiod */ 509*3d8817e4Smiod #define J_CLASS_INSN(name1, name2, opcode, level) \ 510*3d8817e4Smiod { name1, opcode|0x00000000, 0xffe00000, "Q", level }, \ 511*3d8817e4Smiod { name1, opcode|0x02000000, 0xffe00000, "P", level }, \ 512*3d8817e4Smiod { name2, opcode|0x00000000, 0xffe00000, "Q", level }, \ 513*3d8817e4Smiod { name2, opcode|0x02000000, 0xffe00000, "P", level } 514*3d8817e4Smiod 515*3d8817e4Smiod /* JS: General conditional branch operations 516*3d8817e4Smiod Syntax: <i>c dst 517*3d8817e4Smiod c = Condition 518*3d8817e4Smiod dst = Register (Q), PC-relative (P) 519*3d8817e4Smiod Instr: 1/1 - CALLc, C4X: LAJc 520*3d8817e4Smiod */ 521*3d8817e4Smiod 522*3d8817e4Smiod /* LL: Load-load parallell operation 523*3d8817e4Smiod Syntax: <i> src2, dst2 || <i> src1, dst1 524*3d8817e4Smiod src1 = Indirect 0,1,IR0,IR1 (J) 525*3d8817e4Smiod dst1 = Register 0-7 (K) 526*3d8817e4Smiod src2 = Indirect 0,1,IR0,IR1, ENH: Register (i) 527*3d8817e4Smiod dst2 = Register 0-7 (L) 528*3d8817e4Smiod Instr: 2/0 - LDF||LDF, LDI||LDI 529*3d8817e4Smiod Alias: i||i, i1||i2, i2||i1 530*3d8817e4Smiod */ 531*3d8817e4Smiod #define LL_CLASS_INSN(name, opcode, level) \ 532*3d8817e4Smiod { name "_" name , opcode, 0xfe000000, "i;L|J,K", level }, \ 533*3d8817e4Smiod { name "2_" name "1", opcode, 0xfe000000, "i;L|J,K", level }, \ 534*3d8817e4Smiod { name "1_" name "2", opcode, 0xfe000000, "J,K|i;L", level } 535*3d8817e4Smiod 536*3d8817e4Smiod /* LS: Store-store parallell operation 537*3d8817e4Smiod Syntax: <i> src2, dst2 || <i> src1, dst1 538*3d8817e4Smiod src1 = Register 0-7 (H) 539*3d8817e4Smiod dst1 = Indirect 0,1,IR0,IR1 (J) 540*3d8817e4Smiod src2 = Register 0-7 (L) 541*3d8817e4Smiod dst2 = Indirect 0,1,IR0,IR1, ENH: register (i) 542*3d8817e4Smiod Instr: 2/0 - STF||STF, STI||STI 543*3d8817e4Smiod Alias: i||i, i1||i2, i2||i1. 544*3d8817e4Smiod */ 545*3d8817e4Smiod #define LS_CLASS_INSN(name, opcode, level) \ 546*3d8817e4Smiod { name "_" name , opcode, 0xfe000000, "L;i|H,J", level }, \ 547*3d8817e4Smiod { name "2_" name "1", opcode, 0xfe000000, "L;i|H,J", level }, \ 548*3d8817e4Smiod { name "1_" name "2", opcode, 0xfe000000, "H,J|L;i", level } 549*3d8817e4Smiod 550*3d8817e4Smiod /* M: General multiply and add/sub operations 551*3d8817e4Smiod Syntax: <ia> src3,src4,dst1 || <ib> src2,src1,dst2 [00] - Manual 552*3d8817e4Smiod <ia> src3,src1,dst1 || <ib> src2,src4,dst2 [01] - Manual 553*3d8817e4Smiod <ia> src1,src3,dst1 || <ib> src2,src4,dst2 [01] 554*3d8817e4Smiod <ia> src1,src2,dst1 || <ib> src4,src3,dst2 [02] - Manual 555*3d8817e4Smiod <ia> src3,src1,dst1 || <ib> src4,src2,dst2 [03] - Manual 556*3d8817e4Smiod <ia> src1,src3,dst1 || <ib> src4,src2,dst2 [03] 557*3d8817e4Smiod src1 = Register 0-7 (K) 558*3d8817e4Smiod src2 = Register 0-7 (H) 559*3d8817e4Smiod src3 = Indirect 0,1,IR0,IR1, ENH: register (j) 560*3d8817e4Smiod src4 = Indirect 0,1,IR0,IR1, ENH: register (i) 561*3d8817e4Smiod dst1 = Register 0-1 (N) 562*3d8817e4Smiod dst2 = Register 2-3 (M) 563*3d8817e4Smiod Instr: 4/0 - MPYF3||ADDF3, MPYF3||SUBF3, MPYI3||ADDI3, MPYI3||SUBI3 564*3d8817e4Smiod Alias: a||b, a3||n, a||b3, a3||b3, b||a, b3||a, b||a3, b3||a3 565*3d8817e4Smiod */ 566*3d8817e4Smiod #define M_CLASS_INSN(namea, nameb, opcode, level) \ 567*3d8817e4Smiod { namea "_" nameb, opcode|0x00000000, 0xff000000, "i;j;N|H;K;M", level }, \ 568*3d8817e4Smiod { namea "_" nameb, opcode|0x01000000, 0xff000000, "j;K;N|H;i;M", level }, \ 569*3d8817e4Smiod { namea "_" nameb, opcode|0x01000000, 0xff000000, "K;j;N|H;i;M", level }, \ 570*3d8817e4Smiod { namea "_" nameb, opcode|0x02000000, 0xff000000, "H;K;N|i;j;M", level }, \ 571*3d8817e4Smiod { namea "_" nameb, opcode|0x03000000, 0xff000000, "j;K;N|i;H;M", level }, \ 572*3d8817e4Smiod { namea "_" nameb, opcode|0x03000000, 0xff000000, "K;j;N|i;H;M", level }, \ 573*3d8817e4Smiod { namea "3_" nameb, opcode|0x00000000, 0xff000000, "i;j;N|H;K;M", level }, \ 574*3d8817e4Smiod { namea "3_" nameb, opcode|0x01000000, 0xff000000, "j;K;N|H;i;M", level }, \ 575*3d8817e4Smiod { namea "3_" nameb, opcode|0x01000000, 0xff000000, "K;j;N|H;i;M", level }, \ 576*3d8817e4Smiod { namea "3_" nameb, opcode|0x02000000, 0xff000000, "H;K;N|i;j;M", level }, \ 577*3d8817e4Smiod { namea "3_" nameb, opcode|0x03000000, 0xff000000, "j;K;N|i;H;M", level }, \ 578*3d8817e4Smiod { namea "3_" nameb, opcode|0x03000000, 0xff000000, "K;j;N|i;H;M", level }, \ 579*3d8817e4Smiod { namea "_" nameb "3", opcode|0x00000000, 0xff000000, "i;j;N|H;K;M", level }, \ 580*3d8817e4Smiod { namea "_" nameb "3", opcode|0x01000000, 0xff000000, "j;K;N|H;i;M", level }, \ 581*3d8817e4Smiod { namea "_" nameb "3", opcode|0x01000000, 0xff000000, "K;j;N|H;i;M", level }, \ 582*3d8817e4Smiod { namea "_" nameb "3", opcode|0x02000000, 0xff000000, "H;K;N|i;j;M", level }, \ 583*3d8817e4Smiod { namea "_" nameb "3", opcode|0x03000000, 0xff000000, "j;K;N|i;H;M", level }, \ 584*3d8817e4Smiod { namea "_" nameb "3", opcode|0x03000000, 0xff000000, "K;j;N|i;H;M", level }, \ 585*3d8817e4Smiod { namea "3_" nameb "3", opcode|0x00000000, 0xff000000, "i;j;N|H;K;M", level }, \ 586*3d8817e4Smiod { namea "3_" nameb "3", opcode|0x01000000, 0xff000000, "j;K;N|H;i;M", level }, \ 587*3d8817e4Smiod { namea "3_" nameb "3", opcode|0x01000000, 0xff000000, "K;j;N|H;i;M", level }, \ 588*3d8817e4Smiod { namea "3_" nameb "3", opcode|0x02000000, 0xff000000, "H;K;N|i;j;M", level }, \ 589*3d8817e4Smiod { namea "3_" nameb "3", opcode|0x03000000, 0xff000000, "j;K;N|i;H;M", level }, \ 590*3d8817e4Smiod { namea "3_" nameb "3", opcode|0x03000000, 0xff000000, "K;j;N|i;H;M", level }, \ 591*3d8817e4Smiod { nameb "_" namea, opcode|0x00000000, 0xff000000, "H;K;M|i;j;N", level }, \ 592*3d8817e4Smiod { nameb "_" namea, opcode|0x01000000, 0xff000000, "H;i;M|j;K;N", level }, \ 593*3d8817e4Smiod { nameb "_" namea, opcode|0x01000000, 0xff000000, "H;i;M|K;j;N", level }, \ 594*3d8817e4Smiod { nameb "_" namea, opcode|0x02000000, 0xff000000, "i;j;M|H;K;N", level }, \ 595*3d8817e4Smiod { nameb "_" namea, opcode|0x03000000, 0xff000000, "i;H;M|j;K;N", level }, \ 596*3d8817e4Smiod { nameb "_" namea, opcode|0x03000000, 0xff000000, "i;H;M|K;j;N", level }, \ 597*3d8817e4Smiod { nameb "3_" namea, opcode|0x00000000, 0xff000000, "H;K;M|i;j;N", level }, \ 598*3d8817e4Smiod { nameb "3_" namea, opcode|0x01000000, 0xff000000, "H;i;M|j;K;N", level }, \ 599*3d8817e4Smiod { nameb "3_" namea, opcode|0x01000000, 0xff000000, "H;i;M|K;j;N", level }, \ 600*3d8817e4Smiod { nameb "3_" namea, opcode|0x02000000, 0xff000000, "i;j;M|H;K;N", level }, \ 601*3d8817e4Smiod { nameb "3_" namea, opcode|0x03000000, 0xff000000, "i;H;M|j;K;N", level }, \ 602*3d8817e4Smiod { nameb "3_" namea, opcode|0x03000000, 0xff000000, "i;H;M|K;j;N", level }, \ 603*3d8817e4Smiod { nameb "_" namea "3", opcode|0x00000000, 0xff000000, "H;K;M|i;j;N", level }, \ 604*3d8817e4Smiod { nameb "_" namea "3", opcode|0x01000000, 0xff000000, "H;i;M|j;K;N", level }, \ 605*3d8817e4Smiod { nameb "_" namea "3", opcode|0x01000000, 0xff000000, "H;i;M|K;j;N", level }, \ 606*3d8817e4Smiod { nameb "_" namea "3", opcode|0x02000000, 0xff000000, "i;j;M|H;K;N", level }, \ 607*3d8817e4Smiod { nameb "_" namea "3", opcode|0x03000000, 0xff000000, "i;H;M|j;K;N", level }, \ 608*3d8817e4Smiod { nameb "_" namea "3", opcode|0x03000000, 0xff000000, "i;H;M|K;j;N", level }, \ 609*3d8817e4Smiod { nameb "3_" namea "3", opcode|0x00000000, 0xff000000, "H;K;M|i;j;N", level }, \ 610*3d8817e4Smiod { nameb "3_" namea "3", opcode|0x01000000, 0xff000000, "H;i;M|j;K;N", level }, \ 611*3d8817e4Smiod { nameb "3_" namea "3", opcode|0x01000000, 0xff000000, "H;i;M|K;j;N", level }, \ 612*3d8817e4Smiod { nameb "3_" namea "3", opcode|0x02000000, 0xff000000, "i;j;M|H;K;N", level }, \ 613*3d8817e4Smiod { nameb "3_" namea "3", opcode|0x03000000, 0xff000000, "i;H;M|j;K;N", level }, \ 614*3d8817e4Smiod { nameb "3_" namea "3", opcode|0x03000000, 0xff000000, "i;H;M|K;j;N", level } 615*3d8817e4Smiod 616*3d8817e4Smiod /* P: General 2-operand operation with parallell store 617*3d8817e4Smiod Syntax: <ia> src2, dst1 || <ib> src3, dst2 618*3d8817e4Smiod src2 = Indirect 0,1,IR0,IR1, ENH: register (i) 619*3d8817e4Smiod dst1 = Register 0-7 (L) 620*3d8817e4Smiod src3 = Register 0-7 (H) 621*3d8817e4Smiod dst2 = Indirect 0,1,IR0,IR1 (J) 622*3d8817e4Smiod Instr: 9/2 - ABSF||STF, ABSI||STI, FIX||STI, FLOAT||STF, LDF||STF, 623*3d8817e4Smiod LDI||STI, NEGF||STF, NEGI||STI, NOT||STI, C4x: FRIEEE||STF, 624*3d8817e4Smiod TOIEEE||STF 625*3d8817e4Smiod Alias: a||b, b||a 626*3d8817e4Smiod */ 627*3d8817e4Smiod #define P_CLASS_INSN(namea, nameb, opcode, level) \ 628*3d8817e4Smiod { namea "_" nameb, opcode, 0xfe000000, "i;L|H,J", level }, \ 629*3d8817e4Smiod { nameb "_" namea, opcode, 0xfe000000, "H,J|i;L", level } 630*3d8817e4Smiod 631*3d8817e4Smiod /* Q: General 3-operand operation with parallell store 632*3d8817e4Smiod Syntax: <ia> src1, src2, dst1 || <ib> src3, dst2 633*3d8817e4Smiod src1 = Register 0-7 (K) 634*3d8817e4Smiod src2 = Indirect 0,1,IR0,IR1, ENH: register (i) 635*3d8817e4Smiod dst1 = Register 0-7 (L) 636*3d8817e4Smiod src3 = Register 0-7 (H) 637*3d8817e4Smiod dst2 = Indirect 0,1,IR0,IR1 (J) 638*3d8817e4Smiod Instr: 4/0 - ASH3||STI, LSH3||STI, SUBF3||STF, SUBI3||STI 639*3d8817e4Smiod Alias: a||b, b||a, a3||b, b||a3 640*3d8817e4Smiod */ 641*3d8817e4Smiod #define Q_CLASS_INSN(namea, nameb, opcode, level) \ 642*3d8817e4Smiod { namea "_" nameb , opcode, 0xfe000000, "K,i;L|H,J", level }, \ 643*3d8817e4Smiod { nameb "_" namea , opcode, 0xfe000000, "H,J|K,i;L", level }, \ 644*3d8817e4Smiod { namea "3_" nameb , opcode, 0xfe000000, "K,i;L|H,J", level }, \ 645*3d8817e4Smiod { nameb "_" namea "3", opcode, 0xfe000000, "H,J|K,i;L", level } 646*3d8817e4Smiod 647*3d8817e4Smiod /* QC: General commutative 3-operand operation with parallell store 648*3d8817e4Smiod Syntax: <ia> src2, src1, dst1 || <ib> src3, dst2 649*3d8817e4Smiod <ia> src1, src2, dst1 || <ib> src3, dst2 - Manual 650*3d8817e4Smiod src1 = Register 0-7 (K) 651*3d8817e4Smiod src2 = Indirect 0,1,IR0,IR1, ENH: register (i) 652*3d8817e4Smiod dst1 = Register 0-7 (L) 653*3d8817e4Smiod src3 = Register 0-7 (H) 654*3d8817e4Smiod dst2 = Indirect 0,1,IR0,IR1 (J) 655*3d8817e4Smiod Instr: 7/0 - ADDF3||STF, ADDI3||STI, AND3||STI, MPYF3||STF, MPYI3||STI, 656*3d8817e4Smiod OR3||STI, XOR3||STI 657*3d8817e4Smiod Alias: a||b, b||a, a3||b, b||a3 658*3d8817e4Smiod */ 659*3d8817e4Smiod #define QC_CLASS_INSN(namea, nameb, opcode, level) \ 660*3d8817e4Smiod { namea "_" nameb , opcode, 0xfe000000, "i;K;L|H,J", level }, \ 661*3d8817e4Smiod { namea "_" nameb , opcode, 0xfe000000, "K;i;L|H,J", level }, \ 662*3d8817e4Smiod { nameb "_" namea , opcode, 0xfe000000, "H,J|i;K;L", level }, \ 663*3d8817e4Smiod { nameb "_" namea , opcode, 0xfe000000, "H,J|K;i;L", level }, \ 664*3d8817e4Smiod { namea "3_" nameb , opcode, 0xfe000000, "i;K;L|H,J", level }, \ 665*3d8817e4Smiod { namea "3_" nameb , opcode, 0xfe000000, "K;i;L|H,J", level }, \ 666*3d8817e4Smiod { nameb "_" namea "3", opcode, 0xfe000000, "H,J|i;K;L", level }, \ 667*3d8817e4Smiod { nameb "_" namea "3", opcode, 0xfe000000, "H,J|K;i;L", level } 668*3d8817e4Smiod 669*3d8817e4Smiod /* R: General register integer operation 670*3d8817e4Smiod Syntax: <i> dst 671*3d8817e4Smiod dst = Register (R) 672*3d8817e4Smiod Instr: 6/0 - POP, PUSH, ROL, ROLC, ROR, RORC 673*3d8817e4Smiod */ 674*3d8817e4Smiod #define R_CLASS_INSN(name, opcode, level) \ 675*3d8817e4Smiod { name, opcode, 0xffe0ffff, "R", level } 676*3d8817e4Smiod 677*3d8817e4Smiod /* RF: General register float operation 678*3d8817e4Smiod Syntax: <i> dst 679*3d8817e4Smiod dst = Register 0-11 (r) 680*3d8817e4Smiod Instr: 2/0 - POPF, PUSHF 681*3d8817e4Smiod */ 682*3d8817e4Smiod #define RF_CLASS_INSN(name, opcode, level) \ 683*3d8817e4Smiod { name, opcode, 0xffe0ffff, "r", level } 684*3d8817e4Smiod 685*3d8817e4Smiod /* S: General 3-operand float operation 686*3d8817e4Smiod Syntax: <i> src2, src1, dst 687*3d8817e4Smiod src2 = Register 0-11 (e), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C) 688*3d8817e4Smiod src1 = Register 0-11 (g), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (O) 689*3d8817e4Smiod dst = Register 0-11 (r) 690*3d8817e4Smiod Instr: 1/0 - SUBF3 691*3d8817e4Smiod Alias: i, i3 692*3d8817e4Smiod */ 693*3d8817e4Smiod #define S_CLASS_INSN(name, opcode, level) \ 694*3d8817e4Smiod { name, opcode|0x20000000, 0xffe00000, "e,g;r", level }, \ 695*3d8817e4Smiod { name, opcode|0x20200000, 0xffe00000, "e,J,r", level }, \ 696*3d8817e4Smiod { name, opcode|0x20400000, 0xffe00000, "I,g;r", level }, \ 697*3d8817e4Smiod { name, opcode|0x20600000, 0xffe00000, "I,J,r", level }, \ 698*3d8817e4Smiod { name, opcode|0x30200000, 0xffe00000, "C,g;r", OP_C4X }, \ 699*3d8817e4Smiod { name, opcode|0x30600000, 0xffe00000, "C,O,r", OP_C4X }, \ 700*3d8817e4Smiod { name "3", opcode|0x20000000, 0xffe00000, "e,g;r", level }, \ 701*3d8817e4Smiod { name "3", opcode|0x20200000, 0xffe00000, "e,J,r", level }, \ 702*3d8817e4Smiod { name "3", opcode|0x20400000, 0xffe00000, "I,g;r", level }, \ 703*3d8817e4Smiod { name "3", opcode|0x20600000, 0xffe00000, "I,J,r", level }, \ 704*3d8817e4Smiod { name "3", opcode|0x30200000, 0xffe00000, "C,g;r", OP_C4X }, \ 705*3d8817e4Smiod { name "3", opcode|0x30600000, 0xffe00000, "C,O,r", OP_C4X } 706*3d8817e4Smiod 707*3d8817e4Smiod /* SC: General commutative 3-operand float operation 708*3d8817e4Smiod Syntax: <i> src2, src1, dst - Manual 709*3d8817e4Smiod <i> src1, src2, dst 710*3d8817e4Smiod src2 = Register 0-11 (e), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C) 711*3d8817e4Smiod src1 = Register 0-11 (g), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (O) 712*3d8817e4Smiod dst = Register 0-11 (r) 713*3d8817e4Smiod Instr: 2/0 - ADDF3, MPYF3 714*3d8817e4Smiod Alias: i, i3 715*3d8817e4Smiod */ 716*3d8817e4Smiod #define SC_CLASS_INSN(name, opcode, level) \ 717*3d8817e4Smiod { name, opcode|0x20000000, 0xffe00000, "e,g;r", level }, \ 718*3d8817e4Smiod { name, opcode|0x20200000, 0xffe00000, "e,J,r", level }, \ 719*3d8817e4Smiod { name, opcode|0x20400000, 0xffe00000, "I,g;r", level }, \ 720*3d8817e4Smiod { name, opcode|0x20600000, 0xffe00000, "I,J,r", level }, \ 721*3d8817e4Smiod { name, opcode|0x30200000, 0xffe00000, "C,g;r", OP_C4X }, \ 722*3d8817e4Smiod { name, opcode|0x30200000, 0xffe00000, "g,C,r", OP_C4X }, \ 723*3d8817e4Smiod { name, opcode|0x30600000, 0xffe00000, "C,O,r", OP_C4X }, \ 724*3d8817e4Smiod { name "3", opcode|0x20000000, 0xffe00000, "e,g;r", level }, \ 725*3d8817e4Smiod { name "3", opcode|0x20200000, 0xffe00000, "e,J,r", level }, \ 726*3d8817e4Smiod { name "3", opcode|0x20400000, 0xffe00000, "I,g;r", level }, \ 727*3d8817e4Smiod { name "3", opcode|0x20600000, 0xffe00000, "I,J,r", level }, \ 728*3d8817e4Smiod { name "3", opcode|0x30200000, 0xffe00000, "g,C,r", OP_C4X }, \ 729*3d8817e4Smiod { name "3", opcode|0x30200000, 0xffe00000, "C,g;r", OP_C4X }, \ 730*3d8817e4Smiod { name "3", opcode|0x30600000, 0xffe00000, "C,O,r", OP_C4X } 731*3d8817e4Smiod 732*3d8817e4Smiod /* S2: General 3-operand float operation with 2 args 733*3d8817e4Smiod Syntax: <i> src2, src1 734*3d8817e4Smiod src2 = Register 0-11 (e), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C) 735*3d8817e4Smiod src1 = Register 0-11 (g), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (O) 736*3d8817e4Smiod Instr: 1/0 - CMPF3 737*3d8817e4Smiod Alias: i, i3 738*3d8817e4Smiod */ 739*3d8817e4Smiod #define S2_CLASS_INSN(name, opcode, level) \ 740*3d8817e4Smiod { name, opcode|0x20000000, 0xffe00000, "e,g", level }, \ 741*3d8817e4Smiod { name, opcode|0x20200000, 0xffe00000, "e,J", level }, \ 742*3d8817e4Smiod { name, opcode|0x20400000, 0xffe00000, "I,g", level }, \ 743*3d8817e4Smiod { name, opcode|0x20600000, 0xffe00000, "I,J", level }, \ 744*3d8817e4Smiod { name, opcode|0x30200000, 0xffe00000, "C,g", OP_C4X }, \ 745*3d8817e4Smiod { name, opcode|0x30600000, 0xffe00000, "C,O", OP_C4X }, \ 746*3d8817e4Smiod { name "3", opcode|0x20000000, 0xffe00000, "e,g", level }, \ 747*3d8817e4Smiod { name "3", opcode|0x20200000, 0xffe00000, "e,J", level }, \ 748*3d8817e4Smiod { name "3", opcode|0x20400000, 0xffe00000, "I,g", level }, \ 749*3d8817e4Smiod { name "3", opcode|0x20600000, 0xffe00000, "I,J", level }, \ 750*3d8817e4Smiod { name "3", opcode|0x30200000, 0xffe00000, "C,g", OP_C4X }, \ 751*3d8817e4Smiod { name "3", opcode|0x30600000, 0xffe00000, "C,O", OP_C4X } 752*3d8817e4Smiod 753*3d8817e4Smiod /* T: General 3-operand integer operand 754*3d8817e4Smiod Syntax: <i> src2, src1, dst 755*3d8817e4Smiod src2 = Register (E), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C), Immediate (W) 756*3d8817e4Smiod src1 = Register (G), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (O) 757*3d8817e4Smiod dst = Register (R) 758*3d8817e4Smiod Instr: 5/0 - ANDN3, ASH3, LSH3, SUBB3, SUBI3 759*3d8817e4Smiod Alias: i, i3 760*3d8817e4Smiod */ 761*3d8817e4Smiod #define T_CLASS_INSN(name, opcode, level) \ 762*3d8817e4Smiod { name, opcode|0x20000000, 0xffe00000, "E,G;R", level }, \ 763*3d8817e4Smiod { name, opcode|0x20200000, 0xffe00000, "E,J,R", level }, \ 764*3d8817e4Smiod { name, opcode|0x20400000, 0xffe00000, "I,G;R", level }, \ 765*3d8817e4Smiod { name, opcode|0x20600000, 0xffe00000, "I,J,R", level }, \ 766*3d8817e4Smiod { name, opcode|0x30000000, 0xffe00000, "W,G;R", OP_C4X }, \ 767*3d8817e4Smiod { name, opcode|0x30200000, 0xffe00000, "C,G;R", OP_C4X }, \ 768*3d8817e4Smiod { name, opcode|0x30400000, 0xffe00000, "W,O,R", OP_C4X }, \ 769*3d8817e4Smiod { name, opcode|0x30600000, 0xffe00000, "C,O,R", OP_C4X }, \ 770*3d8817e4Smiod { name "3", opcode|0x20000000, 0xffe00000, "E,G;R", level }, \ 771*3d8817e4Smiod { name "3", opcode|0x20200000, 0xffe00000, "E,J,R", level }, \ 772*3d8817e4Smiod { name "3", opcode|0x20400000, 0xffe00000, "I,G;R", level }, \ 773*3d8817e4Smiod { name "3", opcode|0x20600000, 0xffe00000, "I,J,R", level }, \ 774*3d8817e4Smiod { name "3", opcode|0x30000000, 0xffe00000, "W,G;R", OP_C4X }, \ 775*3d8817e4Smiod { name "3", opcode|0x30200000, 0xffe00000, "C,G;R", OP_C4X }, \ 776*3d8817e4Smiod { name "3", opcode|0x30400000, 0xffe00000, "W,O,R", OP_C4X }, \ 777*3d8817e4Smiod { name "3", opcode|0x30600000, 0xffe00000, "C,O,R", OP_C4X } 778*3d8817e4Smiod 779*3d8817e4Smiod /* TC: General commutative 3-operand integer operation 780*3d8817e4Smiod Syntax: <i> src2, src1, dst 781*3d8817e4Smiod <i> src1, src2, dst 782*3d8817e4Smiod src2 = Register (E), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C), Immediate (W) 783*3d8817e4Smiod src1 = Register (G), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (O) 784*3d8817e4Smiod dst = Register (R) 785*3d8817e4Smiod Instr: 6/2 - ADDC3, ADDI3, AND3, MPYI3, OR3, XOR3, C4x: MPYSHI, MPYUHI 786*3d8817e4Smiod Alias: i, i3 787*3d8817e4Smiod */ 788*3d8817e4Smiod #define TC_CLASS_INSN(name, opcode, level) \ 789*3d8817e4Smiod { name, opcode|0x20000000, 0xffe00000, "E,G;R", level }, \ 790*3d8817e4Smiod { name, opcode|0x20200000, 0xffe00000, "E,J,R", level }, \ 791*3d8817e4Smiod { name, opcode|0x20400000, 0xffe00000, "I,G;R", level }, \ 792*3d8817e4Smiod { name, opcode|0x20600000, 0xffe00000, "I,J,R", level }, \ 793*3d8817e4Smiod { name, opcode|0x30000000, 0xffe00000, "W,G;R", OP_C4X }, \ 794*3d8817e4Smiod { name, opcode|0x30000000, 0xffe00000, "G,W,R", OP_C4X }, \ 795*3d8817e4Smiod { name, opcode|0x30200000, 0xffe00000, "C,G;R", OP_C4X }, \ 796*3d8817e4Smiod { name, opcode|0x30200000, 0xffe00000, "G,C,R", OP_C4X }, \ 797*3d8817e4Smiod { name, opcode|0x30400000, 0xffe00000, "W,O,R", OP_C4X }, \ 798*3d8817e4Smiod { name, opcode|0x30400000, 0xffe00000, "O,W,R", OP_C4X }, \ 799*3d8817e4Smiod { name, opcode|0x30600000, 0xffe00000, "C,O,R", OP_C4X }, \ 800*3d8817e4Smiod { name "3", opcode|0x20000000, 0xffe00000, "E,G;R", level }, \ 801*3d8817e4Smiod { name "3", opcode|0x20200000, 0xffe00000, "E,J,R", level }, \ 802*3d8817e4Smiod { name "3", opcode|0x20400000, 0xffe00000, "I,G;R", level }, \ 803*3d8817e4Smiod { name "3", opcode|0x20600000, 0xffe00000, "I,J,R", level }, \ 804*3d8817e4Smiod { name "3", opcode|0x30000000, 0xffe00000, "W,G;R", OP_C4X }, \ 805*3d8817e4Smiod { name "3", opcode|0x30000000, 0xffe00000, "G,W,R", OP_C4X }, \ 806*3d8817e4Smiod { name "3", opcode|0x30200000, 0xffe00000, "C,G;R", OP_C4X }, \ 807*3d8817e4Smiod { name "3", opcode|0x30200000, 0xffe00000, "G,C,R", OP_C4X }, \ 808*3d8817e4Smiod { name "3", opcode|0x30400000, 0xffe00000, "W,O,R", OP_C4X }, \ 809*3d8817e4Smiod { name "3", opcode|0x30400000, 0xffe00000, "O,W,R", OP_C4X }, \ 810*3d8817e4Smiod { name "3", opcode|0x30600000, 0xffe00000, "C,O,R", OP_C4X } 811*3d8817e4Smiod 812*3d8817e4Smiod /* T2: General 3-operand integer operation with 2 args 813*3d8817e4Smiod Syntax: <i> src2, src1 814*3d8817e4Smiod src2 = Register (E), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C), Immediate (W) 815*3d8817e4Smiod src1 = Register (G), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (O) 816*3d8817e4Smiod Instr: 1/0 - CMPI3 817*3d8817e4Smiod Alias: i, i3 818*3d8817e4Smiod */ 819*3d8817e4Smiod #define T2_CLASS_INSN(name, opcode, level) \ 820*3d8817e4Smiod { name, opcode|0x20000000, 0xffe00000, "E,G", level }, \ 821*3d8817e4Smiod { name, opcode|0x20200000, 0xffe00000, "E,J", level }, \ 822*3d8817e4Smiod { name, opcode|0x20400000, 0xffe00000, "I,G", level }, \ 823*3d8817e4Smiod { name, opcode|0x20600000, 0xffe00000, "I,J", level }, \ 824*3d8817e4Smiod { name, opcode|0x30000000, 0xffe00000, "W,G", OP_C4X }, \ 825*3d8817e4Smiod { name, opcode|0x30200000, 0xffe00000, "C,G", OP_C4X }, \ 826*3d8817e4Smiod { name, opcode|0x30400000, 0xffe00000, "W,O", OP_C4X }, \ 827*3d8817e4Smiod { name, opcode|0x30600000, 0xffe00000, "C,O", OP_C4X }, \ 828*3d8817e4Smiod { name "3", opcode|0x20000000, 0xffe00000, "E,G", level }, \ 829*3d8817e4Smiod { name "3", opcode|0x20200000, 0xffe00000, "E,J", level }, \ 830*3d8817e4Smiod { name "3", opcode|0x20400000, 0xffe00000, "I,G", level }, \ 831*3d8817e4Smiod { name "3", opcode|0x20600000, 0xffe00000, "I,J", level }, \ 832*3d8817e4Smiod { name "3", opcode|0x30000000, 0xffe00000, "W,G", OP_C4X }, \ 833*3d8817e4Smiod { name "3", opcode|0x30200000, 0xffe00000, "C,G", OP_C4X }, \ 834*3d8817e4Smiod { name "3", opcode|0x30400000, 0xffe00000, "W,O", OP_C4X }, \ 835*3d8817e4Smiod { name "3", opcode|0x30600000, 0xffe00000, "C,O", OP_C4X } 836*3d8817e4Smiod 837*3d8817e4Smiod /* T2C: General commutative 3-operand integer operation with 2 args 838*3d8817e4Smiod Syntax: <i> src2, src1 - Manual 839*3d8817e4Smiod <i> src1, src2 840*3d8817e4Smiod src2 = Register (E), Indirect 0,1,IR0,IR1 (I), C4x T2: Indirect (C), Immediate (W) 841*3d8817e4Smiod src1 = Register (G), Indirect 0,1,IR0,IR1 (J), C4x T2: Indirect (0) 842*3d8817e4Smiod Instr: 1/0 - TSTB3 843*3d8817e4Smiod Alias: i, i3 844*3d8817e4Smiod */ 845*3d8817e4Smiod #define T2C_CLASS_INSN(name, opcode, level) \ 846*3d8817e4Smiod { name, opcode|0x20000000, 0xffe00000, "E,G", level }, \ 847*3d8817e4Smiod { name, opcode|0x20200000, 0xffe00000, "E,J", level }, \ 848*3d8817e4Smiod { name, opcode|0x20400000, 0xffe00000, "I,G", level }, \ 849*3d8817e4Smiod { name, opcode|0x20600000, 0xffe00000, "I,J", level }, \ 850*3d8817e4Smiod { name, opcode|0x30000000, 0xffe00000, "W,G", OP_C4X }, \ 851*3d8817e4Smiod { name, opcode|0x30000000, 0xffe00000, "G,W", OP_C4X }, \ 852*3d8817e4Smiod { name, opcode|0x30200000, 0xffe00000, "C,G", OP_C4X }, \ 853*3d8817e4Smiod { name, opcode|0x30200000, 0xffe00000, "G,C", OP_C4X }, \ 854*3d8817e4Smiod { name, opcode|0x30400000, 0xffe00000, "W,O", OP_C4X }, \ 855*3d8817e4Smiod { name, opcode|0x30400000, 0xffe00000, "O,W", OP_C4X }, \ 856*3d8817e4Smiod { name, opcode|0x30600000, 0xffe00000, "C,O", OP_C4X }, \ 857*3d8817e4Smiod { name "3", opcode|0x20000000, 0xffe00000, "E,G", level }, \ 858*3d8817e4Smiod { name "3", opcode|0x20200000, 0xffe00000, "E,J", level }, \ 859*3d8817e4Smiod { name "3", opcode|0x20400000, 0xffe00000, "I,G", level }, \ 860*3d8817e4Smiod { name "3", opcode|0x20600000, 0xffe00000, "I,J", level }, \ 861*3d8817e4Smiod { name "3", opcode|0x30000000, 0xffe00000, "W,G", OP_C4X }, \ 862*3d8817e4Smiod { name "3", opcode|0x30000000, 0xffe00000, "G,W", OP_C4X }, \ 863*3d8817e4Smiod { name "3", opcode|0x30200000, 0xffe00000, "C,G", OP_C4X }, \ 864*3d8817e4Smiod { name "3", opcode|0x30200000, 0xffe00000, "G,C", OP_C4X }, \ 865*3d8817e4Smiod { name "3", opcode|0x30400000, 0xffe00000, "W,O", OP_C4X }, \ 866*3d8817e4Smiod { name "3", opcode|0x30400000, 0xffe00000, "O,W", OP_C4X }, \ 867*3d8817e4Smiod { name "3", opcode|0x30600000, 0xffe00000, "C,O", OP_C4X } 868*3d8817e4Smiod 869*3d8817e4Smiod /* Z: Misc operations with or without arguments 870*3d8817e4Smiod Syntax: <i> <arg1>,... 871*3d8817e4Smiod Instr: 16 - RETIc, RETSc, SIGI(c3X), SWI, IDLE, IDLE2, RETIcD, 872*3d8817e4Smiod TRAPc, LATc, LDEP, LDEHI, LDEPE, LDPK, STIK, LDP, IACK 873*3d8817e4Smiod */ 874*3d8817e4Smiod 875*3d8817e4Smiod 876*3d8817e4Smiod /* Define tic4x opcodes for assembler and disassembler. */ 877*3d8817e4Smiod static const tic4x_inst_t tic4x_insts[] = 878*3d8817e4Smiod { 879*3d8817e4Smiod /* Put synonyms after the desired forms in table so that they get 880*3d8817e4Smiod overwritten in the lookup table. The disassembler will thus 881*3d8817e4Smiod print the `proper' mnemonics. Note that the disassembler 882*3d8817e4Smiod only decodes the 11 MSBs, so instructions like ldp @0x500 will 883*3d8817e4Smiod be printed as ldiu 5, dp. Note that with parallel instructions, 884*3d8817e4Smiod the second part is executed before the first part, unless 885*3d8817e4Smiod the sti1||sti2 form is used. We also allow sti2||sti1 886*3d8817e4Smiod which is equivalent to the default sti||sti form. 887*3d8817e4Smiod */ 888*3d8817e4Smiod B_CLASS_INSN( "absf", 0x00000000, OP_C3X ), 889*3d8817e4Smiod P_CLASS_INSN( "absf", "stf", 0xc8000000, OP_C3X ), 890*3d8817e4Smiod A_CLASS_INSN( "absi", 0x00800000, OP_C3X ), 891*3d8817e4Smiod P_CLASS_INSN( "absi", "sti", 0xca000000, OP_C3X ), 892*3d8817e4Smiod A_CLASS_INSN( "addc", 0x01000000, OP_C3X ), 893*3d8817e4Smiod TC_CLASS_INSN( "addc", 0x00000000, OP_C3X ), 894*3d8817e4Smiod B_CLASS_INSN( "addf", 0x01800000, OP_C3X ), 895*3d8817e4Smiod SC_CLASS_INSN( "addf", 0x00800000, OP_C3X ), 896*3d8817e4Smiod QC_CLASS_INSN( "addf", "stf", 0xcc000000, OP_C3X ), 897*3d8817e4Smiod A_CLASS_INSN( "addi", 0x02000000, OP_C3X ), 898*3d8817e4Smiod TC_CLASS_INSN( "addi", 0x01000000, OP_C3X ), 899*3d8817e4Smiod QC_CLASS_INSN( "addi", "sti", 0xce000000, OP_C3X ), 900*3d8817e4Smiod AU_CLASS_INSN( "and", 0x02800000, OP_C3X ), 901*3d8817e4Smiod TC_CLASS_INSN( "and", 0x01800000, OP_C3X ), 902*3d8817e4Smiod QC_CLASS_INSN( "and", "sti", 0xd0000000, OP_C3X ), 903*3d8817e4Smiod AU_CLASS_INSN( "andn", 0x03000000, OP_C3X ), 904*3d8817e4Smiod T_CLASS_INSN( "andn", 0x02000000, OP_C3X ), 905*3d8817e4Smiod A_CLASS_INSN( "ash", 0x03800000, OP_C3X ), 906*3d8817e4Smiod T_CLASS_INSN( "ash", 0x02800000, OP_C3X ), 907*3d8817e4Smiod Q_CLASS_INSN( "ash", "sti", 0xd2000000, OP_C3X ), 908*3d8817e4Smiod J_CLASS_INSN( "bB", "b", 0x68000000, OP_C3X ), 909*3d8817e4Smiod J_CLASS_INSN( "bBd", "bd", 0x68200000, OP_C3X ), 910*3d8817e4Smiod J_CLASS_INSN( "bBaf", "baf", 0x68a00000, OP_C4X ), 911*3d8817e4Smiod J_CLASS_INSN( "bBat", "bat", 0x68600000, OP_C4X ), 912*3d8817e4Smiod { "br", 0x60000000, 0xff000000, "B" , OP_C3X }, /* I_CLASS */ 913*3d8817e4Smiod { "brd", 0x61000000, 0xff000000, "B" , OP_C3X }, /* I_CLASS */ 914*3d8817e4Smiod { "call", 0x62000000, 0xff000000, "B" , OP_C3X }, /* I_CLASS */ 915*3d8817e4Smiod { "callB", 0x70000000, 0xffe00000, "Q" , OP_C3X }, /* JS_CLASS */ 916*3d8817e4Smiod { "callB", 0x72000000, 0xffe00000, "P" , OP_C3X }, /* JS_CLASS */ 917*3d8817e4Smiod B_CLASS_INSN( "cmpf", 0x04000000, OP_C3X ), 918*3d8817e4Smiod S2_CLASS_INSN( "cmpf", 0x03000000, OP_C3X ), 919*3d8817e4Smiod A_CLASS_INSN( "cmpi", 0x04800000, OP_C3X ), 920*3d8817e4Smiod T2_CLASS_INSN( "cmpi", 0x03800000, OP_C3X ), 921*3d8817e4Smiod D_CLASS_INSN( "dbB", "db", 0x6c000000, OP_C3X ), 922*3d8817e4Smiod D_CLASS_INSN( "dbBd", "dbd", 0x6c200000, OP_C3X ), 923*3d8817e4Smiod AF_CLASS_INSN( "fix", 0x05000000, OP_C3X ), 924*3d8817e4Smiod P_CLASS_INSN( "fix", "sti", 0xd4000000, OP_C3X ), 925*3d8817e4Smiod BI_CLASS_INSN( "float", 0x05800000, OP_C3X ), 926*3d8817e4Smiod P_CLASS_INSN( "float", "stf", 0xd6000000, OP_C3X ), 927*3d8817e4Smiod B6_CLASS_INSN( "frieee", 0x1c000000, OP_C4X ), 928*3d8817e4Smiod P_CLASS_INSN( "frieee","stf", 0xf2000000, OP_C4X ), 929*3d8817e4Smiod { "iack", 0x1b200000, 0xffe00000, "@" , OP_C3X }, /* Z_CLASS */ 930*3d8817e4Smiod { "iack", 0x1b400000, 0xffe00000, "*" , OP_C3X }, /* Z_CLASS */ 931*3d8817e4Smiod { "idle", 0x06000000, 0xffffffff, "" , OP_C3X }, /* Z_CLASS */ 932*3d8817e4Smiod { "idlez", 0x06000000, 0xffffffff, "" , OP_C3X }, /* Z_CLASS */ 933*3d8817e4Smiod { "idle2", 0x06000001, 0xffffffff, "" , OP_IDLE2 }, /* Z_CLASS */ 934*3d8817e4Smiod { "laj", 0x63000000, 0xff000000, "B" , OP_C4X }, /* I_CLASS */ 935*3d8817e4Smiod { "lajB", 0x70200000, 0xffe00000, "Q" , OP_C4X }, /* JS_CLASS */ 936*3d8817e4Smiod { "lajB", 0x72200000, 0xffe00000, "P" , OP_C4X }, /* JS_CLASS */ 937*3d8817e4Smiod { "latB", 0x74800000, 0xffe00000, "V" , OP_C4X }, /* Z_CLASS */ 938*3d8817e4Smiod A_CLASS_INSN( "lb0", 0xb0000000, OP_C4X ), 939*3d8817e4Smiod A_CLASS_INSN( "lb1", 0xb0800000, OP_C4X ), 940*3d8817e4Smiod A_CLASS_INSN( "lb2", 0xb1000000, OP_C4X ), 941*3d8817e4Smiod A_CLASS_INSN( "lb3", 0xb1800000, OP_C4X ), 942*3d8817e4Smiod AU_CLASS_INSN( "lbu0", 0xb2000000, OP_C4X ), 943*3d8817e4Smiod AU_CLASS_INSN( "lbu1", 0xb2800000, OP_C4X ), 944*3d8817e4Smiod AU_CLASS_INSN( "lbu2", 0xb3000000, OP_C4X ), 945*3d8817e4Smiod AU_CLASS_INSN( "lbu3", 0xb3800000, OP_C4X ), 946*3d8817e4Smiod AY_CLASS_INSN( "lda", 0x1e800000, OP_C4X ), 947*3d8817e4Smiod B_CLASS_INSN( "lde", 0x06800000, OP_C3X ), 948*3d8817e4Smiod { "ldep", 0x76000000, 0xffe00000, "X,R" , OP_C4X }, /* Z_CLASS */ 949*3d8817e4Smiod B_CLASS_INSN( "ldf", 0x07000000, OP_C3X ), 950*3d8817e4Smiod LL_CLASS_INSN( "ldf", 0xc4000000, OP_C3X ), 951*3d8817e4Smiod P_CLASS_INSN( "ldf", "stf", 0xd8000000, OP_C3X ), 952*3d8817e4Smiod BB_CLASS_INSN( "ldfC", 0x00000000, OP_C3X ), 953*3d8817e4Smiod B6_CLASS_INSN( "ldfi", 0x07800000, OP_C3X ), 954*3d8817e4Smiod { "ldhi", 0x1fe00000, 0xffe00000, "U,R" , OP_C4X }, /* Z_CLASS */ 955*3d8817e4Smiod { "ldhi", 0x1fe00000, 0xffe00000, "#,R" , OP_C4X }, /* Z_CLASS */ 956*3d8817e4Smiod A_CLASS_INSN( "ldi", 0x08000000, OP_C3X ), 957*3d8817e4Smiod LL_CLASS_INSN( "ldi", 0xc6000000, OP_C3X ), 958*3d8817e4Smiod P_CLASS_INSN( "ldi", "sti", 0xda000000, OP_C3X ), 959*3d8817e4Smiod AB_CLASS_INSN( "ldiC", 0x10000000, OP_C3X ), 960*3d8817e4Smiod A6_CLASS_INSN( "ldii", 0x08800000, OP_C3X ), 961*3d8817e4Smiod { "ldp", 0x50700000, 0xffff0000, "#" , OP_C3X }, /* Z_CLASS - synonym for ldiu #,dp */ 962*3d8817e4Smiod B_CLASS_INSN( "ldm", 0x09000000, OP_C3X ), 963*3d8817e4Smiod { "ldpe", 0x76800000, 0xffe00000, "Q,Z" , OP_C4X }, /* Z_CLASS */ 964*3d8817e4Smiod { "ldpk", 0x1F700000, 0xffff0000, "#" , OP_C4X }, /* Z_CLASS */ 965*3d8817e4Smiod A_CLASS_INSN( "lh0", 0xba000000, OP_C4X ), 966*3d8817e4Smiod A_CLASS_INSN( "lh1", 0xba800000, OP_C4X ), 967*3d8817e4Smiod AU_CLASS_INSN( "lhu0", 0xbb000000, OP_C4X ), 968*3d8817e4Smiod AU_CLASS_INSN( "lhu1", 0xbb800000, OP_C4X ), 969*3d8817e4Smiod { "lopower", 0x10800001,0xffffffff, "" , OP_LPWR }, /* Z_CLASS */ 970*3d8817e4Smiod A_CLASS_INSN( "lsh", 0x09800000, OP_C3X ), 971*3d8817e4Smiod T_CLASS_INSN( "lsh", 0x04000000, OP_C3X ), 972*3d8817e4Smiod Q_CLASS_INSN( "lsh", "sti", 0xdc000000, OP_C3X ), 973*3d8817e4Smiod A_CLASS_INSN( "lwl0", 0xb4000000, OP_C4X ), 974*3d8817e4Smiod A_CLASS_INSN( "lwl1", 0xb4800000, OP_C4X ), 975*3d8817e4Smiod A_CLASS_INSN( "lwl2", 0xb5000000, OP_C4X ), 976*3d8817e4Smiod A_CLASS_INSN( "lwl3", 0xb5800000, OP_C4X ), 977*3d8817e4Smiod A_CLASS_INSN( "lwr0", 0xb6000000, OP_C4X ), 978*3d8817e4Smiod A_CLASS_INSN( "lwr1", 0xb6800000, OP_C4X ), 979*3d8817e4Smiod A_CLASS_INSN( "lwr2", 0xb7000000, OP_C4X ), 980*3d8817e4Smiod A_CLASS_INSN( "lwr3", 0xb7800000, OP_C4X ), 981*3d8817e4Smiod { "maxspeed",0x10800000,0xffffffff, "" , OP_LPWR }, /* Z_CLASS */ 982*3d8817e4Smiod A_CLASS_INSN( "mb0", 0xb8000000, OP_C4X ), 983*3d8817e4Smiod A_CLASS_INSN( "mb1", 0xb8800000, OP_C4X ), 984*3d8817e4Smiod A_CLASS_INSN( "mb2", 0xb9000000, OP_C4X ), 985*3d8817e4Smiod A_CLASS_INSN( "mb3", 0xb9800000, OP_C4X ), 986*3d8817e4Smiod A_CLASS_INSN( "mh0", 0xbc000000, OP_C4X ), 987*3d8817e4Smiod A_CLASS_INSN( "mh1", 0xbc800000, OP_C4X ), 988*3d8817e4Smiod A_CLASS_INSN( "mh2", 0xbd000000, OP_C4X ), 989*3d8817e4Smiod A_CLASS_INSN( "mh3", 0xbd800000, OP_C4X ), 990*3d8817e4Smiod B_CLASS_INSN( "mpyf", 0x0a000000, OP_C3X ), 991*3d8817e4Smiod SC_CLASS_INSN( "mpyf", 0x04800000, OP_C3X ), 992*3d8817e4Smiod M_CLASS_INSN( "mpyf", "addf", 0x80000000, OP_C3X ), 993*3d8817e4Smiod QC_CLASS_INSN( "mpyf", "stf", 0xde000000, OP_C3X ), 994*3d8817e4Smiod M_CLASS_INSN( "mpyf", "subf", 0x84000000, OP_C3X ), 995*3d8817e4Smiod A_CLASS_INSN( "mpyi", 0x0a800000, OP_C3X ), 996*3d8817e4Smiod TC_CLASS_INSN( "mpyi", 0x05000000, OP_C3X ), 997*3d8817e4Smiod M_CLASS_INSN( "mpyi", "addi", 0x88000000, OP_C3X ), 998*3d8817e4Smiod QC_CLASS_INSN( "mpyi", "sti", 0xe0000000, OP_C3X ), 999*3d8817e4Smiod M_CLASS_INSN( "mpyi", "subi", 0x8c000000, OP_C3X ), 1000*3d8817e4Smiod A_CLASS_INSN( "mpyshi", 0x1d800000, OP_C4X ), 1001*3d8817e4Smiod TC_CLASS_INSN( "mpyshi", 0x28800000, OP_C4X ), 1002*3d8817e4Smiod A_CLASS_INSN( "mpyuhi", 0x1e000000, OP_C4X ), 1003*3d8817e4Smiod TC_CLASS_INSN( "mpyuhi", 0x29000000, OP_C4X ), 1004*3d8817e4Smiod A_CLASS_INSN( "negb", 0x0b000000, OP_C3X ), 1005*3d8817e4Smiod B_CLASS_INSN( "negf", 0x0b800000, OP_C3X ), 1006*3d8817e4Smiod P_CLASS_INSN( "negf", "stf", 0xe2000000, OP_C3X ), 1007*3d8817e4Smiod A_CLASS_INSN( "negi", 0x0c000000, OP_C3X ), 1008*3d8817e4Smiod P_CLASS_INSN( "negi", "sti", 0xe4000000, OP_C3X ), 1009*3d8817e4Smiod A2_CLASS_INSN( "nop", 0x0c800000, OP_C3X ), 1010*3d8817e4Smiod B_CLASS_INSN( "norm", 0x0d000000, OP_C3X ), 1011*3d8817e4Smiod AU_CLASS_INSN( "not", 0x0d800000, OP_C3X ), 1012*3d8817e4Smiod P_CLASS_INSN( "not", "sti", 0xe6000000, OP_C3X ), 1013*3d8817e4Smiod AU_CLASS_INSN( "or", 0x10000000, OP_C3X ), 1014*3d8817e4Smiod TC_CLASS_INSN( "or", 0x05800000, OP_C3X ), 1015*3d8817e4Smiod QC_CLASS_INSN( "or", "sti", 0xe8000000, OP_C3X ), 1016*3d8817e4Smiod R_CLASS_INSN( "pop", 0x0e200000, OP_C3X ), 1017*3d8817e4Smiod RF_CLASS_INSN( "popf", 0x0ea00000, OP_C3X ), 1018*3d8817e4Smiod R_CLASS_INSN( "push", 0x0f200000, OP_C3X ), 1019*3d8817e4Smiod RF_CLASS_INSN( "pushf", 0x0fa00000, OP_C3X ), 1020*3d8817e4Smiod BA_CLASS_INSN( "rcpf", 0x1d000000, OP_C4X ), 1021*3d8817e4Smiod { "retiB", 0x78000000, 0xffe00000, "" , OP_C3X }, /* Z_CLASS */ 1022*3d8817e4Smiod { "reti", 0x78000000, 0xffe00000, "" , OP_C3X }, /* Z_CLASS - Alias for retiu */ 1023*3d8817e4Smiod { "retiBd", 0x78200000, 0xffe00000, "" , OP_C4X }, /* Z_CLASS */ 1024*3d8817e4Smiod { "retid", 0x78200000, 0xffe00000, "" , OP_C4X }, /* Z_CLASS - Alias for retiud */ 1025*3d8817e4Smiod { "retsB", 0x78800000, 0xffe00000, "" , OP_C3X }, /* Z_CLASS */ 1026*3d8817e4Smiod { "rets", 0x78800000, 0xffe00000, "" , OP_C3X }, /* Z_CLASS - Alias for retsu */ 1027*3d8817e4Smiod B_CLASS_INSN( "rnd", 0x11000000, OP_C3X ), 1028*3d8817e4Smiod R_CLASS_INSN( "rol", 0x11e00001, OP_C3X ), 1029*3d8817e4Smiod R_CLASS_INSN( "rolc", 0x12600001, OP_C3X ), 1030*3d8817e4Smiod R_CLASS_INSN( "ror", 0x12e0ffff, OP_C3X ), 1031*3d8817e4Smiod R_CLASS_INSN( "rorc", 0x1360ffff, OP_C3X ), 1032*3d8817e4Smiod { "rptb", 0x64000000, 0xff000000, "B" , OP_C3X }, /* I2_CLASS */ 1033*3d8817e4Smiod { "rptb", 0x79000000, 0xff000000, "Q" , OP_C4X }, /* I2_CLASS */ 1034*3d8817e4Smiod { "rptbd", 0x65000000, 0xff000000, "B" , OP_C4X }, /* I2_CLASS */ 1035*3d8817e4Smiod { "rptbd", 0x79800000, 0xff000000, "Q" , OP_C4X }, /* I2_CLASS */ 1036*3d8817e4Smiod A3_CLASS_INSN( "rpts", 0x139b0000, OP_C3X ), 1037*3d8817e4Smiod B_CLASS_INSN( "rsqrf", 0x1c800000, OP_C4X ), 1038*3d8817e4Smiod { "sigi", 0x16000000, 0xffe00000, "" , OP_C3X }, /* Z_CLASS */ 1039*3d8817e4Smiod A6_CLASS_INSN( "sigi", 0x16000000, OP_C4X ), 1040*3d8817e4Smiod B7_CLASS_INSN( "stf", 0x14000000, OP_C3X ), 1041*3d8817e4Smiod LS_CLASS_INSN( "stf", 0xc0000000, OP_C3X ), 1042*3d8817e4Smiod B7_CLASS_INSN( "stfi", 0x14800000, OP_C3X ), 1043*3d8817e4Smiod A7_CLASS_INSN( "sti", 0x15000000, OP_C3X ), 1044*3d8817e4Smiod { "sti", 0x15000000, 0xffe00000, "T,@" , OP_C4X }, /* Class A7 - Alias for stik */ 1045*3d8817e4Smiod { "sti", 0x15600000, 0xffe00000, "T,*" , OP_C4X }, /* Class A7 */ 1046*3d8817e4Smiod LS_CLASS_INSN( "sti", 0xc2000000, OP_C3X ), 1047*3d8817e4Smiod A7_CLASS_INSN( "stii", 0x15800000, OP_C3X ), 1048*3d8817e4Smiod { "stik", 0x15000000, 0xffe00000, "T,@" , OP_C4X }, /* Z_CLASS */ 1049*3d8817e4Smiod { "stik", 0x15600000, 0xffe00000, "T,*" , OP_C4X }, /* Z_CLASS */ 1050*3d8817e4Smiod A_CLASS_INSN( "subb", 0x16800000, OP_C3X ), 1051*3d8817e4Smiod T_CLASS_INSN( "subb", 0x06000000, OP_C3X ), 1052*3d8817e4Smiod A_CLASS_INSN( "subc", 0x17000000, OP_C3X ), 1053*3d8817e4Smiod B_CLASS_INSN( "subf", 0x17800000, OP_C3X ), 1054*3d8817e4Smiod S_CLASS_INSN( "subf", 0x06800000, OP_C3X ), 1055*3d8817e4Smiod Q_CLASS_INSN( "subf", "stf", 0xea000000, OP_C3X ), 1056*3d8817e4Smiod A_CLASS_INSN( "subi", 0x18000000, OP_C3X ), 1057*3d8817e4Smiod T_CLASS_INSN( "subi", 0x07000000, OP_C3X ), 1058*3d8817e4Smiod Q_CLASS_INSN( "subi", "sti", 0xec000000, OP_C3X ), 1059*3d8817e4Smiod A_CLASS_INSN( "subrb", 0x18800000, OP_C3X ), 1060*3d8817e4Smiod B_CLASS_INSN( "subrf", 0x19000000, OP_C3X ), 1061*3d8817e4Smiod A_CLASS_INSN( "subri", 0x19800000, OP_C3X ), 1062*3d8817e4Smiod { "swi", 0x66000000, 0xffffffff, "" , OP_C3X }, /* Z_CLASS */ 1063*3d8817e4Smiod B_CLASS_INSN( "toieee", 0x1b800000, OP_C4X ), 1064*3d8817e4Smiod P_CLASS_INSN( "toieee","stf", 0xf0000000, OP_C4X ), 1065*3d8817e4Smiod { "trapB", 0x74000000, 0xffe00000, "V" , OP_C3X }, /* Z_CLASS */ 1066*3d8817e4Smiod { "trap", 0x74000000, 0xffe00000, "V" , OP_C3X }, /* Z_CLASS - Alias for trapu */ 1067*3d8817e4Smiod AU_CLASS_INSN( "tstb", 0x1a000000, OP_C3X ), 1068*3d8817e4Smiod T2C_CLASS_INSN("tstb", 0x07800000, OP_C3X ), 1069*3d8817e4Smiod AU_CLASS_INSN( "xor", 0x1a800000, OP_C3X ), 1070*3d8817e4Smiod TC_CLASS_INSN( "xor", 0x08000000, OP_C3X ), 1071*3d8817e4Smiod QC_CLASS_INSN( "xor", "sti", 0xee000000, OP_C3X ), 1072*3d8817e4Smiod 1073*3d8817e4Smiod /* Dummy entry, not included in tic4x_num_insts. This 1074*3d8817e4Smiod lets code examine entry i + 1 without checking 1075*3d8817e4Smiod if we've run off the end of the table. */ 1076*3d8817e4Smiod { "", 0x0, 0x00, "", 0 } 1077*3d8817e4Smiod }; 1078*3d8817e4Smiod 1079*3d8817e4Smiod const unsigned int tic4x_num_insts = (((sizeof tic4x_insts) / (sizeof tic4x_insts[0])) - 1); 1080