1 // Simulator definition for the micromips ASE.
2 // Copyright (C) 2005-2016 Free Software Foundation, Inc.
3 // Contributed by Imagination Technologies, Ltd.
4 // Written by Andrew Bennett <andrew.bennett@imgtec.com>
6 // This file is part of the MIPS sim.
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 3 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 :compute:::int:TBASE:BASE:((BASE < 2) ? (16 + BASE) \: BASE)
22 :compute:::int:TRD:RD:((RD < 2) ? (16 + RD) \: RD)
23 :compute:::int:TRS:RS:((RS < 2) ? (16 + RS) \: RS)
24 :compute:::int:TRT:RT:((RT < 2) ? (16 + RT) \: RT)
25 :compute:::int:TRT_S:RT_S:((RT_S == 1 ) ? 17 \: RT_S)
26 :compute:::int:ERT:RT:(compute_movep_src_reg (SD_, RT))
27 :compute:::int:ERS:RS:(compute_movep_src_reg (SD_, RS))
29 :compute:::int:IMM_DEC1:IMMEDIATE:((IMMEDIATE == 7) ? -1 \: ((IMMEDIATE == 0) ? 1 \: IMMEDIATE << 2))
30 :compute:::int:IMM_DEC2:IMMEDIATE:((IMMEDIATE < 8) ? IMMEDIATE \: (IMMEDIATE - 16))
31 :compute:::int:IMM_DEC3:IMMEDIATE:((IMMEDIATE < 2) ? IMMEDIATE + 256 \: ((IMMEDIATE < 256) ? IMMEDIATE \: ((IMMEDIATE < 510) ? IMMEDIATE - 512 \: IMMEDIATE - 768)))
32 :compute:::int:IMM_DEC4:IMMEDIATE:(compute_andi16_imm (SD_, IMMEDIATE))
33 :compute:::int:IMM_DEC5:IMMEDIATE:((IMMEDIATE < 15) ? IMMEDIATE \: -1)
34 :compute:::int:IMM_DEC6:IMMEDIATE:((IMMEDIATE < 127) ? IMMEDIATE \: -1)
36 :compute:::int:SHIFT_DEC:SHIFT:((SHIFT == 0) ? 8 \: SHIFT)
38 :compute:::int:IMM_SHIFT_1BIT:IMMEDIATE:(IMMEDIATE << 1)
39 :compute:::int:IMM_SHIFT_2BIT:IMMEDIATE:(IMMEDIATE << 2)
41 :function:::address_word:delayslot_micromips:address_word target, address_word nia, int delayslot_instruction_size
46 instruction_word delay_insn;
47 sim_events_slip (SD, 1);
50 STATE |= simDELAYSLOT;
51 ENGINE_ISSUE_PREFIX_HOOK();
52 micromips_instruction_decode (SD, CPU, CIA, delayslot_instruction_size);
53 STATE &= ~simDELAYSLOT;
57 :function:::address_word:process_isa_mode:address_word target
61 SD->isa_mode = target & 0x1;
62 return (target & (-(1 << 1)));
65 :function:::address_word:do_micromips_jalr:int rt, int rs, address_word nia, int delayslot_instruction_size
69 GPR[rt] = (nia + delayslot_instruction_size) | ISA_MODE_MICROMIPS;
70 return (process_isa_mode (SD_,
71 delayslot_micromips (SD_, GPR[rs], nia, delayslot_instruction_size)));
74 :function:::address_word:do_micromips_jal:address_word target, address_word nia, int delayslot_instruction_size
78 RA = (nia + delayslot_instruction_size) | ISA_MODE_MICROMIPS;
79 return delayslot_micromips (SD_, target, nia, delayslot_instruction_size);
83 :function:::unsigned32:compute_movep_src_reg:int reg
101 :function:::unsigned32:compute_andi16_imm:int encoded_imm
121 case 14: return 32768;
122 case 15: return 65535;
127 :function:::FP_formats:convert_fmt_micromips:int fmt
133 case 0: return fmt_single;
134 case 1: return fmt_double;
135 case 2: return fmt_ps;
136 default: return fmt_unknown;
140 :function:::FP_formats:convert_fmt_micromips_cvt_d:int fmt
146 case 0: return fmt_single;
147 case 1: return fmt_word;
148 case 2: return fmt_long;
149 default: return fmt_unknown;
154 :function:::FP_formats:convert_fmt_micromips_cvt_s:int fmt
160 case 0: return fmt_double;
161 case 1: return fmt_word;
162 case 2: return fmt_long;
163 default: return fmt_unknown;
168 011011,3.RD,6.IMMEDIATE,1:POOL16E:16::ADDIUR1SP
169 "addiur1sp r<TRD>, <IMMEDIATE>"
173 do_addiu (SD_, SPIDX, TRD, IMMEDIATE << 2);
177 011011,3.RD,3.RS,3.IMMEDIATE,0:POOL16E:16::ADDIUR2
178 "addiur2 r<TRD>, r<TRS>, <IMM_DEC1>"
182 do_addiu (SD_, TRS, TRD, IMM_DEC1);
186 010011,5.RD,4.IMMEDIATE,0:POOL16D:16::ADDIUS5
187 "addius5 r<RD>, <IMM_DEC2>"
191 do_addiu (SD_, RD, RD, IMM_DEC2);
195 010011,9.IMMEDIATE,1:POOL16D:16::ADDIUSP
200 do_addiu (SD_, SPIDX, SPIDX, IMM_DEC3 << 2);
204 000001,3.RD,3.RT,3.RS,0:POOL16A:16::ADDU16
205 "addu16 r<TRD>, r<TRS>, r<TRT>"
209 do_addu (SD_, TRS, TRT, TRD);
213 001011,3.RD,3.RS,4.IMMEDIATE:MICROMIPS:16::ANDI16
214 "andi16 r<TRD>, r<TRS>, <IMM_DEC4>"
218 do_andi (SD_, TRS, TRD, IMM_DEC4);
222 010001,0010,3.RT,3.RS:POOL16C:16::AND16
223 "and16 r<TRT>, r<TRS>"
227 do_and (SD_, TRS, TRT, TRT);
231 110011,10.IMMEDIATE:MICROMIPS:16::B16
236 NIA = delayslot_micromips (SD_, NIA + (EXTEND11 (IMMEDIATE << 1)),
237 NIA, MICROMIPS_DELAYSLOT_SIZE_ANY);
241 100011,3.RS,7.IMMEDIATE:MICROMIPS:16::BEQZ16
242 "beqz16 r<TRS>, <IMMEDIATE>"
247 NIA = delayslot_micromips (SD_, NIA + (EXTEND8 (IMMEDIATE << 1)),
248 NIA, MICROMIPS_DELAYSLOT_SIZE_ANY);
252 101011,3.RS,7.IMMEDIATE:MICROMIPS:16::BNEZ16
253 "bnez16 r<TRS>, <IMMEDIATE>"
258 NIA = delayslot_micromips (SD_, NIA + (EXTEND8 (IMMEDIATE << 1)),
259 NIA, MICROMIPS_DELAYSLOT_SIZE_ANY);
263 010001,101000,4.CODE:POOL16C:16::BREAK16
268 do_break16 (SD_, instruction_0);
272 010001,01110,5.RS:POOL16C:16::JALR16
277 NIA = do_micromips_jalr (SD_, RAIDX, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_32);
281 010001,01111,5.RS:POOL16C:16::JALRS16
286 NIA = do_micromips_jalr (SD_, RAIDX, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_16);
290 010001,01100,5.RS:POOL16C:16::JR16
295 NIA = process_isa_mode (SD_,
296 delayslot_micromips (SD_, GPR[RS], NIA, MICROMIPS_DELAYSLOT_SIZE_ANY));
300 010001,11000,5.IMMEDIATE:POOL16C:16::JRADDIUSP
301 "jraddiusp <IMMEDIATE>"
305 address_word temp = RA;
306 do_addiu (SD_, SPIDX, SPIDX, IMMEDIATE << 2);
307 NIA = process_isa_mode (SD_, temp);
311 010001,01101,5.RS:POOL16C:16::JRC
316 NIA = process_isa_mode (SD_, GPR[RS]);
320 000010,3.RT,3.BASE,4.IMMEDIATE:MICROMIPS:16::LBU16
321 "lbu16 r<TRT>, <IMM_DEC5>(r<TBASE>)"
325 /* LBU can have a negative offset. As the offset argument to do_load is
326 unsigned we need to do the address calcuation before the function call so
327 that the load address has been correctly calculated */
329 GPR[TRT] = do_load (SD_, AccessLength_BYTE, GPR[TBASE] + IMM_DEC5, 0);
333 001010,3.RT,3.BASE,4.IMMEDIATE:MICROMIPS:16::LHU16
334 "lhu16 r<TRT>, <IMM_SHIFT_1BIT>(r<TBASE>)"
338 GPR[TRT] = do_load (SD_, AccessLength_HALFWORD, GPR[TBASE], IMM_SHIFT_1BIT);
342 111011,3.RD,7.IMMEDIATE:MICROMIPS:16::LI16
343 "li16 r<TRD>, <IMM_DEC6>"
351 011010,3.RT,3.BASE,4.IMMEDIATE:MICROMIPS:16::LW16
352 "lw16 r<TRT>, <IMM_SHIFT_2BIT>(r<TBASE>)"
356 GPR[TRT] = EXTEND32 (
357 do_load (SD_, AccessLength_WORD, GPR[TBASE], IMM_SHIFT_2BIT));
360 :%s::::LWMREGS:int lwmregs
365 return "s0, s1, s2, s3, ra";
366 else if (lwmregs == 2)
367 return "s0, s1, s2, ra";
368 else if (lwmregs == 1)
370 else if (lwmregs == 0)
376 010001,0100,2.LWMREGS,4.IMMEDIATE:POOL16C:16::LWM16
377 "lwm16 %s<LWMREGS>, <IMM_SHIFT_2BIT>(sp)"
381 int address = GPR[SPIDX] + IMM_SHIFT_2BIT;
384 for (reg_offset = 0; reg_offset <= LWMREGS; reg_offset++)
385 GPR[16 + reg_offset] = EXTEND32 (
386 do_load (SD_, AccessLength_WORD, address, reg_offset * 4));
388 RA = EXTEND32 (do_load (SD_, AccessLength_WORD, address, reg_offset * 4));
392 011001,3.RT,7.IMMEDIATE:MICROMIPS:16::LWGP
393 "lwgp r<TRT>, <IMM_SHIFT_2BIT>(gp)"
397 GPR[TRT] = EXTEND32 (
398 do_load (SD_, AccessLength_WORD, GPR[28], IMM_SHIFT_2BIT));
402 010010,5.RT,5.IMMEDIATE:MICROMIPS:16::LWSP
403 "lwsp r<RT>, <IMM_SHIFT_2BIT>(sp)"
407 GPR[RT] = EXTEND32 (do_load (SD_, AccessLength_WORD, SP, IMM_SHIFT_2BIT));
411 010001,10000,5.RD:POOL16C:16::MFHI16
420 010001,10010,5.RD:POOL16C:16::MFLO16
429 000011,5.RD,5.RS:MICROMIPS:16::MOVE16
431 "move16 r<RD>, r<RS>"
439 :%s::::DESTREGS:int regs
445 case 0: return "a1, a2,";
446 case 1: return "a1, a3,";
447 case 2: return "a2, a3,";
448 case 3: return "a0, s5,";
449 case 4: return "a0, s6,";
450 case 5: return "a0, a1,";
451 case 6: return "a0, a2,";
452 case 7: return "a0, a3,";
457 100001,3.DESTREGS,3.RT,3.RS,0:MICROMIPS:16::MOVEP
458 "movep %s<DESTREGS> r<ERS>, r<ERT>"
466 if (dest == 0 || dest == 1)
473 if (dest == 0 || dest == 6)
475 else if (dest == 1 || dest == 2 || dest == 7)
481 /* assume dest is 5 */
490 010001,0000,3.RT,3.RS:POOL16C:16::NOT16
491 "not16 r<TRT>, r<TRS>"
495 do_nor (SD_, 0, TRS, TRT);
499 010001,0011,3.RT,3.RS:POOL16C:16::OR16
500 "or16 r<TRT>, r<TRS>"
504 do_or (SD_, TRS, TRT, TRT);
508 100010,3.RT_S,3.BASE,4.IMMEDIATE:MICROMIPS:16::SB16
509 "sb16 r<TRT_S>, <IMMEDIATE>(r<TBASE>)"
513 do_store (SD_, AccessLength_BYTE, GPR[TBASE], IMMEDIATE, GPR[TRT_S]);
517 010001,101100,4.CODE:POOL16C:16::SDBBP16
522 SignalException (DebugBreakPoint, instruction_0);
526 101010,3.RT_S,3.BASE,4.IMMEDIATE:MICROMIPS:16::SH16
527 "sh16 r<TRT_S>, <IMM_SHIFT_1BIT>(r<TBASE>)"
531 do_store (SD_, AccessLength_HALFWORD, GPR[TBASE], IMM_SHIFT_1BIT, GPR[TRT_S]);
535 001001,3.RD,3.RT,3.SHIFT,0:POOL16B:16::SLL16
536 "sll16 r<TRD>, r<TRT>, <SHIFT_DEC>"
540 do_sll (SD_, TRT, TRD, SHIFT_DEC);
544 001001,3.RD,3.RT,3.SHIFT,1:POOL16B:16::SRL16
545 "srl16 r<TRD>, r<TRT>, <SHIFT_DEC>"
549 do_srl (SD_, TRT, TRD, SHIFT_DEC);
553 000001,3.RD,3.RT,3.RS,1:POOL16A:16::SUBU16
554 "subu16 r<TRD>, r<TRS>, r<TRT>"
558 do_subu (SD_, TRS, TRT, TRD);
562 111010,3.RT_S,3.BASE,4.IMMEDIATE:MICROMIPS:16::SW16
563 "sw16 r<TRT_S>, <IMM_SHIFT_2BIT>(r<TBASE>)"
567 do_store (SD_, AccessLength_WORD, GPR[TBASE], IMM_SHIFT_2BIT, GPR[TRT_S]);
571 110010,5.RT,5.IMMEDIATE:MICROMIPS:16::SWSP
572 "swsp r<RT>, <IMM_SHIFT_2BIT>(sp)"
576 do_store (SD_, AccessLength_WORD, SP, IMM_SHIFT_2BIT, GPR[RT]);
580 010001,0101,2.LWMREGS,4.IMMEDIATE:POOL16C:16::SWM16
581 "swm16 %s<LWMREGS>, <IMM_SHIFT_2BIT>(sp)"
585 int address = GPR[SPIDX] + IMM_SHIFT_2BIT;
588 for (reg_offset = 0; reg_offset <= LWMREGS; reg_offset++)
589 do_store (SD_, AccessLength_WORD, address, reg_offset * 4,
590 GPR[16 + reg_offset]);
592 do_store (SD_, AccessLength_WORD, address, reg_offset * 4, RA);
596 010001,0001,3.RT,3.RS:POOL16C:16::XOR16
597 "xor16 r<TRT>, r<TRS>"
601 do_xor (SD_, TRS, TRT, TRT);
605 000000,5.RT,5.RS,5.RD,00100,010000:POOL32A:32::ADD
606 "add r<RD>, r<RS>, r<RT>"
610 do_add (SD_, RS, RT, RD);
614 000100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::ADDI
615 "addi r<RT>, r<RS>, <IMMEDIATE>"
619 do_addi (SD_, RS, RT, IMMEDIATE);
623 001100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::ADDIU
624 "li r<RT>, <IMMEDIATE>":RS==0
625 "addiu r<RT>, r<RS>, <IMMEDIATE>"
629 do_addiu (SD_, RS, RT, IMMEDIATE);
633 011110,3.RS,23.IMMEDIATE:MICROMIPS:32::ADDIUPC
634 "addiupc r<TRS>, <IMM_SHIFT_2BIT>"
638 GPR[TRS] = EXTEND32 ((CIA & ~3) + EXTEND25 (IMM_SHIFT_2BIT));
642 000000,5.RT,5.RS,5.RD,00101,010000:POOL32A:32::ADDU
643 "addu r<RD>, r<RS>, r<RT>"
647 do_addu (SD_, RS, RT, RD);
651 000000,5.RT,5.RS,5.RD,01001,010000:POOL32A:32::AND
652 "and r<RD>, r<RS>, r<RT>"
656 do_and (SD_, RS, RT, RD);
660 110100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::ANDI
661 "andi r<RT>, r<RS>, <IMMEDIATE>"
665 do_andi (SD_, RS, RT, IMMEDIATE);
669 010000,1110,1.TF,3.CC,00,16.IMMEDIATE:POOL32I:32,f::BC1a
670 "bc1%s<TF> <IMMEDIATE>":CC == 0
671 "bc1%s<TF> <CC>, <IMMEDIATE>"
676 if (GETFCC(CC) == TF)
678 address_word dest = NIA + (EXTEND16 (IMMEDIATE) << 1);
679 NIA = delayslot_micromips (SD_, dest, NIA, MICROMIPS_DELAYSLOT_SIZE_ANY);
684 010000,1010,1.TF,3.CC,00,16.IMMEDIATE:POOL32I:32::BC2a
685 "bc2%s<TF> <CC>, <IMMEDIATE>":CC == 0
686 "bc2%s<TF> <CC>, <IMMEDIATE>"
691 100101,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::BEQ
692 "b <IMMEDIATE>":RT == 0 && RS == 0
693 "beq r<RS>, r<RT>, <IMMEDIATE>"
697 address_word offset = EXTEND16 (IMMEDIATE) << 1;
698 if ((signed_word) GPR[RS] == (signed_word) GPR[RT])
699 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
700 MICROMIPS_DELAYSLOT_SIZE_ANY);
703 010000,00010,5.RS,16.IMMEDIATE:POOL32I:32::BGEZ
704 "bgez r<RS>, <IMMEDIATE>"
708 address_word offset = EXTEND16 (IMMEDIATE) << 1;
709 if ((signed_word) GPR[RS] >= 0)
710 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
711 MICROMIPS_DELAYSLOT_SIZE_ANY);
715 010000,00111,5.RS,16.IMMEDIATE:POOL32I:32::BEQZC
716 "beqzc r<RS>, <IMMEDIATE>"
720 address_word offset = EXTEND16 (IMMEDIATE) << 1;
726 010000,00011,5.RS,16.IMMEDIATE:POOL32I:32::BGEZAL
727 "bal <IMMEDIATE>":RS == 0
728 "bgezal r<RS>, <IMMEDIATE>"
732 address_word offset = EXTEND16 (IMMEDIATE) << 1;
735 RA = (NIA + MICROMIPS_DELAYSLOT_SIZE_32) | ISA_MODE_MICROMIPS;
736 if ((signed_word) GPR[RS] >= 0)
737 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
738 MICROMIPS_DELAYSLOT_SIZE_32);
742 010000,00110,5.RS,16.IMMEDIATE:POOL32I:32::BGTZ
743 "bgtz r<RS>, <IMMEDIATE>"
747 address_word offset = EXTEND16 (IMMEDIATE) << 1;
748 if ((signed_word) GPR[RS] > 0)
749 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
750 MICROMIPS_DELAYSLOT_SIZE_ANY);
754 010000,10011,5.RS,16.IMMEDIATE:POOL32I:32::BGEZALS
755 "bal <IMMEDIATE>":RS == 0
756 "bgezals r<RS>, <IMMEDIATE>"
760 address_word offset = EXTEND16 (IMMEDIATE) << 1;
763 RA = (NIA + MICROMIPS_DELAYSLOT_SIZE_16) | ISA_MODE_MICROMIPS;
764 if ((signed_word) GPR[RS] >= 0)
765 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
766 MICROMIPS_DELAYSLOT_SIZE_16);
770 010000,00100,5.RS,16.IMMEDIATE:POOL32I:32::BLEZ
771 "blez r<RS>, <IMMEDIATE>"
775 address_word offset = EXTEND16 (IMMEDIATE) << 1;
776 /* NOTE: The branch occurs AFTER the next instruction has been
778 if ((signed_word) GPR[RS] <= 0)
779 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
780 MICROMIPS_DELAYSLOT_SIZE_ANY);
784 010000,00000,5.RS,16.IMMEDIATE:POOL32I:32::BLTZ
785 "bltz r<RS>, <IMMEDIATE>"
789 address_word offset = EXTEND16 (IMMEDIATE) << 1;
790 if ((signed_word) GPR[RS] < 0)
791 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
792 MICROMIPS_DELAYSLOT_SIZE_ANY);
796 010000,00001,5.RS,16.IMMEDIATE:POOL32I:32::BLTZAL
797 "bltzal r<RS>, <IMMEDIATE>"
801 address_word offset = EXTEND16 (IMMEDIATE) << 1;
804 RA = (NIA + MICROMIPS_DELAYSLOT_SIZE_32) | ISA_MODE_MICROMIPS;
805 /* NOTE: The branch occurs AFTER the next instruction has been
807 if ((signed_word) GPR[RS] < 0)
808 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
809 MICROMIPS_DELAYSLOT_SIZE_32);
812 010000,10001,5.RS,16.IMMEDIATE:POOL32I:32::BLTZALS
813 "bltzals r<RS>, <IMMEDIATE>"
817 address_word offset = EXTEND16 (IMMEDIATE) << 1;
820 RA = (NIA + MICROMIPS_DELAYSLOT_SIZE_16) | ISA_MODE_MICROMIPS;
821 if ((signed_word) GPR[RS] < 0)
822 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
823 MICROMIPS_DELAYSLOT_SIZE_16);
827 101101,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::BNE
828 "bne r<RS>, r<RT>, <IMMEDIATE>"
832 address_word offset = EXTEND16 (IMMEDIATE) << 1;
833 if ((signed_word) GPR[RS] != (signed_word) GPR[RT])
834 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
835 MICROMIPS_DELAYSLOT_SIZE_ANY);
839 010000,00101,5.RS,16.IMMEDIATE:POOL32I:32::BNEZC
840 "bnezc r<RS>, <IMMEDIATE>"
844 address_word offset = EXTEND16 (IMMEDIATE) << 1;
845 if ((signed_word) GPR[RS] != 0)
850 000000,20.CODE,000111:POOL32A:32::BREAK
855 do_break (SD_, instruction_0);
859 001000,5.OP,5.BASE,0110,12.IMMEDIATE:POOL32B:32::CACHE
860 "cache <OP>, <IMMEDIATE>(r<BASE>)"
864 address_word base = GPR[BASE];
865 address_word offset = EXTEND12 (IMMEDIATE);
866 address_word vaddr = loadstore_ea (SD_, base, offset);
867 address_word paddr = vaddr;
868 CacheOp (OP, vaddr, paddr, instruction_0);
872 011000,5.OP,5.BASE,1010011,9.IMMEDIATE:POOL32C:32::CACHEE
873 "cachee <OP>, <IMMEDIATE>(r<BASE>)"
878 010101,5.RT,5.FS,0001000000,111011:POOL32F:32,f::CFC1
883 do_cfc1 (SD_, RT, FS);
887 000000,5.RT,5.IMPL,1100110100,111100:POOL32A:32::CFC2
893 000000,5.RT,5.RS,0100101100,111100:POOL32A:32::CLO
898 do_clo (SD_, RT, RS);
902 000000,5.RT,5.RS,0101101100,111100:POOL32A:32::CLZ
907 do_clz (SD_, RT, RS);
911 000000,23.COFUN,010:POOL32A:32::COP2
917 010101,5.RT,5.FS,0001100000,111011:POOL32F:32,f::CTC1
922 do_ctc1 (SD_, RT, FS);
926 000000,5.RT,5.IMPL,1101110100,111100:POOL32A:32::CTC2
932 000000,00000000001110001101,111100:POOL32A:32::DERET
938 000000,00000,5.RS,0100011101,111100:POOL32A:32::DI
947 000000,5.RT,5.RS,1010101100,111100:POOL32A:32::DIV
952 do_div (SD_, RS, RT);
956 000000,5.RT,5.RS,1011101100,111100:POOL32A:32::DIVU
961 do_divu (SD_, RS, RT);
965 000000,00000000000001100000,000000:POOL32A:32::EHB
971 000000,00000,5.RS,0101011101,111100:POOL32A:32::EI
980 000000,00000000001111001101,111100:POOL32A:32::ERET
987 /* Oops, not yet available */
988 sim_io_printf (SD, "Warning: ERET when SR[ERL] set not supported");
1000 000000,5.RT,5.RS,5.MSBD,5.LSB,101100:POOL32A:32::EXT
1001 "ext r<RT>, r<RS>, <LSB>, <MSBD+1>"
1005 do_ext (SD_, RT, RS, LSB, MSBD);
1009 000000,5.RT,5.RS,5.MSBD,5.LSB,001100:POOL32A:32::INS
1010 "ins r<RT>, r<RS>, <LSB>, <MSBD-LSB+1>"
1014 do_ins (SD_, RT, RS, LSB, MSBD);
1018 110101,26.IMMEDIATE:MICROMIPS:32::J
1019 "j <IMM_SHIFT_1BIT>"
1023 address_word region = (NIA & MASK (63, 27));
1024 NIA = delayslot_micromips (SD_, region | (IMM_SHIFT_1BIT), NIA,
1025 MICROMIPS_DELAYSLOT_SIZE_ANY);
1029 111101,26.IMMEDIATE:MICROMIPS:32::JAL
1030 "jal <IMM_SHIFT_1BIT>"
1034 /* NOTE: The region used is that of the delay slot and NOT the
1035 current instruction */
1036 address_word region = (NIA & MASK (63, 27));
1037 NIA = do_micromips_jal (SD_, (region | (IMM_SHIFT_1BIT)), NIA,
1038 MICROMIPS_DELAYSLOT_SIZE_32);
1042 011101,26.IMMEDIATE:MICROMIPS:32::JALS
1043 "jals <IMM_SHIFT_1BIT>"
1047 address_word region = (NIA & MASK (63, 27));
1048 NIA = do_micromips_jal (SD_, (region | (IMM_SHIFT_1BIT)), NIA,
1049 MICROMIPS_DELAYSLOT_SIZE_16);
1052 000000,5.RT!0,5.RS,0000111100,111100:POOL32A:32::JALR
1053 "jalr r<RS>":RT == 31
1060 NIA = do_micromips_jalr (SD_, RT, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_32);
1063 000000,5.RT,5.RS,0100111100,111100:POOL32A:32::JALRS
1064 "jalrs r<RT>, r<RS>"
1070 NIA = do_micromips_jalr (SD_, RT, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_16);
1074 111100,26.IMMEDIATE:MICROMIPS:32::JALX
1075 "jalx <IMM_SHIFT_2BIT>"
1079 address_word region = (NIA & MASK (63, 26));
1080 NIA = do_micromips_jal (SD_, (region | (IMM_SHIFT_2BIT)) | ISA_MODE_MIPS32,
1081 NIA, MICROMIPS_DELAYSLOT_SIZE_32);
1082 SD->isa_mode = ISA_MODE_MIPS32;
1085 000000,00000,5.RS,0000111100,111100:POOL32A:32::JR
1090 NIA = process_isa_mode (SD_,
1091 delayslot_micromips (SD_, GPR[RS], NIA,
1092 MICROMIPS_DELAYSLOT_SIZE_32));
1096 000000,5.RT,5.RS,0001111100,111100:POOL32A:32::JALR.HB
1097 "jalr.hb r<RT>, r<RS>"
1103 NIA = do_micromips_jalr (SD_, RT, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_32);
1107 000000,5.RT,5.RS,0101111100,111100:POOL32A:32::JALRS.HB
1108 "jalrs.hb r<RT>, r<RS>"
1114 NIA = do_micromips_jalr (SD_, RT, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_16);
1118 000000,00000,5.RS,0111111100,111100:POOL32A:32::JR.HB
1123 NIA = process_isa_mode (SD_,
1124 delayslot_micromips (SD_, GPR[RS], NIA,
1125 MICROMIPS_DELAYSLOT_SIZE_32));
1129 000111,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LB
1130 "lb r<RT>, <IMMEDIATE>(r<BASE>)"
1134 do_lb (SD_, RT, IMMEDIATE, BASE);
1138 011000,5.RT,5.BASE,0110100,9.IMMEDIATE:POOL32C:32::LBE
1139 "lbe r<RT>, <IMMEDIATE>(r<BASE>)"
1144 000101,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LBU
1145 "lbu r<RT>, <IMMEDIATE>(r<BASE>)"
1149 do_lbu (SD_, RT, IMMEDIATE, BASE);
1153 011000,5.RT,5.BASE,0110000,9.IMMEDIATE:POOL32C:32::LBUE
1154 "lbue r<RT>, <IMMEDIATE>(r<BASE>)"
1159 101111,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::LDC1a
1160 "ldc1 f<FT>, <IMMEDIATE>(r<BASE>)"
1164 COP_LD (1, FT, do_load_double (SD_, GPR[BASE], EXTEND16 (IMMEDIATE)));
1168 101111,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::LDC1b
1169 "ldc1 f<FT>, <IMMEDIATE>(r<BASE>)"
1173 COP_LD (1, FT, do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
1174 EXTEND16 (IMMEDIATE)));
1178 001000,5.RT,5.BASE,0010,12.IMMEDIATE:POOL32B:32::LDC2
1179 "ldc2 r<RT>, <IMMEDIATE>(r<BASE>)"
1184 001111,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LH
1185 "lh r<RT>, <IMMEDIATE>(r<BASE>)"
1189 do_lh (SD_, RT, IMMEDIATE, BASE);
1193 011000,5.RT,5.BASE,0110101,9.IMMEDIATE:POOL32C:32::LHE
1194 "lhe r<RT>, <IMMEDIATE>(r<BASE>)"
1199 001101,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LHU
1200 "lhu r<RT>, <IMMEDIATE>(r<BASE>)"
1204 do_lhu (SD_, RT, IMMEDIATE, BASE);
1208 011000,5.RT,5.BASE,0110001,9.IMMEDIATE:POOL32C:32::LHUE
1209 "lhue r<RT>, <IMMEDIATE>(r<BASE>)"
1214 011000,5.RT,5.BASE,0011,12.IMMEDIATE:POOL32C:32::LL
1215 "ll r<RT>, <IMMEDIATE>(r<BASE>)"
1219 do_ll (SD_, RT, EXTEND12 (IMMEDIATE), BASE);
1223 011000,5.RT,5.BASE,0110110,9.IMMEDIATE:POOL32C:32::LLE
1224 "lle r<RT>, <IMMEDIATE>(r<BASE>)"
1229 010000,01101,5.RS,16.IMMEDIATE:POOL32I:32::LUI
1230 "lui r<RS>, <IMMEDIATE>"
1234 do_lui (SD_, RS, IMMEDIATE);
1238 010101,5.INDEX,5.BASE,5.FD,00101,001000:POOL32F:32,f::LUXC1
1239 "luxc1 f<FD>, r<INDEX>(r<BASE>)"
1242 do_luxc1_32 (SD_, FD, INDEX, BASE);
1246 010101,5.INDEX,5.BASE,5.FD,00101,001000:POOL32F:64,f::LUXC1
1247 "luxc1 f<FD>, r<INDEX>(r<BASE>)"
1251 check_u64 (SD_, instruction_0);
1252 do_luxc1_64 (SD_, FD, INDEX, BASE);
1256 111111,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LW
1257 "lw r<RT>, <IMMEDIATE>(r<BASE>)"
1261 do_lw (SD_, RT, IMMEDIATE, BASE);
1265 100111,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::LWC1
1266 "lwc1 f<FT>, <IMMEDIATE>(r<BASE>)"
1270 do_lwc1 (SD_, FT, IMMEDIATE, BASE);
1274 001000,5.RT,5.BASE,0000,12.IMMEDIATE:POOL32B:32::LWC2
1275 "lwc2 r<RT>, <IMMEDIATE>(r<BASE>)"
1280 011000,5.RT,5.BASE,0110111,9.IMMEDIATE:POOL32C:32::LWE
1281 "lwe r<RT>, <IMMEDIATE>(r<BASE>)"
1286 011000,5.RT,5.BASE,0110011,9.IMMEDIATE:POOL32C:32::LWEE
1287 "lwee r<RT>, <IMMEDIATE>(r<BASE>)"
1292 011000,5.RT,5.BASE,0000,12.IMMEDIATE:POOL32C:32::LWL
1293 "lwl r<RT>, <IMMEDIATE>(r<BASE>)"
1297 do_lwl (SD_, RT, EXTEND12 (IMMEDIATE), BASE);
1301 011000,5.RT,5.BASE,0110010,9.IMMEDIATE:POOL32C:32::LWLE
1302 "lwle r<RT>, <IMMEDIATE>(r<BASE>)"
1306 :%s::::LWM32REGS:int lwmregs
1312 switch(lwmregs & 0xf)
1319 return "s0, s1, ra";
1321 return "s0, s1, s2, ra";
1323 return "s0, s1, s2, s3, ra";
1325 return "s0, s1, s2, s3, s4, ra";
1327 return "s0, s1, s2, s3, s4, s5, ra";
1329 return "s0, s1, s2, s3, s4, s5, s6, ra";
1331 return "s0, s1, s2, s3, s4, s5, s6, s7, ra";
1333 return "s0, s1, s2, s3, s4, s5, s6, s7, s8, ra";
1340 switch(lwmregs & 0xf)
1347 return "s0, s1, s2";
1349 return "s0, s1, s2, s3";
1351 return "s0, s1, s2, s3, s4";
1353 return "s0, s1, s2, s3, s4, s5";
1355 return "s0, s1, s2, s3, s4, s5, s6";
1357 return "s0, s1, s2, s3, s4, s5, s6, s7";
1359 return "s0, s1, s2, s3, s4, s5, s6, s7, s8";
1366 001000,5.LWM32REGS,5.BASE,0101,12.IMMEDIATE:POOL32B:32::LWM32
1367 "lwm32 %s<LWM32REGS>, <IMMEDIATE>(r<BASE>)"
1371 int address_base = GPR[BASE] + EXTEND12 (IMMEDIATE);
1373 for (reg_offset = 0; reg_offset < (LWM32REGS & 0xf); reg_offset++)
1375 int dst = (reg_offset == 8) ? 30 : 16 + reg_offset;
1376 GPR[dst] = EXTEND32 (do_load (SD_, AccessLength_WORD, address_base,
1380 if (LWM32REGS & 0x10)
1381 RA = EXTEND32 (do_load (SD_, AccessLength_WORD, address_base,
1386 001000,5.RD,5.BASE,0001,12.IMMEDIATE:POOL32B:32::LWP
1387 "lwp r<RD>, <IMMEDIATE>(r<BASE>)"
1391 if (BASE == RD || RD == 31)
1395 do_lw (SD_, RD, EXTEND12 (IMMEDIATE), BASE);
1396 do_lw (SD_, RD + 1, EXTEND12 (IMMEDIATE) + 4, BASE);
1401 011000,5.RT,5.BASE,0001,12.IMMEDIATE:POOL32C:32::LWR
1402 "lwr r<RT>, <IMMEDIATE>(r<BASE>)"
1406 do_lwr (SD_, RT, EXTEND12 (IMMEDIATE), BASE);
1410 011000,5.RT,5.BASE,1110,12.IMMEDIATE:POOL32C:32::LWU
1411 "lwu r<RT>, <IMMEDIATE>(r<BASE>)"
1415 do_lwu (SD_, RT, IMMEDIATE, BASE, instruction_0);
1419 010101,5.INDEX,5.BASE,5.FD,00001,001000:POOL32F:32,f::LWXC1
1420 "lwxc1 f<FD>, <INDEX>(r<BASE>)"
1424 do_lwxc1 (SD_, FD, INDEX, BASE, instruction_0);
1428 000000,5.INDEX,5.BASE,5.RD,00100,011000:POOL32A:32::LWXS
1429 "lwxs r<RD>, r<INDEX>(r<BASE>)"
1433 GPR[RD] = EXTEND32 (do_load (SD_, AccessLength_WORD, GPR[BASE],
1438 000000,5.RT,5.RS,1100101100,111100:POOL32A:32::MADD
1443 do_madd (SD_, RS, RT);
1447 000000,5.RT,5.RS,1101101100,111100:POOL32A:32::MADDU
1448 "maddu r<RS>, r<RT>"
1452 do_maddu (SD_, RS, RT);
1456 000000,5.RT,5.RS,00,3.SEL,00011,111100:POOL32A:32::MFC0
1457 "mfc0 r<RS>, r<RT>": SEL == 0
1458 "mfc0 r<RS>, r<RT>, <SEL>"
1462 DecodeCoproc (instruction_0, 0, cp0_mfc0, RT, RS, SEL);
1466 010101,5.RT,5.FS,0010000000,111011:POOL32F:32,f::MFC1
1471 do_mfc1b (SD_, RT, FS);
1475 000000,5.RT,5.IMPL,0100110100,111100:POOL32A:32::MFC2
1476 "mfc2 r<RT>, <IMPL>"
1481 010101,5.RT,5.FS,0011000000,111011:POOL32F:32,f::MFHC1
1482 "mfhc1 r<RT>, f<FS>"
1486 do_mfhc1 (SD_, RT, FS);
1490 000000,5.RT,5.IMPL,1000110100,111100:POOL32A:32::MFHC2
1491 "mfhc2 r<RT>, <IMPL>"
1496 000000,00000,5.RS,0000110101,111100:POOL32A:32::MFHI
1505 000000,00000,5.RS,0001110101,111100:POOL32A:32::MFLO
1516 010101,5.RT,5.RS,3.CC,0,1.TF,00101,111011:POOL32F:32::MOVtf
1517 "mov%s<TF> r<RT>, r<RS>, CC"
1521 do_movtf (SD_, TF, RT, RS, CC);
1525 000000,5.RT,5.RS,5.RD,00000,011000:POOL32A:32::MOVN
1526 "movn r<RD>, r<RS>, r<RT>"
1530 do_movn (SD_, RD, RS, RT);
1534 000000,5.RT,5.RS,5.RD,00001,011000:POOL32A:32::MOVZ
1535 "movz r<RD>, r<RS>, r<RT>"
1539 do_movz (SD_, RD, RS, RT);
1543 000000,5.RT,5.RS,1110101100,111100:POOL32A:32::MSUB
1548 do_msub (SD_, RS, RT);
1552 000000,5.RT,5.RS,1111101100,111100:POOL32A:32::MSUBU
1553 "msubu r<RS>, r<RT>"
1557 do_msubu (SD_, RS, RT);
1561 000000,5.RT,5.RS,00,3.SEL,01011,111100:POOL32A:32::MTC0
1562 "mtc0 r<RS>, r<RT>": SEL == 0
1563 "mtc0 r<RS>, r<RT>, <SEL>"
1567 DecodeCoproc (instruction_0, 0, cp0_mtc0, RT, RS, SEL);
1571 010101,5.RT,5.FS,0010100000,111011:POOL32F:32,f::MTC1
1576 do_mtc1b (SD_, RT, FS);
1580 000000,5.RT,5.IMPL,0101110100,111100:POOL32A:32::MTC2
1581 "mtc2 r<RT>, <IMPL>"
1586 010101,5.RT,5.FS,0011100000,111011:POOL32F:32,f::MTHC1
1587 "mthc1 r<RT>, f<FS>"
1591 do_mthc1 (SD_, RT, FS);
1595 000000,5.RT,5.IMPL,1001110100,111100:POOL32A:32::MTHC2
1596 "mthc2 r<RT>, <IMPL>"
1601 000000,00000,5.RS,0010110101,111100:POOL32A:32::MTHI
1610 000000,00000,5.RS,0011110101,111100:POOL32A:32::MTLO
1619 000000,5.RT,5.RS,5.RD,01000,010000:POOL32A:32::MUL
1620 "mul r<RD>, r<RS>, r<RT>"
1624 do_mul (SD_, RD, RS, RT);
1628 000000,5.RT,5.RS,1000101100,111100:POOL32A:32::MULT
1633 do_mult (SD_, RS, RT, 0);
1637 000000,5.RT,5.RS,1001101100,111100:POOL32A:32::MULTU
1642 do_multu (SD_, RS, RT, 0);
1646 000000,00000000000000000000,000000:POOL32A:32::NOP
1654 000000,5.RT,5.RS,5.RD,01011,010000:POOL32A:32::NOR
1655 "nor r<RD>, r<RS>, r<RT>"
1659 do_nor (SD_, RS, RT, RD);
1663 000000,5.RT,5.RS,5.RD,01010,010000:POOL32A:32::OR
1664 "or r<RD>, r<RS>, r<RT>"
1668 do_or (SD_, RS, RT, RD);
1672 010100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::ORI
1673 "ori r<RT>, r<RS>, <IMMEDIATE>"
1677 do_ori (SD_, RS, RT, IMMEDIATE);
1681 000000,00000000000010100000,000000:POOL32A:32::PAUSE
1687 011000,5.HINT,5.BASE,0010,12.IMMEDIATE:POOL32C:32::PREF
1688 "pref <HINT>, <IMMEDIATE>(r<BASE>)"
1692 do_pref (SD_, HINT, EXTEND12 (IMMEDIATE), BASE);
1696 011000,5.HINT,5.BASE,1010010,9.IMMEDIATE:POOL32C:32::PREFE
1697 "prefe <HINT>, <IMMEDIATE>(r<BASE>)"
1702 010101,5.INDEX,5.BASE,5.HINT,00110,100000:POOL32F:32::PREFX
1703 "prefx <HINT>, r<INDEX>(r<BASE>)"
1707 do_prefx (SD_, HINT, INDEX, BASE);
1710 000000,5.RT,5.RS,0110101100,111100:POOL32A:32::RDHWR
1711 "rdhwr r<RS>, r<RT>"
1715 do_rdhwr (SD_, RT, RS);
1718 000000,5.RT,5.RS,1110000101,111100:POOL32A:32::RDPGPR
1719 "rdpgpr r<RS>, r<RT>"
1724 000000,5.RT,5.RS,5.SHIFT,00011,000000:POOL32A:32::ROTR
1725 "rotr r<RT>, r<RS>, <SHIFT>"
1729 GPR[RT] = do_ror (SD_, GPR[RS], SHIFT);
1733 000000,5.RT,5.RS,5.RD,00011,010000:POOL32A:32::ROTRV
1734 "rotrv r<RD>, r<RT>, r<RS>"
1738 GPR[RD] = do_ror (SD_, GPR[RT], GPR[RS]);
1742 000110,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::SB
1743 "sb r<RT>, <IMMEDIATE>(r<BASE>)"
1747 do_store (SD_, AccessLength_BYTE, GPR[BASE], EXTEND16 (IMMEDIATE), GPR[RT]);
1751 011000,5.RT,5.BASE,1010101,9.IMMEDIATE:POOL32C:32::SBE
1752 "sbe r<RT>, <IMMEDIATE>(r<BASE>)"
1757 011000,5.RT,5.BASE,1011,12.IMMEDIATE:POOL32C:32::SC
1758 "sc r<RT>, <IMMEDIATE>(r<BASE>)"
1762 do_sc (SD_, RT, EXTEND12 (IMMEDIATE), BASE, instruction_0);
1766 011000,5.RT,5.BASE,1010110,9.IMMEDIATE:POOL32C:32::SCE
1767 "sce r<RT>, <IMMEDIATE>(r<BASE>)"
1772 000000,10.CODE,1101101101,111100:POOL32A:32::SDBBP
1777 SignalException (DebugBreakPoint, instruction_0);
1781 101110,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::SDC1a
1782 "sdc1 f<FT>, <IMMEDIATE>(r<BASE>)"
1785 do_sdc1 (SD_, FT, IMMEDIATE, BASE);
1789 101110,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::SDC1b
1790 "sdc1 f<FT>, <IMMEDIATE>(r<BASE>)"
1794 do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND16 (IMMEDIATE),
1799 001000,5.RT,5.BASE,1010,12.IMMEDIATE:MICROMIPS:32::SDC2
1800 "sdc2 r<RT>, <IMMEDIATE>(r<BASE>)"
1805 000000,5.RT,5.RS,0010101100,111100:POOL32A:32::SEB
1810 do_seb (SD_, RT, RS);
1814 000000,5.RT,5.RS,0011101100,111100:POOL32A:32::SEH
1819 do_seh (SD_, RT, RS);
1823 001110,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::SH
1824 "sh r<RT>, <IMMEDIATE>(r<BASE>)"
1828 do_store (SD_, AccessLength_HALFWORD, GPR[BASE], EXTEND16 (IMMEDIATE),
1833 011000,5.RT,5.BASE,1010100,9.IMMEDIATE:POOL32C:32::SHE
1834 "she r<RT>, <IMMEDIATE>(r<BASE>)"
1839 000000,5.RT!0,5.RS!0,5.SHIFT,00000,000000:POOL32A:32::SLL
1840 "sll r<RT>, r<RS>, <SHIFT>"
1844 do_sll (SD_, RS, RT, SHIFT);
1848 000000,5.RT,5.RS,5.RD,00000,010000:POOL32A:32::SLLV
1849 "sllv r<RD>, r<RT>, r<RS>"
1853 do_sllv (SD_, RS, RT, RD);
1857 000000,5.RT,5.RS,5.RD,01101,010000:POOL32A:32::SLT
1858 "slt r<RD>, r<RS>, r<RT>"
1862 do_slt (SD_, RS, RT, RD);
1866 100100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::SLTI
1867 "slti r<RT>, r<RS>, <IMMEDIATE>"
1871 do_slti (SD_, RS, RT, IMMEDIATE);
1875 101100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::SLTIU
1876 "sltiu r<RT>, r<RS>, <IMMEDIATE>"
1880 do_sltiu (SD_, RS, RT, IMMEDIATE);
1884 000000,5.RT,5.RS,5.RD,01110,010000:POOL32A:32::SLTU
1885 "sltu r<RD>, r<RS>, r<RT>"
1889 do_sltu (SD_, RS, RT, RD);
1893 000000,5.RT,5.RS,5.SHIFT,00010,000000:POOL32A:32::SRA
1894 "sra r<RT>, r<RS>, <SHIFT>"
1898 do_sra (SD_, RS, RT, SHIFT);
1902 000000,5.RT,5.RS,5.RD,00010,010000:POOL32A:32::SRAV
1903 "srav r<RD>, r<RT>, r<RS>"
1907 do_srav (SD_, RS, RT, RD);
1911 000000,5.RT,5.RS,5.SHIFT,00001,000000:POOL32A:32::SRL
1912 "srl r<RT>, r<RS>, <SHIFT>"
1916 do_srl (SD_, RS, RT, SHIFT);
1920 000000,5.RT,5.RS,5.RD,00001,010000:POOL32A:32::SRLV
1921 "srlv r<RD>, r<RT>, r<RS>"
1925 do_srlv (SD_, RS, RT, RD);
1929 000000,00000000000000100000,000000:POOL32A:32::SSNOP
1937 000000,5.RT,5.RS,5.RD,00110,010000:POOL32A:32::SUB
1938 "sub r<RD>, r<RS>, r<RT>"
1942 do_sub (SD_, RD, RS, RT);
1946 000000,5.RT,5.RS,5.RD,00111,010000:POOL32A:32::SUBU
1947 "subu r<RD>, r<RS>, r<RT>"
1951 do_subu (SD_, RS, RT, RD);
1955 010101,5.INDEX,5.BASE,5.FD,00110,001000:POOL32F:32,f::SUXC1
1956 "suxc1 f<FD>, r<INDEX>(r<BASE>)"
1959 do_suxc1_32 (SD_, FD, INDEX, BASE);
1963 010101,5.INDEX,5.BASE,5.FD,00110,001000:POOL32F:64,f::SUXC1
1964 "suxc1 f<FD>, r<INDEX>(r<BASE>)"
1968 check_u64 (SD_, instruction_0);
1969 do_suxc1_64 (SD_, FD, INDEX, BASE);
1972 111110,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::SW
1973 "sw r<RT>, <IMMEDIATE>(r<BASE>)"
1977 do_store (SD_, AccessLength_WORD, GPR[BASE], EXTEND16 (IMMEDIATE), GPR[RT]);
1981 100110,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::SWC1
1982 "swc1 f<FT>, <IMMEDIATE>(r<BASE>)"
1986 do_swc1 (SD_, FT, IMMEDIATE, BASE, instruction_0);
1990 001000,5.RT,5.BASE,1000,12.IMMEDIATE:POOL32B:32::SWC2
1991 "swc2 r<RT>, <IMMEDIATE>(r<BASE>)"
1996 011000,5.RT,5.BASE,1010111,9.IMMEDIATE:POOL32C:32::SWE
1997 "swe r<RT>, <IMMEDIATE>(r<BASE>)"
2002 011000,5.RT,5.BASE,1000,12.IMMEDIATE:POOL32C:32::SWL
2003 "swl r<RT>, <IMMEDIATE>(r<BASE>)"
2007 do_store_left (SD_, AccessLength_WORD, GPR[BASE], EXTEND12 (IMMEDIATE),
2012 011000,5.RT,5.BASE,1010000,9.IMMEDIATE:POOL32C:32::SWLE
2013 "swle r<RT>, <IMMEDIATE>(r<BASE>)"
2018 001000,5.LWM32REGS,5.BASE,1101,12.IMMEDIATE:POOL32B:32::SWM32
2019 "swm32 %s<LWM32REGS>, <IMMEDIATE>(r<BASE>)"
2023 int address_base = GPR[BASE] + EXTEND12 (IMMEDIATE);
2025 for (reg_offset = 0; reg_offset < (LWM32REGS & 0xf); reg_offset++)
2027 int src = (reg_offset == 8) ? 30 : 16 + reg_offset;
2028 do_store (SD_, AccessLength_WORD, address_base, 4 * reg_offset,
2032 if (LWM32REGS & 0x10)
2033 do_store (SD_, AccessLength_WORD, address_base, 4 * reg_offset, RA);
2037 001000,5.RS1,5.BASE,1001,12.IMMEDIATE:POOL32B:32::SWP
2038 "swp r<RS1>, <IMMEDIATE>(r<BASE>)"
2046 do_sw (SD_, RS1, EXTEND12 (IMMEDIATE), BASE);
2047 do_sw (SD_, RS1 + 1, EXTEND12 (IMMEDIATE) + 4, BASE);
2052 011000,5.RT,5.BASE,1001,12.IMMEDIATE:POOL32C:32::SWR
2053 "swr r<RT>, <IMMEDIATE>(r<BASE>)"
2057 do_store_right (SD_, AccessLength_WORD, GPR[BASE], EXTEND12 (IMMEDIATE),
2062 011000,5.RT,5.BASE,1010001,9.IMMEDIATE:POOL32C:32::SWRE
2063 "swre r<RT>, <IMMEDIATE>(r<BASE>)"
2068 010101,5.INDEX,5.BASE,5.FD,00010,001000:POOL32F:32,f::SWXC1
2069 "swxc1 f<FD>, r<INDEX>(r<BASE>)"
2073 do_swxc1 (SD_, FD, INDEX, BASE, instruction_0);
2077 000000,00000,5.STYPE,0110101101,111100:POOL32A:32::SYNC
2082 SyncOperation (STYPE);
2086 010000,10000,5.BASE,16.IMMEDIATE:POOL32I:32::SYNCI
2087 "synci <IMMEDIATE>(r<BASE>)"
2093 000000,10.CODE,1000101101,111100:POOL32A:32::SYSCALL
2094 "syscall %#lx<CODE>"
2098 SignalException (SystemCall, instruction_0);
2102 000000,5.RT,5.RS,4.CODE,000000,111100:POOL32A:32::TEQ
2107 do_teq (SD_, RS, RT, instruction_0);
2111 010000,01110,5.RS,16.IMMEDIATE:POOL32I:32::TEQI
2112 "teqi r<RS>, <IMMEDIATE>"
2116 do_teqi (SD_, RS, IMMEDIATE, instruction_0);
2120 000000,5.RT,5.RS,4.CODE,001000,111100:POOL32A:32::TGE
2125 do_tge (SD_, RS, RT, instruction_0);
2129 010000,01001,5.RS,16.IMMEDIATE:POOL32I:32::TGEI
2130 "tgei r<RS>, <IMMEDIATE>"
2134 do_tgei (SD_, RS, IMMEDIATE, instruction_0);
2138 010000,01011,5.RS,16.IMMEDIATE:POOL32I:32::TGEIU
2139 "tgeiu r<RS>, <IMMEDIATE>"
2143 do_tgeiu (SD_, RS, IMMEDIATE, instruction_0);
2147 000000,5.RT,5.RS,4.CODE,010000,111100:POOL32A:32::TGEU
2152 do_tgeu (SD_, RS, RT, instruction_0);
2156 000000,00000000000000001101,111100:POOL32A:32::TLBP
2162 000000,00000000000001001101,111100:POOL32A:32::TLBR
2168 000000,00000000000010001101,111100:POOL32A:32::TLBWI
2174 000000,00000000000011001101,111100:POOL32A:32::TLBWR
2180 000000,5.RT,5.RS,4.CODE,100000,111100:POOL32A:32::TLT
2181 "tlt r<RS>, r<RT>, %#lx<CODE>"
2185 do_tlt (SD_, RS, RT, instruction_0);
2189 010000,01000,5.RS,16.IMMEDIATE:POOL32I:32::TLTI
2190 "tlti r<RS>, <IMMEDIATE>"
2194 do_tlti (SD_, RS, IMMEDIATE, instruction_0);
2198 010000,01010,5.RS,16.IMMEDIATE:POOL32I:32::TLTIU
2199 "tltiu r<RS>, <IMMEDIATE>"
2203 do_tltiu (SD_, RS, IMMEDIATE, instruction_0);
2207 000000,5.RT,5.RS,4.CODE,101000,111100:POOL32A:32::TLTU
2212 do_tltu (SD_, RS, RT, instruction_0);
2216 000000,5.RT,5.RS,4.CODE,110000,111100:POOL32A:32::TNE
2221 do_tne (SD_, RS, RT, instruction_0);
2225 010000,01100,5.RS,16.IMMEDIATE:POOL32I:32::TNEI
2226 "tnei r<RS>, <IMMEDIATE>"
2230 do_tnei (SD_, RS, IMMEDIATE, instruction_0);
2234 000000,10.CODE,1001001101,111100:POOL32A:32::WAIT
2240 000000,5.RT,5.RS,1111000101,111100:POOL32A:32::WRPGPR
2241 "wrpgpr r<RS>, r<RT>"
2246 000000,5.RT,5.RS,0111101100,111100:POOL32A:32::WSBH
2251 do_wsbh (SD_, RT, RS);
2255 000000,5.RT,5.RS,5.RD,01100,010000:POOL32A:32::XOR
2256 "xor r<RD>, r<RS>, r<RT>"
2260 do_xor (SD_, RS, RT, RD);
2264 011100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::XORI
2265 "xori r<RT>, r<RS>, <IMMEDIATE>"
2269 do_xori (SD_, RS, RT, IMMEDIATE);
2273 :%s::::FMT_MICROMIPS:int fmt
2281 case 2: return "ps";
2282 default: return "?";
2287 :%s::::FMT_MICROMIPS_CVT_D:int fmt
2296 default: return "?";
2301 :%s::::FMT_MICROMIPS_CVT_S:int fmt
2310 default: return "?";
2315 010101,5.FT,5.FS,0,2.FMT_MICROMIPS!3,0001101,111011:POOL32F:32,f::ABS.fmt
2316 "abs.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2320 do_abs_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FT, FS,
2325 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,00,110000:POOL32F:32,f::ADD.fmt
2326 "add.%s<FMT_MICROMIPS> f<FD>, f<FS>, f<FT>"
2330 do_add_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT,
2335 010101,5.FT,5.FS,5.FD,5.RS,011001:POOL32F:32,f::ALNV.PS
2336 "alnv.ps f<FD>, f<FS>, f<FT>, r<RS>"
2340 do_alnv_ps (SD_, FD, FS, FT, RS, instruction_0);
2344 010101,5.FT,5.FS,3.CC,0,2.FMT_MICROMIPS!3,4.COND,111100:POOL32F:32,f::C.cond.fmt
2345 "c.%s<COND>.%s<FMT_MICROMIPS> f<FS>, f<FT>":CC == 0
2346 "c.%s<COND>.%s<FMT_MICROMIPS> <CC>, f<FS>, f<FT>"
2350 do_c_cond_fmt (SD_, COND, convert_fmt_micromips (SD_, FMT_MICROMIPS), CC,
2351 FS, FT, instruction_0);
2355 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,01001100,111011:POOL32F:32,f::CEIL.L.fmt
2356 "ceil.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2360 do_ceil_fmt (SD_, fmt_long, FMT_MICROMIPS, FT, FS, instruction_0);
2364 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,01101100,111011:POOL32F:32,f::CEIL.W.fmt
2365 "ceil.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2369 do_ceil_fmt (SD_, fmt_word, FMT_MICROMIPS, FT, FS, instruction_0);
2373 010101,5.FT,5.FS,0,2.FMT_MICROMIPS_CVT_D!3,1001101,111011:POOL32F:32,f::CVT.D.fmt
2374 "cvt.d.%s<FMT_MICROMIPS_CVT_D> f<FT>, f<FS>"
2378 do_cvt_d_fmt (SD_, convert_fmt_micromips_cvt_d (SD_, FMT_MICROMIPS_CVT_D),
2379 FT, FS, instruction_0);
2383 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00000100,111011:POOL32F:32,f::CVT.L.fmt
2384 "cvt.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2388 do_cvt_l_fmt (SD_, FMT_MICROMIPS, FT, FS, instruction_0);
2392 010101,5.FT,5.FS,5.FD,00110,000000:POOL32F:32,f::CVT.PS.S
2393 "cvt.ps.s f<FD>, f<FS>, f<FT>"
2397 do_cvt_ps_s (SD_, FD, FS, FT, instruction_0);
2401 010101,5.FT,5.FS,0,2.FMT_MICROMIPS_CVT_S!3,1101101,111011:POOL32F:32,f::CVT.S.fmt
2402 "cvt.s.%s<FMT_MICROMIPS_CVT_S> f<FT>, f<FS>"
2406 do_cvt_s_fmt (SD_, convert_fmt_micromips_cvt_s (SD_, FMT_MICROMIPS_CVT_S),
2407 FT, FS, instruction_0);
2411 010101,5.FT,5.FS,00,10000100,111011:POOL32F:32,f::CVT.S.PL
2412 "cvt.s.pl f<FT>, f<FS>"
2416 do_cvt_s_pl (SD_, FT, FS, instruction_0);
2420 010101,5.FT,5.FS,00,10100100,111011:POOL32F:32,f::CVT.S.PU
2421 "cvt.s.pu f<FT>, f<FS>"
2425 do_cvt_s_pu (SD_, FT, FS, instruction_0);
2429 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00100100,111011:POOL32F:32,f::CVT.W.fmt
2430 "cvt.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2434 do_cvt_w_fmt (SD_, FMT_MICROMIPS, FT, FS, instruction_0);
2438 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!2!3,11,110000:POOL32F:32,f::DIV.fmt
2439 "div.%s<FMT_MICROMIPS> f<FD>, f<FS>, f<FT>"
2443 do_div_fmt (SD_, FMT_MICROMIPS, FD, FS, FT, instruction_0);
2447 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00001100,111011:POOL32F:32,f::FLOOR.L.fmt
2448 "floor.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2452 do_floor_fmt (SD_, fmt_long, FMT_MICROMIPS, FT, FS);
2456 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00101100,111011:POOL32F:32,f::FLOOR.W.fmt
2457 "floor.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2461 do_floor_fmt (SD_, fmt_word, FMT_MICROMIPS, FT, FS);
2465 010101,5.FT,5.FS,5.FD,5.FR,0,2.FMT_MICROMIPS!3,001:POOL32F:32,f::MADD.fmt
2466 "madd.%s<FMT_MICROMIPS> f<FD>, f<FR>, f<FS>, f<FT>"
2470 do_madd_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FR, FS,
2474 010101,5.FT,5.FS,0,2.FMT_MICROMIPS!3,0000001,111011:POOL32F:32,f::MOV.fmt
2475 "mov.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2479 do_mov_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FT, FS,
2484 010101,5.FT,5.FS,3.CC,00,2.FMT_MICROMIPS!3,00,1.TF,100000:POOL32F:32,f::MOVtf.fmt
2485 "mov%s<TF>.%s<FMT_MICROMIPS> f<FT>, f<FS>, <CC>"
2489 do_movtf_fmt (SD_, TF, convert_fmt_micromips (SD_, FMT_MICROMIPS), FT,
2494 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,00,111000:POOL32F:32,f::MOVN.fmt
2495 "movn.%s<FMT_MICROMIPS> f<FD>, f<FS>, r<FT>"
2499 do_movn_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT);
2502 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,01,111000:POOL32F:32,f::MOVZ.fmt
2503 "movz.%s<FMT_MICROMIPS> f<FD>, f<FS>, r<FT>"
2507 do_movz_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT);
2511 010101,5.FT,5.FS,5.FD,5.FR,1,2.FMT_MICROMIPS!3,001:POOL32F:32,f::MSUB.fmt
2512 "msub.%s<FMT_MICROMIPS> f<FD>, f<FR>, f<FS>, f<FT>"
2516 do_msub_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FR, FS,
2520 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,10,110000:POOL32F:32,f::MUL.fmt
2521 "mul.%s<FMT_MICROMIPS> f<FD>, f<FS>, f<FT>"
2525 do_mul_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT,
2530 010101,5.FT,5.FS,0,2.FMT_MICROMIPS!3,0101101,111011:POOL32F:32,f::NEG.fmt
2531 "neg.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2535 do_neg_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FT, FS,
2540 010101,5.FT,5.FS,5.FD,5.FR,0,2.FMT_MICROMIPS!3,010:POOL32F:32,f::NMADD.fmt
2541 "nmadd.%s<FMT_MICROMIPS> f<FD>, f<FR>, f<FS>, f<FT>"
2545 do_nmadd_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FR, FS,
2549 010101,5.FT,5.FS,5.FD,5.FR,1,2.FMT_MICROMIPS!3,010:POOL32F:32,f::NMSUB.fmt
2550 "nmsub.%s<FMT_MICROMIPS> f<FD>, f<FR>, f<FS>, f<FT>"
2554 do_nmsub_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FR, FS,
2559 010101,5.FT,5.FS,5.FD,00010,000000:POOL32F:32,f::PLL.PS
2560 "pll.ps f<FD>, f<FS>, f<FT>"
2564 do_pll_ps (SD_, FD, FS, FT, instruction_0);
2568 010101,5.FT,5.FS,5.FD,00011,000000:POOL32F:32,f::PLU.PS
2569 "plu.ps f<FD>, f<FS>, f<FT>"
2573 do_plu_ps (SD_, FD, FS, FT, instruction_0);
2577 010101,5.FT,5.FS,5.FD,00100,000000:POOL32F:32,f::PUL.PS
2578 "pul.ps f<FD>, f<FS>, f<FT>"
2582 do_pul_ps (SD_, FD, FS, FT, instruction_0);
2586 010101,5.FT,5.FS,5.FD,00101,000000:POOL32F:32,f::PUU.PS
2587 "puu.ps f<FD>, f<FS>, f<FT>"
2591 do_puu_ps (SD_, FD, FS, FT, instruction_0);
2595 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,01001000,111011:POOL32F:32,f::RECIP.fmt
2596 "recip.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2600 do_recip_fmt (SD_, FMT_MICROMIPS, FT, FS);
2604 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,11001100,111011:POOL32F:32,f::ROUND.L.fmt
2605 "round.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2609 do_round_fmt (SD_, fmt_long, FMT_MICROMIPS, FT, FS);
2613 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,11101100,111011:POOL32F:32,f::ROUND.W.fmt
2614 "round.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2618 do_round_fmt (SD_, fmt_word, FMT_MICROMIPS, FT, FS);
2622 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00001000,111011:POOL32F:32,f::RSQRT.fmt
2623 "rsqrt.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2627 do_rsqrt_fmt (SD_, FMT_MICROMIPS, FT, FS);
2631 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00101000,111011:POOL32F:32,f::SQRT.fmt
2632 "sqrt.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2636 do_sqrt_fmt (SD_, FMT_MICROMIPS, FT, FS);
2640 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,01,110000:POOL32F:32,f::SUB.fmt
2641 "sub.%s<FMT_MICROMIPS> f<FD>, f<FS>, f<FT>"
2645 do_sub_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT,
2650 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,10001100,111011:POOL32F:32,f::TRUNC.L.fmt
2651 "trunc.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2655 do_trunc_fmt (SD_, fmt_long, FMT_MICROMIPS, FT, FS);
2659 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,10101100,111011:POOL32F:32,f::TRUNC.W.fmt
2660 "trunc.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2664 do_trunc_fmt (SD_, fmt_word, FMT_MICROMIPS, FT, FS);
2667 001000,5.LWM32REGS,5.BASE,0111,12.OFFSET:POOL32B:64::LDM
2668 "ldm %s<LWM32REGS>, <OFFSET>(r<BASE>)"
2671 int address_base = GPR[BASE] + EXTEND12 (OFFSET);
2673 for (reg_offset = 0; reg_offset < (LWM32REGS & 0xf); reg_offset++)
2675 int dst = (reg_offset == 8) ? 30 : 16 + reg_offset;
2676 GPR[dst] = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, address_base,
2680 if (LWM32REGS & 0x10)
2681 RA = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, address_base,
2685 001000,5.RD,5.BASE,0100,12.OFFSET:POOL32B:64::LDP
2686 "ldp r<RD>, <OFFSET>(r<BASE>)"
2689 if (BASE == RD || RD == 31)
2693 check_u64 (SD_, instruction_0);
2694 GPR[RD] = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
2695 EXTEND12 (OFFSET)));
2696 GPR[RD + 1] = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
2697 EXTEND12 (OFFSET) + 8));
2701 001000,5.LWM32REGS,5.BASE,1111,12.OFFSET:POOL32B:64::SDM
2702 "sdm %s<LWM32REGS>, <OFFSET>(r<BASE>)"
2705 int address_base = GPR[BASE] + EXTEND12 (OFFSET);
2707 for (reg_offset = 0; reg_offset < (LWM32REGS & 0xf); reg_offset++)
2709 int src = (reg_offset == 8) ? 30 : 16 + reg_offset;
2710 do_store (SD_, AccessLength_DOUBLEWORD, address_base, 8 * reg_offset,
2714 if (LWM32REGS & 0x10)
2715 do_store (SD_, AccessLength_DOUBLEWORD, address_base, 8 * reg_offset, RA);
2718 001000,5.RD,5.BASE,1100,12.OFFSET:POOL32B:64::SDP
2719 "sdp r<RD>, <OFFSET>(r<BASE>)"
2726 check_u64 (SD_, instruction_0);
2727 do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND12 (OFFSET),
2729 do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND12 (OFFSET) + 8,
2734 010110,5.RT,5.RS,5.RD,00,100010000:POOL32S:64::DADD
2735 "dadd r<RD>, r<RS>, r<RT>"
2738 check_u64 (SD_, instruction_0);
2739 do_dadd (SD_, RD, RS, RT);
2742 010110,5.RT,5.RS,10.IMMEDIATE,011100:POOL32S:64::DADDI
2743 "daddi r<RT>, r<RS>, <IMMEDIATE>"
2746 check_u64 (SD_, instruction_0);
2747 do_daddi (SD_, RT, RS, IMMEDIATE);
2750 010111,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:64::DADDIU
2751 "daddiu r<RT>, r<RS>, <IMMEDIATE>"
2754 check_u64 (SD_, instruction_0);
2755 do_daddiu (SD_, RS, RT, IMMEDIATE);
2758 010110,5.RT,5.RS,5.RD,00,101010000:POOL32S:64::DADDU
2759 "daddu r<RD>, r<RS>, r<RT>"
2762 check_u64 (SD_, instruction_0);
2763 do_daddu (SD_, RS, RT, RD);
2766 010110,5.RT,5.RS,0100101100,111100:POOL32S:64::DCLO
2770 check_u64 (SD_, instruction_0);
2771 do_dclo (SD_, RT, RS);
2774 010110,5.RT,5.RS,0101101100,111100:POOL32S:64::DCLZ
2778 check_u64 (SD_, instruction_0);
2779 do_dclz (SD_, RT, RS);
2782 010110,5.RT,5.RS,1010101100,111100:POOL32S:64::DDIV
2786 check_u64 (SD_, instruction_0);
2787 do_ddiv (SD_, RS, RT);
2790 010110,5.RT,5.RS,1011101100,111100:POOL32S:64::DDIVU
2791 "ddivu r<RS>, r<RT>"
2794 check_u64 (SD_, instruction_0);
2795 do_ddivu (SD_, RS, RT);
2798 010110,5.RT,5.RS,5.SIZE,5.LSB,101100:POOL32S:64::DEXT
2799 "dext r<RT>, r<RS>, <LSB>, <SIZE+1>"
2802 check_u64 (SD_, instruction_0);
2803 do_dext (SD_, RT, RS, LSB, SIZE);
2806 010110,5.RT,5.RS,5.SIZE,5.LSB,100100:POOL32S:64::DEXTM
2807 "dextm r<RT>, r<RS>, <LSB>, <SIZE+33>"
2810 check_u64 (SD_, instruction_0);
2811 do_dextm (SD_, RT, RS, LSB, SIZE);
2814 010110,5.RT,5.RS,5.SIZE,5.LSB,010100:POOL32S:64::DEXTU
2815 "dextu r<RT>, r<RS>, <LSB+32>, <SIZE+1>"
2818 check_u64 (SD_, instruction_0);
2819 do_dextu (SD_, RT, RS, LSB, SIZE);
2822 010110,5.RT,5.RS,5.MSB,5.LSB,001100:POOL32S:64::DINS
2823 "dins r<RT>, r<RS>, <LSB>, <MSB-LSB+1>"
2826 check_u64 (SD_, instruction_0);
2827 do_dins (SD_, RT, RS, LSB, MSB);
2830 010110,5.RT,5.RS,5.MSB,5.LSB,000100:POOL32S:64::DINSM
2831 "dinsm r<RT>, r<RS>, <LSB>, <MSB+32-LSB+1>"
2834 check_u64 (SD_, instruction_0);
2835 do_dinsm (SD_, RT, RS, LSB, MSB);
2838 010110,5.RT,5.RS,5.MSB,5.LSB,110100:POOL32S:64::DINSU
2839 "dinsu r<RT>, r<RS>, <LSB+32>, <MSB-LSB+1>"
2842 check_u64 (SD_, instruction_0);
2843 do_dinsu (SD_, RT, RS, LSB, MSB);
2846 010110,5.RT,5.RS,00,3.SEL,00011,111100:POOL32S:64::DMFC0
2847 "dmfc0 r<RT>, r<RS>": SEL == 0
2848 "dmfc0 r<RT>, r<RS>, <SEL>"
2851 check_u64 (SD_, instruction_0);
2852 DecodeCoproc (instruction_0, 0, cp0_dmfc0, RT, RS, SEL);
2855 010101,5.RT,5.FS,00,10010000,111011:POOL32F:64::DMFC1
2856 "dmfc1 r<RT>, f<FS>"
2860 check_u64 (SD_, instruction_0);
2861 do_dmfc1b (SD_, RT, FS);
2864 010110,5.RT,5.RS,00,3.SEL,01011,111100:POOL32S:64::DMTC0
2865 "dmtc0 r<RT>, r<RS>": SEL == 0
2866 "dmtc0 r<RT>, r<RS>, <SEL>"
2869 check_u64 (SD_, instruction_0);
2870 DecodeCoproc (instruction_0, 0, cp0_dmtc0, RT, RS, SEL);
2873 010101,5.RT,5.FS,00,10110000,111011:POOL32F:64::DMTC1
2874 "dmtc1 r<RT>, f<FS>"
2878 check_u64 (SD_, instruction_0);
2879 do_dmtc1b (SD_, RT, FS);
2882 010110,5.RT,5.RS,1000101100,111100:POOL32S:64::DMULT
2883 "dmult r<RS>, r<RT>"
2886 check_u64 (SD_, instruction_0);
2887 do_dmult (SD_, RS, RT, 0);
2890 010110,5.RT,5.RS,1001101100,111100:POOL32S:64::DMULTU
2891 "dmultu r<RS>, r<RT>"
2894 check_u64 (SD_, instruction_0);
2895 do_dmultu (SD_, RS, RT, 0);
2898 010110,5.RT,5.RS,5.SA,00,011000000:POOL32S:64::DROTR
2899 "drotr r<RT>, r<RS>, <SA>"
2902 check_u64 (SD_, instruction_0);
2903 GPR[RT] = do_dror (SD_, GPR[RS], SA);
2906 010110,5.RT,5.RS,5.SA,00,011001000:POOL32S:64::DROTR32
2907 "drotr32 r<RT>, r<RS>, <SA+32>"
2910 check_u64 (SD_, instruction_0);
2911 GPR[RT] = do_dror (SD_, GPR[RS], SA + 32);
2914 010110,5.RT,5.RS,5.RD,00,011010000:POOL32S:64::DROTRV
2915 "drotrv r<RD>, r<RT>, r<RS>"
2918 check_u64 (SD_, instruction_0);
2919 GPR[RD] = do_dror (SD_, GPR[RT], GPR[RS]);
2922 010110,5.RT,5.RS,0111101100,111100:POOL32S:64::DSBH
2926 check_u64 (SD_, instruction_0);
2927 do_dsbh (SD_, RT, RS);
2930 010110,5.RT,5.RS,1111101100,111100:POOL32S:64::DSHD
2934 check_u64 (SD_, instruction_0);
2935 do_dshd (SD_, RS, RT);
2938 010110,5.RT,5.RS,5.SA,00,000000000:POOL32S:64::DSLL
2939 "dsll r<RT>, r<RS>, <SA>"
2942 check_u64 (SD_, instruction_0);
2943 do_dsll (SD_, RS, RT, SA);
2946 010110,5.RT,5.RS,5.SA,00,000001000:POOL32S:64::DSLL32
2947 "dsll32 r<RT>, r<RS>, <SA>"
2950 check_u64 (SD_, instruction_0);
2951 do_dsll32 (SD_, RT, RS, SA);
2954 010110,5.RT,5.RS,5.RD,00,000010000:POOL32S:64::DSLLV
2955 "dsllv r<RD>, r<RT>, r<RS>"
2958 check_u64 (SD_, instruction_0);
2959 do_dsllv (SD_, RS, RT, RD);
2962 010110,5.RT,5.RS,5.SA,00,010000000:POOL32S:64::DSRA
2963 "dsra r<RT>, r<RS>, <SA>"
2966 check_u64 (SD_, instruction_0);
2967 do_dsra (SD_, RS, RT, SA);
2970 010110,5.RT,5.RS,5.SA,00,010001000:POOL32S:64::DSRA32
2971 "dsra32 r<RT>, r<RS>, <SA>"
2974 check_u64 (SD_, instruction_0);
2975 do_dsra32 (SD_, RT, RS, SA);
2978 010110,5.RT,5.RS,5.RD,00,010010000:POOL32S:64::DSRAV
2979 "dsrav r<RD>, r<RS>, r<RT>"
2982 check_u64 (SD_, instruction_0);
2983 do_dsrav (SD_, RS, RT, RD);
2986 010110,5.RT,5.RS,5.SA,00,001000000:POOL32S:64::DSRL
2987 "dsrl r<RT>, r<RS>, <SA>"
2990 check_u64 (SD_, instruction_0);
2991 do_dsrl (SD_, RS, RT, SA);
2994 010110,5.RT,5.RS,5.SA,00,001001000:POOL32S:64::DSRL32
2995 "dsrl32 r<RT>, r<RS>, <SA>"
2998 check_u64 (SD_, instruction_0);
2999 do_dsrl32 (SD_, RT, RS, SA);
3002 010110,5.RT,5.RS,5.RD,00,001010000:POOL32S:64::DSRLV
3003 "dsrlv r<RD>, r<RT>, r<RS>"
3006 check_u64 (SD_, instruction_0);
3007 do_dsrlv (SD_, RS, RT, RD);
3010 010110,5.RT,5.RS,5.RD,00,110001000:POOL32S:64::DSUB
3011 "dsub r<RD>, r<RS>, r<RT>"
3014 check_u64 (SD_, instruction_0);
3015 do_dsub (SD_, RD, RS, RT);
3018 010110,5.RT,5.RS,5.RD,00,111001000:POOL32S:64::DSUBU
3019 "dsubu r<RD>, r<RS>, r<RT>"
3022 check_u64 (SD_, instruction_0);
3023 do_dsubu (SD_, RS, RT, RD);
3026 110111,5.RT,5.BASE,16.OFFSET:MICROMIPS64:64::LD
3027 "ld r<RT>, <OFFSET>(r<BASE>)"
3030 check_u64 (SD_, instruction_0);
3031 GPR[RT] = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
3032 EXTEND16 (OFFSET)));
3035 011000,5.RT,5.BASE,0100,12.OFFSET:POOL32C:64::LDL
3036 "ldl r<RT>, <OFFSET>(r<BASE>)"
3039 check_u64 (SD_, instruction_0);
3040 GPR[RT] = do_load_left (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
3041 EXTEND12 (OFFSET), GPR[RT]);
3044 011000,5.RT,5.BASE,0101,12.OFFSET:POOL32C:64::LDR
3045 "ldr r<RT>, <OFFSET>(r<BASE>)"
3048 check_u64 (SD_, instruction_0);
3049 GPR[RT] = do_load_right (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
3050 EXTEND12 (OFFSET), GPR[RT]);
3053 010101,5.INDEX,5.BASE,5.FD,00,011001000:POOL32F:64,f::LDXC1
3054 "ldxc1 f<FD>, r<INDEX>(r<BASE>)"
3058 check_u64 (SD_, instruction_0);
3059 COP_LD (1, FD, do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE], GPR[INDEX]));
3062 011000,5.RT,5.BASE,0111,12.OFFSET:POOL32C:64::LLD
3063 "lld r<RT>, <OFFSET>(r<BASE>)"
3066 check_u64 (SD_, instruction_0);
3067 do_lld (SD_, RT, OFFSET, BASE);
3070 011000,5.RT,5.BASE,1111,12.OFFSET:POOL32C:64::SCD
3071 "scd r<RT>, <OFFSET>(r<BASE>)"
3074 check_u64 (SD_, instruction_0);
3075 do_scd (SD_, RT, OFFSET, BASE);
3078 110110,5.RT,5.BASE,16.OFFSET:MICROMIPS64:64::SD
3079 "sd r<RT>, <OFFSET>(r<BASE>)"
3082 check_u64 (SD_, instruction_0);
3083 do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND16 (OFFSET),
3087 011000,5.RT,5.BASE,1100,12.OFFSET:POOL32C:64::SDL
3088 "sdl r<RT>, <OFFSET>(r<BASE>)"
3091 check_u64 (SD_, instruction_0);
3092 do_store_left (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND12 (OFFSET),
3096 011000,5.RT,5.BASE,1101,12.OFFSET:POOL32C:64::SDR
3097 "sdr r<RT>, <OFFSET>(r<BASE>)"
3100 check_u64 (SD_, instruction_0);
3101 do_store_right (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND12 (OFFSET),
3105 010101,5.INDEX,5.BASE,5.FD,00,100001000:POOL32F:64,f::SDXC1
3106 "sdxc1 f<FD>, r<INDEX>(r<BASE>)"
3110 check_u64 (SD_, instruction_0);
3111 do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], GPR[INDEX],