1 // Simulator definition for the micromips ASE.
2 // Copyright (C) 2005-2024 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 struct mips_sim_state *state = MIPS_SIM_STATE (SD);
62 state->isa_mode = target & 0x1;
63 return (target & (-(1 << 1)));
66 :function:::address_word:do_micromips_jalr:int rt, int rs, address_word nia, int delayslot_instruction_size
70 GPR[rt] = (nia + delayslot_instruction_size) | ISA_MODE_MICROMIPS;
71 return (process_isa_mode (SD_,
72 delayslot_micromips (SD_, GPR[rs], nia, delayslot_instruction_size)));
75 :function:::address_word:do_micromips_jal:address_word target, address_word nia, int delayslot_instruction_size
79 RA = (nia + delayslot_instruction_size) | ISA_MODE_MICROMIPS;
80 return delayslot_micromips (SD_, target, nia, delayslot_instruction_size);
84 :function:::uint32_t:compute_movep_src_reg:int reg
102 :function:::uint32_t:compute_andi16_imm:int encoded_imm
122 case 14: return 32768;
123 case 15: return 65535;
128 :function:::FP_formats:convert_fmt_micromips:int fmt
134 case 0: return fmt_single;
135 case 1: return fmt_double;
136 case 2: return fmt_ps;
137 default: return fmt_unknown;
141 :function:::FP_formats:convert_fmt_micromips_cvt_d:int fmt
147 case 0: return fmt_single;
148 case 1: return fmt_word;
149 case 2: return fmt_long;
150 default: return fmt_unknown;
155 :function:::FP_formats:convert_fmt_micromips_cvt_s:int fmt
161 case 0: return fmt_double;
162 case 1: return fmt_word;
163 case 2: return fmt_long;
164 default: return fmt_unknown;
169 011011,3.RD,6.IMMEDIATE,1:POOL16E:16::ADDIUR1SP
170 "addiur1sp r<TRD>, <IMMEDIATE>"
174 do_addiu (SD_, SPIDX, TRD, IMMEDIATE << 2);
178 011011,3.RD,3.RS,3.IMMEDIATE,0:POOL16E:16::ADDIUR2
179 "addiur2 r<TRD>, r<TRS>, <IMM_DEC1>"
183 do_addiu (SD_, TRS, TRD, IMM_DEC1);
187 010011,5.RD,4.IMMEDIATE,0:POOL16D:16::ADDIUS5
188 "addius5 r<RD>, <IMM_DEC2>"
192 do_addiu (SD_, RD, RD, IMM_DEC2);
196 010011,9.IMMEDIATE,1:POOL16D:16::ADDIUSP
201 do_addiu (SD_, SPIDX, SPIDX, IMM_DEC3 << 2);
205 000001,3.RD,3.RT,3.RS,0:POOL16A:16::ADDU16
206 "addu16 r<TRD>, r<TRS>, r<TRT>"
210 do_addu (SD_, TRS, TRT, TRD);
214 001011,3.RD,3.RS,4.IMMEDIATE:MICROMIPS:16::ANDI16
215 "andi16 r<TRD>, r<TRS>, <IMM_DEC4>"
219 do_andi (SD_, TRS, TRD, IMM_DEC4);
223 010001,0010,3.RT,3.RS:POOL16C:16::AND16
224 "and16 r<TRT>, r<TRS>"
228 do_and (SD_, TRS, TRT, TRT);
232 110011,10.IMMEDIATE:MICROMIPS:16::B16
237 NIA = delayslot_micromips (SD_, NIA + (EXTEND11 (IMMEDIATE << 1)),
238 NIA, MICROMIPS_DELAYSLOT_SIZE_ANY);
242 100011,3.RS,7.IMMEDIATE:MICROMIPS:16::BEQZ16
243 "beqz16 r<TRS>, <IMMEDIATE>"
248 NIA = delayslot_micromips (SD_, NIA + (EXTEND8 (IMMEDIATE << 1)),
249 NIA, MICROMIPS_DELAYSLOT_SIZE_ANY);
253 101011,3.RS,7.IMMEDIATE:MICROMIPS:16::BNEZ16
254 "bnez16 r<TRS>, <IMMEDIATE>"
259 NIA = delayslot_micromips (SD_, NIA + (EXTEND8 (IMMEDIATE << 1)),
260 NIA, MICROMIPS_DELAYSLOT_SIZE_ANY);
264 010001,101000,4.CODE:POOL16C:16::BREAK16
269 do_break16 (SD_, instruction_0);
273 010001,01110,5.RS:POOL16C:16::JALR16
278 NIA = do_micromips_jalr (SD_, RAIDX, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_32);
282 010001,01111,5.RS:POOL16C:16::JALRS16
287 NIA = do_micromips_jalr (SD_, RAIDX, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_16);
291 010001,01100,5.RS:POOL16C:16::JR16
296 NIA = process_isa_mode (SD_,
297 delayslot_micromips (SD_, GPR[RS], NIA, MICROMIPS_DELAYSLOT_SIZE_ANY));
301 010001,11000,5.IMMEDIATE:POOL16C:16::JRADDIUSP
302 "jraddiusp <IMMEDIATE>"
306 address_word temp = RA;
307 do_addiu (SD_, SPIDX, SPIDX, IMMEDIATE << 2);
308 NIA = process_isa_mode (SD_, temp);
312 010001,01101,5.RS:POOL16C:16::JRC
317 NIA = process_isa_mode (SD_, GPR[RS]);
321 000010,3.RT,3.BASE,4.IMMEDIATE:MICROMIPS:16::LBU16
322 "lbu16 r<TRT>, <IMM_DEC5>(r<TBASE>)"
326 /* LBU can have a negative offset. As the offset argument to do_load is
327 unsigned we need to do the address calcuation before the function call so
328 that the load address has been correctly calculated */
330 GPR[TRT] = do_load (SD_, AccessLength_BYTE, GPR[TBASE] + IMM_DEC5, 0);
334 001010,3.RT,3.BASE,4.IMMEDIATE:MICROMIPS:16::LHU16
335 "lhu16 r<TRT>, <IMM_SHIFT_1BIT>(r<TBASE>)"
339 GPR[TRT] = do_load (SD_, AccessLength_HALFWORD, GPR[TBASE], IMM_SHIFT_1BIT);
343 111011,3.RD,7.IMMEDIATE:MICROMIPS:16::LI16
344 "li16 r<TRD>, <IMM_DEC6>"
352 011010,3.RT,3.BASE,4.IMMEDIATE:MICROMIPS:16::LW16
353 "lw16 r<TRT>, <IMM_SHIFT_2BIT>(r<TBASE>)"
357 GPR[TRT] = EXTEND32 (
358 do_load (SD_, AccessLength_WORD, GPR[TBASE], IMM_SHIFT_2BIT));
361 :%s::::LWMREGS:int lwmregs
366 return "s0, s1, s2, s3, ra";
367 else if (lwmregs == 2)
368 return "s0, s1, s2, ra";
369 else if (lwmregs == 1)
371 else if (lwmregs == 0)
377 010001,0100,2.LWMREGS,4.IMMEDIATE:POOL16C:16::LWM16
378 "lwm16 %s<LWMREGS>, <IMM_SHIFT_2BIT>(sp)"
382 int address = GPR[SPIDX] + IMM_SHIFT_2BIT;
385 for (reg_offset = 0; reg_offset <= LWMREGS; reg_offset++)
386 GPR[16 + reg_offset] = EXTEND32 (
387 do_load (SD_, AccessLength_WORD, address, reg_offset * 4));
389 RA = EXTEND32 (do_load (SD_, AccessLength_WORD, address, reg_offset * 4));
393 011001,3.RT,7.IMMEDIATE:MICROMIPS:16::LWGP
394 "lwgp r<TRT>, <IMM_SHIFT_2BIT>(gp)"
398 GPR[TRT] = EXTEND32 (
399 do_load (SD_, AccessLength_WORD, GPR[28], IMM_SHIFT_2BIT));
403 010010,5.RT,5.IMMEDIATE:MICROMIPS:16::LWSP
404 "lwsp r<RT>, <IMM_SHIFT_2BIT>(sp)"
408 GPR[RT] = EXTEND32 (do_load (SD_, AccessLength_WORD, SP, IMM_SHIFT_2BIT));
412 010001,10000,5.RD:POOL16C:16::MFHI16
421 010001,10010,5.RD:POOL16C:16::MFLO16
430 000011,5.RD,5.RS:MICROMIPS:16::MOVE16
432 "move16 r<RD>, r<RS>"
440 :%s::::DESTREGS:int regs
446 case 0: return "a1, a2,";
447 case 1: return "a1, a3,";
448 case 2: return "a2, a3,";
449 case 3: return "a0, s5,";
450 case 4: return "a0, s6,";
451 case 5: return "a0, a1,";
452 case 6: return "a0, a2,";
453 case 7: return "a0, a3,";
458 100001,3.DESTREGS,3.RT,3.RS,0:MICROMIPS:16::MOVEP
459 "movep %s<DESTREGS> r<ERS>, r<ERT>"
467 if (dest == 0 || dest == 1)
474 if (dest == 0 || dest == 6)
476 else if (dest == 1 || dest == 2 || dest == 7)
482 /* assume dest is 5 */
491 010001,0000,3.RT,3.RS:POOL16C:16::NOT16
492 "not16 r<TRT>, r<TRS>"
496 do_nor (SD_, 0, TRS, TRT);
500 010001,0011,3.RT,3.RS:POOL16C:16::OR16
501 "or16 r<TRT>, r<TRS>"
505 do_or (SD_, TRS, TRT, TRT);
509 100010,3.RT_S,3.BASE,4.IMMEDIATE:MICROMIPS:16::SB16
510 "sb16 r<TRT_S>, <IMMEDIATE>(r<TBASE>)"
514 do_store (SD_, AccessLength_BYTE, GPR[TBASE], IMMEDIATE, GPR[TRT_S]);
518 010001,101100,4.CODE:POOL16C:16::SDBBP16
523 SignalException (DebugBreakPoint, instruction_0);
527 101010,3.RT_S,3.BASE,4.IMMEDIATE:MICROMIPS:16::SH16
528 "sh16 r<TRT_S>, <IMM_SHIFT_1BIT>(r<TBASE>)"
532 do_store (SD_, AccessLength_HALFWORD, GPR[TBASE], IMM_SHIFT_1BIT, GPR[TRT_S]);
536 001001,3.RD,3.RT,3.SHIFT,0:POOL16B:16::SLL16
537 "sll16 r<TRD>, r<TRT>, <SHIFT_DEC>"
541 do_sll (SD_, TRT, TRD, SHIFT_DEC);
545 001001,3.RD,3.RT,3.SHIFT,1:POOL16B:16::SRL16
546 "srl16 r<TRD>, r<TRT>, <SHIFT_DEC>"
550 do_srl (SD_, TRT, TRD, SHIFT_DEC);
554 000001,3.RD,3.RT,3.RS,1:POOL16A:16::SUBU16
555 "subu16 r<TRD>, r<TRS>, r<TRT>"
559 do_subu (SD_, TRS, TRT, TRD);
563 111010,3.RT_S,3.BASE,4.IMMEDIATE:MICROMIPS:16::SW16
564 "sw16 r<TRT_S>, <IMM_SHIFT_2BIT>(r<TBASE>)"
568 do_store (SD_, AccessLength_WORD, GPR[TBASE], IMM_SHIFT_2BIT, GPR[TRT_S]);
572 110010,5.RT,5.IMMEDIATE:MICROMIPS:16::SWSP
573 "swsp r<RT>, <IMM_SHIFT_2BIT>(sp)"
577 do_store (SD_, AccessLength_WORD, SP, IMM_SHIFT_2BIT, GPR[RT]);
581 010001,0101,2.LWMREGS,4.IMMEDIATE:POOL16C:16::SWM16
582 "swm16 %s<LWMREGS>, <IMM_SHIFT_2BIT>(sp)"
586 int address = GPR[SPIDX] + IMM_SHIFT_2BIT;
589 for (reg_offset = 0; reg_offset <= LWMREGS; reg_offset++)
590 do_store (SD_, AccessLength_WORD, address, reg_offset * 4,
591 GPR[16 + reg_offset]);
593 do_store (SD_, AccessLength_WORD, address, reg_offset * 4, RA);
597 010001,0001,3.RT,3.RS:POOL16C:16::XOR16
598 "xor16 r<TRT>, r<TRS>"
602 do_xor (SD_, TRS, TRT, TRT);
606 000000,5.RT,5.RS,5.RD,00100,010000:POOL32A:32::ADD
607 "add r<RD>, r<RS>, r<RT>"
611 do_add (SD_, RS, RT, RD);
615 000100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::ADDI
616 "addi r<RT>, r<RS>, <IMMEDIATE>"
620 do_addi (SD_, RS, RT, IMMEDIATE);
624 001100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::ADDIU
625 "li r<RT>, <IMMEDIATE>":RS==0
626 "addiu r<RT>, r<RS>, <IMMEDIATE>"
630 do_addiu (SD_, RS, RT, IMMEDIATE);
634 011110,3.RS,23.IMMEDIATE:MICROMIPS:32::ADDIUPC
635 "addiupc r<TRS>, <IMM_SHIFT_2BIT>"
639 GPR[TRS] = EXTEND32 ((CIA & ~3) + EXTEND25 (IMM_SHIFT_2BIT));
643 000000,5.RT,5.RS,5.RD,00101,010000:POOL32A:32::ADDU
644 "addu r<RD>, r<RS>, r<RT>"
648 do_addu (SD_, RS, RT, RD);
652 000000,5.RT,5.RS,5.RD,01001,010000:POOL32A:32::AND
653 "and r<RD>, r<RS>, r<RT>"
657 do_and (SD_, RS, RT, RD);
661 110100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::ANDI
662 "andi r<RT>, r<RS>, <IMMEDIATE>"
666 do_andi (SD_, RS, RT, IMMEDIATE);
670 010000,1110,1.TF,3.CC,00,16.IMMEDIATE:POOL32I:32,f::BC1a
671 "bc1%s<TF> <IMMEDIATE>":CC == 0
672 "bc1%s<TF> <CC>, <IMMEDIATE>"
677 if (GETFCC(CC) == TF)
679 address_word dest = NIA + (EXTEND16 (IMMEDIATE) << 1);
680 NIA = delayslot_micromips (SD_, dest, NIA, MICROMIPS_DELAYSLOT_SIZE_ANY);
685 010000,1010,1.TF,3.CC,00,16.IMMEDIATE:POOL32I:32::BC2a
686 "bc2%s<TF> <CC>, <IMMEDIATE>":CC == 0
687 "bc2%s<TF> <CC>, <IMMEDIATE>"
692 100101,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::BEQ
693 "b <IMMEDIATE>":RT == 0 && RS == 0
694 "beq r<RS>, r<RT>, <IMMEDIATE>"
698 address_word offset = EXTEND16 (IMMEDIATE) << 1;
699 if ((signed_word) GPR[RS] == (signed_word) GPR[RT])
700 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
701 MICROMIPS_DELAYSLOT_SIZE_ANY);
704 010000,00010,5.RS,16.IMMEDIATE:POOL32I:32::BGEZ
705 "bgez r<RS>, <IMMEDIATE>"
709 address_word offset = EXTEND16 (IMMEDIATE) << 1;
710 if ((signed_word) GPR[RS] >= 0)
711 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
712 MICROMIPS_DELAYSLOT_SIZE_ANY);
716 010000,00111,5.RS,16.IMMEDIATE:POOL32I:32::BEQZC
717 "beqzc r<RS>, <IMMEDIATE>"
721 address_word offset = EXTEND16 (IMMEDIATE) << 1;
727 010000,00011,5.RS,16.IMMEDIATE:POOL32I:32::BGEZAL
728 "bal <IMMEDIATE>":RS == 0
729 "bgezal r<RS>, <IMMEDIATE>"
733 address_word offset = EXTEND16 (IMMEDIATE) << 1;
736 RA = (NIA + MICROMIPS_DELAYSLOT_SIZE_32) | ISA_MODE_MICROMIPS;
737 if ((signed_word) GPR[RS] >= 0)
738 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
739 MICROMIPS_DELAYSLOT_SIZE_32);
743 010000,00110,5.RS,16.IMMEDIATE:POOL32I:32::BGTZ
744 "bgtz r<RS>, <IMMEDIATE>"
748 address_word offset = EXTEND16 (IMMEDIATE) << 1;
749 if ((signed_word) GPR[RS] > 0)
750 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
751 MICROMIPS_DELAYSLOT_SIZE_ANY);
755 010000,10011,5.RS,16.IMMEDIATE:POOL32I:32::BGEZALS
756 "bal <IMMEDIATE>":RS == 0
757 "bgezals r<RS>, <IMMEDIATE>"
761 address_word offset = EXTEND16 (IMMEDIATE) << 1;
764 RA = (NIA + MICROMIPS_DELAYSLOT_SIZE_16) | ISA_MODE_MICROMIPS;
765 if ((signed_word) GPR[RS] >= 0)
766 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
767 MICROMIPS_DELAYSLOT_SIZE_16);
771 010000,00100,5.RS,16.IMMEDIATE:POOL32I:32::BLEZ
772 "blez r<RS>, <IMMEDIATE>"
776 address_word offset = EXTEND16 (IMMEDIATE) << 1;
777 /* NOTE: The branch occurs AFTER the next instruction has been
779 if ((signed_word) GPR[RS] <= 0)
780 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
781 MICROMIPS_DELAYSLOT_SIZE_ANY);
785 010000,00000,5.RS,16.IMMEDIATE:POOL32I:32::BLTZ
786 "bltz r<RS>, <IMMEDIATE>"
790 address_word offset = EXTEND16 (IMMEDIATE) << 1;
791 if ((signed_word) GPR[RS] < 0)
792 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
793 MICROMIPS_DELAYSLOT_SIZE_ANY);
797 010000,00001,5.RS,16.IMMEDIATE:POOL32I:32::BLTZAL
798 "bltzal r<RS>, <IMMEDIATE>"
802 address_word offset = EXTEND16 (IMMEDIATE) << 1;
805 RA = (NIA + MICROMIPS_DELAYSLOT_SIZE_32) | ISA_MODE_MICROMIPS;
806 /* NOTE: The branch occurs AFTER the next instruction has been
808 if ((signed_word) GPR[RS] < 0)
809 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
810 MICROMIPS_DELAYSLOT_SIZE_32);
813 010000,10001,5.RS,16.IMMEDIATE:POOL32I:32::BLTZALS
814 "bltzals r<RS>, <IMMEDIATE>"
818 address_word offset = EXTEND16 (IMMEDIATE) << 1;
821 RA = (NIA + MICROMIPS_DELAYSLOT_SIZE_16) | ISA_MODE_MICROMIPS;
822 if ((signed_word) GPR[RS] < 0)
823 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
824 MICROMIPS_DELAYSLOT_SIZE_16);
828 101101,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::BNE
829 "bne r<RS>, r<RT>, <IMMEDIATE>"
833 address_word offset = EXTEND16 (IMMEDIATE) << 1;
834 if ((signed_word) GPR[RS] != (signed_word) GPR[RT])
835 NIA = delayslot_micromips (SD_, NIA + offset, NIA,
836 MICROMIPS_DELAYSLOT_SIZE_ANY);
840 010000,00101,5.RS,16.IMMEDIATE:POOL32I:32::BNEZC
841 "bnezc r<RS>, <IMMEDIATE>"
845 address_word offset = EXTEND16 (IMMEDIATE) << 1;
846 if ((signed_word) GPR[RS] != 0)
851 000000,20.CODE,000111:POOL32A:32::BREAK
856 do_break (SD_, instruction_0);
860 001000,5.OP,5.BASE,0110,12.IMMEDIATE:POOL32B:32::CACHE
861 "cache <OP>, <IMMEDIATE>(r<BASE>)"
865 address_word base = GPR[BASE];
866 address_word offset = EXTEND12 (IMMEDIATE);
867 address_word vaddr = loadstore_ea (SD_, base, offset);
868 address_word paddr = vaddr;
869 CacheOp (OP, vaddr, paddr, instruction_0);
873 011000,5.OP,5.BASE,1010011,9.IMMEDIATE:POOL32C:32::CACHEE
874 "cachee <OP>, <IMMEDIATE>(r<BASE>)"
879 010101,5.RT,5.FS,0001000000,111011:POOL32F:32,f::CFC1
884 do_cfc1 (SD_, RT, FS);
888 000000,5.RT,5.IMPL,1100110100,111100:POOL32A:32::CFC2
894 000000,5.RT,5.RS,0100101100,111100:POOL32A:32::CLO
899 do_clo (SD_, RT, RS);
903 000000,5.RT,5.RS,0101101100,111100:POOL32A:32::CLZ
908 do_clz (SD_, RT, RS);
912 000000,23.COFUN,010:POOL32A:32::COP2
918 010101,5.RT,5.FS,0001100000,111011:POOL32F:32,f::CTC1
923 do_ctc1 (SD_, RT, FS);
927 000000,5.RT,5.IMPL,1101110100,111100:POOL32A:32::CTC2
933 000000,00000000001110001101,111100:POOL32A:32::DERET
939 000000,00000,5.RS,0100011101,111100:POOL32A:32::DI
948 000000,5.RT,5.RS,1010101100,111100:POOL32A:32::DIV
953 do_div (SD_, RS, RT);
957 000000,5.RT,5.RS,1011101100,111100:POOL32A:32::DIVU
962 do_divu (SD_, RS, RT);
966 000000,00000000000001100000,000000:POOL32A:32::EHB
972 000000,00000,5.RS,0101011101,111100:POOL32A:32::EI
981 000000,00000000001111001101,111100:POOL32A:32::ERET
988 /* Oops, not yet available */
989 sim_io_printf (SD, "Warning: ERET when SR[ERL] set not supported");
1001 000000,5.RT,5.RS,5.MSBD,5.LSB,101100:POOL32A:32::EXT
1002 "ext r<RT>, r<RS>, <LSB>, <MSBD+1>"
1006 do_ext (SD_, RT, RS, LSB, MSBD);
1010 000000,5.RT,5.RS,5.MSBD,5.LSB,001100:POOL32A:32::INS
1011 "ins r<RT>, r<RS>, <LSB>, <MSBD-LSB+1>"
1015 do_ins (SD_, RT, RS, LSB, MSBD);
1019 110101,26.IMMEDIATE:MICROMIPS:32::J
1020 "j <IMM_SHIFT_1BIT>"
1024 address_word region = (NIA & MASK (63, 27));
1025 NIA = delayslot_micromips (SD_, region | (IMM_SHIFT_1BIT), NIA,
1026 MICROMIPS_DELAYSLOT_SIZE_ANY);
1030 111101,26.IMMEDIATE:MICROMIPS:32::JAL
1031 "jal <IMM_SHIFT_1BIT>"
1035 /* NOTE: The region used is that of the delay slot and NOT the
1036 current instruction */
1037 address_word region = (NIA & MASK (63, 27));
1038 NIA = do_micromips_jal (SD_, (region | (IMM_SHIFT_1BIT)), NIA,
1039 MICROMIPS_DELAYSLOT_SIZE_32);
1043 011101,26.IMMEDIATE:MICROMIPS:32::JALS
1044 "jals <IMM_SHIFT_1BIT>"
1048 address_word region = (NIA & MASK (63, 27));
1049 NIA = do_micromips_jal (SD_, (region | (IMM_SHIFT_1BIT)), NIA,
1050 MICROMIPS_DELAYSLOT_SIZE_16);
1053 000000,5.RT!0,5.RS,0000111100,111100:POOL32A:32::JALR
1054 "jalr r<RS>":RT == 31
1061 NIA = do_micromips_jalr (SD_, RT, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_32);
1064 000000,5.RT,5.RS,0100111100,111100:POOL32A:32::JALRS
1065 "jalrs r<RT>, r<RS>"
1071 NIA = do_micromips_jalr (SD_, RT, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_16);
1075 111100,26.IMMEDIATE:MICROMIPS:32::JALX
1076 "jalx <IMM_SHIFT_2BIT>"
1080 struct mips_sim_state *state = MIPS_SIM_STATE (SD);
1081 address_word region = (NIA & MASK (63, 26));
1082 NIA = do_micromips_jal (SD_, (region | (IMM_SHIFT_2BIT)) | ISA_MODE_MIPS32,
1083 NIA, MICROMIPS_DELAYSLOT_SIZE_32);
1084 state->isa_mode = ISA_MODE_MIPS32;
1087 000000,00000,5.RS,0000111100,111100:POOL32A:32::JR
1092 NIA = process_isa_mode (SD_,
1093 delayslot_micromips (SD_, GPR[RS], NIA,
1094 MICROMIPS_DELAYSLOT_SIZE_32));
1098 000000,5.RT,5.RS,0001111100,111100:POOL32A:32::JALR.HB
1099 "jalr.hb r<RT>, r<RS>"
1105 NIA = do_micromips_jalr (SD_, RT, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_32);
1109 000000,5.RT,5.RS,0101111100,111100:POOL32A:32::JALRS.HB
1110 "jalrs.hb r<RT>, r<RS>"
1116 NIA = do_micromips_jalr (SD_, RT, RS, NIA, MICROMIPS_DELAYSLOT_SIZE_16);
1120 000000,00000,5.RS,0111111100,111100:POOL32A:32::JR.HB
1125 NIA = process_isa_mode (SD_,
1126 delayslot_micromips (SD_, GPR[RS], NIA,
1127 MICROMIPS_DELAYSLOT_SIZE_32));
1131 000111,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LB
1132 "lb r<RT>, <IMMEDIATE>(r<BASE>)"
1136 do_lb (SD_, RT, IMMEDIATE, BASE);
1140 011000,5.RT,5.BASE,0110100,9.IMMEDIATE:POOL32C:32::LBE
1141 "lbe r<RT>, <IMMEDIATE>(r<BASE>)"
1146 000101,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LBU
1147 "lbu r<RT>, <IMMEDIATE>(r<BASE>)"
1151 do_lbu (SD_, RT, IMMEDIATE, BASE);
1155 011000,5.RT,5.BASE,0110000,9.IMMEDIATE:POOL32C:32::LBUE
1156 "lbue r<RT>, <IMMEDIATE>(r<BASE>)"
1161 101111,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::LDC1a
1162 "ldc1 f<FT>, <IMMEDIATE>(r<BASE>)"
1166 COP_LD (1, FT, do_load_double (SD_, GPR[BASE], EXTEND16 (IMMEDIATE)));
1170 101111,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::LDC1b
1171 "ldc1 f<FT>, <IMMEDIATE>(r<BASE>)"
1175 COP_LD (1, FT, do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
1176 EXTEND16 (IMMEDIATE)));
1180 001000,5.RT,5.BASE,0010,12.IMMEDIATE:POOL32B:32::LDC2
1181 "ldc2 r<RT>, <IMMEDIATE>(r<BASE>)"
1186 001111,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LH
1187 "lh r<RT>, <IMMEDIATE>(r<BASE>)"
1191 do_lh (SD_, RT, IMMEDIATE, BASE);
1195 011000,5.RT,5.BASE,0110101,9.IMMEDIATE:POOL32C:32::LHE
1196 "lhe r<RT>, <IMMEDIATE>(r<BASE>)"
1201 001101,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LHU
1202 "lhu r<RT>, <IMMEDIATE>(r<BASE>)"
1206 do_lhu (SD_, RT, IMMEDIATE, BASE);
1210 011000,5.RT,5.BASE,0110001,9.IMMEDIATE:POOL32C:32::LHUE
1211 "lhue r<RT>, <IMMEDIATE>(r<BASE>)"
1216 011000,5.RT,5.BASE,0011,12.IMMEDIATE:POOL32C:32::LL
1217 "ll r<RT>, <IMMEDIATE>(r<BASE>)"
1221 do_ll (SD_, RT, EXTEND12 (IMMEDIATE), BASE);
1225 011000,5.RT,5.BASE,0110110,9.IMMEDIATE:POOL32C:32::LLE
1226 "lle r<RT>, <IMMEDIATE>(r<BASE>)"
1231 010000,01101,5.RS,16.IMMEDIATE:POOL32I:32::LUI
1232 "lui r<RS>, <IMMEDIATE>"
1236 do_lui (SD_, RS, IMMEDIATE);
1240 010101,5.INDEX,5.BASE,5.FD,00101,001000:POOL32F:32,f::LUXC1
1241 "luxc1 f<FD>, r<INDEX>(r<BASE>)"
1244 do_luxc1_32 (SD_, FD, INDEX, BASE);
1248 010101,5.INDEX,5.BASE,5.FD,00101,001000:POOL32F:64,f::LUXC1
1249 "luxc1 f<FD>, r<INDEX>(r<BASE>)"
1253 check_u64 (SD_, instruction_0);
1254 do_luxc1_64 (SD_, FD, INDEX, BASE);
1258 111111,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::LW
1259 "lw r<RT>, <IMMEDIATE>(r<BASE>)"
1263 do_lw (SD_, RT, IMMEDIATE, BASE);
1267 100111,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::LWC1
1268 "lwc1 f<FT>, <IMMEDIATE>(r<BASE>)"
1272 do_lwc1 (SD_, FT, IMMEDIATE, BASE);
1276 001000,5.RT,5.BASE,0000,12.IMMEDIATE:POOL32B:32::LWC2
1277 "lwc2 r<RT>, <IMMEDIATE>(r<BASE>)"
1282 011000,5.RT,5.BASE,0110111,9.IMMEDIATE:POOL32C:32::LWE
1283 "lwe r<RT>, <IMMEDIATE>(r<BASE>)"
1288 011000,5.RT,5.BASE,0110011,9.IMMEDIATE:POOL32C:32::LWEE
1289 "lwee r<RT>, <IMMEDIATE>(r<BASE>)"
1294 011000,5.RT,5.BASE,0000,12.IMMEDIATE:POOL32C:32::LWL
1295 "lwl r<RT>, <IMMEDIATE>(r<BASE>)"
1299 do_lwl (SD_, RT, EXTEND12 (IMMEDIATE), BASE);
1303 011000,5.RT,5.BASE,0110010,9.IMMEDIATE:POOL32C:32::LWLE
1304 "lwle r<RT>, <IMMEDIATE>(r<BASE>)"
1308 :%s::::LWM32REGS:int lwmregs
1314 switch (lwmregs & 0xf)
1321 return "s0, s1, ra";
1323 return "s0, s1, s2, ra";
1325 return "s0, s1, s2, s3, ra";
1327 return "s0, s1, s2, s3, s4, ra";
1329 return "s0, s1, s2, s3, s4, s5, ra";
1331 return "s0, s1, s2, s3, s4, s5, s6, ra";
1333 return "s0, s1, s2, s3, s4, s5, s6, s7, ra";
1335 return "s0, s1, s2, s3, s4, s5, s6, s7, s8, ra";
1342 switch (lwmregs & 0xf)
1349 return "s0, s1, s2";
1351 return "s0, s1, s2, s3";
1353 return "s0, s1, s2, s3, s4";
1355 return "s0, s1, s2, s3, s4, s5";
1357 return "s0, s1, s2, s3, s4, s5, s6";
1359 return "s0, s1, s2, s3, s4, s5, s6, s7";
1361 return "s0, s1, s2, s3, s4, s5, s6, s7, s8";
1368 001000,5.LWM32REGS,5.BASE,0101,12.IMMEDIATE:POOL32B:32::LWM32
1369 "lwm32 %s<LWM32REGS>, <IMMEDIATE>(r<BASE>)"
1373 int address_base = GPR[BASE] + EXTEND12 (IMMEDIATE);
1375 for (reg_offset = 0; reg_offset < (LWM32REGS & 0xf); reg_offset++)
1377 int dst = (reg_offset == 8) ? 30 : 16 + reg_offset;
1378 GPR[dst] = EXTEND32 (do_load (SD_, AccessLength_WORD, address_base,
1382 if (LWM32REGS & 0x10)
1383 RA = EXTEND32 (do_load (SD_, AccessLength_WORD, address_base,
1388 001000,5.RD,5.BASE,0001,12.IMMEDIATE:POOL32B:32::LWP
1389 "lwp r<RD>, <IMMEDIATE>(r<BASE>)"
1393 if (BASE == RD || RD == 31)
1397 do_lw (SD_, RD, EXTEND12 (IMMEDIATE), BASE);
1398 do_lw (SD_, RD + 1, EXTEND12 (IMMEDIATE) + 4, BASE);
1403 011000,5.RT,5.BASE,0001,12.IMMEDIATE:POOL32C:32::LWR
1404 "lwr r<RT>, <IMMEDIATE>(r<BASE>)"
1408 do_lwr (SD_, RT, EXTEND12 (IMMEDIATE), BASE);
1412 011000,5.RT,5.BASE,1110,12.IMMEDIATE:POOL32C:32::LWU
1413 "lwu r<RT>, <IMMEDIATE>(r<BASE>)"
1417 do_lwu (SD_, RT, IMMEDIATE, BASE, instruction_0);
1421 010101,5.INDEX,5.BASE,5.FD,00001,001000:POOL32F:32,f::LWXC1
1422 "lwxc1 f<FD>, <INDEX>(r<BASE>)"
1426 do_lwxc1 (SD_, FD, INDEX, BASE, instruction_0);
1430 000000,5.INDEX,5.BASE,5.RD,00100,011000:POOL32A:32::LWXS
1431 "lwxs r<RD>, r<INDEX>(r<BASE>)"
1435 GPR[RD] = EXTEND32 (do_load (SD_, AccessLength_WORD, GPR[BASE],
1440 000000,5.RT,5.RS,1100101100,111100:POOL32A:32::MADD
1445 do_madd (SD_, RS, RT);
1449 000000,5.RT,5.RS,1101101100,111100:POOL32A:32::MADDU
1450 "maddu r<RS>, r<RT>"
1454 do_maddu (SD_, RS, RT);
1458 000000,5.RT,5.RS,00,3.SEL,00011,111100:POOL32A:32::MFC0
1459 "mfc0 r<RS>, r<RT>": SEL == 0
1460 "mfc0 r<RS>, r<RT>, <SEL>"
1464 DecodeCoproc (instruction_0, 0, cp0_mfc0, RT, RS, SEL);
1468 010101,5.RT,5.FS,0010000000,111011:POOL32F:32,f::MFC1
1473 do_mfc1b (SD_, RT, FS);
1477 000000,5.RT,5.IMPL,0100110100,111100:POOL32A:32::MFC2
1478 "mfc2 r<RT>, <IMPL>"
1483 010101,5.RT,5.FS,0011000000,111011:POOL32F:32,f::MFHC1
1484 "mfhc1 r<RT>, f<FS>"
1488 do_mfhc1 (SD_, RT, FS);
1492 000000,5.RT,5.IMPL,1000110100,111100:POOL32A:32::MFHC2
1493 "mfhc2 r<RT>, <IMPL>"
1498 000000,00000,5.RS,0000110101,111100:POOL32A:32::MFHI
1507 000000,00000,5.RS,0001110101,111100:POOL32A:32::MFLO
1518 010101,5.RT,5.RS,3.CC,0,1.TF,00101,111011:POOL32F:32::MOVtf
1519 "mov%s<TF> r<RT>, r<RS>, CC"
1523 do_movtf (SD_, TF, RT, RS, CC);
1527 000000,5.RT,5.RS,5.RD,00000,011000:POOL32A:32::MOVN
1528 "movn r<RD>, r<RS>, r<RT>"
1532 do_movn (SD_, RD, RS, RT);
1536 000000,5.RT,5.RS,5.RD,00001,011000:POOL32A:32::MOVZ
1537 "movz r<RD>, r<RS>, r<RT>"
1541 do_movz (SD_, RD, RS, RT);
1545 000000,5.RT,5.RS,1110101100,111100:POOL32A:32::MSUB
1550 do_msub (SD_, RS, RT);
1554 000000,5.RT,5.RS,1111101100,111100:POOL32A:32::MSUBU
1555 "msubu r<RS>, r<RT>"
1559 do_msubu (SD_, RS, RT);
1563 000000,5.RT,5.RS,00,3.SEL,01011,111100:POOL32A:32::MTC0
1564 "mtc0 r<RS>, r<RT>": SEL == 0
1565 "mtc0 r<RS>, r<RT>, <SEL>"
1569 DecodeCoproc (instruction_0, 0, cp0_mtc0, RT, RS, SEL);
1573 010101,5.RT,5.FS,0010100000,111011:POOL32F:32,f::MTC1
1578 do_mtc1b (SD_, RT, FS);
1582 000000,5.RT,5.IMPL,0101110100,111100:POOL32A:32::MTC2
1583 "mtc2 r<RT>, <IMPL>"
1588 010101,5.RT,5.FS,0011100000,111011:POOL32F:32,f::MTHC1
1589 "mthc1 r<RT>, f<FS>"
1593 do_mthc1 (SD_, RT, FS);
1597 000000,5.RT,5.IMPL,1001110100,111100:POOL32A:32::MTHC2
1598 "mthc2 r<RT>, <IMPL>"
1603 000000,00000,5.RS,0010110101,111100:POOL32A:32::MTHI
1612 000000,00000,5.RS,0011110101,111100:POOL32A:32::MTLO
1621 000000,5.RT,5.RS,5.RD,01000,010000:POOL32A:32::MUL
1622 "mul r<RD>, r<RS>, r<RT>"
1626 do_mul (SD_, RD, RS, RT);
1630 000000,5.RT,5.RS,1000101100,111100:POOL32A:32::MULT
1635 do_mult (SD_, RS, RT, 0);
1639 000000,5.RT,5.RS,1001101100,111100:POOL32A:32::MULTU
1644 do_multu (SD_, RS, RT, 0);
1648 000000,00000000000000000000,000000:POOL32A:32::NOP
1656 000000,5.RT,5.RS,5.RD,01011,010000:POOL32A:32::NOR
1657 "nor r<RD>, r<RS>, r<RT>"
1661 do_nor (SD_, RS, RT, RD);
1665 000000,5.RT,5.RS,5.RD,01010,010000:POOL32A:32::OR
1666 "or r<RD>, r<RS>, r<RT>"
1670 do_or (SD_, RS, RT, RD);
1674 010100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::ORI
1675 "ori r<RT>, r<RS>, <IMMEDIATE>"
1679 do_ori (SD_, RS, RT, IMMEDIATE);
1683 000000,00000000000010100000,000000:POOL32A:32::PAUSE
1689 011000,5.HINT,5.BASE,0010,12.IMMEDIATE:POOL32C:32::PREF
1690 "pref <HINT>, <IMMEDIATE>(r<BASE>)"
1694 do_pref (SD_, HINT, EXTEND12 (IMMEDIATE), BASE);
1698 011000,5.HINT,5.BASE,1010010,9.IMMEDIATE:POOL32C:32::PREFE
1699 "prefe <HINT>, <IMMEDIATE>(r<BASE>)"
1704 010101,5.INDEX,5.BASE,5.HINT,00110,100000:POOL32F:32::PREFX
1705 "prefx <HINT>, r<INDEX>(r<BASE>)"
1709 do_prefx (SD_, HINT, INDEX, BASE);
1712 000000,5.RT,5.RS,0110101100,111100:POOL32A:32::RDHWR
1713 "rdhwr r<RS>, r<RT>"
1717 do_rdhwr (SD_, RT, RS);
1720 000000,5.RT,5.RS,1110000101,111100:POOL32A:32::RDPGPR
1721 "rdpgpr r<RS>, r<RT>"
1726 000000,5.RT,5.RS,5.SHIFT,00011,000000:POOL32A:32::ROTR
1727 "rotr r<RT>, r<RS>, <SHIFT>"
1731 GPR[RT] = do_ror (SD_, GPR[RS], SHIFT);
1735 000000,5.RT,5.RS,5.RD,00011,010000:POOL32A:32::ROTRV
1736 "rotrv r<RD>, r<RT>, r<RS>"
1740 GPR[RD] = do_ror (SD_, GPR[RT], GPR[RS]);
1744 000110,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::SB
1745 "sb r<RT>, <IMMEDIATE>(r<BASE>)"
1749 do_store (SD_, AccessLength_BYTE, GPR[BASE], EXTEND16 (IMMEDIATE), GPR[RT]);
1753 011000,5.RT,5.BASE,1010101,9.IMMEDIATE:POOL32C:32::SBE
1754 "sbe r<RT>, <IMMEDIATE>(r<BASE>)"
1759 011000,5.RT,5.BASE,1011,12.IMMEDIATE:POOL32C:32::SC
1760 "sc r<RT>, <IMMEDIATE>(r<BASE>)"
1764 do_sc (SD_, RT, EXTEND12 (IMMEDIATE), BASE, instruction_0, 1);
1768 011000,5.RT,5.BASE,1010110,9.IMMEDIATE:POOL32C:32::SCE
1769 "sce r<RT>, <IMMEDIATE>(r<BASE>)"
1774 000000,10.CODE,1101101101,111100:POOL32A:32::SDBBP
1779 SignalException (DebugBreakPoint, instruction_0);
1783 101110,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::SDC1a
1784 "sdc1 f<FT>, <IMMEDIATE>(r<BASE>)"
1787 do_sdc1 (SD_, FT, IMMEDIATE, BASE);
1791 101110,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::SDC1b
1792 "sdc1 f<FT>, <IMMEDIATE>(r<BASE>)"
1796 do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND16 (IMMEDIATE),
1801 001000,5.RT,5.BASE,1010,12.IMMEDIATE:MICROMIPS:32::SDC2
1802 "sdc2 r<RT>, <IMMEDIATE>(r<BASE>)"
1807 000000,5.RT,5.RS,0010101100,111100:POOL32A:32::SEB
1812 do_seb (SD_, RT, RS);
1816 000000,5.RT,5.RS,0011101100,111100:POOL32A:32::SEH
1821 do_seh (SD_, RT, RS);
1825 001110,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::SH
1826 "sh r<RT>, <IMMEDIATE>(r<BASE>)"
1830 do_store (SD_, AccessLength_HALFWORD, GPR[BASE], EXTEND16 (IMMEDIATE),
1835 011000,5.RT,5.BASE,1010100,9.IMMEDIATE:POOL32C:32::SHE
1836 "she r<RT>, <IMMEDIATE>(r<BASE>)"
1841 000000,5.RT!0,5.RS!0,5.SHIFT,00000,000000:POOL32A:32::SLL
1842 "sll r<RT>, r<RS>, <SHIFT>"
1846 do_sll (SD_, RS, RT, SHIFT);
1850 000000,5.RT,5.RS,5.RD,00000,010000:POOL32A:32::SLLV
1851 "sllv r<RD>, r<RT>, r<RS>"
1855 do_sllv (SD_, RS, RT, RD);
1859 000000,5.RT,5.RS,5.RD,01101,010000:POOL32A:32::SLT
1860 "slt r<RD>, r<RS>, r<RT>"
1864 do_slt (SD_, RS, RT, RD);
1868 100100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::SLTI
1869 "slti r<RT>, r<RS>, <IMMEDIATE>"
1873 do_slti (SD_, RS, RT, IMMEDIATE);
1877 101100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::SLTIU
1878 "sltiu r<RT>, r<RS>, <IMMEDIATE>"
1882 do_sltiu (SD_, RS, RT, IMMEDIATE);
1886 000000,5.RT,5.RS,5.RD,01110,010000:POOL32A:32::SLTU
1887 "sltu r<RD>, r<RS>, r<RT>"
1891 do_sltu (SD_, RS, RT, RD);
1895 000000,5.RT,5.RS,5.SHIFT,00010,000000:POOL32A:32::SRA
1896 "sra r<RT>, r<RS>, <SHIFT>"
1900 do_sra (SD_, RS, RT, SHIFT);
1904 000000,5.RT,5.RS,5.RD,00010,010000:POOL32A:32::SRAV
1905 "srav r<RD>, r<RT>, r<RS>"
1909 do_srav (SD_, RS, RT, RD);
1913 000000,5.RT,5.RS,5.SHIFT,00001,000000:POOL32A:32::SRL
1914 "srl r<RT>, r<RS>, <SHIFT>"
1918 do_srl (SD_, RS, RT, SHIFT);
1922 000000,5.RT,5.RS,5.RD,00001,010000:POOL32A:32::SRLV
1923 "srlv r<RD>, r<RT>, r<RS>"
1927 do_srlv (SD_, RS, RT, RD);
1931 000000,00000000000000100000,000000:POOL32A:32::SSNOP
1939 000000,5.RT,5.RS,5.RD,00110,010000:POOL32A:32::SUB
1940 "sub r<RD>, r<RS>, r<RT>"
1944 do_sub (SD_, RD, RS, RT);
1948 000000,5.RT,5.RS,5.RD,00111,010000:POOL32A:32::SUBU
1949 "subu r<RD>, r<RS>, r<RT>"
1953 do_subu (SD_, RS, RT, RD);
1957 010101,5.INDEX,5.BASE,5.FD,00110,001000:POOL32F:32,f::SUXC1
1958 "suxc1 f<FD>, r<INDEX>(r<BASE>)"
1961 do_suxc1_32 (SD_, FD, INDEX, BASE);
1965 010101,5.INDEX,5.BASE,5.FD,00110,001000:POOL32F:64,f::SUXC1
1966 "suxc1 f<FD>, r<INDEX>(r<BASE>)"
1970 check_u64 (SD_, instruction_0);
1971 do_suxc1_64 (SD_, FD, INDEX, BASE);
1974 111110,5.RT,5.BASE,16.IMMEDIATE:MICROMIPS:32::SW
1975 "sw r<RT>, <IMMEDIATE>(r<BASE>)"
1979 do_store (SD_, AccessLength_WORD, GPR[BASE], EXTEND16 (IMMEDIATE), GPR[RT]);
1983 100110,5.FT,5.BASE,16.IMMEDIATE:MICROMIPS:32,f::SWC1
1984 "swc1 f<FT>, <IMMEDIATE>(r<BASE>)"
1988 do_swc1 (SD_, FT, IMMEDIATE, BASE, instruction_0);
1992 001000,5.RT,5.BASE,1000,12.IMMEDIATE:POOL32B:32::SWC2
1993 "swc2 r<RT>, <IMMEDIATE>(r<BASE>)"
1998 011000,5.RT,5.BASE,1010111,9.IMMEDIATE:POOL32C:32::SWE
1999 "swe r<RT>, <IMMEDIATE>(r<BASE>)"
2004 011000,5.RT,5.BASE,1000,12.IMMEDIATE:POOL32C:32::SWL
2005 "swl r<RT>, <IMMEDIATE>(r<BASE>)"
2009 do_store_left (SD_, AccessLength_WORD, GPR[BASE], EXTEND12 (IMMEDIATE),
2014 011000,5.RT,5.BASE,1010000,9.IMMEDIATE:POOL32C:32::SWLE
2015 "swle r<RT>, <IMMEDIATE>(r<BASE>)"
2020 001000,5.LWM32REGS,5.BASE,1101,12.IMMEDIATE:POOL32B:32::SWM32
2021 "swm32 %s<LWM32REGS>, <IMMEDIATE>(r<BASE>)"
2025 int address_base = GPR[BASE] + EXTEND12 (IMMEDIATE);
2027 for (reg_offset = 0; reg_offset < (LWM32REGS & 0xf); reg_offset++)
2029 int src = (reg_offset == 8) ? 30 : 16 + reg_offset;
2030 do_store (SD_, AccessLength_WORD, address_base, 4 * reg_offset,
2034 if (LWM32REGS & 0x10)
2035 do_store (SD_, AccessLength_WORD, address_base, 4 * reg_offset, RA);
2039 001000,5.RS1,5.BASE,1001,12.IMMEDIATE:POOL32B:32::SWP
2040 "swp r<RS1>, <IMMEDIATE>(r<BASE>)"
2048 do_sw (SD_, RS1, EXTEND12 (IMMEDIATE), BASE);
2049 do_sw (SD_, RS1 + 1, EXTEND12 (IMMEDIATE) + 4, BASE);
2054 011000,5.RT,5.BASE,1001,12.IMMEDIATE:POOL32C:32::SWR
2055 "swr r<RT>, <IMMEDIATE>(r<BASE>)"
2059 do_store_right (SD_, AccessLength_WORD, GPR[BASE], EXTEND12 (IMMEDIATE),
2064 011000,5.RT,5.BASE,1010001,9.IMMEDIATE:POOL32C:32::SWRE
2065 "swre r<RT>, <IMMEDIATE>(r<BASE>)"
2070 010101,5.INDEX,5.BASE,5.FD,00010,001000:POOL32F:32,f::SWXC1
2071 "swxc1 f<FD>, r<INDEX>(r<BASE>)"
2075 do_swxc1 (SD_, FD, INDEX, BASE, instruction_0);
2079 000000,00000,5.STYPE,0110101101,111100:POOL32A:32::SYNC
2084 SyncOperation (STYPE);
2088 010000,10000,5.BASE,16.IMMEDIATE:POOL32I:32::SYNCI
2089 "synci <IMMEDIATE>(r<BASE>)"
2095 000000,10.CODE,1000101101,111100:POOL32A:32::SYSCALL
2096 "syscall %#lx<CODE>"
2100 SignalException (SystemCall, instruction_0);
2104 000000,5.RT,5.RS,4.CODE,000000,111100:POOL32A:32::TEQ
2109 do_teq (SD_, RS, RT, instruction_0);
2113 010000,01110,5.RS,16.IMMEDIATE:POOL32I:32::TEQI
2114 "teqi r<RS>, <IMMEDIATE>"
2118 do_teqi (SD_, RS, IMMEDIATE, instruction_0);
2122 000000,5.RT,5.RS,4.CODE,001000,111100:POOL32A:32::TGE
2127 do_tge (SD_, RS, RT, instruction_0);
2131 010000,01001,5.RS,16.IMMEDIATE:POOL32I:32::TGEI
2132 "tgei r<RS>, <IMMEDIATE>"
2136 do_tgei (SD_, RS, IMMEDIATE, instruction_0);
2140 010000,01011,5.RS,16.IMMEDIATE:POOL32I:32::TGEIU
2141 "tgeiu r<RS>, <IMMEDIATE>"
2145 do_tgeiu (SD_, RS, IMMEDIATE, instruction_0);
2149 000000,5.RT,5.RS,4.CODE,010000,111100:POOL32A:32::TGEU
2154 do_tgeu (SD_, RS, RT, instruction_0);
2158 000000,00000000000000001101,111100:POOL32A:32::TLBP
2164 000000,00000000000001001101,111100:POOL32A:32::TLBR
2170 000000,00000000000010001101,111100:POOL32A:32::TLBWI
2176 000000,00000000000011001101,111100:POOL32A:32::TLBWR
2182 000000,5.RT,5.RS,4.CODE,100000,111100:POOL32A:32::TLT
2183 "tlt r<RS>, r<RT>, %#lx<CODE>"
2187 do_tlt (SD_, RS, RT, instruction_0);
2191 010000,01000,5.RS,16.IMMEDIATE:POOL32I:32::TLTI
2192 "tlti r<RS>, <IMMEDIATE>"
2196 do_tlti (SD_, RS, IMMEDIATE, instruction_0);
2200 010000,01010,5.RS,16.IMMEDIATE:POOL32I:32::TLTIU
2201 "tltiu r<RS>, <IMMEDIATE>"
2205 do_tltiu (SD_, RS, IMMEDIATE, instruction_0);
2209 000000,5.RT,5.RS,4.CODE,101000,111100:POOL32A:32::TLTU
2214 do_tltu (SD_, RS, RT, instruction_0);
2218 000000,5.RT,5.RS,4.CODE,110000,111100:POOL32A:32::TNE
2223 do_tne (SD_, RS, RT, instruction_0);
2227 010000,01100,5.RS,16.IMMEDIATE:POOL32I:32::TNEI
2228 "tnei r<RS>, <IMMEDIATE>"
2232 do_tnei (SD_, RS, IMMEDIATE, instruction_0);
2236 000000,10.CODE,1001001101,111100:POOL32A:32::WAIT
2242 000000,5.RT,5.RS,1111000101,111100:POOL32A:32::WRPGPR
2243 "wrpgpr r<RS>, r<RT>"
2248 000000,5.RT,5.RS,0111101100,111100:POOL32A:32::WSBH
2253 do_wsbh (SD_, RT, RS);
2257 000000,5.RT,5.RS,5.RD,01100,010000:POOL32A:32::XOR
2258 "xor r<RD>, r<RS>, r<RT>"
2262 do_xor (SD_, RS, RT, RD);
2266 011100,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:32::XORI
2267 "xori r<RT>, r<RS>, <IMMEDIATE>"
2271 do_xori (SD_, RS, RT, IMMEDIATE);
2275 :%s::::FMT_MICROMIPS:int fmt
2283 case 2: return "ps";
2284 default: return "?";
2289 :%s::::FMT_MICROMIPS_CVT_D:int fmt
2298 default: return "?";
2303 :%s::::FMT_MICROMIPS_CVT_S:int fmt
2312 default: return "?";
2317 010101,5.FT,5.FS,0,2.FMT_MICROMIPS!3,0001101,111011:POOL32F:32,f::ABS.fmt
2318 "abs.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2322 do_abs_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FT, FS,
2327 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,00,110000:POOL32F:32,f::ADD.fmt
2328 "add.%s<FMT_MICROMIPS> f<FD>, f<FS>, f<FT>"
2332 do_add_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT,
2337 010101,5.FT,5.FS,5.FD,5.RS,011001:POOL32F:32,f::ALNV.PS
2338 "alnv.ps f<FD>, f<FS>, f<FT>, r<RS>"
2342 do_alnv_ps (SD_, FD, FS, FT, RS, instruction_0);
2346 010101,5.FT,5.FS,3.CC,0,2.FMT_MICROMIPS!3,4.COND,111100:POOL32F:32,f::C.cond.fmt
2347 "c.%s<COND>.%s<FMT_MICROMIPS> f<FS>, f<FT>":CC == 0
2348 "c.%s<COND>.%s<FMT_MICROMIPS> <CC>, f<FS>, f<FT>"
2352 do_c_cond_fmt (SD_, COND, convert_fmt_micromips (SD_, FMT_MICROMIPS), CC,
2353 FS, FT, instruction_0);
2357 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,01001100,111011:POOL32F:32,f::CEIL.L.fmt
2358 "ceil.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2362 do_ceil_fmt (SD_, fmt_long, FMT_MICROMIPS, FT, FS, instruction_0);
2366 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,01101100,111011:POOL32F:32,f::CEIL.W.fmt
2367 "ceil.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2371 do_ceil_fmt (SD_, fmt_word, FMT_MICROMIPS, FT, FS, instruction_0);
2375 010101,5.FT,5.FS,0,2.FMT_MICROMIPS_CVT_D!3,1001101,111011:POOL32F:32,f::CVT.D.fmt
2376 "cvt.d.%s<FMT_MICROMIPS_CVT_D> f<FT>, f<FS>"
2380 do_cvt_d_fmt (SD_, convert_fmt_micromips_cvt_d (SD_, FMT_MICROMIPS_CVT_D),
2381 FT, FS, instruction_0);
2385 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00000100,111011:POOL32F:32,f::CVT.L.fmt
2386 "cvt.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2390 do_cvt_l_fmt (SD_, FMT_MICROMIPS, FT, FS, instruction_0);
2394 010101,5.FT,5.FS,5.FD,00110,000000:POOL32F:32,f::CVT.PS.S
2395 "cvt.ps.s f<FD>, f<FS>, f<FT>"
2399 do_cvt_ps_s (SD_, FD, FS, FT, instruction_0);
2403 010101,5.FT,5.FS,0,2.FMT_MICROMIPS_CVT_S!3,1101101,111011:POOL32F:32,f::CVT.S.fmt
2404 "cvt.s.%s<FMT_MICROMIPS_CVT_S> f<FT>, f<FS>"
2408 do_cvt_s_fmt (SD_, convert_fmt_micromips_cvt_s (SD_, FMT_MICROMIPS_CVT_S),
2409 FT, FS, instruction_0);
2413 010101,5.FT,5.FS,00,10000100,111011:POOL32F:32,f::CVT.S.PL
2414 "cvt.s.pl f<FT>, f<FS>"
2418 do_cvt_s_pl (SD_, FT, FS, instruction_0);
2422 010101,5.FT,5.FS,00,10100100,111011:POOL32F:32,f::CVT.S.PU
2423 "cvt.s.pu f<FT>, f<FS>"
2427 do_cvt_s_pu (SD_, FT, FS, instruction_0);
2431 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00100100,111011:POOL32F:32,f::CVT.W.fmt
2432 "cvt.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2436 do_cvt_w_fmt (SD_, FMT_MICROMIPS, FT, FS, instruction_0);
2440 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!2!3,11,110000:POOL32F:32,f::DIV.fmt
2441 "div.%s<FMT_MICROMIPS> f<FD>, f<FS>, f<FT>"
2445 do_div_fmt (SD_, FMT_MICROMIPS, FD, FS, FT, instruction_0);
2449 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00001100,111011:POOL32F:32,f::FLOOR.L.fmt
2450 "floor.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2454 do_floor_fmt (SD_, fmt_long, FMT_MICROMIPS, FT, FS);
2458 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00101100,111011:POOL32F:32,f::FLOOR.W.fmt
2459 "floor.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2463 do_floor_fmt (SD_, fmt_word, FMT_MICROMIPS, FT, FS);
2467 010101,5.FT,5.FS,5.FD,5.FR,0,2.FMT_MICROMIPS!3,001:POOL32F:32,f::MADD.fmt
2468 "madd.%s<FMT_MICROMIPS> f<FD>, f<FR>, f<FS>, f<FT>"
2472 do_madd_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FR, FS,
2476 010101,5.FT,5.FS,0,2.FMT_MICROMIPS!3,0000001,111011:POOL32F:32,f::MOV.fmt
2477 "mov.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2481 do_mov_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FT, FS,
2486 010101,5.FT,5.FS,3.CC,00,2.FMT_MICROMIPS!3,00,1.TF,100000:POOL32F:32,f::MOVtf.fmt
2487 "mov%s<TF>.%s<FMT_MICROMIPS> f<FT>, f<FS>, <CC>"
2491 do_movtf_fmt (SD_, TF, convert_fmt_micromips (SD_, FMT_MICROMIPS), FT,
2496 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,00,111000:POOL32F:32,f::MOVN.fmt
2497 "movn.%s<FMT_MICROMIPS> f<FD>, f<FS>, r<FT>"
2501 do_movn_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT);
2504 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,01,111000:POOL32F:32,f::MOVZ.fmt
2505 "movz.%s<FMT_MICROMIPS> f<FD>, f<FS>, r<FT>"
2509 do_movz_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT);
2513 010101,5.FT,5.FS,5.FD,5.FR,1,2.FMT_MICROMIPS!3,001:POOL32F:32,f::MSUB.fmt
2514 "msub.%s<FMT_MICROMIPS> f<FD>, f<FR>, f<FS>, f<FT>"
2518 do_msub_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FR, FS,
2522 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,10,110000:POOL32F:32,f::MUL.fmt
2523 "mul.%s<FMT_MICROMIPS> f<FD>, f<FS>, f<FT>"
2527 do_mul_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT,
2532 010101,5.FT,5.FS,0,2.FMT_MICROMIPS!3,0101101,111011:POOL32F:32,f::NEG.fmt
2533 "neg.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2537 do_neg_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FT, FS,
2542 010101,5.FT,5.FS,5.FD,5.FR,0,2.FMT_MICROMIPS!3,010:POOL32F:32,f::NMADD.fmt
2543 "nmadd.%s<FMT_MICROMIPS> f<FD>, f<FR>, f<FS>, f<FT>"
2547 do_nmadd_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FR, FS,
2551 010101,5.FT,5.FS,5.FD,5.FR,1,2.FMT_MICROMIPS!3,010:POOL32F:32,f::NMSUB.fmt
2552 "nmsub.%s<FMT_MICROMIPS> f<FD>, f<FR>, f<FS>, f<FT>"
2556 do_nmsub_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FR, FS,
2561 010101,5.FT,5.FS,5.FD,00010,000000:POOL32F:32,f::PLL.PS
2562 "pll.ps f<FD>, f<FS>, f<FT>"
2566 do_pll_ps (SD_, FD, FS, FT, instruction_0);
2570 010101,5.FT,5.FS,5.FD,00011,000000:POOL32F:32,f::PLU.PS
2571 "plu.ps f<FD>, f<FS>, f<FT>"
2575 do_plu_ps (SD_, FD, FS, FT, instruction_0);
2579 010101,5.FT,5.FS,5.FD,00100,000000:POOL32F:32,f::PUL.PS
2580 "pul.ps f<FD>, f<FS>, f<FT>"
2584 do_pul_ps (SD_, FD, FS, FT, instruction_0);
2588 010101,5.FT,5.FS,5.FD,00101,000000:POOL32F:32,f::PUU.PS
2589 "puu.ps f<FD>, f<FS>, f<FT>"
2593 do_puu_ps (SD_, FD, FS, FT, instruction_0);
2597 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,01001000,111011:POOL32F:32,f::RECIP.fmt
2598 "recip.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2602 do_recip_fmt (SD_, FMT_MICROMIPS, FT, FS);
2606 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,11001100,111011:POOL32F:32,f::ROUND.L.fmt
2607 "round.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2611 do_round_fmt (SD_, fmt_long, FMT_MICROMIPS, FT, FS);
2615 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,11101100,111011:POOL32F:32,f::ROUND.W.fmt
2616 "round.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2620 do_round_fmt (SD_, fmt_word, FMT_MICROMIPS, FT, FS);
2624 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00001000,111011:POOL32F:32,f::RSQRT.fmt
2625 "rsqrt.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2629 do_rsqrt_fmt (SD_, FMT_MICROMIPS, FT, FS);
2633 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,00101000,111011:POOL32F:32,f::SQRT.fmt
2634 "sqrt.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2638 do_sqrt_fmt (SD_, FMT_MICROMIPS, FT, FS);
2642 010101,5.FT,5.FS,5.FD,0,2.FMT_MICROMIPS!3,01,110000:POOL32F:32,f::SUB.fmt
2643 "sub.%s<FMT_MICROMIPS> f<FD>, f<FS>, f<FT>"
2647 do_sub_fmt (SD_, convert_fmt_micromips (SD_, FMT_MICROMIPS), FD, FS, FT,
2652 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,10001100,111011:POOL32F:32,f::TRUNC.L.fmt
2653 "trunc.l.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2657 do_trunc_fmt (SD_, fmt_long, FMT_MICROMIPS, FT, FS);
2661 010101,5.FT,5.FS,0,1.FMT_MICROMIPS,10101100,111011:POOL32F:32,f::TRUNC.W.fmt
2662 "trunc.w.%s<FMT_MICROMIPS> f<FT>, f<FS>"
2666 do_trunc_fmt (SD_, fmt_word, FMT_MICROMIPS, FT, FS);
2669 001000,5.LWM32REGS,5.BASE,0111,12.OFFSET:POOL32B:64::LDM
2670 "ldm %s<LWM32REGS>, <OFFSET>(r<BASE>)"
2673 int address_base = GPR[BASE] + EXTEND12 (OFFSET);
2675 for (reg_offset = 0; reg_offset < (LWM32REGS & 0xf); reg_offset++)
2677 int dst = (reg_offset == 8) ? 30 : 16 + reg_offset;
2678 GPR[dst] = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, address_base,
2682 if (LWM32REGS & 0x10)
2683 RA = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, address_base,
2687 001000,5.RD,5.BASE,0100,12.OFFSET:POOL32B:64::LDP
2688 "ldp r<RD>, <OFFSET>(r<BASE>)"
2691 if (BASE == RD || RD == 31)
2695 check_u64 (SD_, instruction_0);
2696 GPR[RD] = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
2697 EXTEND12 (OFFSET)));
2698 GPR[RD + 1] = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
2699 EXTEND12 (OFFSET) + 8));
2703 001000,5.LWM32REGS,5.BASE,1111,12.OFFSET:POOL32B:64::SDM
2704 "sdm %s<LWM32REGS>, <OFFSET>(r<BASE>)"
2707 int address_base = GPR[BASE] + EXTEND12 (OFFSET);
2709 for (reg_offset = 0; reg_offset < (LWM32REGS & 0xf); reg_offset++)
2711 int src = (reg_offset == 8) ? 30 : 16 + reg_offset;
2712 do_store (SD_, AccessLength_DOUBLEWORD, address_base, 8 * reg_offset,
2716 if (LWM32REGS & 0x10)
2717 do_store (SD_, AccessLength_DOUBLEWORD, address_base, 8 * reg_offset, RA);
2720 001000,5.RD,5.BASE,1100,12.OFFSET:POOL32B:64::SDP
2721 "sdp r<RD>, <OFFSET>(r<BASE>)"
2728 check_u64 (SD_, instruction_0);
2729 do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND12 (OFFSET),
2731 do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND12 (OFFSET) + 8,
2736 010110,5.RT,5.RS,5.RD,00,100010000:POOL32S:64::DADD
2737 "dadd r<RD>, r<RS>, r<RT>"
2740 check_u64 (SD_, instruction_0);
2741 do_dadd (SD_, RD, RS, RT);
2744 010110,5.RT,5.RS,10.IMMEDIATE,011100:POOL32S:64::DADDI
2745 "daddi r<RT>, r<RS>, <IMMEDIATE>"
2748 check_u64 (SD_, instruction_0);
2749 do_daddi (SD_, RT, RS, IMMEDIATE);
2752 010111,5.RT,5.RS,16.IMMEDIATE:MICROMIPS:64::DADDIU
2753 "daddiu r<RT>, r<RS>, <IMMEDIATE>"
2756 check_u64 (SD_, instruction_0);
2757 do_daddiu (SD_, RS, RT, IMMEDIATE);
2760 010110,5.RT,5.RS,5.RD,00,101010000:POOL32S:64::DADDU
2761 "daddu r<RD>, r<RS>, r<RT>"
2764 check_u64 (SD_, instruction_0);
2765 do_daddu (SD_, RS, RT, RD);
2768 010110,5.RT,5.RS,0100101100,111100:POOL32S:64::DCLO
2772 check_u64 (SD_, instruction_0);
2773 do_dclo (SD_, RT, RS);
2776 010110,5.RT,5.RS,0101101100,111100:POOL32S:64::DCLZ
2780 check_u64 (SD_, instruction_0);
2781 do_dclz (SD_, RT, RS);
2784 010110,5.RT,5.RS,1010101100,111100:POOL32S:64::DDIV
2788 check_u64 (SD_, instruction_0);
2789 do_ddiv (SD_, RS, RT);
2792 010110,5.RT,5.RS,1011101100,111100:POOL32S:64::DDIVU
2793 "ddivu r<RS>, r<RT>"
2796 check_u64 (SD_, instruction_0);
2797 do_ddivu (SD_, RS, RT);
2800 010110,5.RT,5.RS,5.SIZE,5.LSB,101100:POOL32S:64::DEXT
2801 "dext r<RT>, r<RS>, <LSB>, <SIZE+1>"
2804 check_u64 (SD_, instruction_0);
2805 do_dext (SD_, RT, RS, LSB, SIZE);
2808 010110,5.RT,5.RS,5.SIZE,5.LSB,100100:POOL32S:64::DEXTM
2809 "dextm r<RT>, r<RS>, <LSB>, <SIZE+33>"
2812 check_u64 (SD_, instruction_0);
2813 do_dextm (SD_, RT, RS, LSB, SIZE);
2816 010110,5.RT,5.RS,5.SIZE,5.LSB,010100:POOL32S:64::DEXTU
2817 "dextu r<RT>, r<RS>, <LSB+32>, <SIZE+1>"
2820 check_u64 (SD_, instruction_0);
2821 do_dextu (SD_, RT, RS, LSB, SIZE);
2824 010110,5.RT,5.RS,5.MSB,5.LSB,001100:POOL32S:64::DINS
2825 "dins r<RT>, r<RS>, <LSB>, <MSB-LSB+1>"
2828 check_u64 (SD_, instruction_0);
2829 do_dins (SD_, RT, RS, LSB, MSB);
2832 010110,5.RT,5.RS,5.MSB,5.LSB,000100:POOL32S:64::DINSM
2833 "dinsm r<RT>, r<RS>, <LSB>, <MSB+32-LSB+1>"
2836 check_u64 (SD_, instruction_0);
2837 do_dinsm (SD_, RT, RS, LSB, MSB);
2840 010110,5.RT,5.RS,5.MSB,5.LSB,110100:POOL32S:64::DINSU
2841 "dinsu r<RT>, r<RS>, <LSB+32>, <MSB-LSB+1>"
2844 check_u64 (SD_, instruction_0);
2845 do_dinsu (SD_, RT, RS, LSB, MSB);
2848 010110,5.RT,5.RS,00,3.SEL,00011,111100:POOL32S:64::DMFC0
2849 "dmfc0 r<RT>, r<RS>": SEL == 0
2850 "dmfc0 r<RT>, r<RS>, <SEL>"
2853 check_u64 (SD_, instruction_0);
2854 DecodeCoproc (instruction_0, 0, cp0_dmfc0, RT, RS, SEL);
2857 010101,5.RT,5.FS,00,10010000,111011:POOL32F:64::DMFC1
2858 "dmfc1 r<RT>, f<FS>"
2862 check_u64 (SD_, instruction_0);
2863 do_dmfc1b (SD_, RT, FS);
2866 010110,5.RT,5.RS,00,3.SEL,01011,111100:POOL32S:64::DMTC0
2867 "dmtc0 r<RT>, r<RS>": SEL == 0
2868 "dmtc0 r<RT>, r<RS>, <SEL>"
2871 check_u64 (SD_, instruction_0);
2872 DecodeCoproc (instruction_0, 0, cp0_dmtc0, RT, RS, SEL);
2875 010101,5.RT,5.FS,00,10110000,111011:POOL32F:64::DMTC1
2876 "dmtc1 r<RT>, f<FS>"
2880 check_u64 (SD_, instruction_0);
2881 do_dmtc1b (SD_, RT, FS);
2884 010110,5.RT,5.RS,1000101100,111100:POOL32S:64::DMULT
2885 "dmult r<RS>, r<RT>"
2888 check_u64 (SD_, instruction_0);
2889 do_dmult (SD_, RS, RT, 0);
2892 010110,5.RT,5.RS,1001101100,111100:POOL32S:64::DMULTU
2893 "dmultu r<RS>, r<RT>"
2896 check_u64 (SD_, instruction_0);
2897 do_dmultu (SD_, RS, RT, 0);
2900 010110,5.RT,5.RS,5.SA,00,011000000:POOL32S:64::DROTR
2901 "drotr r<RT>, r<RS>, <SA>"
2904 check_u64 (SD_, instruction_0);
2905 GPR[RT] = do_dror (SD_, GPR[RS], SA);
2908 010110,5.RT,5.RS,5.SA,00,011001000:POOL32S:64::DROTR32
2909 "drotr32 r<RT>, r<RS>, <SA+32>"
2912 check_u64 (SD_, instruction_0);
2913 GPR[RT] = do_dror (SD_, GPR[RS], SA + 32);
2916 010110,5.RT,5.RS,5.RD,00,011010000:POOL32S:64::DROTRV
2917 "drotrv r<RD>, r<RT>, r<RS>"
2920 check_u64 (SD_, instruction_0);
2921 GPR[RD] = do_dror (SD_, GPR[RT], GPR[RS]);
2924 010110,5.RT,5.RS,0111101100,111100:POOL32S:64::DSBH
2928 check_u64 (SD_, instruction_0);
2929 do_dsbh (SD_, RT, RS);
2932 010110,5.RT,5.RS,1111101100,111100:POOL32S:64::DSHD
2936 check_u64 (SD_, instruction_0);
2937 do_dshd (SD_, RS, RT);
2940 010110,5.RT,5.RS,5.SA,00,000000000:POOL32S:64::DSLL
2941 "dsll r<RT>, r<RS>, <SA>"
2944 check_u64 (SD_, instruction_0);
2945 do_dsll (SD_, RS, RT, SA);
2948 010110,5.RT,5.RS,5.SA,00,000001000:POOL32S:64::DSLL32
2949 "dsll32 r<RT>, r<RS>, <SA>"
2952 check_u64 (SD_, instruction_0);
2953 do_dsll32 (SD_, RT, RS, SA);
2956 010110,5.RT,5.RS,5.RD,00,000010000:POOL32S:64::DSLLV
2957 "dsllv r<RD>, r<RT>, r<RS>"
2960 check_u64 (SD_, instruction_0);
2961 do_dsllv (SD_, RS, RT, RD);
2964 010110,5.RT,5.RS,5.SA,00,010000000:POOL32S:64::DSRA
2965 "dsra r<RT>, r<RS>, <SA>"
2968 check_u64 (SD_, instruction_0);
2969 do_dsra (SD_, RS, RT, SA);
2972 010110,5.RT,5.RS,5.SA,00,010001000:POOL32S:64::DSRA32
2973 "dsra32 r<RT>, r<RS>, <SA>"
2976 check_u64 (SD_, instruction_0);
2977 do_dsra32 (SD_, RT, RS, SA);
2980 010110,5.RT,5.RS,5.RD,00,010010000:POOL32S:64::DSRAV
2981 "dsrav r<RD>, r<RS>, r<RT>"
2984 check_u64 (SD_, instruction_0);
2985 do_dsrav (SD_, RS, RT, RD);
2988 010110,5.RT,5.RS,5.SA,00,001000000:POOL32S:64::DSRL
2989 "dsrl r<RT>, r<RS>, <SA>"
2992 check_u64 (SD_, instruction_0);
2993 do_dsrl (SD_, RS, RT, SA);
2996 010110,5.RT,5.RS,5.SA,00,001001000:POOL32S:64::DSRL32
2997 "dsrl32 r<RT>, r<RS>, <SA>"
3000 check_u64 (SD_, instruction_0);
3001 do_dsrl32 (SD_, RT, RS, SA);
3004 010110,5.RT,5.RS,5.RD,00,001010000:POOL32S:64::DSRLV
3005 "dsrlv r<RD>, r<RT>, r<RS>"
3008 check_u64 (SD_, instruction_0);
3009 do_dsrlv (SD_, RS, RT, RD);
3012 010110,5.RT,5.RS,5.RD,00,110001000:POOL32S:64::DSUB
3013 "dsub r<RD>, r<RS>, r<RT>"
3016 check_u64 (SD_, instruction_0);
3017 do_dsub (SD_, RD, RS, RT);
3020 010110,5.RT,5.RS,5.RD,00,111001000:POOL32S:64::DSUBU
3021 "dsubu r<RD>, r<RS>, r<RT>"
3024 check_u64 (SD_, instruction_0);
3025 do_dsubu (SD_, RS, RT, RD);
3028 110111,5.RT,5.BASE,16.OFFSET:MICROMIPS64:64::LD
3029 "ld r<RT>, <OFFSET>(r<BASE>)"
3032 check_u64 (SD_, instruction_0);
3033 GPR[RT] = EXTEND64 (do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
3034 EXTEND16 (OFFSET)));
3037 011000,5.RT,5.BASE,0100,12.OFFSET:POOL32C:64::LDL
3038 "ldl r<RT>, <OFFSET>(r<BASE>)"
3041 check_u64 (SD_, instruction_0);
3042 GPR[RT] = do_load_left (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
3043 EXTEND12 (OFFSET), GPR[RT]);
3046 011000,5.RT,5.BASE,0101,12.OFFSET:POOL32C:64::LDR
3047 "ldr r<RT>, <OFFSET>(r<BASE>)"
3050 check_u64 (SD_, instruction_0);
3051 GPR[RT] = do_load_right (SD_, AccessLength_DOUBLEWORD, GPR[BASE],
3052 EXTEND12 (OFFSET), GPR[RT]);
3055 010101,5.INDEX,5.BASE,5.FD,00,011001000:POOL32F:64,f::LDXC1
3056 "ldxc1 f<FD>, r<INDEX>(r<BASE>)"
3060 check_u64 (SD_, instruction_0);
3061 COP_LD (1, FD, do_load (SD_, AccessLength_DOUBLEWORD, GPR[BASE], GPR[INDEX]));
3064 011000,5.RT,5.BASE,0111,12.OFFSET:POOL32C:64::LLD
3065 "lld r<RT>, <OFFSET>(r<BASE>)"
3068 check_u64 (SD_, instruction_0);
3069 do_lld (SD_, RT, OFFSET, BASE);
3072 011000,5.RT,5.BASE,1111,12.OFFSET:POOL32C:64::SCD
3073 "scd r<RT>, <OFFSET>(r<BASE>)"
3076 check_u64 (SD_, instruction_0);
3077 do_scd (SD_, RT, OFFSET, BASE, 1);
3080 110110,5.RT,5.BASE,16.OFFSET:MICROMIPS64:64::SD
3081 "sd r<RT>, <OFFSET>(r<BASE>)"
3084 check_u64 (SD_, instruction_0);
3085 do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND16 (OFFSET),
3089 011000,5.RT,5.BASE,1100,12.OFFSET:POOL32C:64::SDL
3090 "sdl r<RT>, <OFFSET>(r<BASE>)"
3093 check_u64 (SD_, instruction_0);
3094 do_store_left (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND12 (OFFSET),
3098 011000,5.RT,5.BASE,1101,12.OFFSET:POOL32C:64::SDR
3099 "sdr r<RT>, <OFFSET>(r<BASE>)"
3102 check_u64 (SD_, instruction_0);
3103 do_store_right (SD_, AccessLength_DOUBLEWORD, GPR[BASE], EXTEND12 (OFFSET),
3107 010101,5.INDEX,5.BASE,5.FD,00,100001000:POOL32F:64,f::SDXC1
3108 "sdxc1 f<FD>, r<INDEX>(r<BASE>)"
3112 check_u64 (SD_, instruction_0);
3113 do_store (SD_, AccessLength_DOUBLEWORD, GPR[BASE], GPR[INDEX],