Zoran Jovanovic | 87d13e5 | 2014-03-20 10:18:24 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // MicroMIPS Base Classes |
| 3 | //===----------------------------------------------------------------------===// |
| 4 | |
| 5 | // |
| 6 | // Base class for MicroMips instructions. |
| 7 | // This class does not depend on the instruction size. |
| 8 | // |
| 9 | class MicroMipsInstBase<dag outs, dag ins, string asmstr, list<dag> pattern, |
| 10 | InstrItinClass itin, Format f> : Instruction |
| 11 | { |
| 12 | let Namespace = "Mips"; |
| 13 | let DecoderNamespace = "MicroMips"; |
| 14 | |
| 15 | let OutOperandList = outs; |
| 16 | let InOperandList = ins; |
| 17 | |
| 18 | let AsmString = asmstr; |
| 19 | let Pattern = pattern; |
| 20 | let Itinerary = itin; |
| 21 | |
| 22 | let Predicates = [InMicroMips]; |
| 23 | |
| 24 | Format Form = f; |
| 25 | } |
| 26 | |
| 27 | // |
| 28 | // Base class for MicroMIPS 16-bit instructions. |
| 29 | // |
| 30 | class MicroMipsInst16<dag outs, dag ins, string asmstr, list<dag> pattern, |
| 31 | InstrItinClass itin, Format f> : |
| 32 | MicroMipsInstBase<outs, ins, asmstr, pattern, itin, f> |
| 33 | { |
| 34 | let Size = 2; |
| 35 | field bits<16> Inst; |
| 36 | field bits<16> SoftFail = 0; |
| 37 | bits<6> Opcode = 0x0; |
| 38 | } |
| 39 | |
| 40 | //===----------------------------------------------------------------------===// |
| 41 | // MicroMIPS 16-bit Instruction Formats |
| 42 | //===----------------------------------------------------------------------===// |
| 43 | |
Zoran Jovanovic | 592239d | 2014-10-21 08:44:58 +0000 | [diff] [blame] | 44 | class ARITH_FM_MM16<bit funct> { |
| 45 | bits<3> rd; |
| 46 | bits<3> rt; |
| 47 | bits<3> rs; |
| 48 | |
| 49 | bits<16> Inst; |
| 50 | |
| 51 | let Inst{15-10} = 0x01; |
| 52 | let Inst{9-7} = rd; |
| 53 | let Inst{6-4} = rt; |
| 54 | let Inst{3-1} = rs; |
| 55 | let Inst{0} = funct; |
| 56 | } |
| 57 | |
Zoran Jovanovic | 8853171 | 2014-11-05 17:31:00 +0000 | [diff] [blame] | 58 | class ANDI_FM_MM16<bits<6> funct> { |
| 59 | bits<3> rd; |
| 60 | bits<3> rs; |
| 61 | bits<4> imm; |
| 62 | |
| 63 | bits<16> Inst; |
| 64 | |
| 65 | let Inst{15-10} = funct; |
| 66 | let Inst{9-7} = rd; |
| 67 | let Inst{6-4} = rs; |
| 68 | let Inst{3-0} = imm; |
| 69 | } |
| 70 | |
Zoran Jovanovic | 81ceebc | 2014-10-21 08:32:40 +0000 | [diff] [blame] | 71 | class LOGIC_FM_MM16<bits<4> funct> { |
| 72 | bits<3> rt; |
| 73 | bits<3> rs; |
| 74 | |
| 75 | bits<16> Inst; |
| 76 | |
| 77 | let Inst{15-10} = 0x11; |
| 78 | let Inst{9-6} = funct; |
| 79 | let Inst{5-3} = rt; |
| 80 | let Inst{2-0} = rs; |
| 81 | } |
| 82 | |
Zoran Jovanovic | 4a00fdc | 2014-10-23 10:42:01 +0000 | [diff] [blame] | 83 | class SHIFT_FM_MM16<bits<1> funct> { |
| 84 | bits<3> rd; |
| 85 | bits<3> rt; |
| 86 | bits<3> shamt; |
| 87 | |
| 88 | bits<16> Inst; |
| 89 | |
| 90 | let Inst{15-10} = 0x09; |
| 91 | let Inst{9-7} = rd; |
| 92 | let Inst{6-4} = rt; |
| 93 | let Inst{3-1} = shamt; |
| 94 | let Inst{0} = funct; |
| 95 | } |
| 96 | |
Zoran Jovanovic | bac3619 | 2014-10-23 11:06:34 +0000 | [diff] [blame] | 97 | class ADDIUR2_FM_MM16 { |
| 98 | bits<3> rd; |
| 99 | bits<3> rs; |
| 100 | bits<3> imm; |
| 101 | |
| 102 | bits<16> Inst; |
| 103 | |
| 104 | let Inst{15-10} = 0x1b; |
| 105 | let Inst{9-7} = rd; |
| 106 | let Inst{6-4} = rs; |
| 107 | let Inst{3-1} = imm; |
| 108 | let Inst{0} = 0; |
| 109 | } |
| 110 | |
Jozef Kolek | e8c9d1e | 2014-11-24 14:39:13 +0000 | [diff] [blame] | 111 | class LOAD_STORE_FM_MM16<bits<6> op> { |
| 112 | bits<3> rt; |
| 113 | bits<7> addr; |
| 114 | |
| 115 | bits<16> Inst; |
| 116 | |
| 117 | let Inst{15-10} = op; |
| 118 | let Inst{9-7} = rt; |
| 119 | let Inst{6-4} = addr{6-4}; |
| 120 | let Inst{3-0} = addr{3-0}; |
| 121 | } |
| 122 | |
Jozef Kolek | 12c6982 | 2014-12-23 16:16:33 +0000 | [diff] [blame^] | 123 | class LOAD_STORE_SP_FM_MM16<bits<6> op> { |
| 124 | bits<5> rt; |
| 125 | bits<5> offset; |
| 126 | |
| 127 | bits<16> Inst; |
| 128 | |
| 129 | let Inst{15-10} = op; |
| 130 | let Inst{9-5} = rt; |
| 131 | let Inst{4-0} = offset; |
| 132 | } |
| 133 | |
Zoran Jovanovic | b26f889 | 2014-10-10 13:45:34 +0000 | [diff] [blame] | 134 | class ADDIUS5_FM_MM16 { |
| 135 | bits<5> rd; |
| 136 | bits<4> imm; |
| 137 | |
| 138 | bits<16> Inst; |
| 139 | |
| 140 | let Inst{15-10} = 0x13; |
| 141 | let Inst{9-5} = rd; |
| 142 | let Inst{4-1} = imm; |
| 143 | let Inst{0} = 0; |
| 144 | } |
| 145 | |
Zoran Jovanovic | 98bd58c | 2014-10-10 14:37:30 +0000 | [diff] [blame] | 146 | class ADDIUSP_FM_MM16 { |
| 147 | bits<9> imm; |
| 148 | |
| 149 | bits<16> Inst; |
| 150 | |
| 151 | let Inst{15-10} = 0x13; |
| 152 | let Inst{9-1} = imm; |
| 153 | let Inst{0} = 1; |
| 154 | } |
| 155 | |
Zoran Jovanovic | 87d13e5 | 2014-03-20 10:18:24 +0000 | [diff] [blame] | 156 | class MOVE_FM_MM16<bits<6> funct> { |
| 157 | bits<5> rs; |
| 158 | bits<5> rd; |
| 159 | |
| 160 | bits<16> Inst; |
| 161 | |
| 162 | let Inst{15-10} = funct; |
| 163 | let Inst{9-5} = rd; |
| 164 | let Inst{4-0} = rs; |
| 165 | } |
| 166 | |
Zoran Jovanovic | 9bda2f1 | 2014-10-23 10:59:24 +0000 | [diff] [blame] | 167 | class LI_FM_MM16 { |
| 168 | bits<3> rd; |
| 169 | bits<7> imm; |
| 170 | |
| 171 | bits<16> Inst; |
| 172 | |
| 173 | let Inst{15-10} = 0x3b; |
| 174 | let Inst{9-7} = rd; |
| 175 | let Inst{6-0} = imm; |
| 176 | } |
| 177 | |
Zoran Jovanovic | 87d13e5 | 2014-03-20 10:18:24 +0000 | [diff] [blame] | 178 | class JALR_FM_MM16<bits<5> op> { |
| 179 | bits<5> rs; |
| 180 | |
| 181 | bits<16> Inst; |
| 182 | |
| 183 | let Inst{15-10} = 0x11; |
| 184 | let Inst{9-5} = op; |
| 185 | let Inst{4-0} = rs; |
| 186 | } |
| 187 | |
Zoran Jovanovic | cabf0f4 | 2014-04-03 12:47:34 +0000 | [diff] [blame] | 188 | class MFHILO_FM_MM16<bits<5> funct> { |
| 189 | bits<5> rd; |
| 190 | |
| 191 | bits<16> Inst; |
| 192 | |
| 193 | let Inst{15-10} = 0x11; |
| 194 | let Inst{9-5} = funct; |
| 195 | let Inst{4-0} = rd; |
| 196 | } |
| 197 | |
Zoran Jovanovic | c74e3eb9 | 2014-09-12 14:29:54 +0000 | [diff] [blame] | 198 | class JRADDIUSP_FM_MM16<bits<5> op> { |
| 199 | bits<5> rs; |
| 200 | bits<5> imm; |
| 201 | |
| 202 | bits<16> Inst; |
| 203 | |
| 204 | let Inst{15-10} = 0x11; |
| 205 | let Inst{9-5} = op; |
| 206 | let Inst{4-0} = imm; |
| 207 | } |
| 208 | |
Zoran Jovanovic | 42b8444 | 2014-10-23 11:13:59 +0000 | [diff] [blame] | 209 | class ADDIUR1SP_FM_MM16 { |
| 210 | bits<3> rd; |
| 211 | bits<6> imm; |
| 212 | |
| 213 | bits<16> Inst; |
| 214 | |
| 215 | let Inst{15-10} = 0x1b; |
| 216 | let Inst{9-7} = rd; |
| 217 | let Inst{6-1} = imm; |
| 218 | let Inst{0} = 1; |
| 219 | } |
| 220 | |
Jozef Kolek | 56a6a7d | 2014-11-27 18:18:42 +0000 | [diff] [blame] | 221 | class BRKSDBBP16_FM_MM<bits<6> op> { |
| 222 | bits<4> code_; |
| 223 | bits<16> Inst; |
| 224 | |
| 225 | let Inst{15-10} = 0x11; |
| 226 | let Inst{9-4} = op; |
| 227 | let Inst{3-0} = code_; |
| 228 | } |
| 229 | |
Zoran Jovanovic | 87d13e5 | 2014-03-20 10:18:24 +0000 | [diff] [blame] | 230 | //===----------------------------------------------------------------------===// |
| 231 | // MicroMIPS 32-bit Instruction Formats |
| 232 | //===----------------------------------------------------------------------===// |
| 233 | |
Akira Hatanaka | be6a818 | 2013-04-19 19:03:11 +0000 | [diff] [blame] | 234 | class MMArch { |
| 235 | string Arch = "micromips"; |
| 236 | list<dag> Pattern = []; |
| 237 | } |
| 238 | |
| 239 | class ADD_FM_MM<bits<6> op, bits<10> funct> : MMArch { |
| 240 | bits<5> rt; |
| 241 | bits<5> rs; |
| 242 | bits<5> rd; |
| 243 | |
| 244 | bits<32> Inst; |
| 245 | |
| 246 | let Inst{31-26} = op; |
| 247 | let Inst{25-21} = rt; |
| 248 | let Inst{20-16} = rs; |
| 249 | let Inst{15-11} = rd; |
| 250 | let Inst{10} = 0; |
| 251 | let Inst{9-0} = funct; |
| 252 | } |
| 253 | |
| 254 | class ADDI_FM_MM<bits<6> op> : MMArch { |
| 255 | bits<5> rs; |
| 256 | bits<5> rt; |
| 257 | bits<16> imm16; |
| 258 | |
| 259 | bits<32> Inst; |
| 260 | |
| 261 | let Inst{31-26} = op; |
| 262 | let Inst{25-21} = rt; |
| 263 | let Inst{20-16} = rs; |
| 264 | let Inst{15-0} = imm16; |
| 265 | } |
| 266 | |
| 267 | class SLTI_FM_MM<bits<6> op> : MMArch { |
| 268 | bits<5> rt; |
| 269 | bits<5> rs; |
| 270 | bits<16> imm16; |
| 271 | |
| 272 | bits<32> Inst; |
| 273 | |
| 274 | let Inst{31-26} = op; |
Zoran Jovanovic | f4d4d78 | 2013-11-15 08:07:34 +0000 | [diff] [blame] | 275 | let Inst{25-21} = rt; |
| 276 | let Inst{20-16} = rs; |
Akira Hatanaka | be6a818 | 2013-04-19 19:03:11 +0000 | [diff] [blame] | 277 | let Inst{15-0} = imm16; |
| 278 | } |
| 279 | |
| 280 | class LUI_FM_MM : MMArch { |
| 281 | bits<5> rt; |
| 282 | bits<16> imm16; |
| 283 | |
| 284 | bits<32> Inst; |
| 285 | |
| 286 | let Inst{31-26} = 0x10; |
| 287 | let Inst{25-21} = 0xd; |
| 288 | let Inst{20-16} = rt; |
| 289 | let Inst{15-0} = imm16; |
| 290 | } |
| 291 | |
| 292 | class MULT_FM_MM<bits<10> funct> : MMArch { |
| 293 | bits<5> rs; |
| 294 | bits<5> rt; |
| 295 | |
| 296 | bits<32> Inst; |
| 297 | |
| 298 | let Inst{31-26} = 0x00; |
| 299 | let Inst{25-21} = rt; |
| 300 | let Inst{20-16} = rs; |
| 301 | let Inst{15-6} = funct; |
| 302 | let Inst{5-0} = 0x3c; |
| 303 | } |
Akira Hatanaka | cd9b74a | 2013-04-25 01:11:15 +0000 | [diff] [blame] | 304 | |
| 305 | class SRA_FM_MM<bits<10> funct, bit rotate> : MMArch { |
| 306 | bits<5> rd; |
| 307 | bits<5> rt; |
| 308 | bits<5> shamt; |
| 309 | |
| 310 | bits<32> Inst; |
| 311 | |
| 312 | let Inst{31-26} = 0; |
| 313 | let Inst{25-21} = rd; |
| 314 | let Inst{20-16} = rt; |
| 315 | let Inst{15-11} = shamt; |
| 316 | let Inst{10} = rotate; |
| 317 | let Inst{9-0} = funct; |
| 318 | } |
| 319 | |
| 320 | class SRLV_FM_MM<bits<10> funct, bit rotate> : MMArch { |
| 321 | bits<5> rd; |
| 322 | bits<5> rt; |
| 323 | bits<5> rs; |
| 324 | |
| 325 | bits<32> Inst; |
| 326 | |
| 327 | let Inst{31-26} = 0; |
| 328 | let Inst{25-21} = rt; |
| 329 | let Inst{20-16} = rs; |
| 330 | let Inst{15-11} = rd; |
| 331 | let Inst{10} = rotate; |
| 332 | let Inst{9-0} = funct; |
| 333 | } |
Akira Hatanaka | f0aa6c9 | 2013-04-25 01:21:25 +0000 | [diff] [blame] | 334 | |
| 335 | class LW_FM_MM<bits<6> op> : MMArch { |
| 336 | bits<5> rt; |
| 337 | bits<21> addr; |
| 338 | |
| 339 | bits<32> Inst; |
| 340 | |
| 341 | let Inst{31-26} = op; |
| 342 | let Inst{25-21} = rt; |
| 343 | let Inst{20-16} = addr{20-16}; |
| 344 | let Inst{15-0} = addr{15-0}; |
| 345 | } |
Jack Carter | 9770097 | 2013-08-13 20:19:16 +0000 | [diff] [blame] | 346 | |
| 347 | class LWL_FM_MM<bits<4> funct> { |
| 348 | bits<5> rt; |
| 349 | bits<21> addr; |
| 350 | |
| 351 | bits<32> Inst; |
| 352 | |
| 353 | let Inst{31-26} = 0x18; |
| 354 | let Inst{25-21} = rt; |
| 355 | let Inst{20-16} = addr{20-16}; |
| 356 | let Inst{15-12} = funct; |
| 357 | let Inst{11-0} = addr{11-0}; |
| 358 | } |
Vladimir Medic | e0fbb44 | 2013-09-06 12:41:17 +0000 | [diff] [blame] | 359 | |
| 360 | class CMov_F_I_FM_MM<bits<7> func> : MMArch { |
| 361 | bits<5> rd; |
| 362 | bits<5> rs; |
| 363 | bits<3> fcc; |
| 364 | |
| 365 | bits<32> Inst; |
| 366 | |
| 367 | let Inst{31-26} = 0x15; |
| 368 | let Inst{25-21} = rd; |
| 369 | let Inst{20-16} = rs; |
| 370 | let Inst{15-13} = fcc; |
| 371 | let Inst{12-6} = func; |
| 372 | let Inst{5-0} = 0x3b; |
| 373 | } |
Vladimir Medic | 457ba56 | 2013-09-06 12:53:21 +0000 | [diff] [blame] | 374 | |
| 375 | class MTLO_FM_MM<bits<10> funct> : MMArch { |
| 376 | bits<5> rs; |
| 377 | |
| 378 | bits<32> Inst; |
| 379 | |
| 380 | let Inst{31-26} = 0x00; |
| 381 | let Inst{25-21} = 0x00; |
| 382 | let Inst{20-16} = rs; |
| 383 | let Inst{15-6} = funct; |
| 384 | let Inst{5-0} = 0x3c; |
| 385 | } |
| 386 | |
| 387 | class MFLO_FM_MM<bits<10> funct> : MMArch { |
| 388 | bits<5> rd; |
| 389 | |
| 390 | bits<32> Inst; |
| 391 | |
| 392 | let Inst{31-26} = 0x00; |
| 393 | let Inst{25-21} = 0x00; |
| 394 | let Inst{20-16} = rd; |
| 395 | let Inst{15-6} = funct; |
| 396 | let Inst{5-0} = 0x3c; |
| 397 | } |
Zoran Jovanovic | ab85278 | 2013-09-14 06:49:25 +0000 | [diff] [blame] | 398 | |
| 399 | class CLO_FM_MM<bits<10> funct> : MMArch { |
| 400 | bits<5> rd; |
| 401 | bits<5> rs; |
| 402 | |
| 403 | bits<32> Inst; |
| 404 | |
| 405 | let Inst{31-26} = 0x00; |
| 406 | let Inst{25-21} = rd; |
| 407 | let Inst{20-16} = rs; |
| 408 | let Inst{15-6} = funct; |
| 409 | let Inst{5-0} = 0x3c; |
| 410 | } |
| 411 | |
| 412 | class SEB_FM_MM<bits<10> funct> : MMArch { |
| 413 | bits<5> rd; |
| 414 | bits<5> rt; |
| 415 | |
| 416 | bits<32> Inst; |
| 417 | |
| 418 | let Inst{31-26} = 0x00; |
| 419 | let Inst{25-21} = rd; |
| 420 | let Inst{20-16} = rt; |
| 421 | let Inst{15-6} = funct; |
| 422 | let Inst{5-0} = 0x3c; |
| 423 | } |
| 424 | |
| 425 | class EXT_FM_MM<bits<6> funct> : MMArch { |
| 426 | bits<5> rt; |
| 427 | bits<5> rs; |
| 428 | bits<5> pos; |
| 429 | bits<5> size; |
| 430 | |
| 431 | bits<32> Inst; |
| 432 | |
| 433 | let Inst{31-26} = 0x00; |
| 434 | let Inst{25-21} = rt; |
| 435 | let Inst{20-16} = rs; |
| 436 | let Inst{15-11} = size; |
| 437 | let Inst{10-6} = pos; |
| 438 | let Inst{5-0} = funct; |
| 439 | } |
Zoran Jovanovic | 507e084 | 2013-10-29 16:38:59 +0000 | [diff] [blame] | 440 | |
| 441 | class J_FM_MM<bits<6> op> : MMArch { |
| 442 | bits<26> target; |
| 443 | |
| 444 | bits<32> Inst; |
| 445 | |
| 446 | let Inst{31-26} = op; |
| 447 | let Inst{25-0} = target; |
| 448 | } |
| 449 | |
| 450 | class JR_FM_MM<bits<8> funct> : MMArch { |
| 451 | bits<5> rs; |
| 452 | |
| 453 | bits<32> Inst; |
| 454 | |
| 455 | let Inst{31-21} = 0x00; |
| 456 | let Inst{20-16} = rs; |
| 457 | let Inst{15-14} = 0x0; |
| 458 | let Inst{13-6} = funct; |
| 459 | let Inst{5-0} = 0x3c; |
| 460 | } |
| 461 | |
Zoran Jovanovic | 87d13e5 | 2014-03-20 10:18:24 +0000 | [diff] [blame] | 462 | class JALR_FM_MM<bits<10> funct> { |
Zoran Jovanovic | 507e084 | 2013-10-29 16:38:59 +0000 | [diff] [blame] | 463 | bits<5> rs; |
| 464 | bits<5> rd; |
| 465 | |
| 466 | bits<32> Inst; |
| 467 | |
| 468 | let Inst{31-26} = 0x00; |
| 469 | let Inst{25-21} = rd; |
| 470 | let Inst{20-16} = rs; |
| 471 | let Inst{15-6} = funct; |
| 472 | let Inst{5-0} = 0x3c; |
| 473 | } |
Zoran Jovanovic | 8a80aa7 | 2013-11-04 14:53:22 +0000 | [diff] [blame] | 474 | |
| 475 | class BEQ_FM_MM<bits<6> op> : MMArch { |
| 476 | bits<5> rs; |
| 477 | bits<5> rt; |
| 478 | bits<16> offset; |
| 479 | |
| 480 | bits<32> Inst; |
| 481 | |
| 482 | let Inst{31-26} = op; |
| 483 | let Inst{25-21} = rt; |
| 484 | let Inst{20-16} = rs; |
| 485 | let Inst{15-0} = offset; |
| 486 | } |
| 487 | |
| 488 | class BGEZ_FM_MM<bits<5> funct> : MMArch { |
| 489 | bits<5> rs; |
| 490 | bits<16> offset; |
| 491 | |
| 492 | bits<32> Inst; |
| 493 | |
| 494 | let Inst{31-26} = 0x10; |
| 495 | let Inst{25-21} = funct; |
| 496 | let Inst{20-16} = rs; |
| 497 | let Inst{15-0} = offset; |
| 498 | } |
| 499 | |
| 500 | class BGEZAL_FM_MM<bits<5> funct> : MMArch { |
| 501 | bits<5> rs; |
| 502 | bits<16> offset; |
| 503 | |
| 504 | bits<32> Inst; |
| 505 | |
| 506 | let Inst{31-26} = 0x10; |
| 507 | let Inst{25-21} = funct; |
| 508 | let Inst{20-16} = rs; |
| 509 | let Inst{15-0} = offset; |
| 510 | } |
Zoran Jovanovic | c18b6d1 | 2013-11-07 14:35:24 +0000 | [diff] [blame] | 511 | |
Zoran Jovanovic | 8e918c3 | 2013-12-19 16:25:00 +0000 | [diff] [blame] | 512 | class SYNC_FM_MM : MMArch { |
| 513 | bits<5> stype; |
| 514 | |
| 515 | bits<32> Inst; |
| 516 | |
| 517 | let Inst{31-26} = 0x00; |
| 518 | let Inst{25-21} = 0x0; |
| 519 | let Inst{20-16} = stype; |
| 520 | let Inst{15-6} = 0x1ad; |
| 521 | let Inst{5-0} = 0x3c; |
| 522 | } |
| 523 | |
| 524 | class BRK_FM_MM : MMArch { |
| 525 | bits<10> code_1; |
| 526 | bits<10> code_2; |
| 527 | bits<32> Inst; |
| 528 | let Inst{31-26} = 0x0; |
| 529 | let Inst{25-16} = code_1; |
| 530 | let Inst{15-6} = code_2; |
| 531 | let Inst{5-0} = 0x07; |
| 532 | } |
| 533 | |
| 534 | class SYS_FM_MM : MMArch { |
| 535 | bits<10> code_; |
| 536 | bits<32> Inst; |
| 537 | let Inst{31-26} = 0x0; |
| 538 | let Inst{25-16} = code_; |
Zoran Jovanovic | 7c6c36d | 2014-02-28 18:17:08 +0000 | [diff] [blame] | 539 | let Inst{15-6} = 0x22d; |
Zoran Jovanovic | 8e918c3 | 2013-12-19 16:25:00 +0000 | [diff] [blame] | 540 | let Inst{5-0} = 0x3c; |
| 541 | } |
| 542 | |
Zoran Jovanovic | a0f5328 | 2014-03-20 10:41:37 +0000 | [diff] [blame] | 543 | class WAIT_FM_MM { |
| 544 | bits<10> code_; |
Zoran Jovanovic | 8e918c3 | 2013-12-19 16:25:00 +0000 | [diff] [blame] | 545 | bits<32> Inst; |
| 546 | |
| 547 | let Inst{31-26} = 0x00; |
Zoran Jovanovic | a0f5328 | 2014-03-20 10:41:37 +0000 | [diff] [blame] | 548 | let Inst{25-16} = code_; |
Zoran Jovanovic | 8e918c3 | 2013-12-19 16:25:00 +0000 | [diff] [blame] | 549 | let Inst{15-6} = 0x24d; |
| 550 | let Inst{5-0} = 0x3c; |
| 551 | } |
| 552 | |
| 553 | class ER_FM_MM<bits<10> funct> : MMArch { |
| 554 | bits<32> Inst; |
| 555 | |
| 556 | let Inst{31-26} = 0x00; |
| 557 | let Inst{25-16} = 0x00; |
| 558 | let Inst{15-6} = funct; |
| 559 | let Inst{5-0} = 0x3c; |
| 560 | } |
| 561 | |
| 562 | class EI_FM_MM<bits<10> funct> : MMArch { |
| 563 | bits<32> Inst; |
| 564 | bits<5> rt; |
| 565 | |
| 566 | let Inst{31-26} = 0x00; |
| 567 | let Inst{25-21} = 0x00; |
| 568 | let Inst{20-16} = rt; |
| 569 | let Inst{15-6} = funct; |
| 570 | let Inst{5-0} = 0x3c; |
| 571 | } |
| 572 | |
Zoran Jovanovic | c18b6d1 | 2013-11-07 14:35:24 +0000 | [diff] [blame] | 573 | class TEQ_FM_MM<bits<6> funct> : MMArch { |
| 574 | bits<5> rs; |
| 575 | bits<5> rt; |
| 576 | bits<4> code_; |
| 577 | |
| 578 | bits<32> Inst; |
| 579 | |
| 580 | let Inst{31-26} = 0x00; |
| 581 | let Inst{25-21} = rt; |
| 582 | let Inst{20-16} = rs; |
| 583 | let Inst{15-12} = code_; |
| 584 | let Inst{11-6} = funct; |
| 585 | let Inst{5-0} = 0x3c; |
| 586 | } |
Zoran Jovanovic | ccb70ca | 2013-11-13 13:15:03 +0000 | [diff] [blame] | 587 | |
| 588 | class TEQI_FM_MM<bits<5> funct> : MMArch { |
| 589 | bits<5> rs; |
| 590 | bits<16> imm16; |
| 591 | |
| 592 | bits<32> Inst; |
| 593 | |
| 594 | let Inst{31-26} = 0x10; |
| 595 | let Inst{25-21} = funct; |
| 596 | let Inst{20-16} = rs; |
| 597 | let Inst{15-0} = imm16; |
| 598 | } |
Zoran Jovanovic | ff9d5f3 | 2013-12-19 16:12:56 +0000 | [diff] [blame] | 599 | |
| 600 | class LL_FM_MM<bits<4> funct> { |
| 601 | bits<5> rt; |
| 602 | bits<21> addr; |
| 603 | |
| 604 | bits<32> Inst; |
| 605 | |
| 606 | let Inst{31-26} = 0x18; |
| 607 | let Inst{25-21} = rt; |
| 608 | let Inst{20-16} = addr{20-16}; |
| 609 | let Inst{15-12} = funct; |
| 610 | let Inst{11-0} = addr{11-0}; |
| 611 | } |
Zoran Jovanovic | ce02486 | 2013-12-20 15:44:08 +0000 | [diff] [blame] | 612 | |
| 613 | class ADDS_FM_MM<bits<2> fmt, bits<8> funct> : MMArch { |
| 614 | bits<5> ft; |
| 615 | bits<5> fs; |
| 616 | bits<5> fd; |
| 617 | |
| 618 | bits<32> Inst; |
| 619 | |
| 620 | let Inst{31-26} = 0x15; |
| 621 | let Inst{25-21} = ft; |
| 622 | let Inst{20-16} = fs; |
| 623 | let Inst{15-11} = fd; |
| 624 | let Inst{10} = 0; |
| 625 | let Inst{9-8} = fmt; |
| 626 | let Inst{7-0} = funct; |
| 627 | |
| 628 | list<dag> Pattern = []; |
| 629 | } |
| 630 | |
| 631 | class LWXC1_FM_MM<bits<9> funct> : MMArch { |
| 632 | bits<5> fd; |
| 633 | bits<5> base; |
| 634 | bits<5> index; |
| 635 | |
| 636 | bits<32> Inst; |
| 637 | |
| 638 | let Inst{31-26} = 0x15; |
| 639 | let Inst{25-21} = index; |
| 640 | let Inst{20-16} = base; |
| 641 | let Inst{15-11} = fd; |
| 642 | let Inst{10-9} = 0x0; |
| 643 | let Inst{8-0} = funct; |
| 644 | } |
| 645 | |
| 646 | class SWXC1_FM_MM<bits<9> funct> : MMArch { |
| 647 | bits<5> fs; |
| 648 | bits<5> base; |
| 649 | bits<5> index; |
| 650 | |
| 651 | bits<32> Inst; |
| 652 | |
| 653 | let Inst{31-26} = 0x15; |
| 654 | let Inst{25-21} = index; |
| 655 | let Inst{20-16} = base; |
| 656 | let Inst{15-11} = fs; |
| 657 | let Inst{10-9} = 0x0; |
| 658 | let Inst{8-0} = funct; |
| 659 | } |
| 660 | |
| 661 | class CEQS_FM_MM<bits<2> fmt> : MMArch { |
| 662 | bits<5> fs; |
| 663 | bits<5> ft; |
| 664 | bits<4> cond; |
| 665 | |
| 666 | bits<32> Inst; |
| 667 | |
| 668 | let Inst{31-26} = 0x15; |
| 669 | let Inst{25-21} = ft; |
| 670 | let Inst{20-16} = fs; |
| 671 | let Inst{15-13} = 0x0; // cc |
| 672 | let Inst{12} = 0; |
| 673 | let Inst{11-10} = fmt; |
| 674 | let Inst{9-6} = cond; |
| 675 | let Inst{5-0} = 0x3c; |
| 676 | } |
| 677 | |
| 678 | class BC1F_FM_MM<bits<5> tf> : MMArch { |
| 679 | bits<16> offset; |
| 680 | |
| 681 | bits<32> Inst; |
| 682 | |
| 683 | let Inst{31-26} = 0x10; |
| 684 | let Inst{25-21} = tf; |
| 685 | let Inst{20-18} = 0x0; // cc |
| 686 | let Inst{17-16} = 0x0; |
| 687 | let Inst{15-0} = offset; |
| 688 | } |
| 689 | |
| 690 | class ROUND_W_FM_MM<bits<1> fmt, bits<8> funct> : MMArch { |
| 691 | bits<5> fd; |
| 692 | bits<5> fs; |
| 693 | |
| 694 | bits<32> Inst; |
| 695 | |
| 696 | let Inst{31-26} = 0x15; |
| 697 | let Inst{25-21} = fd; |
| 698 | let Inst{20-16} = fs; |
| 699 | let Inst{15} = 0; |
| 700 | let Inst{14} = fmt; |
| 701 | let Inst{13-6} = funct; |
| 702 | let Inst{5-0} = 0x3b; |
| 703 | } |
| 704 | |
| 705 | class ABS_FM_MM<bits<2> fmt, bits<7> funct> : MMArch { |
| 706 | bits<5> fd; |
| 707 | bits<5> fs; |
| 708 | |
| 709 | bits<32> Inst; |
| 710 | |
| 711 | let Inst{31-26} = 0x15; |
| 712 | let Inst{25-21} = fd; |
| 713 | let Inst{20-16} = fs; |
| 714 | let Inst{15} = 0; |
| 715 | let Inst{14-13} = fmt; |
| 716 | let Inst{12-6} = funct; |
| 717 | let Inst{5-0} = 0x3b; |
| 718 | } |
Zoran Jovanovic | 8876be3 | 2013-12-25 10:09:27 +0000 | [diff] [blame] | 719 | |
| 720 | class CMov_F_F_FM_MM<bits<9> func, bits<2> fmt> : MMArch { |
| 721 | bits<5> fd; |
| 722 | bits<5> fs; |
| 723 | |
| 724 | bits<32> Inst; |
| 725 | |
| 726 | let Inst{31-26} = 0x15; |
| 727 | let Inst{25-21} = fd; |
| 728 | let Inst{20-16} = fs; |
| 729 | let Inst{15-13} = 0x0; //cc |
| 730 | let Inst{12-11} = 0x0; |
| 731 | let Inst{10-9} = fmt; |
| 732 | let Inst{8-0} = func; |
| 733 | } |
| 734 | |
| 735 | class CMov_I_F_FM_MM<bits<8> funct, bits<2> fmt> : MMArch { |
| 736 | bits<5> fd; |
| 737 | bits<5> fs; |
| 738 | bits<5> rt; |
| 739 | |
| 740 | bits<32> Inst; |
| 741 | |
| 742 | let Inst{31-26} = 0x15; |
| 743 | let Inst{25-21} = rt; |
| 744 | let Inst{20-16} = fs; |
| 745 | let Inst{15-11} = fd; |
| 746 | let Inst{9-8} = fmt; |
| 747 | let Inst{7-0} = funct; |
| 748 | } |
| 749 | |
| 750 | class MFC1_FM_MM<bits<8> funct> : MMArch { |
| 751 | bits<5> rt; |
| 752 | bits<5> fs; |
| 753 | |
| 754 | bits<32> Inst; |
| 755 | |
| 756 | let Inst{31-26} = 0x15; |
| 757 | let Inst{25-21} = rt; |
| 758 | let Inst{20-16} = fs; |
| 759 | let Inst{15-14} = 0x0; |
| 760 | let Inst{13-6} = funct; |
| 761 | let Inst{5-0} = 0x3b; |
| 762 | } |
| 763 | |
| 764 | class MADDS_FM_MM<bits<6> funct>: MMArch { |
| 765 | bits<5> ft; |
| 766 | bits<5> fs; |
| 767 | bits<5> fd; |
| 768 | bits<5> fr; |
| 769 | |
| 770 | bits<32> Inst; |
| 771 | |
| 772 | let Inst{31-26} = 0x15; |
| 773 | let Inst{25-21} = ft; |
| 774 | let Inst{20-16} = fs; |
| 775 | let Inst{15-11} = fd; |
| 776 | let Inst{10-6} = fr; |
| 777 | let Inst{5-0} = funct; |
| 778 | } |
Zoran Jovanovic | 73ff948 | 2014-08-14 12:09:10 +0000 | [diff] [blame] | 779 | |
| 780 | class COMPACT_BRANCH_FM_MM<bits<5> funct> { |
| 781 | bits<5> rs; |
| 782 | bits<16> offset; |
| 783 | |
| 784 | bits<32> Inst; |
| 785 | |
| 786 | let Inst{31-26} = 0x10; |
| 787 | let Inst{25-21} = funct; |
| 788 | let Inst{20-16} = rs; |
| 789 | let Inst{15-0} = offset; |
| 790 | } |
Zoran Jovanovic | 4e7ac4a | 2014-09-12 13:33:33 +0000 | [diff] [blame] | 791 | |
| 792 | class COP0_TLB_FM_MM<bits<10> op> : MMArch { |
| 793 | bits<32> Inst; |
| 794 | |
| 795 | let Inst{31-26} = 0x0; |
| 796 | let Inst{25-16} = 0x0; |
| 797 | let Inst{15-6} = op; |
| 798 | let Inst{5-0} = 0x3c; |
| 799 | } |
Jozef Kolek | dc62fc4 | 2014-11-19 11:25:50 +0000 | [diff] [blame] | 800 | |
| 801 | class SDBBP_FM_MM : MMArch { |
| 802 | bits<10> code_; |
| 803 | |
| 804 | bits<32> Inst; |
| 805 | |
| 806 | let Inst{31-26} = 0x0; |
| 807 | let Inst{25-16} = code_; |
| 808 | let Inst{15-6} = 0x36d; |
| 809 | let Inst{5-0} = 0x3c; |
| 810 | } |
| 811 | |
| 812 | class RDHWR_FM_MM : MMArch { |
| 813 | bits<5> rt; |
| 814 | bits<5> rd; |
| 815 | |
| 816 | bits<32> Inst; |
| 817 | |
| 818 | let Inst{31-26} = 0x0; |
| 819 | let Inst{25-21} = rt; |
| 820 | let Inst{20-16} = rd; |
| 821 | let Inst{15-6} = 0x1ac; |
| 822 | let Inst{5-0} = 0x3c; |
| 823 | } |
Jozef Kolek | 5f95dd2 | 2014-11-19 11:39:12 +0000 | [diff] [blame] | 824 | |
| 825 | class LWXS_FM_MM<bits<10> funct> { |
| 826 | bits<5> rd; |
| 827 | bits<5> base; |
| 828 | bits<5> index; |
| 829 | |
| 830 | bits<32> Inst; |
| 831 | |
| 832 | let Inst{31-26} = 0x0; |
| 833 | let Inst{25-21} = index; |
| 834 | let Inst{20-16} = base; |
| 835 | let Inst{15-11} = rd; |
| 836 | let Inst{10} = 0; |
| 837 | let Inst{9-0} = funct; |
| 838 | } |
Zoran Jovanovic | a4c4b5f | 2014-11-19 16:44:02 +0000 | [diff] [blame] | 839 | |
| 840 | class LWM_FM_MM<bits<4> funct> : MMArch { |
| 841 | bits<5> rt; |
| 842 | bits<21> addr; |
| 843 | |
| 844 | bits<32> Inst; |
| 845 | |
| 846 | let Inst{31-26} = 0x8; |
| 847 | let Inst{25-21} = rt; |
| 848 | let Inst{20-16} = addr{20-16}; |
| 849 | let Inst{15-12} = funct; |
| 850 | let Inst{11-0} = addr{11-0}; |
| 851 | } |
Zoran Jovanovic | f9a0250 | 2014-11-27 18:28:59 +0000 | [diff] [blame] | 852 | |
| 853 | class LWM_FM_MM16<bits<4> funct> : MMArch { |
| 854 | bits<2> rt; |
| 855 | bits<4> addr; |
| 856 | |
| 857 | bits<16> Inst; |
| 858 | |
| 859 | let Inst{15-10} = 0x11; |
| 860 | let Inst{9-6} = funct; |
| 861 | let Inst{5-4} = rt; |
| 862 | let Inst{3-0} = addr; |
| 863 | } |