LCOV - code coverage report
Current view: directory - src/trusted/validator_mips/gen - decode.cc (source / functions) Found Hit Coverage
Test: coverage.lcov Lines: 554 97 17.5 %
Date: 2014-07-02 Functions: 0 0 -

       1                 : /*
       2                 :  * Copyright (c) 2013 The Native Client Authors. All rights reserved.
       3                 :  * Use of this source code is governed by a BSD-style license that can be
       4                 :  * found in the LICENSE file.
       5                 :  */
       6                 : 
       7                 : // DO NOT EDIT: GENERATED CODE
       8                 : 
       9                 : #include <stdio.h>
      10                 : #include "native_client/src/trusted/validator_mips/decode.h"
      11                 : 
      12                 : namespace nacl_mips_dec {
      13                 : 
      14                 : /*
      15                 :  * This beast holds a bunch of pre-created ClassDecoder instances, which
      16                 :  * we create in init_decode().  Because ClassDecoders are stateless, we
      17                 :  * can freely reuse them -- even across threads -- and avoid allocating
      18                 :  * in the inner decoder loop.
      19                 :  */
      20               0 : struct DecoderState {
      21                 :   const Load _Load_instance;
      22                 :   const JalImm _JalImm_instance;
      23                 :   const Branch _Branch_instance;
      24                 :   const Arithm2 _Arithm2_instance;
      25                 :   const Arithm3 _Arithm3_instance;
      26                 :   const Forbidden _Forbidden_instance;
      27                 :   const Safe _Safe_instance;
      28                 :   const BranchAndLink _BranchAndLink_instance;
      29                 :   const JalReg _JalReg_instance;
      30                 :   const NaClHalt _NaClHalt_instance;
      31                 :   const StoreConditional _StoreConditional_instance;
      32                 :   const FPLoadStore _FPLoadStore_instance;
      33                 :   const JmpImm _JmpImm_instance;
      34                 :   const JmpReg _JmpReg_instance;
      35                 :   const Store _Store_instance;
      36                 :   const ExtIns _ExtIns_instance;
      37              10 :   DecoderState() :
      38                 :   _Load_instance()
      39                 :   , _JalImm_instance()
      40                 :   , _Branch_instance()
      41                 :   , _Arithm2_instance()
      42                 :   , _Arithm3_instance()
      43                 :   , _Forbidden_instance()
      44                 :   , _Safe_instance()
      45                 :   , _BranchAndLink_instance()
      46                 :   , _JalReg_instance()
      47                 :   , _NaClHalt_instance()
      48                 :   , _StoreConditional_instance()
      49                 :   , _FPLoadStore_instance()
      50                 :   , _JmpImm_instance()
      51                 :   , _JmpReg_instance()
      52                 :   , _Store_instance()
      53              10 :   , _ExtIns_instance()
      54              10 :   {}
      55                 : };
      56                 : 
      57                 : /*
      58                 :  * Prototypes for static table-matching functions.
      59                 :  */
      60                 : static inline const ClassDecoder
      61                 :   &decode_MIPS32(const Instruction insn, const DecoderState *state);
      62                 : static inline const ClassDecoder
      63                 :   &decode_special(const Instruction insn, const DecoderState *state);
      64                 : static inline const ClassDecoder
      65                 :   &decode_regimm(const Instruction insn, const DecoderState *state);
      66                 : static inline const ClassDecoder
      67                 :   &decode_special2(const Instruction insn, const DecoderState *state);
      68                 : static inline const ClassDecoder
      69                 :   &decode_special3(const Instruction insn, const DecoderState *state);
      70                 : static inline const ClassDecoder
      71                 :   &decode_movci(const Instruction insn, const DecoderState *state);
      72                 : static inline const ClassDecoder
      73                 :   &decode_srl(const Instruction insn, const DecoderState *state);
      74                 : static inline const ClassDecoder
      75                 :   &decode_srlv(const Instruction insn, const DecoderState *state);
      76                 : static inline const ClassDecoder
      77                 :   &decode_bshfl(const Instruction insn, const DecoderState *state);
      78                 : static inline const ClassDecoder
      79                 :   &decode_cop0(const Instruction insn, const DecoderState *state);
      80                 : static inline const ClassDecoder
      81                 :   &decode_c0(const Instruction insn, const DecoderState *state);
      82                 : static inline const ClassDecoder
      83                 :   &decode_cop1(const Instruction insn, const DecoderState *state);
      84                 : static inline const ClassDecoder
      85                 :   &decode_c1(const Instruction insn, const DecoderState *state);
      86                 : static inline const ClassDecoder
      87                 :   &decode_movcf(const Instruction insn, const DecoderState *state);
      88                 : static inline const ClassDecoder
      89                 :   &decode_cop2(const Instruction insn, const DecoderState *state);
      90                 : static inline const ClassDecoder
      91                 :   &decode_cop1x(const Instruction insn, const DecoderState *state);
      92                 : static inline const ClassDecoder
      93                 :   &decode_branch_1(const Instruction insn, const DecoderState *state);
      94                 : static inline const ClassDecoder
      95                 :   &decode_arithm2_1(const Instruction insn, const DecoderState *state);
      96                 : static inline const ClassDecoder
      97                 :   &decode_arithm3_1(const Instruction insn, const DecoderState *state);
      98                 : static inline const ClassDecoder
      99                 :   &decode_arithm3_2(const Instruction insn, const DecoderState *state);
     100                 : static inline const ClassDecoder
     101                 :   &decode_jr(const Instruction insn, const DecoderState *state);
     102                 : static inline const ClassDecoder
     103                 :   &decode_jalr(const Instruction insn, const DecoderState *state);
     104                 : static inline const ClassDecoder
     105                 :   &decode_sync(const Instruction insn, const DecoderState *state);
     106                 : static inline const ClassDecoder
     107                 :   &decode_mfhi(const Instruction insn, const DecoderState *state);
     108                 : static inline const ClassDecoder
     109                 :   &decode_mthi(const Instruction insn, const DecoderState *state);
     110                 : static inline const ClassDecoder
     111                 :   &decode_mult(const Instruction insn, const DecoderState *state);
     112                 : static inline const ClassDecoder
     113                 :   &decode_arithm3_3(const Instruction insn, const DecoderState *state);
     114                 : static inline const ClassDecoder
     115                 :   &decode_mfmc0(const Instruction insn, const DecoderState *state);
     116                 : static inline const ClassDecoder
     117                 :   &decode_mfc1(const Instruction insn, const DecoderState *state);
     118                 : static inline const ClassDecoder
     119                 :   &decode_mtc1(const Instruction insn, const DecoderState *state);
     120                 : static inline const ClassDecoder
     121                 :   &decode_bc1(const Instruction insn, const DecoderState *state);
     122                 : static inline const ClassDecoder
     123                 :   &decode_fp(const Instruction insn, const DecoderState *state);
     124                 : static inline const ClassDecoder
     125                 :   &decode_bc2(const Instruction insn, const DecoderState *state);
     126                 : static inline const ClassDecoder
     127                 :   &decode_c_cond_fmt(const Instruction insn, const DecoderState *state);
     128                 : 
     129                 : /*
     130                 :  * Table-matching function implementations.
     131                 :  */
     132                 : 
     133                 : /*
     134                 :  * Implementation of table MIPS32.
     135                 :  * Specified by: See Table A.2.
     136                 :  */
     137                 : static inline const ClassDecoder
     138             154 : &decode_MIPS32(const Instruction insn, const DecoderState *state) {
     139             154 :   if (((insn & 0xFC000000) == 0x00000000)) {
     140             138 :     return decode_special(insn, state);
     141                 :   }
     142                 : 
     143              16 :   if (((insn & 0xFC000000) == 0x04000000)) {
     144               0 :     return decode_regimm(insn, state);
     145                 :   }
     146                 : 
     147              16 :   if (((insn & 0xFC000000) == 0x08000000)) {
     148               0 :     return state->_JmpImm_instance;
     149                 :   }
     150                 : 
     151              16 :   if (((insn & 0xFC000000) == 0x0C000000)) {
     152               0 :     return state->_JalImm_instance;
     153                 :   }
     154                 : 
     155              16 :   if (((insn & 0xFC000000) == 0x38000000)) {
     156               0 :     return state->_Arithm2_instance;
     157                 :   }
     158                 : 
     159              16 :   if (((insn & 0xFC000000) == 0x3C000000)) {
     160               0 :     return decode_arithm2_1(insn, state);
     161                 :   }
     162                 : 
     163              16 :   if (((insn & 0xFC000000) == 0x40000000)) {
     164               0 :     return decode_cop0(insn, state);
     165                 :   }
     166                 : 
     167              16 :   if (((insn & 0xFC000000) == 0x44000000)) {
     168               0 :     return decode_cop1(insn, state);
     169                 :   }
     170                 : 
     171              16 :   if (((insn & 0xFC000000) == 0x48000000)) {
     172               0 :     return decode_cop2(insn, state);
     173                 :   }
     174                 : 
     175              16 :   if (((insn & 0xFC000000) == 0x4C000000)) {
     176               0 :     return decode_cop1x(insn, state);
     177                 :   }
     178                 : 
     179              16 :   if (((insn & 0xFC000000) == 0x70000000)) {
     180               0 :     return decode_special2(insn, state);
     181                 :   }
     182                 : 
     183              16 :   if (((insn & 0xFC000000) == 0x74000000)) {
     184               0 :     return state->_Forbidden_instance;
     185                 :   }
     186                 : 
     187              16 :   if (((insn & 0xFC000000) == 0x78000000)) {
     188               0 :     return state->_Forbidden_instance;
     189                 :   }
     190                 : 
     191              16 :   if (((insn & 0xFC000000) == 0x7C000000)) {
     192               0 :     return decode_special3(insn, state);
     193                 :   }
     194                 : 
     195              16 :   if (((insn & 0xFC000000) == 0x98000000)) {
     196               0 :     return state->_Load_instance;
     197                 :   }
     198                 : 
     199              16 :   if (((insn & 0xFC000000) == 0xB8000000)) {
     200               2 :     return state->_Store_instance;
     201                 :   }
     202                 : 
     203              14 :   if (((insn & 0xFC000000) == 0xC0000000)) {
     204               0 :     return state->_Load_instance;
     205                 :   }
     206                 : 
     207              14 :   if (((insn & 0xFC000000) == 0xE0000000)) {
     208               0 :     return state->_StoreConditional_instance;
     209                 :   }
     210                 : 
     211              14 :   if (((insn & 0xDC000000) == 0x9C000000)) {
     212               0 :     return state->_Forbidden_instance;
     213                 :   }
     214                 : 
     215              14 :   if (((insn & 0xDC000000) == 0xD0000000)) {
     216               0 :     return state->_Forbidden_instance;
     217                 :   }
     218                 : 
     219              14 :   if (((insn & 0xF8000000) == 0x30000000)) {
     220               0 :     return state->_Arithm2_instance;
     221                 :   }
     222                 : 
     223              14 :   if (((insn & 0xF8000000) == 0x90000000)) {
     224               0 :     return state->_Load_instance;
     225                 :   }
     226                 : 
     227              14 :   if (((insn & 0xF8000000) == 0xB0000000)) {
     228               0 :     return state->_Forbidden_instance;
     229                 :   }
     230                 : 
     231              14 :   if (((insn & 0xB8000000) == 0x10000000)) {
     232               0 :     return state->_Branch_instance;
     233                 :   }
     234                 : 
     235              14 :   if (((insn & 0xB8000000) == 0x18000000)) {
     236               0 :     return decode_branch_1(insn, state);
     237                 :   }
     238                 : 
     239              14 :   if (((insn & 0xCC000000) == 0xC4000000)) {
     240               2 :     return state->_FPLoadStore_instance;
     241                 :   }
     242                 : 
     243              12 :   if (((insn & 0xCC000000) == 0xC8000000)) {
     244               0 :     return state->_FPLoadStore_instance;
     245                 :   }
     246                 : 
     247              12 :   if (((insn & 0xCC000000) == 0xCC000000)) {
     248               0 :     return state->_Forbidden_instance;
     249                 :   }
     250                 : 
     251              12 :   if (((insn & 0xF0000000) == 0x20000000)) {
     252               0 :     return state->_Arithm2_instance;
     253                 :   }
     254                 : 
     255              12 :   if (((insn & 0xF0000000) == 0x60000000)) {
     256               0 :     return state->_Forbidden_instance;
     257                 :   }
     258                 : 
     259              12 :   if (((insn & 0xF0000000) == 0x80000000)) {
     260               4 :     return state->_Load_instance;
     261                 :   }
     262                 : 
     263               8 :   if (((insn & 0xF0000000) == 0xA0000000)) {
     264               8 :     return state->_Store_instance;
     265                 :   }
     266                 : 
     267                 :   // Catch any attempt to fall through...
     268                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     269               0 :           "MIPS32 could not parse %08X", insn.Bits(31, 0));
     270               0 :   return state->_Forbidden_instance;
     271                 : }
     272                 : 
     273                 : /*
     274                 :  * Implementation of table special.
     275                 :  * Specified by: See Table A.3.
     276                 :  */
     277                 : static inline const ClassDecoder
     278             138 : &decode_special(const Instruction insn, const DecoderState *state) {
     279             138 :   if (((insn & 0x0000003F) == 0x00000000)) {
     280              92 :     return decode_arithm3_1(insn, state);
     281                 :   }
     282                 : 
     283              46 :   if (((insn & 0x0000003F) == 0x00000001)) {
     284               0 :     return decode_movci(insn, state);
     285                 :   }
     286                 : 
     287              46 :   if (((insn & 0x0000003F) == 0x00000002)) {
     288               0 :     return decode_srl(insn, state);
     289                 :   }
     290                 : 
     291              46 :   if (((insn & 0x0000003F) == 0x00000003)) {
     292               0 :     return decode_arithm3_1(insn, state);
     293                 :   }
     294                 : 
     295              46 :   if (((insn & 0x0000003F) == 0x00000004)) {
     296               0 :     return decode_arithm3_2(insn, state);
     297                 :   }
     298                 : 
     299              46 :   if (((insn & 0x0000003F) == 0x00000006)) {
     300               0 :     return decode_srlv(insn, state);
     301                 :   }
     302                 : 
     303              46 :   if (((insn & 0x0000003F) == 0x00000007)) {
     304               0 :     return decode_arithm3_2(insn, state);
     305                 :   }
     306                 : 
     307              46 :   if (((insn & 0x0000003F) == 0x00000008)) {
     308               2 :     return decode_jr(insn, state);
     309                 :   }
     310                 : 
     311              44 :   if (((insn & 0x0000003F) == 0x00000009)) {
     312               2 :     return decode_jalr(insn, state);
     313                 :   }
     314                 : 
     315              42 :   if (((insn & 0x0000003F) == 0x0000000D)) {
     316               0 :     return state->_NaClHalt_instance;
     317                 :   }
     318                 : 
     319              42 :   if (((insn & 0x0000003F) == 0x0000000F)) {
     320               0 :     return decode_sync(insn, state);
     321                 :   }
     322                 : 
     323              42 :   if (((insn & 0x0000003F) == 0x0000003F)) {
     324               0 :     return state->_Forbidden_instance;
     325                 :   }
     326                 : 
     327              42 :   if (((insn & 0x0000001F) == 0x0000001E)) {
     328               0 :     return state->_Forbidden_instance;
     329                 :   }
     330                 : 
     331              42 :   if (((insn & 0x0000002F) == 0x00000005)) {
     332               0 :     return state->_Forbidden_instance;
     333                 :   }
     334                 : 
     335              42 :   if (((insn & 0x00000037) == 0x00000017)) {
     336               0 :     return state->_Forbidden_instance;
     337                 :   }
     338                 : 
     339              42 :   if (((insn & 0x0000003D) == 0x0000000C)) {
     340               0 :     return state->_Forbidden_instance;
     341                 :   }
     342                 : 
     343              42 :   if (((insn & 0x0000003D) == 0x00000010)) {
     344               0 :     return decode_mfhi(insn, state);
     345                 :   }
     346                 : 
     347              42 :   if (((insn & 0x0000003D) == 0x00000011)) {
     348               0 :     return decode_mthi(insn, state);
     349                 :   }
     350                 : 
     351              42 :   if (((insn & 0x0000003D) == 0x00000014)) {
     352               0 :     return state->_Forbidden_instance;
     353                 :   }
     354                 : 
     355              42 :   if (((insn & 0x0000003D) == 0x00000034)) {
     356               0 :     return state->_Safe_instance;
     357                 :   }
     358                 : 
     359              42 :   if (((insn & 0x0000003D) == 0x00000035)) {
     360               0 :     return state->_Forbidden_instance;
     361                 :   }
     362                 : 
     363              42 :   if (((insn & 0x0000003E) == 0x0000000A)) {
     364               0 :     return decode_arithm3_2(insn, state);
     365                 :   }
     366                 : 
     367              42 :   if (((insn & 0x0000003E) == 0x0000002A)) {
     368               0 :     return decode_arithm3_3(insn, state);
     369                 :   }
     370                 : 
     371              42 :   if (((insn & 0x0000003E) == 0x0000002E)) {
     372               0 :     return state->_Forbidden_instance;
     373                 :   }
     374                 : 
     375              42 :   if (((insn & 0x0000001E) == 0x0000001C)) {
     376               0 :     return state->_Forbidden_instance;
     377                 :   }
     378                 : 
     379              42 :   if (((insn & 0x0000003A) == 0x00000028)) {
     380               0 :     return state->_Forbidden_instance;
     381                 :   }
     382                 : 
     383              42 :   if (((insn & 0x0000003C) == 0x00000018)) {
     384               0 :     return decode_mult(insn, state);
     385                 :   }
     386                 : 
     387              42 :   if (((insn & 0x0000003C) == 0x00000030)) {
     388               0 :     return state->_Safe_instance;
     389                 :   }
     390                 : 
     391              42 :   if (((insn & 0x0000003C) == 0x00000038)) {
     392               0 :     return state->_Forbidden_instance;
     393                 :   }
     394                 : 
     395              42 :   if (((insn & 0x00000038) == 0x00000020)) {
     396              42 :     return decode_arithm3_3(insn, state);
     397                 :   }
     398                 : 
     399                 :   // Catch any attempt to fall through...
     400                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     401               0 :           "special could not parse %08X", insn.Bits(31, 0));
     402               0 :   return state->_Forbidden_instance;
     403                 : }
     404                 : 
     405                 : /*
     406                 :  * Implementation of table regimm.
     407                 :  * Specified by: See Table A.4.
     408                 :  */
     409                 : static inline const ClassDecoder
     410               0 : &decode_regimm(const Instruction insn, const DecoderState *state) {
     411               0 :   if (((insn & 0x001D0000) == 0x000C0000)) {
     412               0 :     return state->_Safe_instance;
     413                 :   }
     414                 : 
     415               0 :   if (((insn & 0x001D0000) == 0x000D0000)) {
     416               0 :     return state->_Forbidden_instance;
     417                 :   }
     418                 : 
     419               0 :   if (((insn & 0x001C0000) == 0x00000000)) {
     420               0 :     return state->_Branch_instance;
     421                 :   }
     422                 : 
     423               0 :   if (((insn & 0x001C0000) == 0x00080000)) {
     424               0 :     return state->_Safe_instance;
     425                 :   }
     426                 : 
     427               0 :   if (((insn & 0x001C0000) == 0x00100000)) {
     428               0 :     return state->_BranchAndLink_instance;
     429                 :   }
     430                 : 
     431               0 :   if (((insn & 0x000C0000) == 0x00040000)) {
     432               0 :     return state->_Forbidden_instance;
     433                 :   }
     434                 : 
     435               0 :   if (((insn & 0x00180000) == 0x00180000)) {
     436               0 :     return state->_Forbidden_instance;
     437                 :   }
     438                 : 
     439                 :   // Catch any attempt to fall through...
     440                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     441               0 :           "regimm could not parse %08X", insn.Bits(31, 0));
     442               0 :   return state->_Forbidden_instance;
     443                 : }
     444                 : 
     445                 : /*
     446                 :  * Implementation of table special2.
     447                 :  * Specified by: See Table A.5.
     448                 :  */
     449                 : static inline const ClassDecoder
     450               0 : &decode_special2(const Instruction insn, const DecoderState *state) {
     451               0 :   if (((insn & 0x0000003F) == 0x00000002)) {
     452               0 :     return decode_arithm3_2(insn, state);
     453                 :   }
     454                 : 
     455               0 :   if (((insn & 0x0000003F) == 0x0000003F)) {
     456               0 :     return state->_Forbidden_instance;
     457                 :   }
     458                 : 
     459               0 :   if (((insn & 0x0000001F) == 0x0000001E)) {
     460               0 :     return state->_Forbidden_instance;
     461                 :   }
     462                 : 
     463               0 :   if (((insn & 0x0000002F) == 0x0000000F)) {
     464               0 :     return state->_Forbidden_instance;
     465                 :   }
     466                 : 
     467               0 :   if (((insn & 0x00000037) == 0x00000006)) {
     468               0 :     return state->_Forbidden_instance;
     469                 :   }
     470                 : 
     471               0 :   if (((insn & 0x0000003B) == 0x00000003)) {
     472               0 :     return state->_Forbidden_instance;
     473                 :   }
     474                 : 
     475               0 :   if (((insn & 0x0000003E) == 0x00000020)) {
     476               0 :     return decode_arithm3_2(insn, state);
     477                 :   }
     478                 : 
     479               0 :   if (((insn & 0x0000003E) == 0x0000002E)) {
     480               0 :     return state->_Forbidden_instance;
     481                 :   }
     482                 : 
     483               0 :   if (((insn & 0x0000003E) == 0x0000003C)) {
     484               0 :     return state->_Forbidden_instance;
     485                 :   }
     486                 : 
     487               0 :   if (((insn & 0x0000002E) == 0x0000000C)) {
     488               0 :     return state->_Forbidden_instance;
     489                 :   }
     490                 : 
     491               0 :   if (((insn & 0x00000036) == 0x00000024)) {
     492               0 :     return state->_Forbidden_instance;
     493                 :   }
     494                 : 
     495               0 :   if (((insn & 0x0000003A) == 0x00000000)) {
     496               0 :     return decode_mult(insn, state);
     497                 :   }
     498                 : 
     499               0 :   if (((insn & 0x0000003A) == 0x00000022)) {
     500               0 :     return state->_Forbidden_instance;
     501                 :   }
     502                 : 
     503               0 :   if (((insn & 0x0000000C) == 0x00000008)) {
     504               0 :     return state->_Forbidden_instance;
     505                 :   }
     506                 : 
     507               0 :   if (((insn & 0x00000018) == 0x00000010)) {
     508               0 :     return state->_Forbidden_instance;
     509                 :   }
     510                 : 
     511                 :   // Catch any attempt to fall through...
     512                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     513               0 :           "special2 could not parse %08X", insn.Bits(31, 0));
     514               0 :   return state->_Forbidden_instance;
     515                 : }
     516                 : 
     517                 : /*
     518                 :  * Implementation of table special3.
     519                 :  * Specified by: See Table A.6.
     520                 :  */
     521                 : static inline const ClassDecoder
     522               0 : &decode_special3(const Instruction insn, const DecoderState *state) {
     523               0 :   if (((insn & 0x0000003F) == 0x00000020)) {
     524               0 :     return decode_bshfl(insn, state);
     525                 :   }
     526                 : 
     527               0 :   if (((insn & 0x0000003F) == 0x0000003F)) {
     528               0 :     return state->_Forbidden_instance;
     529                 :   }
     530                 : 
     531               0 :   if (((insn & 0x0000002F) == 0x0000002E)) {
     532               0 :     return state->_Forbidden_instance;
     533                 :   }
     534                 : 
     535               0 :   if (((insn & 0x00000037) == 0x00000027)) {
     536               0 :     return state->_Forbidden_instance;
     537                 :   }
     538                 : 
     539               0 :   if (((insn & 0x0000003B) == 0x00000000)) {
     540               0 :     return state->_ExtIns_instance;
     541                 :   }
     542                 : 
     543               0 :   if (((insn & 0x0000003D) == 0x00000021)) {
     544               0 :     return state->_Forbidden_instance;
     545                 :   }
     546                 : 
     547               0 :   if (((insn & 0x0000003E) == 0x0000003C)) {
     548               0 :     return state->_Forbidden_instance;
     549                 :   }
     550                 : 
     551               0 :   if (((insn & 0x0000001B) == 0x00000002)) {
     552               0 :     return state->_Forbidden_instance;
     553                 :   }
     554                 : 
     555               0 :   if (((insn & 0x00000036) == 0x00000024)) {
     556               0 :     return state->_Forbidden_instance;
     557                 :   }
     558                 : 
     559               0 :   if (((insn & 0x00000039) == 0x00000001)) {
     560               0 :     return state->_Forbidden_instance;
     561                 :   }
     562                 : 
     563               0 :   if (((insn & 0x0000002C) == 0x00000028)) {
     564               0 :     return state->_Forbidden_instance;
     565                 :   }
     566                 : 
     567               0 :   if (((insn & 0x00000018) == 0x00000010)) {
     568               0 :     return state->_Forbidden_instance;
     569                 :   }
     570                 : 
     571               0 :   if (((insn & 0x00000028) == 0x00000008)) {
     572               0 :     return state->_Forbidden_instance;
     573                 :   }
     574                 : 
     575                 :   // Catch any attempt to fall through...
     576                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     577               0 :           "special3 could not parse %08X", insn.Bits(31, 0));
     578               0 :   return state->_Forbidden_instance;
     579                 : }
     580                 : 
     581                 : /*
     582                 :  * Implementation of table movci.
     583                 :  * Specified by: See Table A.7.
     584                 :  */
     585                 : static inline const ClassDecoder
     586               0 : &decode_movci(const Instruction insn, const DecoderState *state) {
     587               0 :   if (((insn & 0x00020000) == 0x00000000)
     588               0 :       && ((insn & 0x000007C0) == 0x00000000)) {
     589               0 :     return state->_Arithm3_instance;
     590                 :   }
     591                 : 
     592               0 :   if (((insn & 0x00020000) == 0x00020000)
     593               0 :       && ((insn & 0x000007C0) == 0x00000000)) {
     594               0 :     return state->_Forbidden_instance;
     595                 :   }
     596                 : 
     597               0 :   if ((true)
     598               0 :       && ((insn & 0x000007C0) != 0x00000000)) {
     599               0 :     return state->_Forbidden_instance;
     600                 :   }
     601                 : 
     602                 :   // Catch any attempt to fall through...
     603                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     604               0 :           "movci could not parse %08X", insn.Bits(31, 0));
     605               0 :   return state->_Forbidden_instance;
     606                 : }
     607                 : 
     608                 : /*
     609                 :  * Implementation of table srl.
     610                 :  * Specified by: See Table A.8.
     611                 :  */
     612                 : static inline const ClassDecoder
     613               0 : &decode_srl(const Instruction insn, const DecoderState *state) {
     614               0 :   if (((insn & 0x03C00000) != 0x00000000)) {
     615               0 :     return state->_Forbidden_instance;
     616                 :   }
     617                 : 
     618               0 :   if (((insn & 0x03C00000) == 0x00000000)) {
     619               0 :     return state->_Arithm3_instance;
     620                 :   }
     621                 : 
     622                 :   // Catch any attempt to fall through...
     623                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     624               0 :           "srl could not parse %08X", insn.Bits(31, 0));
     625               0 :   return state->_Forbidden_instance;
     626                 : }
     627                 : 
     628                 : /*
     629                 :  * Implementation of table srlv.
     630                 :  * Specified by: See Table A.9.
     631                 :  */
     632                 : static inline const ClassDecoder
     633               0 : &decode_srlv(const Instruction insn, const DecoderState *state) {
     634               0 :   if (((insn & 0x00000780) != 0x00000000)) {
     635               0 :     return state->_Forbidden_instance;
     636                 :   }
     637                 : 
     638               0 :   if (((insn & 0x00000780) == 0x00000000)) {
     639               0 :     return state->_Arithm3_instance;
     640                 :   }
     641                 : 
     642                 :   // Catch any attempt to fall through...
     643                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     644               0 :           "srlv could not parse %08X", insn.Bits(31, 0));
     645               0 :   return state->_Forbidden_instance;
     646                 : }
     647                 : 
     648                 : /*
     649                 :  * Implementation of table bshfl.
     650                 :  * Specified by: See Table A.10.
     651                 :  */
     652                 : static inline const ClassDecoder
     653               0 : &decode_bshfl(const Instruction insn, const DecoderState *state) {
     654               0 :   if (((insn & 0x000007C0) == 0x00000080)) {
     655               0 :     return decode_arithm3_1(insn, state);
     656                 :   }
     657                 : 
     658               0 :   if (((insn & 0x000007C0) == 0x000005C0)) {
     659               0 :     return state->_Forbidden_instance;
     660                 :   }
     661                 : 
     662               0 :   if (((insn & 0x000003C0) == 0x000003C0)) {
     663               0 :     return state->_Forbidden_instance;
     664                 :   }
     665                 : 
     666               0 :   if (((insn & 0x000005C0) == 0x00000180)) {
     667               0 :     return state->_Forbidden_instance;
     668                 :   }
     669                 : 
     670               0 :   if (((insn & 0x000005C0) == 0x00000400)) {
     671               0 :     return decode_arithm3_1(insn, state);
     672                 :   }
     673                 : 
     674               0 :   if (((insn & 0x000006C0) == 0x000000C0)) {
     675               0 :     return state->_Forbidden_instance;
     676                 :   }
     677                 : 
     678               0 :   if (((insn & 0x00000780) == 0x00000500)) {
     679               0 :     return state->_Forbidden_instance;
     680                 :   }
     681                 : 
     682               0 :   if (((insn & 0x00000380) == 0x00000300)) {
     683               0 :     return state->_Forbidden_instance;
     684                 :   }
     685                 : 
     686               0 :   if (((insn & 0x000004C0) == 0x00000480)) {
     687               0 :     return state->_Forbidden_instance;
     688                 :   }
     689                 : 
     690               0 :   if (((insn & 0x00000540) == 0x00000440)) {
     691               0 :     return state->_Forbidden_instance;
     692                 :   }
     693                 : 
     694               0 :   if (((insn & 0x00000680) == 0x00000000)) {
     695               0 :     return state->_Forbidden_instance;
     696                 :   }
     697                 : 
     698               0 :   if (((insn & 0x00000700) == 0x00000200)) {
     699               0 :     return state->_Forbidden_instance;
     700                 :   }
     701                 : 
     702                 :   // Catch any attempt to fall through...
     703                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     704               0 :           "bshfl could not parse %08X", insn.Bits(31, 0));
     705               0 :   return state->_Forbidden_instance;
     706                 : }
     707                 : 
     708                 : /*
     709                 :  * Implementation of table cop0.
     710                 :  * Specified by: See Table A.11.
     711                 :  */
     712                 : static inline const ClassDecoder
     713               0 : &decode_cop0(const Instruction insn, const DecoderState *state) {
     714               0 :   if (((insn & 0x03E00000) == 0x01600000)) {
     715               0 :     return decode_mfmc0(insn, state);
     716                 :   }
     717                 : 
     718               0 :   if (((insn & 0x03E00000) == 0x02000000)) {
     719               0 :     return decode_c0(insn, state);
     720                 :   }
     721                 : 
     722               0 :   if (((insn & 0x03E00000) == 0x02E00000)) {
     723               0 :     return state->_Forbidden_instance;
     724                 :   }
     725                 : 
     726               0 :   if (((insn & 0x03E00000) == 0x03C00000)) {
     727               0 :     return state->_Forbidden_instance;
     728                 :   }
     729                 : 
     730               0 :   if (((insn & 0x01E00000) == 0x01E00000)) {
     731               0 :     return state->_Forbidden_instance;
     732                 :   }
     733                 : 
     734               0 :   if (((insn & 0x03600000) == 0x01400000)) {
     735               0 :     return state->_Forbidden_instance;
     736                 :   }
     737                 : 
     738               0 :   if (((insn & 0x03600000) == 0x02400000)) {
     739               0 :     return state->_Forbidden_instance;
     740                 :   }
     741                 : 
     742               0 :   if (((insn & 0x03A00000) == 0x02200000)) {
     743               0 :     return state->_Forbidden_instance;
     744                 :   }
     745                 : 
     746               0 :   if (((insn & 0x02C00000) == 0x02800000)) {
     747               0 :     return state->_Forbidden_instance;
     748                 :   }
     749                 : 
     750               0 :   if (((insn & 0x03400000) == 0x01000000)) {
     751               0 :     return state->_Forbidden_instance;
     752                 :   }
     753                 : 
     754               0 :   if (((insn & 0x03800000) == 0x03000000)) {
     755               0 :     return state->_Forbidden_instance;
     756                 :   }
     757                 : 
     758               0 :   if (((insn & 0x03000000) == 0x00000000)) {
     759               0 :     return state->_Forbidden_instance;
     760                 :   }
     761                 : 
     762                 :   // Catch any attempt to fall through...
     763                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     764               0 :           "cop0 could not parse %08X", insn.Bits(31, 0));
     765               0 :   return state->_Forbidden_instance;
     766                 : }
     767                 : 
     768                 : /*
     769                 :  * Implementation of table c0.
     770                 :  * Specified by: See Table A.12.
     771                 :  */
     772                 : static inline const ClassDecoder
     773               0 : &decode_c0(const Instruction insn, const DecoderState *state) {
     774                 :   if ((true)) {
     775               0 :     return state->_Forbidden_instance;
     776                 :   }
     777                 : 
     778                 :   // Catch any attempt to fall through...
     779                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     780                 :           "c0 could not parse %08X", insn.Bits(31, 0));
     781                 :   return state->_Forbidden_instance;
     782                 : }
     783                 : 
     784                 : /*
     785                 :  * Implementation of table cop1.
     786                 :  * Specified by: See Table A.13.
     787                 :  */
     788                 : static inline const ClassDecoder
     789               0 : &decode_cop1(const Instruction insn, const DecoderState *state) {
     790               0 :   if (((insn & 0x03E00000) == 0x00000000)) {
     791               0 :     return decode_mfc1(insn, state);
     792                 :   }
     793                 : 
     794               0 :   if (((insn & 0x03E00000) == 0x00600000)) {
     795               0 :     return decode_mfc1(insn, state);
     796                 :   }
     797                 : 
     798               0 :   if (((insn & 0x03E00000) == 0x00800000)) {
     799               0 :     return decode_mtc1(insn, state);
     800                 :   }
     801                 : 
     802               0 :   if (((insn & 0x03E00000) == 0x00E00000)) {
     803               0 :     return decode_mtc1(insn, state);
     804                 :   }
     805                 : 
     806               0 :   if (((insn & 0x03E00000) == 0x01000000)) {
     807               0 :     return decode_bc1(insn, state);
     808                 :   }
     809                 : 
     810               0 :   if (((insn & 0x03E00000) == 0x01E00000)) {
     811               0 :     return state->_Forbidden_instance;
     812                 :   }
     813                 : 
     814               0 :   if (((insn & 0x03600000) == 0x00200000)) {
     815               0 :     return state->_Forbidden_instance;
     816                 :   }
     817                 : 
     818               0 :   if (((insn & 0x03A00000) == 0x01200000)) {
     819               0 :     return state->_Forbidden_instance;
     820                 :   }
     821                 : 
     822               0 :   if (((insn & 0x03C00000) == 0x01800000)) {
     823               0 :     return state->_Forbidden_instance;
     824                 :   }
     825                 : 
     826               0 :   if (((insn & 0x03C00000) == 0x02400000)) {
     827               0 :     return state->_Forbidden_instance;
     828                 :   }
     829                 : 
     830               0 :   if (((insn & 0x03C00000) == 0x03800000)) {
     831               0 :     return decode_c1(insn, state);
     832                 :   }
     833                 : 
     834               0 :   if (((insn & 0x02600000) == 0x00400000)) {
     835               0 :     return state->_Forbidden_instance;
     836                 :   }
     837                 : 
     838               0 :   if (((insn & 0x02C00000) == 0x02C00000)) {
     839               0 :     return decode_c1(insn, state);
     840                 :   }
     841                 : 
     842               0 :   if (((insn & 0x03400000) == 0x02000000)) {
     843               0 :     return decode_c1(insn, state);
     844                 :   }
     845                 : 
     846               0 :   if (((insn & 0x03800000) == 0x03000000)) {
     847               0 :     return decode_c1(insn, state);
     848                 :   }
     849                 : 
     850                 :   // Catch any attempt to fall through...
     851                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     852               0 :           "cop1 could not parse %08X", insn.Bits(31, 0));
     853               0 :   return state->_Forbidden_instance;
     854                 : }
     855                 : 
     856                 : /*
     857                 :  * Implementation of table c1.
     858                 :  * Specified by: See Table A.14, A.15, A.16, A.17.
     859                 :  */
     860                 : static inline const ClassDecoder
     861               0 : &decode_c1(const Instruction insn, const DecoderState *state) {
     862               0 :   if (((insn & 0x0000003F) == 0x00000011)) {
     863               0 :     return decode_movcf(insn, state);
     864                 :   }
     865                 : 
     866               0 :   if (((insn & 0x0000003F) == 0x00000015)) {
     867               0 :     return decode_fp(insn, state);
     868                 :   }
     869                 : 
     870               0 :   if (((insn & 0x0000003F) == 0x00000016)) {
     871               0 :     return decode_fp(insn, state);
     872                 :   }
     873                 : 
     874               0 :   if (((insn & 0x0000003F) == 0x0000001E)) {
     875               0 :     return state->_Forbidden_instance;
     876                 :   }
     877                 : 
     878               0 :   if (((insn & 0x0000003F) == 0x00000027)) {
     879               0 :     return state->_Forbidden_instance;
     880                 :   }
     881                 : 
     882               0 :   if (((insn & 0x0000003F) == 0x00000028)) {
     883               0 :     return decode_fp(insn, state);
     884                 :   }
     885                 : 
     886               0 :   if (((insn & 0x0000003F) == 0x0000002A)) {
     887               0 :     return state->_Forbidden_instance;
     888                 :   }
     889                 : 
     890               0 :   if (((insn & 0x0000003F) == 0x0000002F)) {
     891               0 :     return state->_Safe_instance;
     892                 :   }
     893                 : 
     894               0 :   if (((insn & 0x00000037) == 0x00000017)) {
     895               0 :     return state->_Forbidden_instance;
     896                 :   }
     897                 : 
     898               0 :   if (((insn & 0x00000037) == 0x00000026)) {
     899               0 :     return state->_Safe_instance;
     900                 :   }
     901                 : 
     902               0 :   if (((insn & 0x0000003B) == 0x00000010)) {
     903               0 :     return state->_Forbidden_instance;
     904                 :   }
     905                 : 
     906               0 :   if (((insn & 0x0000003D) == 0x00000029)) {
     907               0 :     return state->_Forbidden_instance;
     908                 :   }
     909                 : 
     910               0 :   if (((insn & 0x0000003E) == 0x00000012)) {
     911               0 :     return state->_Safe_instance;
     912                 :   }
     913                 : 
     914               0 :   if (((insn & 0x0000003E) == 0x0000001C)) {
     915               0 :     return state->_Forbidden_instance;
     916                 :   }
     917                 : 
     918               0 :   if (((insn & 0x0000003E) == 0x00000022)) {
     919               0 :     return state->_Forbidden_instance;
     920                 :   }
     921                 : 
     922               0 :   if (((insn & 0x0000003E) == 0x0000002C)) {
     923               0 :     return state->_Safe_instance;
     924                 :   }
     925                 : 
     926               0 :   if (((insn & 0x0000003A) == 0x00000020)) {
     927               0 :     return decode_fp(insn, state);
     928                 :   }
     929                 : 
     930               0 :   if (((insn & 0x0000003C) == 0x00000000)) {
     931               0 :     return state->_Safe_instance;
     932                 :   }
     933                 : 
     934               0 :   if (((insn & 0x0000003C) == 0x00000008)) {
     935               0 :     return decode_fp(insn, state);
     936                 :   }
     937                 : 
     938               0 :   if (((insn & 0x0000003C) == 0x00000018)) {
     939               0 :     return state->_Forbidden_instance;
     940                 :   }
     941                 : 
     942               0 :   if (((insn & 0x00000034) == 0x00000004)) {
     943               0 :     return decode_fp(insn, state);
     944                 :   }
     945                 : 
     946               0 :   if (((insn & 0x00000030) == 0x00000030)) {
     947               0 :     return decode_c_cond_fmt(insn, state);
     948                 :   }
     949                 : 
     950                 :   // Catch any attempt to fall through...
     951                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     952               0 :           "c1 could not parse %08X", insn.Bits(31, 0));
     953               0 :   return state->_Forbidden_instance;
     954                 : }
     955                 : 
     956                 : /*
     957                 :  * Implementation of table movcf.
     958                 :  * Specified by: See Table A.18.
     959                 :  */
     960                 : static inline const ClassDecoder
     961               0 : &decode_movcf(const Instruction insn, const DecoderState *state) {
     962               0 :   if (((insn & 0x00020000) == 0x00000000)) {
     963               0 :     return state->_Safe_instance;
     964                 :   }
     965                 : 
     966               0 :   if (((insn & 0x00020000) == 0x00020000)) {
     967               0 :     return state->_Forbidden_instance;
     968                 :   }
     969                 : 
     970                 :   // Catch any attempt to fall through...
     971                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
     972               0 :           "movcf could not parse %08X", insn.Bits(31, 0));
     973               0 :   return state->_Forbidden_instance;
     974                 : }
     975                 : 
     976                 : /*
     977                 :  * Implementation of table cop2.
     978                 :  * Specified by: See Table A.19.
     979                 :  */
     980                 : static inline const ClassDecoder
     981               0 : &decode_cop2(const Instruction insn, const DecoderState *state) {
     982               0 :   if (((insn & 0x03E00000) == 0x01000000)) {
     983               0 :     return decode_bc2(insn, state);
     984                 :   }
     985                 : 
     986               0 :   if (((insn & 0x03E00000) == 0x03C00000)) {
     987               0 :     return state->_Forbidden_instance;
     988                 :   }
     989                 : 
     990               0 :   if (((insn & 0x01E00000) == 0x01E00000)) {
     991               0 :     return state->_Forbidden_instance;
     992                 :   }
     993                 : 
     994               0 :   if (((insn & 0x03600000) == 0x01400000)) {
     995               0 :     return state->_Forbidden_instance;
     996                 :   }
     997                 : 
     998               0 :   if (((insn & 0x03A00000) == 0x01200000)) {
     999               0 :     return state->_Forbidden_instance;
    1000                 :   }
    1001                 : 
    1002               0 :   if (((insn & 0x01C00000) == 0x01800000)) {
    1003               0 :     return state->_Forbidden_instance;
    1004                 :   }
    1005                 : 
    1006               0 :   if (((insn & 0x03800000) == 0x03000000)) {
    1007               0 :     return state->_Forbidden_instance;
    1008                 :   }
    1009                 : 
    1010               0 :   if (((insn & 0x01000000) == 0x00000000)) {
    1011               0 :     return state->_Forbidden_instance;
    1012                 :   }
    1013                 : 
    1014                 :   // Catch any attempt to fall through...
    1015                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1016               0 :           "cop2 could not parse %08X", insn.Bits(31, 0));
    1017               0 :   return state->_Forbidden_instance;
    1018                 : }
    1019                 : 
    1020                 : /*
    1021                 :  * Implementation of table cop1x.
    1022                 :  * Specified by: See Table A.20.
    1023                 :  */
    1024                 : static inline const ClassDecoder
    1025               0 : &decode_cop1x(const Instruction insn, const DecoderState *state) {
    1026               0 :   if (((insn & 0x0000003F) == 0x00000036)) {
    1027               0 :     return state->_Safe_instance;
    1028                 :   }
    1029                 : 
    1030               0 :   if (((insn & 0x0000003F) == 0x00000037)) {
    1031               0 :     return state->_Forbidden_instance;
    1032                 :   }
    1033                 : 
    1034               0 :   if (((insn & 0x0000001F) == 0x0000001E)) {
    1035               0 :     return state->_Safe_instance;
    1036                 :   }
    1037                 : 
    1038               0 :   if (((insn & 0x0000001F) == 0x0000001F)) {
    1039               0 :     return state->_Forbidden_instance;
    1040                 :   }
    1041                 : 
    1042               0 :   if (((insn & 0x00000037) == 0x00000026)) {
    1043               0 :     return state->_Safe_instance;
    1044                 :   }
    1045                 : 
    1046               0 :   if (((insn & 0x00000037) == 0x00000027)) {
    1047               0 :     return state->_Forbidden_instance;
    1048                 :   }
    1049                 : 
    1050               0 :   if (((insn & 0x0000003E) == 0x00000034)) {
    1051               0 :     return state->_Forbidden_instance;
    1052                 :   }
    1053                 : 
    1054               0 :   if (((insn & 0x0000001E) == 0x0000001C)) {
    1055               0 :     return state->_Forbidden_instance;
    1056                 :   }
    1057                 : 
    1058               0 :   if (((insn & 0x00000036) == 0x00000024)) {
    1059               0 :     return state->_Forbidden_instance;
    1060                 :   }
    1061                 : 
    1062               0 :   if (((insn & 0x0000003C) == 0x00000018)) {
    1063               0 :     return state->_Forbidden_instance;
    1064                 :   }
    1065                 : 
    1066               0 :   if (((insn & 0x00000026) == 0x00000020)) {
    1067               0 :     return state->_Safe_instance;
    1068                 :   }
    1069                 : 
    1070               0 :   if (((insn & 0x00000026) == 0x00000022)) {
    1071               0 :     return state->_Forbidden_instance;
    1072                 :   }
    1073                 : 
    1074               0 :   if (((insn & 0x00000038) == 0x00000010)) {
    1075               0 :     return state->_Forbidden_instance;
    1076                 :   }
    1077                 : 
    1078               0 :   if (((insn & 0x00000030) == 0x00000000)) {
    1079               0 :     return state->_Forbidden_instance;
    1080                 :   }
    1081                 : 
    1082                 :   // Catch any attempt to fall through...
    1083                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1084               0 :           "cop1x could not parse %08X", insn.Bits(31, 0));
    1085               0 :   return state->_Forbidden_instance;
    1086                 : }
    1087                 : 
    1088                 : /*
    1089                 :  * Implementation of table branch_1.
    1090                 :  * Specified by: blez, bgtz, blezl, bgtzl.
    1091                 :  */
    1092                 : static inline const ClassDecoder
    1093               0 : &decode_branch_1(const Instruction insn, const DecoderState *state) {
    1094               0 :   if (((insn & 0x001F0000) != 0x00000000)) {
    1095               0 :     return state->_Forbidden_instance;
    1096                 :   }
    1097                 : 
    1098               0 :   if (((insn & 0x001F0000) == 0x00000000)) {
    1099               0 :     return state->_Branch_instance;
    1100                 :   }
    1101                 : 
    1102                 :   // Catch any attempt to fall through...
    1103                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1104               0 :           "branch_1 could not parse %08X", insn.Bits(31, 0));
    1105               0 :   return state->_Forbidden_instance;
    1106                 : }
    1107                 : 
    1108                 : /*
    1109                 :  * Implementation of table arithm2_1.
    1110                 :  * Specified by: lui.
    1111                 :  */
    1112                 : static inline const ClassDecoder
    1113               0 : &decode_arithm2_1(const Instruction insn, const DecoderState *state) {
    1114               0 :   if (((insn & 0x03E00000) != 0x00000000)) {
    1115               0 :     return state->_Forbidden_instance;
    1116                 :   }
    1117                 : 
    1118               0 :   if (((insn & 0x03E00000) == 0x00000000)) {
    1119               0 :     return state->_Arithm2_instance;
    1120                 :   }
    1121                 : 
    1122                 :   // Catch any attempt to fall through...
    1123                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1124               0 :           "arithm2_1 could not parse %08X", insn.Bits(31, 0));
    1125               0 :   return state->_Forbidden_instance;
    1126                 : }
    1127                 : 
    1128                 : /*
    1129                 :  * Implementation of table arithm3_1.
    1130                 :  * Specified by: sll, sra, wsbh, seb, seh.
    1131                 :  */
    1132                 : static inline const ClassDecoder
    1133              92 : &decode_arithm3_1(const Instruction insn, const DecoderState *state) {
    1134              92 :   if (((insn & 0x03E00000) != 0x00000000)) {
    1135               0 :     return state->_Forbidden_instance;
    1136                 :   }
    1137                 : 
    1138              92 :   if (((insn & 0x03E00000) == 0x00000000)) {
    1139              92 :     return state->_Arithm3_instance;
    1140                 :   }
    1141                 : 
    1142                 :   // Catch any attempt to fall through...
    1143                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1144               0 :           "arithm3_1 could not parse %08X", insn.Bits(31, 0));
    1145               0 :   return state->_Forbidden_instance;
    1146                 : }
    1147                 : 
    1148                 : /*
    1149                 :  * Implementation of table arithm3_2.
    1150                 :  * Specified by: sllv, srav, movz, movn, mul, clz, clo.
    1151                 :  */
    1152                 : static inline const ClassDecoder
    1153               0 : &decode_arithm3_2(const Instruction insn, const DecoderState *state) {
    1154               0 :   if (((insn & 0x000007C0) != 0x00000000)) {
    1155               0 :     return state->_Forbidden_instance;
    1156                 :   }
    1157                 : 
    1158               0 :   if (((insn & 0x000007C0) == 0x00000000)) {
    1159               0 :     return state->_Arithm3_instance;
    1160                 :   }
    1161                 : 
    1162                 :   // Catch any attempt to fall through...
    1163                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1164               0 :           "arithm3_2 could not parse %08X", insn.Bits(31, 0));
    1165               0 :   return state->_Forbidden_instance;
    1166                 : }
    1167                 : 
    1168                 : /*
    1169                 :  * Implementation of table jr.
    1170                 :  * Specified by: jr.
    1171                 :  */
    1172                 : static inline const ClassDecoder
    1173               2 : &decode_jr(const Instruction insn, const DecoderState *state) {
    1174               2 :   if (((insn & 0x001FFFC0) != 0x00000000)) {
    1175               0 :     return state->_Forbidden_instance;
    1176                 :   }
    1177                 : 
    1178               2 :   if (((insn & 0x001FFFC0) == 0x00000000)) {
    1179               2 :     return state->_JmpReg_instance;
    1180                 :   }
    1181                 : 
    1182                 :   // Catch any attempt to fall through...
    1183                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1184               0 :           "jr could not parse %08X", insn.Bits(31, 0));
    1185               0 :   return state->_Forbidden_instance;
    1186                 : }
    1187                 : 
    1188                 : /*
    1189                 :  * Implementation of table jalr.
    1190                 :  * Specified by: jalr.
    1191                 :  */
    1192                 : static inline const ClassDecoder
    1193               2 : &decode_jalr(const Instruction insn, const DecoderState *state) {
    1194               2 :   if (((insn & 0x001F0000) != 0x00000000)
    1195               0 :       && ((insn & 0x000007C0) != 0x00000000)) {
    1196               0 :     return state->_Forbidden_instance;
    1197                 :   }
    1198                 : 
    1199               4 :   if (((insn & 0x001F0000) == 0x00000000)
    1200               2 :       && ((insn & 0x000007C0) == 0x00000000)) {
    1201               2 :     return state->_JalReg_instance;
    1202                 :   }
    1203                 : 
    1204                 :   // Catch any attempt to fall through...
    1205                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1206               0 :           "jalr could not parse %08X", insn.Bits(31, 0));
    1207               0 :   return state->_Forbidden_instance;
    1208                 : }
    1209                 : 
    1210                 : /*
    1211                 :  * Implementation of table sync.
    1212                 :  * Specified by: sync.
    1213                 :  */
    1214                 : static inline const ClassDecoder
    1215               0 : &decode_sync(const Instruction insn, const DecoderState *state) {
    1216               0 :   if (((insn & 0x03FFFFC0) != 0x00000000)) {
    1217               0 :     return state->_Forbidden_instance;
    1218                 :   }
    1219                 : 
    1220               0 :   if (((insn & 0x03FFFFC0) == 0x00000000)) {
    1221               0 :     return state->_Safe_instance;
    1222                 :   }
    1223                 : 
    1224                 :   // Catch any attempt to fall through...
    1225                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1226               0 :           "sync could not parse %08X", insn.Bits(31, 0));
    1227               0 :   return state->_Forbidden_instance;
    1228                 : }
    1229                 : 
    1230                 : /*
    1231                 :  * Implementation of table mfhi.
    1232                 :  * Specified by: mfhi, mflo.
    1233                 :  */
    1234                 : static inline const ClassDecoder
    1235               0 : &decode_mfhi(const Instruction insn, const DecoderState *state) {
    1236               0 :   if (((insn & 0x03FF0000) != 0x00000000)
    1237               0 :       && ((insn & 0x000007C0) != 0x00000000)) {
    1238               0 :     return state->_Forbidden_instance;
    1239                 :   }
    1240                 : 
    1241               0 :   if (((insn & 0x03FF0000) == 0x00000000)
    1242               0 :       && ((insn & 0x000007C0) == 0x00000000)) {
    1243               0 :     return state->_Arithm3_instance;
    1244                 :   }
    1245                 : 
    1246                 :   // Catch any attempt to fall through...
    1247                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1248               0 :           "mfhi could not parse %08X", insn.Bits(31, 0));
    1249               0 :   return state->_Forbidden_instance;
    1250                 : }
    1251                 : 
    1252                 : /*
    1253                 :  * Implementation of table mthi.
    1254                 :  * Specified by: mthi, mtlo.
    1255                 :  */
    1256                 : static inline const ClassDecoder
    1257               0 : &decode_mthi(const Instruction insn, const DecoderState *state) {
    1258               0 :   if (((insn & 0x001FFFC0) != 0x00000000)) {
    1259               0 :     return state->_Forbidden_instance;
    1260                 :   }
    1261                 : 
    1262               0 :   if (((insn & 0x001FFFC0) == 0x00000000)) {
    1263               0 :     return state->_Safe_instance;
    1264                 :   }
    1265                 : 
    1266                 :   // Catch any attempt to fall through...
    1267                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1268               0 :           "mthi could not parse %08X", insn.Bits(31, 0));
    1269               0 :   return state->_Forbidden_instance;
    1270                 : }
    1271                 : 
    1272                 : /*
    1273                 :  * Implementation of table mult.
    1274                 :  * Specified by: mult, multu, div, divu, madd, maddu, msub, msubu.
    1275                 :  */
    1276                 : static inline const ClassDecoder
    1277               0 : &decode_mult(const Instruction insn, const DecoderState *state) {
    1278               0 :   if (((insn & 0x0000FFC0) != 0x00000000)) {
    1279               0 :     return state->_Forbidden_instance;
    1280                 :   }
    1281                 : 
    1282               0 :   if (((insn & 0x0000FFC0) == 0x00000000)) {
    1283               0 :     return state->_Safe_instance;
    1284                 :   }
    1285                 : 
    1286                 :   // Catch any attempt to fall through...
    1287                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1288               0 :           "mult could not parse %08X", insn.Bits(31, 0));
    1289               0 :   return state->_Forbidden_instance;
    1290                 : }
    1291                 : 
    1292                 : /*
    1293                 :  * Implementation of table arithm3_3.
    1294                 :  * Specified by: add, addu, sub, subu, and, or, xor, nor, slt, sltu.
    1295                 :  */
    1296                 : static inline const ClassDecoder
    1297              42 : &decode_arithm3_3(const Instruction insn, const DecoderState *state) {
    1298              42 :   if (((insn & 0x000007C0) != 0x00000000)) {
    1299               0 :     return state->_Forbidden_instance;
    1300                 :   }
    1301                 : 
    1302              42 :   if (((insn & 0x000007C0) == 0x00000000)) {
    1303              42 :     return state->_Arithm3_instance;
    1304                 :   }
    1305                 : 
    1306                 :   // Catch any attempt to fall through...
    1307                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1308               0 :           "arithm3_3 could not parse %08X", insn.Bits(31, 0));
    1309               0 :   return state->_Forbidden_instance;
    1310                 : }
    1311                 : 
    1312                 : /*
    1313                 :  * Implementation of table mfmc0.
    1314                 :  * Specified by: di, ei.
    1315                 :  */
    1316                 : static inline const ClassDecoder
    1317               0 : &decode_mfmc0(const Instruction insn, const DecoderState *state) {
    1318                 :   if ((true)) {
    1319               0 :     return state->_Forbidden_instance;
    1320                 :   }
    1321                 : 
    1322                 :   // Catch any attempt to fall through...
    1323                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1324                 :           "mfmc0 could not parse %08X", insn.Bits(31, 0));
    1325                 :   return state->_Forbidden_instance;
    1326                 : }
    1327                 : 
    1328                 : /*
    1329                 :  * Implementation of table mfc1.
    1330                 :  * Specified by: mfc1, mfhc1.
    1331                 :  */
    1332                 : static inline const ClassDecoder
    1333               0 : &decode_mfc1(const Instruction insn, const DecoderState *state) {
    1334               0 :   if (((insn & 0x000007FF) != 0x00000000)) {
    1335               0 :     return state->_Forbidden_instance;
    1336                 :   }
    1337                 : 
    1338               0 :   if (((insn & 0x000007FF) == 0x00000000)) {
    1339               0 :     return state->_Arithm2_instance;
    1340                 :   }
    1341                 : 
    1342                 :   // Catch any attempt to fall through...
    1343                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1344               0 :           "mfc1 could not parse %08X", insn.Bits(31, 0));
    1345               0 :   return state->_Forbidden_instance;
    1346                 : }
    1347                 : 
    1348                 : /*
    1349                 :  * Implementation of table mtc1.
    1350                 :  * Specified by: mtc1, mthc1.
    1351                 :  */
    1352                 : static inline const ClassDecoder
    1353               0 : &decode_mtc1(const Instruction insn, const DecoderState *state) {
    1354               0 :   if (((insn & 0x000007FF) != 0x00000000)) {
    1355               0 :     return state->_Forbidden_instance;
    1356                 :   }
    1357                 : 
    1358               0 :   if (((insn & 0x000007FF) == 0x00000000)) {
    1359               0 :     return state->_Safe_instance;
    1360                 :   }
    1361                 : 
    1362                 :   // Catch any attempt to fall through...
    1363                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1364               0 :           "mtc1 could not parse %08X", insn.Bits(31, 0));
    1365               0 :   return state->_Forbidden_instance;
    1366                 : }
    1367                 : 
    1368                 : /*
    1369                 :  * Implementation of table bc1.
    1370                 :  * Specified by: bc1f, bc1t, bc1fl, bc1tl.
    1371                 :  */
    1372                 : static inline const ClassDecoder
    1373               0 : &decode_bc1(const Instruction insn, const DecoderState *state) {
    1374                 :   if ((true)) {
    1375               0 :     return state->_Branch_instance;
    1376                 :   }
    1377                 : 
    1378                 :   // Catch any attempt to fall through...
    1379                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1380                 :           "bc1 could not parse %08X", insn.Bits(31, 0));
    1381                 :   return state->_Forbidden_instance;
    1382                 : }
    1383                 : 
    1384                 : /*
    1385                 :  * Implementation of table fp.
    1386                 :  * Specified by: sqrt.fmt, abs.fmt, mov.fmt, neg.fmt, round.l.fmt, trunc.l.fmt, ceil.l.fmt, floor.l.fmt, round.w.fmt, trunc.w.fmt, ceil.w.fmt, floor.w.fmt, recip.fmt, rsqrt.fmt, cvt.s.fmt, cvt.d.fmt, cvt.w.fmt, cvt.l.fmt, cvt.s.pl.
    1387                 :  */
    1388                 : static inline const ClassDecoder
    1389               0 : &decode_fp(const Instruction insn, const DecoderState *state) {
    1390               0 :   if (((insn & 0x001F0000) != 0x00000000)) {
    1391               0 :     return state->_Forbidden_instance;
    1392                 :   }
    1393                 : 
    1394               0 :   if (((insn & 0x001F0000) == 0x00000000)) {
    1395               0 :     return state->_Safe_instance;
    1396                 :   }
    1397                 : 
    1398                 :   // Catch any attempt to fall through...
    1399                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1400               0 :           "fp could not parse %08X", insn.Bits(31, 0));
    1401               0 :   return state->_Forbidden_instance;
    1402                 : }
    1403                 : 
    1404                 : /*
    1405                 :  * Implementation of table bc2.
    1406                 :  * Specified by: bc2f, bc2t, bc2fl, bc2tl.
    1407                 :  */
    1408                 : static inline const ClassDecoder
    1409               0 : &decode_bc2(const Instruction insn, const DecoderState *state) {
    1410                 :   if ((true)) {
    1411               0 :     return state->_Forbidden_instance;
    1412                 :   }
    1413                 : 
    1414                 :   // Catch any attempt to fall through...
    1415                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1416                 :           "bc2 could not parse %08X", insn.Bits(31, 0));
    1417                 :   return state->_Forbidden_instance;
    1418                 : }
    1419                 : 
    1420                 : /*
    1421                 :  * Implementation of table c_cond_fmt.
    1422                 :  * Specified by: c.cond.fmt.
    1423                 :  */
    1424                 : static inline const ClassDecoder
    1425               0 : &decode_c_cond_fmt(const Instruction insn, const DecoderState *state) {
    1426               0 :   if (((insn & 0x000000C0) != 0x00000000)) {
    1427               0 :     return state->_Forbidden_instance;
    1428                 :   }
    1429                 : 
    1430               0 :   if (((insn & 0x000000C0) == 0x00000000)) {
    1431               0 :     return state->_Safe_instance;
    1432                 :   }
    1433                 : 
    1434                 :   // Catch any attempt to fall through...
    1435                 :   fprintf(stderr, "TABLE IS INCOMPLETE: "
    1436               0 :           "c_cond_fmt could not parse %08X", insn.Bits(31, 0));
    1437               0 :   return state->_Forbidden_instance;
    1438                 : }
    1439                 : 
    1440              10 : const DecoderState *init_decode() {
    1441              10 :   return new DecoderState;
    1442                 : }
    1443               0 : void delete_state(const DecoderState *state) {
    1444               0 :   delete state;
    1445               0 : }
    1446                 : 
    1447             154 : const ClassDecoder &decode(const Instruction insn, const DecoderState *state) {
    1448             154 :   return decode_MIPS32(insn, state);
    1449                 : }
    1450                 : 
    1451                 : }  // namespace nacl_mips_dec

Generated by: LCOV version 1.7