decoder.isa revision 2052
1////////////////////////////////////////////////////////////////////
2//
3// The actual MIPS32 ISA decoder
4// -----------------------------
5// The following instructions are specified in the MIPS32 ISA
6// Specification. Decoding closely follows the style specified
7// in the MIPS32 ISAthe specification document starting with Table
8// A-2 (document available @ www.mips.com)
9//
10//@todo: Distinguish "unknown/future" use insts from "reserved"
11// ones
12decode OPCODE_HI default FailUnimpl::unknown() {
13
14    // Derived From ... Table A-2 MIPS32 ISA Manual
15    0x0: decode OPCODE_LO default FailUnimpl::reserved(){
16
17        0x0: decode FUNCTION_HI {
18            0x0: decode FUNCTION_LO {
19              0x1: decode MOVCI {
20                format BasicOp {
21                  0: movf({{ if( xc->miscRegs.fpcr == 0) Rd = Rs}});
22                  1: movt({{ if( xc->miscRegs.fpcr == 1) Rd = Rs}});
23                }
24              }
25
26              format BasicOp {
27
28                //Table A-3 Note: "1. Specific encodings of the rt, rd, and sa fields
29                //are used to distinguish among the SLL, NOP, SSNOP and EHB functions."
30
31                0x0: sll({{ Rd = Rt.uw << SA; }});
32
33                0x2: decode SRL {
34                   0: srl({{ Rd = Rt.uw >> SA; }});
35
36                   //Hardcoded assuming 32-bit ISA, probably need parameter here
37                   1: rotr({{ Rd = (Rt.uw << (32 - SA)) | (Rt.uw >> SA);}});
38                 }
39
40                 0x3: sra({{ Rd = Rt.sw >> SA; }});
41
42                 0x4: sllv({{ Rd = Rt.uw << Rs<4:0>; }});
43
44                 0x6: decode SRLV {
45                   0: srlv({{ Rd = Rt.uw >> Rs<4:0>; }});
46
47                   //Hardcoded assuming 32-bit ISA, probably need parameter here
48                   1: rotrv({{ Rd = (Rt.uw << (32 - Rs<4:0>)) | (Rt.uw >> Rs<4:0>);}});
49                 }
50
51                 0x7: srav({{ Rd = Rt.sw >> Rs<4:0>; }});
52              }
53            }
54
55            0x1: decode FUNCTION_LO {
56
57              //Table A-3 Note: "Specific encodings of the hint field are used
58              //to distinguish JR from JR.HB and JALR from JALR.HB"
59              format Jump {
60                0x0: jr(IsReturn);
61                0x1: jalr(IsCall,IsReturn);
62              }
63
64              format BasicOp {
65                0x2: movz({{ if (Rt == 0) Rd = Rs; }});
66                0x3: movn({{ if (Rt != 0) Rd = Rs; }});
67              }
68
69              format Trap {
70                0x4: syscall({{ xc->syscall()}},IsNonSpeculative);
71                0x5: break({{ }});
72                0x7: sync({{ }});
73              }
74            }
75
76            0x2: decode FUNCTION_LO {
77              format BasicOp {
78                0x0: mfhi({{ Rd = xc->miscRegs.hi; }});
79                0x1: mthi({{ xc->miscRegs.hi = Rs; }});
80                0x2: mflo({{ Rd = xc->miscRegs.lo; }});
81                0x3: mtlo({{ xc->miscRegs.lo = Rs; }});
82              }
83            };
84
85            0x3: decode FUNCTION_LO {
86              format IntOp {
87                0x0: mult({{
88                        INT64 temp1 = Rs.sw * Rt.sw;
89                        xc->miscRegs.hi->temp1<63:32>;
90                        xc->miscRegs.lo->temp1<31:0>
91                }});
92
93                0x1: multu({{
94                        INT64 temp1 = Rs.uw * Rt.uw;
95                        xc->miscRegs.hi->temp1<63:32>;
96                        xc->miscRegs.lo->temp1<31:0>
97                        Rd.sw = Rs.uw * Rt.uw;
98                }});
99
100                0x2: div({{
101                        xc->miscRegs.hi = Rs.sw % Rt.sw;
102                        xc->miscRegs.lo = Rs.sw / Rt.sw;
103                        }});
104
105                0x3: divu({{
106                        xc->miscRegs.hi = Rs.uw % Rt.uw;
107                        xc->miscRegs.lo = Rs.uw / Rt.uw;
108                        }});
109              }
110            };
111
112            0x4: decode FUNCTION_LO {
113              format IntOp {
114                0x0: add({{  Rd.sw = Rs.sw + Rt.sw;}});
115                0x1: addu({{ Rd.uw = Rs.uw + Rt.uw;}});
116                0x2: sub({{ Rd.sw = Rs.sw - Rt.sw;}});
117                0x3: subu({{ Rd.uw = Rs.uw - Rt.uw;}});
118                0x4: and({{ Rd.sw = Rs.uw & Rt.uw;}});
119                0x5: or({{ Rd.sw = Rs.uw | Rt.uw;}});
120                0x6: xor({{ Rd.sw = Rs.uw ^ Rt.uw;}});
121                0x7: nor({{ Rd.sw = ~(Rs.uw | Rt.uw);}});
122              }
123            }
124
125            0x5: decode FUNCTION_LO {
126              format IntOp{
127                0x2: slt({{  Rd.sw = ( Rs.sw < Rt.sw ) ? 1 : 0}});
128                0x3: sltu({{ Rd.uw = ( Rs.uw < Rt.uw ) ? 1 : 0}});
129              }
130            };
131
132            0x6: decode FUNCTION_LO {
133              format Trap {
134                 0x0: tge({{ }});
135                 0x1: tgeu({{ }});
136                 0x2: tlt({{ }});
137                 0x3: tltu({{ }});
138                 0x4: teq({{ }});
139                 0x6: tne({{ }});
140              }
141            }
142        }
143
144        0x1: decode REGIMM_HI {
145            0x0: decode REGIMM_LO {
146              format Branch {
147                0x0: bltz({{ cond = (Rs.sq < 0); }});
148                0x1: bgez({{ cond = (Rs.sq >= 0); }});
149
150                //MIPS obsolete instructions
151                0x2: bltzl({{ cond = (Rs.sq < 0); }});
152                0x3: bgezl({{ cond = (Rs.sq >= 0); }});
153              }
154            }
155
156            0x1: decode REGIMM_LO {
157              format Trap {
158                 0x0: tgei({{ }});
159                 0x1: tgeiu({{ }});
160                 0x2: tlti({{ }});
161                 0x3: tltiu({{ }});
162                 0x4: teqi({{ }});
163                 0x6: tnei({{ }});
164              }
165            }
166
167            0x2: decode REGIMM_LO {
168              format Branch {
169                0x0: bltzal({{ cond = (Rs.sq < 0); }});
170                0x1: bgezal({{ cond = (Rs.sq >= 0); }});
171
172                //MIPS obsolete instructions
173                0x2: bltzall({{ cond = (Rs.sq < 0); }});
174                0x3: bgezall({{ cond = (Rs.sq >= 0); }});
175              }
176            }
177
178            0x3: decode REGIMM_LO {
179              format Trap {
180                0x7: synci({{ }});
181              }
182            }
183        }
184
185        format Jump {
186            0x2: j();
187            0x3: jal(IsCall);
188        }
189
190        format Branch {
191            0x4: beq({{ cond = (Rs.sq == 0); }});
192            0x5: bne({{ cond = (Rs.sq !=  0); }});
193            0x6: blez({{ cond = (Rs.sq <= 0); }});
194            0x7: bgtz({{ cond = (Rs.sq > 0); }});
195        }
196    };
197
198    0x1: decode OPCODE_LO default FailUnimpl::reserved(){
199        format IntOp {
200            0x0: addi({{ Rt.sw = Rs.sw + INTIMM; }});
201            0x1: addiu({{ Rt.uw = Rs.uw + INTIMM;}});
202            0x2: slti({{ Rt.sw = ( Rs.sw < INTIMM ) ? 1 : 0 }});
203            0x3: sltiu({{ Rt.uw = ( Rs.uw < INTIMM ) ? 1 : 0 }});
204            0x4: andi({{ Rt.sw = Rs.sw & INTIMM;}});
205            0x5: ori({{ Rt.sw = Rs.sw | INTIMM;}});
206            0x6: xori({{ Rt.sw = Rs.sw ^ INTIMM;}});
207            0x7: lui({{ Rt = INTIMM << 16}});
208        };
209    };
210
211    0x2: decode OPCODE_LO default FailUnimpl::reserved(){
212
213      //Table A-11 MIPS32 COP0 Encoding of rs Field
214      0x0: decode RS_MSB {
215        0x0: decode RS {
216
217           format BasicOp {
218                0x0: mfc0({{
219                        //The contents of the coprocessor 0 register specified by the
220                        //combination of rd and sel are loaded into general register
221                        //rt. Note that not all coprocessor 0 registers support the
222                        //sel field. In those instances, the sel field must be zero.
223
224                        if (SEL > 0)
225                                panic("Can't Handle Cop0 with register select yet\n");
226
227                        uint64_t reg_num = Rd.uw;
228
229                        Rt = xc->miscRegs.cop0[reg_num];
230                        }});
231
232                0xC: mtc0({{
233                        //The contents of the coprocessor 0 register specified by the
234                        //combination of rd and sel are loaded into general register
235                        //rt. Note that not all coprocessor 0 registers support the
236                        //sel field. In those instances, the sel field must be zero.
237
238                        if (SEL > 0)
239                                panic("Can't Handle Cop0 with register select yet\n");
240
241                        uint64_t reg_num = Rd.uw;
242
243                        xc->miscRegs.cop0[reg_num] = Rt;
244                        }});
245
246                0xA: rdpgpr({{
247                        //Accessing Previous Shadow Set Register Number
248                        uint64_t prev = xc->miscRegs.cop0[SRSCtl][PSS];
249                        uint64_t reg_num = Rt.uw;
250
251                        Rd = xc->shadowIntRegFile[prev][reg_num];
252                        }});
253            }
254
255          0xB: decode SC {
256            format BasicOp {
257                0x0: di({{
258                        //Accessing Coprocessor 0 "Status" Register
259                        Rt.sw = xc->miscRegs.cop0[12];
260                        xc->miscRegs.cop0[12][INTERRUPT_ENABLE] = 0;
261                        }});
262
263                0x1: ei({{
264                        //Accessing Coprocessor 0 "Status" Register
265                        Rt.sw = xc->miscRegs.cop0[12];
266                        xc->miscRegs.cop0[12][INTERRUPT_ENABLE] = 1;
267                        }});
268            }
269          }
270
271          0xE: BasicOp::wrpgpr({{
272                        //Accessing Previous Shadow Set Register Number
273                        uint64_t prev = xc->miscRegs.cop0[SRSCtl][PSS];
274                        uint64_t reg_num = Rd.uw;
275
276                        xc->shadowIntRegFile[prev][reg_num] = Rt;
277                        }});
278        }
279
280        //Table A-12 MIPS32 COP0 Encoding of Function Field When rs=CO
281        0x1: decode FUNCTION {
282          format Trap {
283                0x01: tlbr({{ }});
284                0x02: tlbwi({{ }});
285                0x06: tlbwr({{ }});
286                0x08: tlbp({{ }});
287          }
288
289          format WarnUnimpl {
290                0x18: eret({{ }});
291                0x1F: deret({{ }});
292                0x20: wait({{ }});
293          }
294        }
295      }
296
297      //Table A-13 MIPS32 COP1 Encoding of rs Field
298      0x1: decode RS_MSB {
299
300        0x0: decode RS_HI {
301          0x0: decode RS_LO {
302            format FloatOp {
303              0x0: mfc1({{ Rt = Fs<31:0>; }});
304              0x2: cfc1({{ Rt = xc->miscRegs.fpcr[Fs];}});
305              0x3: mfhc1({{ Rt = Fs<63:32>;}});
306              0x4: mtc1({{ Fs<31:0> = Rt}});
307              0x6: ctc1({{ xc->miscRegs.fpcr[Fs] = Rt;}});
308              0x7: mftc1({{ Fs<63:32> = Rt}});
309            }
310          }
311
312          0x1: decode ND {
313            0x0: decode TF {
314              format Branch {
315                0x0: bc1f({{ cond = (xc->miscRegs.fpcr == 0); }});
316                0x1: bc1t({{ cond = (xc->miscRegs.fpcr == 1); }});
317              }
318            }
319
320            0x1: decode TF {
321              format Branch {
322                0x0: bc1fl({{ cond = (xc->miscRegs.fpcr == 0); }});
323                0x1: bc1tl({{ cond = (xc->miscRegs.fpcr == 1); }});
324              }
325            }
326          }
327        }
328
329        0x1: decode RS_HI {
330          0x2: decode RS_LO {
331
332            //Table A-14 MIPS32 COP1 Encoding of Function Field When rs=S
333            //(( single-word ))
334            0x0: decode RS_HI {
335              0x0: decode RS_LO {
336                format FloatOp {
337                  0x0: add_fmt({{ }});
338                  0x1: sub_fmt({{ }});
339                  0x2: mul_fmt({{ }});
340                  0x3: div_fmt({{ }});
341                  0x4: sqrt_fmt({{ }});
342                  0x5: abs_fmt({{ }});
343                  0x6: mov_fmt({{ }});
344                  0x7: neg_fmt({{ }});
345                }
346              }
347
348              0x1: decode RS_LO {
349                //only legal for 64 bit
350                format Float64Op {
351                  0x0: round_l({{ }});
352                  0x1: trunc_l({{ }});
353                  0x2: ceil_l({{ }});
354                  0x3: floor_l({{ }});
355                }
356
357                format FloatOp {
358                  0x4: round_w({{ }});
359                  0x5: trunc_w({{ }});
360                  0x6: ceil_w({{ }});
361                  0x7: floor_w({{ }});
362                }
363              }
364
365              0x2: decode RS_LO {
366                0x1: decode MOVCF {
367                  format FloatOp {
368                    0x0: movf_fmt({{ }});
369                    0x1: movt_fmt({{ }});
370                  }
371                }
372
373                format BasicOp {
374                  0x2: movz({{ if (Rt == 0) Rd = Rs; }});
375                  0x3: movn({{ if (Rt != 0) Rd = Rs; }});
376                }
377
378                format Float64Op {
379                  0x2: recip({{ }});
380                  0x3: rsqrt{{ }});
381                }
382              }
383
384              0x4: decode RS_LO {
385                0x1: cvt_d({{ }});
386                0x4: cvt_w({{ }});
387
388                //only legal for 64 bit
389                format Float64Op {
390                  0x5: cvt_l({{ }});
391                  0x6: cvt_ps({{ }});
392                }
393              }
394            }
395
396            //Table A-15 MIPS32 COP1 Encoding of Function Field When rs=D
397            0x1: decode RS_HI {
398              0x0: decode RS_LO {
399                format FloatOp {
400                  0x0: add_fmt({{ }});
401                  0x1: sub_fmt({{ }});
402                  0x2: mul_fmt({{ }});
403                  0x3: div_fmt({{ }});
404                  0x4: sqrt_fmt({{ }});
405                  0x5: abs_fmt({{ }});
406                  0x6: mov_fmt({{ }});
407                  0x7: neg_fmt({{ }});
408                }
409              }
410
411              0x1: decode RS_LO {
412                //only legal for 64 bit
413                format FloatOp64 {
414                  0x0: round_l({{ }});
415                  0x1: trunc_l({{ }});
416                  0x2: ceil_l({{ }});
417                  0x3: floor_l({{ }});
418                }
419
420                format FloatOp {
421                  0x4: round_w({{ }});
422                  0x5: trunc_w({{ }});
423                  0x6: ceil_w({{ }});
424                  0x7: floor_w({{ }});
425                }
426              }
427
428              0x2: decode RS_LO {
429                0x1: decode MOVCF {
430                  format FloatOp {
431                    0x0: movf_fmt({{ }});
432                    0x1: movt_fmt({{ }});
433                  }
434                }
435
436                format BasicOp {
437                  0x2: movz({{ if (Rt == 0) Rd = Rs; }});
438                  0x3: movn({{ if (Rt != 0) Rd = Rs; }});
439                }
440
441                format FloatOp64 {
442                  0x5: recip({{ }});
443                  0x6: rsqrt{{ }});
444                }
445              }
446
447              0x4: decode RS_LO {
448                format FloatOp {
449                  0x0: cvt_s({{ }});
450                  0x4: cvt_w({{ }});
451                }
452
453                //only legal for 64 bit
454                format FloatOp64 {
455                  0x5: cvt_l({{ }});
456                }
457              }
458            }
459
460            //Table A-16 MIPS32 COP1 Encoding of Function Field When rs=W
461            0x4: decode FUNCTION {
462              format FloatOp {
463                0x10: cvt_s({{ }});
464                0x10: cvt_d({{ }});
465              }
466            }
467
468            //Table A-16 MIPS32 COP1 Encoding of Function Field When rs=L1
469            //Note: "1. Format type L is legal only if 64-bit floating point operations
470            //are enabled."
471            0x5: decode FUNCTION_HI {
472              format FloatOp {
473                0x10: cvt_s({{ }});
474                0x11: cvt_d({{ }});
475              }
476            }
477
478            //Table A-17 MIPS64 COP1 Encoding of Function Field When rs=PS1
479            //Note: "1. Format type PS is legal only if 64-bit floating point operations
480            //are enabled. "
481            0x6: decode RS_HI {
482              0x0: decode RS_LO {
483                format FloatOp64 {
484                  0x0: add_fmt({{ }});
485                  0x1: sub_fmt({{ }});
486                  0x2: mul_fmt({{ }});
487                  0x5: abs_fmt({{ }});
488                  0x6: mov_fmt({{ }});
489                  0x7: neg_fmt({{ }});
490                }
491              }
492
493              0x2: decode RS_LO {
494                0x1: decode MOVCF {
495                  format FloatOp64 {
496                    0x0: movf_fmt({{ }});
497                    0x1: movt_fmt({{ }});
498                  }
499                }
500
501              }
502
503              0x4: decode RS_LO {
504                0x0: FloatOp64::cvt_s_pu({{ }});
505              }
506
507              0x5: decode RS_LO {
508                format FloatOp64 {
509                  0x0: cvt_s_pl({{ }});
510                  0x4: pll_s_pl({{ }});
511                  0x5: plu_s_pl({{ }});
512                  0x6: pul_s_pl({{ }});
513                  0x7: puu_s_pl({{ }});
514                }
515              }
516            }
517      }
518
519      //Table A-19 MIPS32 COP2 Encoding of rs Field
520      0x2: decode RS_MSB {
521        0x0: decode RS_HI {
522          0x0: decode RS_LO {
523            format WarnUnimpl {
524                0x0: mfc2({{ }});
525                0x2: cfc2({{ }});
526                0x3: mfhc2({{ }});
527                0x4: mtc2({{ }});
528                0x6: ctc2({{ }});
529                0x7: mftc2({{ }});
530            }
531          }
532
533          0x1: decode ND {
534            0x0: decode TF {
535              format Branch {
536                0x0: bc2f({{ cond = (xc->miscRegs.cop2cc == 0); }}, COP2);
537                0x1: bc2t({{ cond = (xc->miscRegs.cop2cc == 1); }}, COP2}});
538              }
539            }
540
541            0x1: decode TF {
542              format Branch {
543                0x0: bc2fl({{ cond = (xc->miscRegs.cop2cc == 0); }}, COP2}});
544                0x1: bc2tl({{ cond = (xc->miscRegs.cop2cc == 1); }}, COP2}});
545              }
546            }
547          }
548        }
549      }
550
551      //Table A-20 MIPS64 COP1X Encoding of Function Field 1
552      //Note: "COP1X instructions are legal only if 64-bit floating point
553      //operations are enabled."
554      0x3: decode FUNCTION_HI {
555        0x0: decode FUNCTION_LO {
556                format Memory {
557                  0x0: lwxc1({{ }});
558                  0x1: ldxc1({{ }});
559                  0x5: luxc1({{ }});
560                }
561        }
562
563        0x1: decode FUNCTION_LO {
564                format Memory {
565                  0x0: swxc1({{ }});
566                  0x1: sdxc1({{ }});
567                  0x5: suxc1({{ }});
568                  0x7: prefx({{ }});
569                }
570        }
571
572        format FloatOp {
573                0x3: alnv_ps({{ }});
574
575                0x4: decode FUNCTION_LO {
576                  0x0: madd_s({{ }});
577                  0x1: madd_d({{ }});
578                  0x6: madd_ps({{ }});
579                }
580
581                0x5: decode FUNCTION_LO {
582                  0x0: msub_s({{ }});
583                  0x1: msub_d({{ }});
584                  0x6: msub_ps({{ }});
585                }
586
587                0x6: decode FUNCTION_LO {
588                  0x0: nmadd_s({{ }});
589                  0x1: nmadd_d({{ }});
590                  0x6: nmadd_ps({{ }});
591                }
592
593                0x7: decode FUNCTION_LO {
594                  0x0: nmsub_s({{ }});
595                  0x1: nmsub_d({{ }});
596                  0x6: nmsub_ps({{ }});
597                }
598        }
599      }
600
601      //MIPS obsolete instructions
602        format Branch {
603              0x4: beql({{ cond = (Rs.sq == 0); }});
604              0x5: bnel({{ cond = (Rs.sq != 0); }});
605              0x6: blezl({{ cond = (Rs.sq <= 0); }});
606              0x7: bgtzl({{ cond = (Rs.sq > 0); }});
607        }
608    };
609
610    0x3: decode OPCODE_LO default FailUnimpl::reserved() {
611
612        //Table A-5 MIPS32 SPECIAL2 Encoding of Function Field
613        0x4: decode FUNCTION_HI {
614
615            0x0: decode FUNCTION_LO {
616                format IntOp {
617                   0x0: madd({{
618                        INT64 temp1 = Hi.sw << 32 | Lo.sw >> 32;
619                        temp1 = temp1 + (Rs.sw * Rt.sw);
620                        xc->miscRegs.hi->temp1<63:32>;
621                        xc->miscRegs.lo->temp1<31:0>
622                        }});
623
624                   0x1: maddu({{
625                        INT64 temp1 = Hi.uw << 32 | Lo.uw >> 32;
626                        temp1 = temp1 + (Rs.uw * Rt.uw);
627                        xc->miscRegs.hi->temp1<63:32>;
628                        xc->miscRegs.lo->temp1<31:0>
629                        }});
630
631                   0x2: mul({{ 	Rd.sw = Rs.sw * Rt.sw; 	}});
632
633                   0x4: msub({{
634                        INT64 temp1 = Hi.sw << 32 | Lo.sw >> 32;
635                        temp1 = temp1 - (Rs.sw * Rt.sw);
636                        xc->miscRegs.hi->temp1<63:32>;
637                        xc->miscRegs.lo->temp1<31:0>
638                        }});
639
640                   0x5: msubu({{
641                        INT64 temp1 = Hi.uw << 32 | Lo.uw >> 32;
642                        temp1 = temp1 - (Rs.uw * Rt.uw);
643                        xc->miscRegs.hi->temp1<63:32>;
644                        xc->miscRegs.lo->temp1<31:0>
645                        }});
646                }
647            }
648
649            0x4: decode FUNCTION_LO {
650                  format BasicOp {
651                      0x0: clz({{
652                        int cnt = 0;
653                        int idx = 0;
654                        while ( Rs.uw<idx>!= 1) {
655                                cnt++;
656                                idx--;
657                        }
658
659                        Rd.uw = cnt;
660                        }});
661
662                      0x1: clo({{
663                        int cnt = 0;
664                        int idx = 0;
665                        while ( Rs.uw<idx>!= 0) {
666                                cnt++;
667                                idx--;
668                        }
669
670                        Rd.uw = cnt;
671                        }});
672                  }
673            }
674
675            0x7: decode FUNCTION_LO {
676              0x7: WarnUnimpl::sdbbp({{ }});
677            }
678        }
679
680        //Table A-6 MIPS32 SPECIAL3 Encoding of Function Field for Release 2 of the Architecture
681        0x7: decode FUNCTION_HI {
682
683          0x0: decode FUNCTION_LO {
684                format WarnUnimpl {
685                    0x1: ext({{ }});
686                    0x4: ins({{ }});
687                }
688          }
689
690          //Table A-10 MIPS32 BSHFL Encoding of sa Field
691          0x4: decode SA {
692                format BasicOp {
693                    0x02: wsbh({{ }});
694                    0x10: seb({{ Rd.sw = /* sext32(Rt<7>,24)  | */ Rt<7:0>}});
695                    0x18: seh({{ Rd.sw = /* sext32(Rt<15>,16) | */ Rt<15:0>}});
696                }
697          }
698
699          0x6: decode FUNCTION_LO {
700            0x7: BasicOp::rdhwr({{ }});
701          }
702        }
703    };
704
705    0x4: decode OPCODE_LO default FailUnimpl::reserved() {
706        format Memory {
707            0x0: lb({{ EA = Rs + disp; }}, {{ Rb.sw = Mem.sb; }});
708            0x1: lh({{ EA = Rs + disp; }}, {{ Rb.sw = Mem.sh; }});
709            0x2: lwl({{ EA = Rs + disp; }}, {{ Rb.sw = Mem.sw; }}, WordAlign);
710            0x3: lw({{ EA = Rs + disp; }}, {{ Rb.uq = Mem.sb; }});
711            0x4: lbu({{ EA = Rs + disp; }}, {{ Rb.uw = Mem.ub; }});
712            0x5: lhu({{ EA = Rs + disp; }}, {{ Rb.uw = Mem.uh; }});
713            0x6: lwr({{ EA = Rs + disp; }}, {{ Rb.uw = Mem.uw; }}, WordAlign);
714        };
715
716        0x7: FailUnimpl::reserved({{ }});
717    };
718
719    0x5: decode OPCODE_LO default FailUnimpl::reserved() {
720        format Memory {
721            0x0: sb({{ EA = Rs + disp; }}, {{ Mem.ub = Rt<7:0>; }});
722            0x1: sh({{ EA = Rs + disp; }},{{ Mem.uh = Rt<15:0>; }});
723            0x2: swl({{ EA = Rs + disp; }},{{ Mem.ub = Rt<31:0>; }},WordAlign);
724            0x3: sw({{ EA = Rs + disp; }},{{ Mem.ub = Rt<31:0>; }});
725            0x6: swr({{ EA = Rs + disp; }},{{ Mem.ub = Rt<31:0>; }},WordAlign);
726        };
727
728        format WarnUnimpl {
729            0x4: reserved({{ }});
730            0x5: reserved({{ }});
731            0x7: cache({{ }});
732        };
733
734    };
735
736    0x6: decode OPCODE_LO default FailUnimpl::reserved() {
737        format Memory {
738            0x0: ll({{ }});
739            0x1: lwc1({{ EA = Rs + disp; }},{{ Ft<31:0> = Mem.uf; }});
740            0x5: ldc1({{ EA = Rs + disp; }},{{ Ft<63:0> = Mem.df; }});
741        };
742    };
743
744    0x7: decode OPCODE_LO default FailUnimpl::reserved() {
745        format Memory {
746            0x0: sc({{ }});
747            0x1: swc1({{ EA = Rs + disp; }},{{ Mem.uf = Ft<31:0>; }});
748            0x5: sdc1({{ EA = Rs + disp; }},{{ Mem.df = Ft<63:0>; }});
749        };
750
751    }
752}
753
754
755