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