Search
lxdream.org :: lxdream/src/sh4/sh4stat.c
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4stat.c
changeset 671:a530ea88eebd
prev561:533f6b478071
next673:44c579439d73
author nkeynes
date Thu May 15 10:22:39 2008 +0000 (11 years ago)
permissions -rw-r--r--
last change Permanently add SH4 instruction statistics tracking (enabled with --enable-sh4stats)
file annotate diff log raw
nkeynes@387
     1
/**
nkeynes@561
     2
 * $Id$
nkeynes@387
     3
 * 
nkeynes@387
     4
 * Support module for collecting instruction stats
nkeynes@387
     5
 *
nkeynes@387
     6
 * Copyright (c) 2005 Nathan Keynes.
nkeynes@387
     7
 *
nkeynes@387
     8
 * This program is free software; you can redistribute it and/or modify
nkeynes@387
     9
 * it under the terms of the GNU General Public License as published by
nkeynes@387
    10
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@387
    11
 * (at your option) any later version.
nkeynes@387
    12
 *
nkeynes@387
    13
 * This program is distributed in the hope that it will be useful,
nkeynes@387
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@387
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@387
    16
 * GNU General Public License for more details.
nkeynes@387
    17
 */
nkeynes@387
    18
nkeynes@387
    19
#include "dream.h"
nkeynes@387
    20
#include "sh4stat.h"
nkeynes@387
    21
#include "sh4core.h"
nkeynes@387
    22
nkeynes@387
    23
static uint64_t sh4_stats[SH4_INSTRUCTION_COUNT+1];
nkeynes@387
    24
static uint64_t sh4_stats_total;
nkeynes@387
    25
static const char *sh4_stats_names[] = {
nkeynes@387
    26
    "???",
nkeynes@387
    27
"ADD Rm, Rn",
nkeynes@387
    28
"ADD #imm, Rn",
nkeynes@387
    29
"ADDC Rm, Rn",
nkeynes@387
    30
"ADDV Rm, Rn",
nkeynes@387
    31
"AND Rm, Rn",
nkeynes@387
    32
"AND #imm, R0",
nkeynes@387
    33
"AND.B #imm, @(R0, GBR)",
nkeynes@387
    34
"BF disp",
nkeynes@387
    35
"BF/S disp",
nkeynes@387
    36
"BRA disp",
nkeynes@387
    37
"BRAF Rn",
nkeynes@387
    38
"BSR disp",
nkeynes@387
    39
"BSRF Rn",
nkeynes@387
    40
"BT disp",
nkeynes@387
    41
"BT/S disp",
nkeynes@387
    42
"CLRMAC",
nkeynes@387
    43
"CLRS",
nkeynes@387
    44
"CLRT",
nkeynes@387
    45
"CMP/EQ Rm, Rn",
nkeynes@387
    46
"CMP/EQ #imm, R0",
nkeynes@387
    47
"CMP/GE Rm, Rn",
nkeynes@387
    48
"CMP/GT Rm, Rn",
nkeynes@387
    49
"CMP/HI Rm, Rn",
nkeynes@387
    50
"CMP/HS Rm, Rn",
nkeynes@387
    51
"CMP/PL Rn",
nkeynes@387
    52
"CMP/PZ Rn",
nkeynes@387
    53
"CMP/STR Rm, Rn",
nkeynes@387
    54
"DIV0S Rm, Rn",
nkeynes@387
    55
"DIV0U",
nkeynes@387
    56
"DIV1 Rm, Rn",
nkeynes@387
    57
"DMULS.L Rm, Rn",
nkeynes@387
    58
"DMULU.L Rm, Rn",
nkeynes@387
    59
"DT Rn",
nkeynes@387
    60
"EXTS.B Rm, Rn",
nkeynes@387
    61
"EXTS.W Rm, Rn",
nkeynes@387
    62
"EXTU.B Rm, Rn",
nkeynes@387
    63
"EXTU.W Rm, Rn",
nkeynes@387
    64
"FABS FRn",
nkeynes@387
    65
"FADD FRm, FRn",
nkeynes@387
    66
"FCMP/EQ FRm, FRn",
nkeynes@387
    67
"FCMP/GT FRm, FRn",
nkeynes@387
    68
"FCNVDS FRm, FPUL",
nkeynes@387
    69
"FCNVSD FPUL, FRn",
nkeynes@387
    70
"FDIV FRm, FRn",
nkeynes@387
    71
"FIPR FVm, FVn",
nkeynes@387
    72
"FLDS FRm, FPUL",
nkeynes@387
    73
"FLDI0 FRn",
nkeynes@387
    74
"FLDI1 FRn",
nkeynes@387
    75
"FLOAT FPUL, FRn",
nkeynes@387
    76
"FMAC FR0, FRm, FRn",
nkeynes@387
    77
"FMOV FRm, FRn",
nkeynes@387
    78
"FMOV FRm, @Rn",
nkeynes@387
    79
"FMOV FRm, @-Rn",
nkeynes@387
    80
"FMOV FRm, @(R0, Rn)",
nkeynes@387
    81
"FMOV @Rm, FRn",
nkeynes@387
    82
"FMOV @Rm+, FRn",
nkeynes@387
    83
"FMOV @(R0, Rm), FRn",
nkeynes@387
    84
"FMUL FRm, FRn",
nkeynes@387
    85
"FNEG FRn",
nkeynes@387
    86
"FRCHG",
nkeynes@387
    87
"FSCA FPUL, FRn",
nkeynes@387
    88
"FSCHG",
nkeynes@387
    89
"FSQRT FRn",
nkeynes@387
    90
"FSRRA FRn",
nkeynes@387
    91
"FSTS FPUL, FRn",
nkeynes@387
    92
"FSUB FRm, FRn",
nkeynes@387
    93
"FTRC FRm, FPUL",
nkeynes@387
    94
"FTRV XMTRX, FVn",
nkeynes@387
    95
"JMP @Rn",
nkeynes@387
    96
"JSR @Rn",
nkeynes@387
    97
"LDC Rm, SR",
nkeynes@387
    98
"LDC Rm, *",
nkeynes@387
    99
"LDC.L @Rm+, SR",
nkeynes@387
   100
"LDC.L @Rm+, *",
nkeynes@387
   101
"LDS Rm, *",
nkeynes@387
   102
"LDS.L @Rm+, *",
nkeynes@387
   103
"LDTLB",
nkeynes@387
   104
"MAC.L @Rm+, @Rn+",
nkeynes@387
   105
"MAC.W @Rm+, @Rn+",
nkeynes@387
   106
"MOV Rm, Rn",
nkeynes@387
   107
"MOV #imm, Rn",
nkeynes@387
   108
"MOV.B ...",
nkeynes@387
   109
"MOV.L ...",
nkeynes@387
   110
"MOV.L @(disp, PC)",
nkeynes@387
   111
"MOV.W ...",
nkeynes@387
   112
"MOVA @(disp, PC), R0",
nkeynes@387
   113
"MOVCA.L R0, @Rn",
nkeynes@387
   114
"MOVT Rn",
nkeynes@387
   115
"MUL.L Rm, Rn",
nkeynes@387
   116
"MULS.W Rm, Rn",
nkeynes@387
   117
"MULU.W Rm, Rn",
nkeynes@387
   118
"NEG Rm, Rn",
nkeynes@387
   119
"NEGC Rm, Rn",
nkeynes@387
   120
"NOP",
nkeynes@387
   121
"NOT Rm, Rn",
nkeynes@387
   122
"OCBI @Rn",
nkeynes@387
   123
"OCBP @Rn",
nkeynes@387
   124
"OCBWB @Rn",
nkeynes@387
   125
"OR Rm, Rn",
nkeynes@387
   126
"OR #imm, R0",
nkeynes@387
   127
"OR.B #imm, @(R0, GBR)",
nkeynes@387
   128
"PREF @Rn",
nkeynes@387
   129
"ROTCL Rn",
nkeynes@387
   130
"ROTCR Rn",
nkeynes@387
   131
"ROTL Rn",
nkeynes@387
   132
"ROTR Rn",
nkeynes@387
   133
"RTE",
nkeynes@387
   134
"RTS",
nkeynes@387
   135
"SETS",
nkeynes@387
   136
"SETT",
nkeynes@387
   137
"SHAD Rm, Rn",
nkeynes@387
   138
"SHAL Rn",
nkeynes@387
   139
"SHAR Rn",
nkeynes@387
   140
"SHLD Rm, Rn",
nkeynes@387
   141
"SHLL* Rn",
nkeynes@387
   142
"SHLR* Rn",
nkeynes@387
   143
"SLEEP",
nkeynes@387
   144
"STC SR, Rn",
nkeynes@387
   145
"STC *, Rn",
nkeynes@387
   146
"STC.L SR, @-Rn",
nkeynes@387
   147
"STC.L *, @-Rn",
nkeynes@387
   148
"STS *, Rn",
nkeynes@387
   149
"STS.L *, @-Rn",
nkeynes@387
   150
"SUB Rm, Rn",
nkeynes@387
   151
"SUBC Rm, Rn",
nkeynes@387
   152
"SUBV Rm, Rn",
nkeynes@387
   153
"SWAP.B Rm, Rn",
nkeynes@387
   154
"SWAP.W Rm, Rn",
nkeynes@387
   155
"TAS.B @Rn",
nkeynes@387
   156
"TRAPA #imm",
nkeynes@387
   157
"TST Rm, Rn",
nkeynes@387
   158
"TST #imm, R0",
nkeynes@387
   159
"TST.B #imm, @(R0, GBR)",
nkeynes@387
   160
"XOR Rm, Rn",
nkeynes@387
   161
"XOR #imm, R0",
nkeynes@387
   162
"XOR.B #imm, @(R0, GBR)",
nkeynes@387
   163
"XTRCT Rm, Rn",
nkeynes@387
   164
"UNDEF"
nkeynes@387
   165
};
nkeynes@387
   166
nkeynes@387
   167
void sh4_stats_reset( void )
nkeynes@387
   168
{
nkeynes@387
   169
    int i;
nkeynes@387
   170
    for( i=0; i<= I_UNDEF; i++ ) {
nkeynes@387
   171
	sh4_stats[i] = 0;
nkeynes@387
   172
    }
nkeynes@387
   173
    sh4_stats_total = 0;
nkeynes@387
   174
}
nkeynes@387
   175
nkeynes@387
   176
void sh4_stats_print( FILE *out )
nkeynes@387
   177
{
nkeynes@387
   178
    int i;
nkeynes@387
   179
    for( i=0; i<= I_UNDEF; i++ ) {
nkeynes@500
   180
	fprintf( out, "%-20s\t%d\t%.2f%%\n", sh4_stats_names[i], (uint32_t)sh4_stats[i], ((double)sh4_stats[i])*100.0/(double)sh4_stats_total );
nkeynes@387
   181
    }
nkeynes@500
   182
    fprintf( out, "Total: %lld\n", sh4_stats_total );
nkeynes@387
   183
}
nkeynes@387
   184
nkeynes@671
   185
void sh4_stats_add( sh4_inst_id item )
nkeynes@671
   186
{
nkeynes@671
   187
    sh4_stats[item]++;
nkeynes@671
   188
    sh4_stats_total++;
nkeynes@671
   189
}
nkeynes@671
   190
nkeynes@671
   191
void sh4_stats_add_by_pc( uint32_t pc ) 
nkeynes@387
   192
{
nkeynes@387
   193
    uint16_t ir = sh4_read_word(pc);
nkeynes@387
   194
#define UNDEF() sh4_stats[0]++
nkeynes@387
   195
        switch( (ir&0xF000) >> 12 ) {
nkeynes@387
   196
            case 0x0:
nkeynes@387
   197
                switch( ir&0xF ) {
nkeynes@387
   198
                    case 0x2:
nkeynes@387
   199
                        switch( (ir&0x80) >> 7 ) {
nkeynes@387
   200
                            case 0x0:
nkeynes@387
   201
                                switch( (ir&0x70) >> 4 ) {
nkeynes@387
   202
                                    case 0x0:
nkeynes@387
   203
                                        { /* STC SR, Rn */
nkeynes@387
   204
                                        uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   205
                                        sh4_stats[I_STCSR]++;
nkeynes@387
   206
                                        }
nkeynes@387
   207
                                        break;
nkeynes@387
   208
                                    case 0x1:
nkeynes@387
   209
                                        { /* STC GBR, Rn */
nkeynes@387
   210
                                        uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   211
                                        sh4_stats[I_STC]++;
nkeynes@387
   212
                                        }
nkeynes@387
   213
                                        break;
nkeynes@387
   214
                                    case 0x2:
nkeynes@387
   215
                                        { /* STC VBR, Rn */
nkeynes@387
   216
                                        uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   217
                                        sh4_stats[I_STC]++;
nkeynes@387
   218
                                        }
nkeynes@387
   219
                                        break;
nkeynes@387
   220
                                    case 0x3:
nkeynes@387
   221
                                        { /* STC SSR, Rn */
nkeynes@387
   222
                                        uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   223
                                        sh4_stats[I_STC]++;
nkeynes@387
   224
                                        }
nkeynes@387
   225
                                        break;
nkeynes@387
   226
                                    case 0x4:
nkeynes@387
   227
                                        { /* STC SPC, Rn */
nkeynes@387
   228
                                        uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   229
                                        sh4_stats[I_STC]++;
nkeynes@387
   230
                                        }
nkeynes@387
   231
                                        break;
nkeynes@387
   232
                                    default:
nkeynes@387
   233
                                        UNDEF();
nkeynes@387
   234
                                        break;
nkeynes@387
   235
                                }
nkeynes@387
   236
                                break;
nkeynes@387
   237
                            case 0x1:
nkeynes@387
   238
                                { /* STC Rm_BANK, Rn */
nkeynes@387
   239
                                uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm_BANK = ((ir>>4)&0x7); 
nkeynes@387
   240
                                sh4_stats[I_STC]++;
nkeynes@387
   241
                                }
nkeynes@387
   242
                                break;
nkeynes@387
   243
                        }
nkeynes@387
   244
                        break;
nkeynes@387
   245
                    case 0x3:
nkeynes@387
   246
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
   247
                            case 0x0:
nkeynes@387
   248
                                { /* BSRF Rn */
nkeynes@387
   249
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   250
                                sh4_stats[I_BSRF]++;
nkeynes@387
   251
                                }
nkeynes@387
   252
                                break;
nkeynes@387
   253
                            case 0x2:
nkeynes@387
   254
                                { /* BRAF Rn */
nkeynes@387
   255
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   256
                                sh4_stats[I_BRAF]++;
nkeynes@387
   257
                                }
nkeynes@387
   258
                                break;
nkeynes@387
   259
                            case 0x8:
nkeynes@387
   260
                                { /* PREF @Rn */
nkeynes@387
   261
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   262
                                sh4_stats[I_PREF]++;
nkeynes@387
   263
                                }
nkeynes@387
   264
                                break;
nkeynes@387
   265
                            case 0x9:
nkeynes@387
   266
                                { /* OCBI @Rn */
nkeynes@387
   267
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   268
                                sh4_stats[I_OCBI]++;
nkeynes@387
   269
                                }
nkeynes@387
   270
                                break;
nkeynes@387
   271
                            case 0xA:
nkeynes@387
   272
                                { /* OCBP @Rn */
nkeynes@387
   273
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   274
                                sh4_stats[I_OCBP]++;
nkeynes@387
   275
                                }
nkeynes@387
   276
                                break;
nkeynes@387
   277
                            case 0xB:
nkeynes@387
   278
                                { /* OCBWB @Rn */
nkeynes@387
   279
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   280
                                sh4_stats[I_OCBWB]++;
nkeynes@387
   281
                                }
nkeynes@387
   282
                                break;
nkeynes@387
   283
                            case 0xC:
nkeynes@387
   284
                                { /* MOVCA.L R0, @Rn */
nkeynes@387
   285
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   286
                                sh4_stats[I_MOVCA]++;
nkeynes@387
   287
                                }
nkeynes@387
   288
                                break;
nkeynes@387
   289
                            default:
nkeynes@387
   290
                                UNDEF();
nkeynes@387
   291
                                break;
nkeynes@387
   292
                        }
nkeynes@387
   293
                        break;
nkeynes@387
   294
                    case 0x4:
nkeynes@387
   295
                        { /* MOV.B Rm, @(R0, Rn) */
nkeynes@387
   296
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   297
                        sh4_stats[I_MOVB]++;
nkeynes@387
   298
                        }
nkeynes@387
   299
                        break;
nkeynes@387
   300
                    case 0x5:
nkeynes@387
   301
                        { /* MOV.W Rm, @(R0, Rn) */
nkeynes@387
   302
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   303
                        sh4_stats[I_MOVW]++;
nkeynes@387
   304
                        }
nkeynes@387
   305
                        break;
nkeynes@387
   306
                    case 0x6:
nkeynes@387
   307
                        { /* MOV.L Rm, @(R0, Rn) */
nkeynes@387
   308
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   309
                        sh4_stats[I_MOVL]++;
nkeynes@387
   310
                        }
nkeynes@387
   311
                        break;
nkeynes@387
   312
                    case 0x7:
nkeynes@387
   313
                        { /* MUL.L Rm, Rn */
nkeynes@387
   314
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   315
                        sh4_stats[I_MULL]++;
nkeynes@387
   316
                        }
nkeynes@387
   317
                        break;
nkeynes@387
   318
                    case 0x8:
nkeynes@387
   319
                        switch( (ir&0xFF0) >> 4 ) {
nkeynes@387
   320
                            case 0x0:
nkeynes@387
   321
                                { /* CLRT */
nkeynes@387
   322
                                sh4_stats[I_CLRT]++;
nkeynes@387
   323
                                }
nkeynes@387
   324
                                break;
nkeynes@387
   325
                            case 0x1:
nkeynes@387
   326
                                { /* SETT */
nkeynes@387
   327
                                sh4_stats[I_SETT]++;
nkeynes@387
   328
                                }
nkeynes@387
   329
                                break;
nkeynes@387
   330
                            case 0x2:
nkeynes@387
   331
                                { /* CLRMAC */
nkeynes@387
   332
                                sh4_stats[I_CLRMAC]++;
nkeynes@387
   333
                                }
nkeynes@387
   334
                                break;
nkeynes@387
   335
                            case 0x3:
nkeynes@387
   336
                                { /* LDTLB */
nkeynes@387
   337
                                sh4_stats[I_LDTLB]++;
nkeynes@387
   338
                                }
nkeynes@387
   339
                                break;
nkeynes@387
   340
                            case 0x4:
nkeynes@387
   341
                                { /* CLRS */
nkeynes@387
   342
                                sh4_stats[I_CLRS]++;
nkeynes@387
   343
                                }
nkeynes@387
   344
                                break;
nkeynes@387
   345
                            case 0x5:
nkeynes@387
   346
                                { /* SETS */
nkeynes@387
   347
                                sh4_stats[I_SETS]++;
nkeynes@387
   348
                                }
nkeynes@387
   349
                                break;
nkeynes@387
   350
                            default:
nkeynes@387
   351
                                UNDEF();
nkeynes@387
   352
                                break;
nkeynes@387
   353
                        }
nkeynes@387
   354
                        break;
nkeynes@387
   355
                    case 0x9:
nkeynes@387
   356
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
   357
                            case 0x0:
nkeynes@387
   358
                                { /* NOP */
nkeynes@387
   359
                                sh4_stats[I_NOP]++;
nkeynes@387
   360
                                }
nkeynes@387
   361
                                break;
nkeynes@387
   362
                            case 0x1:
nkeynes@387
   363
                                { /* DIV0U */
nkeynes@387
   364
                                sh4_stats[I_DIV0U]++;
nkeynes@387
   365
                                }
nkeynes@387
   366
                                break;
nkeynes@387
   367
                            case 0x2:
nkeynes@387
   368
                                { /* MOVT Rn */
nkeynes@387
   369
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   370
                                sh4_stats[I_MOVT]++;
nkeynes@387
   371
                                }
nkeynes@387
   372
                                break;
nkeynes@387
   373
                            default:
nkeynes@387
   374
                                UNDEF();
nkeynes@387
   375
                                break;
nkeynes@387
   376
                        }
nkeynes@387
   377
                        break;
nkeynes@387
   378
                    case 0xA:
nkeynes@387
   379
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
   380
                            case 0x0:
nkeynes@387
   381
                                { /* STS MACH, Rn */
nkeynes@387
   382
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   383
                                sh4_stats[I_STS]++;
nkeynes@387
   384
                                }
nkeynes@387
   385
                                break;
nkeynes@387
   386
                            case 0x1:
nkeynes@387
   387
                                { /* STS MACL, Rn */
nkeynes@387
   388
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   389
                                sh4_stats[I_STS]++;
nkeynes@387
   390
                                }
nkeynes@387
   391
                                break;
nkeynes@387
   392
                            case 0x2:
nkeynes@387
   393
                                { /* STS PR, Rn */
nkeynes@387
   394
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   395
                                sh4_stats[I_STS]++;
nkeynes@387
   396
                                }
nkeynes@387
   397
                                break;
nkeynes@387
   398
                            case 0x3:
nkeynes@387
   399
                                { /* STC SGR, Rn */
nkeynes@387
   400
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   401
                                sh4_stats[I_STC]++;
nkeynes@387
   402
                                }
nkeynes@387
   403
                                break;
nkeynes@387
   404
                            case 0x5:
nkeynes@387
   405
                                { /* STS FPUL, Rn */
nkeynes@387
   406
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   407
                                sh4_stats[I_STS]++;
nkeynes@387
   408
                                }
nkeynes@387
   409
                                break;
nkeynes@387
   410
                            case 0x6:
nkeynes@387
   411
                                { /* STS FPSCR, Rn */
nkeynes@387
   412
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   413
                                sh4_stats[I_STS]++;
nkeynes@387
   414
                                }
nkeynes@387
   415
                                break;
nkeynes@387
   416
                            case 0xF:
nkeynes@387
   417
                                { /* STC DBR, Rn */
nkeynes@387
   418
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   419
                                sh4_stats[I_STC]++;
nkeynes@387
   420
                                }
nkeynes@387
   421
                                break;
nkeynes@387
   422
                            default:
nkeynes@387
   423
                                UNDEF();
nkeynes@387
   424
                                break;
nkeynes@387
   425
                        }
nkeynes@387
   426
                        break;
nkeynes@387
   427
                    case 0xB:
nkeynes@387
   428
                        switch( (ir&0xFF0) >> 4 ) {
nkeynes@387
   429
                            case 0x0:
nkeynes@387
   430
                                { /* RTS */
nkeynes@387
   431
                                sh4_stats[I_RTS]++;
nkeynes@387
   432
                                }
nkeynes@387
   433
                                break;
nkeynes@387
   434
                            case 0x1:
nkeynes@387
   435
                                { /* SLEEP */
nkeynes@387
   436
                                sh4_stats[I_SLEEP]++;
nkeynes@387
   437
                                }
nkeynes@387
   438
                                break;
nkeynes@387
   439
                            case 0x2:
nkeynes@387
   440
                                { /* RTE */
nkeynes@387
   441
                                sh4_stats[I_RTE]++;
nkeynes@387
   442
                                }
nkeynes@387
   443
                                break;
nkeynes@387
   444
                            default:
nkeynes@387
   445
                                UNDEF();
nkeynes@387
   446
                                break;
nkeynes@387
   447
                        }
nkeynes@387
   448
                        break;
nkeynes@387
   449
                    case 0xC:
nkeynes@387
   450
                        { /* MOV.B @(R0, Rm), Rn */
nkeynes@387
   451
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   452
                        sh4_stats[I_MOVB]++;
nkeynes@387
   453
                        }
nkeynes@387
   454
                        break;
nkeynes@387
   455
                    case 0xD:
nkeynes@387
   456
                        { /* MOV.W @(R0, Rm), Rn */
nkeynes@387
   457
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   458
                        sh4_stats[I_MOVW]++;
nkeynes@387
   459
                        }
nkeynes@387
   460
                        break;
nkeynes@387
   461
                    case 0xE:
nkeynes@387
   462
                        { /* MOV.L @(R0, Rm), Rn */
nkeynes@387
   463
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   464
                        sh4_stats[I_MOVL]++;
nkeynes@387
   465
                        }
nkeynes@387
   466
                        break;
nkeynes@387
   467
                    case 0xF:
nkeynes@387
   468
                        { /* MAC.L @Rm+, @Rn+ */
nkeynes@387
   469
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   470
                        sh4_stats[I_MACL]++;
nkeynes@387
   471
                        }
nkeynes@387
   472
                        break;
nkeynes@387
   473
                    default:
nkeynes@387
   474
                        UNDEF();
nkeynes@387
   475
                        break;
nkeynes@387
   476
                }
nkeynes@387
   477
                break;
nkeynes@387
   478
            case 0x1:
nkeynes@387
   479
                { /* MOV.L Rm, @(disp, Rn) */
nkeynes@387
   480
                uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); uint32_t disp = (ir&0xF)<<2; 
nkeynes@387
   481
                sh4_stats[I_MOVL]++;
nkeynes@387
   482
                }
nkeynes@387
   483
                break;
nkeynes@387
   484
            case 0x2:
nkeynes@387
   485
                switch( ir&0xF ) {
nkeynes@387
   486
                    case 0x0:
nkeynes@387
   487
                        { /* MOV.B Rm, @Rn */
nkeynes@387
   488
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   489
                        sh4_stats[I_MOVB]++;
nkeynes@387
   490
                        }
nkeynes@387
   491
                        break;
nkeynes@387
   492
                    case 0x1:
nkeynes@387
   493
                        { /* MOV.W Rm, @Rn */
nkeynes@387
   494
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   495
                        sh4_stats[I_MOVW]++;
nkeynes@387
   496
                        }
nkeynes@387
   497
                        break;
nkeynes@387
   498
                    case 0x2:
nkeynes@387
   499
                        { /* MOV.L Rm, @Rn */
nkeynes@387
   500
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   501
                        sh4_stats[I_MOVL]++;
nkeynes@387
   502
                        }
nkeynes@387
   503
                        break;
nkeynes@387
   504
                    case 0x4:
nkeynes@387
   505
                        { /* MOV.B Rm, @-Rn */
nkeynes@387
   506
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   507
                        sh4_stats[I_MOVB]++;
nkeynes@387
   508
                        }
nkeynes@387
   509
                        break;
nkeynes@387
   510
                    case 0x5:
nkeynes@387
   511
                        { /* MOV.W Rm, @-Rn */
nkeynes@387
   512
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   513
                        sh4_stats[I_MOVW]++;
nkeynes@387
   514
                        }
nkeynes@387
   515
                        break;
nkeynes@387
   516
                    case 0x6:
nkeynes@387
   517
                        { /* MOV.L Rm, @-Rn */
nkeynes@387
   518
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   519
                        sh4_stats[I_MOVL]++;
nkeynes@387
   520
                        }
nkeynes@387
   521
                        break;
nkeynes@387
   522
                    case 0x7:
nkeynes@387
   523
                        { /* DIV0S Rm, Rn */
nkeynes@387
   524
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   525
                        sh4_stats[I_DIV0S]++;
nkeynes@387
   526
                        }
nkeynes@387
   527
                        break;
nkeynes@387
   528
                    case 0x8:
nkeynes@387
   529
                        { /* TST Rm, Rn */
nkeynes@387
   530
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   531
                        sh4_stats[I_TST]++;
nkeynes@387
   532
                        }
nkeynes@387
   533
                        break;
nkeynes@387
   534
                    case 0x9:
nkeynes@387
   535
                        { /* AND Rm, Rn */
nkeynes@387
   536
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   537
                        sh4_stats[I_AND]++;
nkeynes@387
   538
                        }
nkeynes@387
   539
                        break;
nkeynes@387
   540
                    case 0xA:
nkeynes@387
   541
                        { /* XOR Rm, Rn */
nkeynes@387
   542
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   543
                        sh4_stats[I_XOR]++;
nkeynes@387
   544
                        }
nkeynes@387
   545
                        break;
nkeynes@387
   546
                    case 0xB:
nkeynes@387
   547
                        { /* OR Rm, Rn */
nkeynes@387
   548
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   549
                        sh4_stats[I_OR]++;
nkeynes@387
   550
                        }
nkeynes@387
   551
                        break;
nkeynes@387
   552
                    case 0xC:
nkeynes@387
   553
                        { /* CMP/STR Rm, Rn */
nkeynes@387
   554
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   555
                        sh4_stats[I_CMPSTR]++;
nkeynes@387
   556
                        }
nkeynes@387
   557
                        break;
nkeynes@387
   558
                    case 0xD:
nkeynes@387
   559
                        { /* XTRCT Rm, Rn */
nkeynes@387
   560
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   561
                        sh4_stats[I_XTRCT]++;
nkeynes@387
   562
                        }
nkeynes@387
   563
                        break;
nkeynes@387
   564
                    case 0xE:
nkeynes@387
   565
                        { /* MULU.W Rm, Rn */
nkeynes@387
   566
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   567
                        sh4_stats[I_MULUW]++;
nkeynes@387
   568
                        }
nkeynes@387
   569
                        break;
nkeynes@387
   570
                    case 0xF:
nkeynes@387
   571
                        { /* MULS.W Rm, Rn */
nkeynes@387
   572
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   573
                        sh4_stats[I_MULSW]++;
nkeynes@387
   574
                        }
nkeynes@387
   575
                        break;
nkeynes@387
   576
                    default:
nkeynes@387
   577
                        UNDEF();
nkeynes@387
   578
                        break;
nkeynes@387
   579
                }
nkeynes@387
   580
                break;
nkeynes@387
   581
            case 0x3:
nkeynes@387
   582
                switch( ir&0xF ) {
nkeynes@387
   583
                    case 0x0:
nkeynes@387
   584
                        { /* CMP/EQ Rm, Rn */
nkeynes@387
   585
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   586
                        sh4_stats[I_CMPEQ]++;
nkeynes@387
   587
                        }
nkeynes@387
   588
                        break;
nkeynes@387
   589
                    case 0x2:
nkeynes@387
   590
                        { /* CMP/HS Rm, Rn */
nkeynes@387
   591
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   592
                        sh4_stats[I_CMPHS]++;
nkeynes@387
   593
                        }
nkeynes@387
   594
                        break;
nkeynes@387
   595
                    case 0x3:
nkeynes@387
   596
                        { /* CMP/GE Rm, Rn */
nkeynes@387
   597
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   598
                        sh4_stats[I_CMPGE]++;
nkeynes@387
   599
                        }
nkeynes@387
   600
                        break;
nkeynes@387
   601
                    case 0x4:
nkeynes@387
   602
                        { /* DIV1 Rm, Rn */
nkeynes@387
   603
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   604
                        sh4_stats[I_DIV1]++;
nkeynes@387
   605
                        }
nkeynes@387
   606
                        break;
nkeynes@387
   607
                    case 0x5:
nkeynes@387
   608
                        { /* DMULU.L Rm, Rn */
nkeynes@387
   609
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   610
                        sh4_stats[I_DMULU]++;
nkeynes@387
   611
                        }
nkeynes@387
   612
                        break;
nkeynes@387
   613
                    case 0x6:
nkeynes@387
   614
                        { /* CMP/HI Rm, Rn */
nkeynes@387
   615
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   616
                        sh4_stats[I_CMPHI]++;
nkeynes@387
   617
                        }
nkeynes@387
   618
                        break;
nkeynes@387
   619
                    case 0x7:
nkeynes@387
   620
                        { /* CMP/GT Rm, Rn */
nkeynes@387
   621
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   622
                        sh4_stats[I_CMPGT]++;
nkeynes@387
   623
                        }
nkeynes@387
   624
                        break;
nkeynes@387
   625
                    case 0x8:
nkeynes@387
   626
                        { /* SUB Rm, Rn */
nkeynes@387
   627
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   628
                        sh4_stats[I_SUB]++;
nkeynes@387
   629
                        }
nkeynes@387
   630
                        break;
nkeynes@387
   631
                    case 0xA:
nkeynes@387
   632
                        { /* SUBC Rm, Rn */
nkeynes@387
   633
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   634
                        sh4_stats[I_SUBC]++;
nkeynes@387
   635
                        }
nkeynes@387
   636
                        break;
nkeynes@387
   637
                    case 0xB:
nkeynes@387
   638
                        { /* SUBV Rm, Rn */
nkeynes@387
   639
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   640
                        sh4_stats[I_SUBV]++;
nkeynes@387
   641
                        }
nkeynes@387
   642
                        break;
nkeynes@387
   643
                    case 0xC:
nkeynes@387
   644
                        { /* ADD Rm, Rn */
nkeynes@387
   645
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   646
                        sh4_stats[I_ADD]++;
nkeynes@387
   647
                        }
nkeynes@387
   648
                        break;
nkeynes@387
   649
                    case 0xD:
nkeynes@387
   650
                        { /* DMULS.L Rm, Rn */
nkeynes@387
   651
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   652
                        sh4_stats[I_DMULS]++;
nkeynes@387
   653
                        }
nkeynes@387
   654
                        break;
nkeynes@387
   655
                    case 0xE:
nkeynes@387
   656
                        { /* ADDC Rm, Rn */
nkeynes@387
   657
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   658
                        sh4_stats[I_ADDC]++;
nkeynes@387
   659
                        }
nkeynes@387
   660
                        break;
nkeynes@387
   661
                    case 0xF:
nkeynes@387
   662
                        { /* ADDV Rm, Rn */
nkeynes@387
   663
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
   664
                        sh4_stats[I_ADDV]++;
nkeynes@387
   665
                        }
nkeynes@387
   666
                        break;
nkeynes@387
   667
                    default:
nkeynes@387
   668
                        UNDEF();
nkeynes@387
   669
                        break;
nkeynes@387
   670
                }
nkeynes@387
   671
                break;
nkeynes@387
   672
            case 0x4:
nkeynes@387
   673
                switch( ir&0xF ) {
nkeynes@387
   674
                    case 0x0:
nkeynes@387
   675
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
   676
                            case 0x0:
nkeynes@387
   677
                                { /* SHLL Rn */
nkeynes@387
   678
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   679
                                sh4_stats[I_SHLL]++;
nkeynes@387
   680
                                }
nkeynes@387
   681
                                break;
nkeynes@387
   682
                            case 0x1:
nkeynes@387
   683
                                { /* DT Rn */
nkeynes@387
   684
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   685
                                sh4_stats[I_DT]++;
nkeynes@387
   686
                                }
nkeynes@387
   687
                                break;
nkeynes@387
   688
                            case 0x2:
nkeynes@387
   689
                                { /* SHAL Rn */
nkeynes@387
   690
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   691
                                sh4_stats[I_SHAL]++;
nkeynes@387
   692
                                }
nkeynes@387
   693
                                break;
nkeynes@387
   694
                            default:
nkeynes@387
   695
                                UNDEF();
nkeynes@387
   696
                                break;
nkeynes@387
   697
                        }
nkeynes@387
   698
                        break;
nkeynes@387
   699
                    case 0x1:
nkeynes@387
   700
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
   701
                            case 0x0:
nkeynes@387
   702
                                { /* SHLR Rn */
nkeynes@387
   703
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   704
                                sh4_stats[I_SHLR]++;
nkeynes@387
   705
                                }
nkeynes@387
   706
                                break;
nkeynes@387
   707
                            case 0x1:
nkeynes@387
   708
                                { /* CMP/PZ Rn */
nkeynes@387
   709
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   710
                                sh4_stats[I_CMPPZ]++;
nkeynes@387
   711
                                }
nkeynes@387
   712
                                break;
nkeynes@387
   713
                            case 0x2:
nkeynes@387
   714
                                { /* SHAR Rn */
nkeynes@387
   715
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   716
                                sh4_stats[I_SHAR]++;
nkeynes@387
   717
                                }
nkeynes@387
   718
                                break;
nkeynes@387
   719
                            default:
nkeynes@387
   720
                                UNDEF();
nkeynes@387
   721
                                break;
nkeynes@387
   722
                        }
nkeynes@387
   723
                        break;
nkeynes@387
   724
                    case 0x2:
nkeynes@387
   725
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
   726
                            case 0x0:
nkeynes@387
   727
                                { /* STS.L MACH, @-Rn */
nkeynes@387
   728
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   729
                                sh4_stats[I_STSM]++;
nkeynes@387
   730
                                }
nkeynes@387
   731
                                break;
nkeynes@387
   732
                            case 0x1:
nkeynes@387
   733
                                { /* STS.L MACL, @-Rn */
nkeynes@387
   734
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   735
                                sh4_stats[I_STSM]++;
nkeynes@387
   736
                                }
nkeynes@387
   737
                                break;
nkeynes@387
   738
                            case 0x2:
nkeynes@387
   739
                                { /* STS.L PR, @-Rn */
nkeynes@387
   740
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   741
                                sh4_stats[I_STSM]++;
nkeynes@387
   742
                                }
nkeynes@387
   743
                                break;
nkeynes@387
   744
                            case 0x3:
nkeynes@387
   745
                                { /* STC.L SGR, @-Rn */
nkeynes@387
   746
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   747
                                sh4_stats[I_STCM]++;
nkeynes@387
   748
                                }
nkeynes@387
   749
                                break;
nkeynes@387
   750
                            case 0x5:
nkeynes@387
   751
                                { /* STS.L FPUL, @-Rn */
nkeynes@387
   752
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   753
                                sh4_stats[I_STSM]++;
nkeynes@387
   754
                                }
nkeynes@387
   755
                                break;
nkeynes@387
   756
                            case 0x6:
nkeynes@387
   757
                                { /* STS.L FPSCR, @-Rn */
nkeynes@387
   758
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   759
                                sh4_stats[I_STSM]++;
nkeynes@387
   760
                                }
nkeynes@387
   761
                                break;
nkeynes@387
   762
                            case 0xF:
nkeynes@387
   763
                                { /* STC.L DBR, @-Rn */
nkeynes@387
   764
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   765
                                sh4_stats[I_STCM]++;
nkeynes@387
   766
                                }
nkeynes@387
   767
                                break;
nkeynes@387
   768
                            default:
nkeynes@387
   769
                                UNDEF();
nkeynes@387
   770
                                break;
nkeynes@387
   771
                        }
nkeynes@387
   772
                        break;
nkeynes@387
   773
                    case 0x3:
nkeynes@387
   774
                        switch( (ir&0x80) >> 7 ) {
nkeynes@387
   775
                            case 0x0:
nkeynes@387
   776
                                switch( (ir&0x70) >> 4 ) {
nkeynes@387
   777
                                    case 0x0:
nkeynes@387
   778
                                        { /* STC.L SR, @-Rn */
nkeynes@387
   779
                                        uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   780
                                        sh4_stats[I_STCSRM]++;
nkeynes@387
   781
                                        }
nkeynes@387
   782
                                        break;
nkeynes@387
   783
                                    case 0x1:
nkeynes@387
   784
                                        { /* STC.L GBR, @-Rn */
nkeynes@387
   785
                                        uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   786
                                        sh4_stats[I_STCM]++;
nkeynes@387
   787
                                        }
nkeynes@387
   788
                                        break;
nkeynes@387
   789
                                    case 0x2:
nkeynes@387
   790
                                        { /* STC.L VBR, @-Rn */
nkeynes@387
   791
                                        uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   792
                                        sh4_stats[I_STCM]++;
nkeynes@387
   793
                                        }
nkeynes@387
   794
                                        break;
nkeynes@387
   795
                                    case 0x3:
nkeynes@387
   796
                                        { /* STC.L SSR, @-Rn */
nkeynes@387
   797
                                        uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   798
                                        sh4_stats[I_STCM]++;
nkeynes@387
   799
                                        }
nkeynes@387
   800
                                        break;
nkeynes@387
   801
                                    case 0x4:
nkeynes@387
   802
                                        { /* STC.L SPC, @-Rn */
nkeynes@387
   803
                                        uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   804
                                        sh4_stats[I_STCM]++;
nkeynes@387
   805
                                        }
nkeynes@387
   806
                                        break;
nkeynes@387
   807
                                    default:
nkeynes@387
   808
                                        UNDEF();
nkeynes@387
   809
                                        break;
nkeynes@387
   810
                                }
nkeynes@387
   811
                                break;
nkeynes@387
   812
                            case 0x1:
nkeynes@387
   813
                                { /* STC.L Rm_BANK, @-Rn */
nkeynes@387
   814
                                uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm_BANK = ((ir>>4)&0x7); 
nkeynes@387
   815
                                sh4_stats[I_STCM]++;
nkeynes@387
   816
                                }
nkeynes@387
   817
                                break;
nkeynes@387
   818
                        }
nkeynes@387
   819
                        break;
nkeynes@387
   820
                    case 0x4:
nkeynes@387
   821
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
   822
                            case 0x0:
nkeynes@387
   823
                                { /* ROTL Rn */
nkeynes@387
   824
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   825
                                sh4_stats[I_ROTL]++;
nkeynes@387
   826
                                }
nkeynes@387
   827
                                break;
nkeynes@387
   828
                            case 0x2:
nkeynes@387
   829
                                { /* ROTCL Rn */
nkeynes@387
   830
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   831
                                sh4_stats[I_ROTCL]++;
nkeynes@387
   832
                                }
nkeynes@387
   833
                                break;
nkeynes@387
   834
                            default:
nkeynes@387
   835
                                UNDEF();
nkeynes@387
   836
                                break;
nkeynes@387
   837
                        }
nkeynes@387
   838
                        break;
nkeynes@387
   839
                    case 0x5:
nkeynes@387
   840
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
   841
                            case 0x0:
nkeynes@387
   842
                                { /* ROTR Rn */
nkeynes@387
   843
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   844
                                sh4_stats[I_ROTR]++;
nkeynes@387
   845
                                }
nkeynes@387
   846
                                break;
nkeynes@387
   847
                            case 0x1:
nkeynes@387
   848
                                { /* CMP/PL Rn */
nkeynes@387
   849
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   850
                                sh4_stats[I_CMPPL]++;
nkeynes@387
   851
                                }
nkeynes@387
   852
                                break;
nkeynes@387
   853
                            case 0x2:
nkeynes@387
   854
                                { /* ROTCR Rn */
nkeynes@387
   855
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   856
                                sh4_stats[I_ROTCR]++;
nkeynes@387
   857
                                }
nkeynes@387
   858
                                break;
nkeynes@387
   859
                            default:
nkeynes@387
   860
                                UNDEF();
nkeynes@387
   861
                                break;
nkeynes@387
   862
                        }
nkeynes@387
   863
                        break;
nkeynes@387
   864
                    case 0x6:
nkeynes@387
   865
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
   866
                            case 0x0:
nkeynes@387
   867
                                { /* LDS.L @Rm+, MACH */
nkeynes@387
   868
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
   869
                                sh4_stats[I_LDSM]++;
nkeynes@387
   870
                                }
nkeynes@387
   871
                                break;
nkeynes@387
   872
                            case 0x1:
nkeynes@387
   873
                                { /* LDS.L @Rm+, MACL */
nkeynes@387
   874
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
   875
                                sh4_stats[I_LDSM]++;
nkeynes@387
   876
                                }
nkeynes@387
   877
                                break;
nkeynes@387
   878
                            case 0x2:
nkeynes@387
   879
                                { /* LDS.L @Rm+, PR */
nkeynes@387
   880
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
   881
                                sh4_stats[I_LDSM]++;
nkeynes@387
   882
                                }
nkeynes@387
   883
                                break;
nkeynes@387
   884
                            case 0x3:
nkeynes@387
   885
                                { /* LDC.L @Rm+, SGR */
nkeynes@387
   886
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
   887
                                sh4_stats[I_LDCM]++;
nkeynes@387
   888
                                }
nkeynes@387
   889
                                break;
nkeynes@387
   890
                            case 0x5:
nkeynes@387
   891
                                { /* LDS.L @Rm+, FPUL */
nkeynes@387
   892
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
   893
                                sh4_stats[I_LDSM]++;
nkeynes@387
   894
                                }
nkeynes@387
   895
                                break;
nkeynes@387
   896
                            case 0x6:
nkeynes@387
   897
                                { /* LDS.L @Rm+, FPSCR */
nkeynes@387
   898
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
   899
                                sh4_stats[I_LDSM]++;
nkeynes@387
   900
                                }
nkeynes@387
   901
                                break;
nkeynes@387
   902
                            case 0xF:
nkeynes@387
   903
                                { /* LDC.L @Rm+, DBR */
nkeynes@387
   904
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
   905
                                sh4_stats[I_LDCM]++;
nkeynes@387
   906
                                }
nkeynes@387
   907
                                break;
nkeynes@387
   908
                            default:
nkeynes@387
   909
                                UNDEF();
nkeynes@387
   910
                                break;
nkeynes@387
   911
                        }
nkeynes@387
   912
                        break;
nkeynes@387
   913
                    case 0x7:
nkeynes@387
   914
                        switch( (ir&0x80) >> 7 ) {
nkeynes@387
   915
                            case 0x0:
nkeynes@387
   916
                                switch( (ir&0x70) >> 4 ) {
nkeynes@387
   917
                                    case 0x0:
nkeynes@387
   918
                                        { /* LDC.L @Rm+, SR */
nkeynes@387
   919
                                        uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
   920
                                        sh4_stats[I_LDCSRM]++;
nkeynes@387
   921
                                        }
nkeynes@387
   922
                                        break;
nkeynes@387
   923
                                    case 0x1:
nkeynes@387
   924
                                        { /* LDC.L @Rm+, GBR */
nkeynes@387
   925
                                        uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
   926
                                        sh4_stats[I_LDCM]++;
nkeynes@387
   927
                                        }
nkeynes@387
   928
                                        break;
nkeynes@387
   929
                                    case 0x2:
nkeynes@387
   930
                                        { /* LDC.L @Rm+, VBR */
nkeynes@387
   931
                                        uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
   932
                                        sh4_stats[I_LDCM]++;
nkeynes@387
   933
                                        }
nkeynes@387
   934
                                        break;
nkeynes@387
   935
                                    case 0x3:
nkeynes@387
   936
                                        { /* LDC.L @Rm+, SSR */
nkeynes@387
   937
                                        uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
   938
                                        sh4_stats[I_LDCM]++;
nkeynes@387
   939
                                        }
nkeynes@387
   940
                                        break;
nkeynes@387
   941
                                    case 0x4:
nkeynes@387
   942
                                        { /* LDC.L @Rm+, SPC */
nkeynes@387
   943
                                        uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
   944
                                        sh4_stats[I_LDCM]++;
nkeynes@387
   945
                                        }
nkeynes@387
   946
                                        break;
nkeynes@387
   947
                                    default:
nkeynes@387
   948
                                        UNDEF();
nkeynes@387
   949
                                        break;
nkeynes@387
   950
                                }
nkeynes@387
   951
                                break;
nkeynes@387
   952
                            case 0x1:
nkeynes@387
   953
                                { /* LDC.L @Rm+, Rn_BANK */
nkeynes@387
   954
                                uint32_t Rm = ((ir>>8)&0xF); uint32_t Rn_BANK = ((ir>>4)&0x7); 
nkeynes@387
   955
                                sh4_stats[I_LDCM]++;
nkeynes@387
   956
                                }
nkeynes@387
   957
                                break;
nkeynes@387
   958
                        }
nkeynes@387
   959
                        break;
nkeynes@387
   960
                    case 0x8:
nkeynes@387
   961
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
   962
                            case 0x0:
nkeynes@387
   963
                                { /* SHLL2 Rn */
nkeynes@387
   964
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   965
                                sh4_stats[I_SHLL]++;
nkeynes@387
   966
                                }
nkeynes@387
   967
                                break;
nkeynes@387
   968
                            case 0x1:
nkeynes@387
   969
                                { /* SHLL8 Rn */
nkeynes@387
   970
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   971
                                sh4_stats[I_SHLL]++;
nkeynes@387
   972
                                }
nkeynes@387
   973
                                break;
nkeynes@387
   974
                            case 0x2:
nkeynes@387
   975
                                { /* SHLL16 Rn */
nkeynes@387
   976
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   977
                                sh4_stats[I_SHLL]++;
nkeynes@387
   978
                                }
nkeynes@387
   979
                                break;
nkeynes@387
   980
                            default:
nkeynes@387
   981
                                UNDEF();
nkeynes@387
   982
                                break;
nkeynes@387
   983
                        }
nkeynes@387
   984
                        break;
nkeynes@387
   985
                    case 0x9:
nkeynes@387
   986
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
   987
                            case 0x0:
nkeynes@387
   988
                                { /* SHLR2 Rn */
nkeynes@387
   989
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   990
                                sh4_stats[I_SHLR]++;
nkeynes@387
   991
                                }
nkeynes@387
   992
                                break;
nkeynes@387
   993
                            case 0x1:
nkeynes@387
   994
                                { /* SHLR8 Rn */
nkeynes@387
   995
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
   996
                                sh4_stats[I_SHLR]++;
nkeynes@387
   997
                                }
nkeynes@387
   998
                                break;
nkeynes@387
   999
                            case 0x2:
nkeynes@387
  1000
                                { /* SHLR16 Rn */
nkeynes@387
  1001
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
  1002
                                sh4_stats[I_SHLR]++;
nkeynes@387
  1003
                                }
nkeynes@387
  1004
                                break;
nkeynes@387
  1005
                            default:
nkeynes@387
  1006
                                UNDEF();
nkeynes@387
  1007
                                break;
nkeynes@387
  1008
                        }
nkeynes@387
  1009
                        break;
nkeynes@387
  1010
                    case 0xA:
nkeynes@387
  1011
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
  1012
                            case 0x0:
nkeynes@387
  1013
                                { /* LDS Rm, MACH */
nkeynes@387
  1014
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
  1015
                                sh4_stats[I_LDS]++;
nkeynes@387
  1016
                                }
nkeynes@387
  1017
                                break;
nkeynes@387
  1018
                            case 0x1:
nkeynes@387
  1019
                                { /* LDS Rm, MACL */
nkeynes@387
  1020
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
  1021
                                sh4_stats[I_LDS]++;
nkeynes@387
  1022
                                }
nkeynes@387
  1023
                                break;
nkeynes@387
  1024
                            case 0x2:
nkeynes@387
  1025
                                { /* LDS Rm, PR */
nkeynes@387
  1026
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
  1027
                                sh4_stats[I_LDS]++;
nkeynes@387
  1028
                                }
nkeynes@387
  1029
                                break;
nkeynes@387
  1030
                            case 0x3:
nkeynes@387
  1031
                                { /* LDC Rm, SGR */
nkeynes@387
  1032
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
  1033
                                sh4_stats[I_LDC]++;
nkeynes@387
  1034
                                }
nkeynes@387
  1035
                                break;
nkeynes@387
  1036
                            case 0x5:
nkeynes@387
  1037
                                { /* LDS Rm, FPUL */
nkeynes@387
  1038
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
  1039
                                sh4_stats[I_LDS]++;
nkeynes@387
  1040
                                }
nkeynes@387
  1041
                                break;
nkeynes@387
  1042
                            case 0x6:
nkeynes@387
  1043
                                { /* LDS Rm, FPSCR */
nkeynes@387
  1044
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
  1045
                                sh4_stats[I_LDS]++;
nkeynes@387
  1046
                                }
nkeynes@387
  1047
                                break;
nkeynes@387
  1048
                            case 0xF:
nkeynes@387
  1049
                                { /* LDC Rm, DBR */
nkeynes@387
  1050
                                uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
  1051
                                sh4_stats[I_LDC]++;
nkeynes@387
  1052
                                }
nkeynes@387
  1053
                                break;
nkeynes@387
  1054
                            default:
nkeynes@387
  1055
                                UNDEF();
nkeynes@387
  1056
                                break;
nkeynes@387
  1057
                        }
nkeynes@387
  1058
                        break;
nkeynes@387
  1059
                    case 0xB:
nkeynes@387
  1060
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
  1061
                            case 0x0:
nkeynes@387
  1062
                                { /* JSR @Rn */
nkeynes@387
  1063
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
  1064
                                sh4_stats[I_JSR]++;
nkeynes@387
  1065
                                }
nkeynes@387
  1066
                                break;
nkeynes@387
  1067
                            case 0x1:
nkeynes@387
  1068
                                { /* TAS.B @Rn */
nkeynes@387
  1069
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
  1070
                                sh4_stats[I_TASB]++;
nkeynes@387
  1071
                                }
nkeynes@387
  1072
                                break;
nkeynes@387
  1073
                            case 0x2:
nkeynes@387
  1074
                                { /* JMP @Rn */
nkeynes@387
  1075
                                uint32_t Rn = ((ir>>8)&0xF); 
nkeynes@387
  1076
                                sh4_stats[I_JMP]++;
nkeynes@387
  1077
                                }
nkeynes@387
  1078
                                break;
nkeynes@387
  1079
                            default:
nkeynes@387
  1080
                                UNDEF();
nkeynes@387
  1081
                                break;
nkeynes@387
  1082
                        }
nkeynes@387
  1083
                        break;
nkeynes@387
  1084
                    case 0xC:
nkeynes@387
  1085
                        { /* SHAD Rm, Rn */
nkeynes@387
  1086
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1087
                        sh4_stats[I_SHAD]++;
nkeynes@387
  1088
                        }
nkeynes@387
  1089
                        break;
nkeynes@387
  1090
                    case 0xD:
nkeynes@387
  1091
                        { /* SHLD Rm, Rn */
nkeynes@387
  1092
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1093
                        sh4_stats[I_SHLD]++;
nkeynes@387
  1094
                        }
nkeynes@387
  1095
                        break;
nkeynes@387
  1096
                    case 0xE:
nkeynes@387
  1097
                        switch( (ir&0x80) >> 7 ) {
nkeynes@387
  1098
                            case 0x0:
nkeynes@387
  1099
                                switch( (ir&0x70) >> 4 ) {
nkeynes@387
  1100
                                    case 0x0:
nkeynes@387
  1101
                                        { /* LDC Rm, SR */
nkeynes@387
  1102
                                        uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
  1103
                                        sh4_stats[I_LDCSR]++;
nkeynes@387
  1104
                                        }
nkeynes@387
  1105
                                        break;
nkeynes@387
  1106
                                    case 0x1:
nkeynes@387
  1107
                                        { /* LDC Rm, GBR */
nkeynes@387
  1108
                                        uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
  1109
                                        sh4_stats[I_LDC]++;
nkeynes@387
  1110
                                        }
nkeynes@387
  1111
                                        break;
nkeynes@387
  1112
                                    case 0x2:
nkeynes@387
  1113
                                        { /* LDC Rm, VBR */
nkeynes@387
  1114
                                        uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
  1115
                                        sh4_stats[I_LDC]++;
nkeynes@387
  1116
                                        }
nkeynes@387
  1117
                                        break;
nkeynes@387
  1118
                                    case 0x3:
nkeynes@387
  1119
                                        { /* LDC Rm, SSR */
nkeynes@387
  1120
                                        uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
  1121
                                        sh4_stats[I_LDC]++;
nkeynes@387
  1122
                                        }
nkeynes@387
  1123
                                        break;
nkeynes@387
  1124
                                    case 0x4:
nkeynes@387
  1125
                                        { /* LDC Rm, SPC */
nkeynes@387
  1126
                                        uint32_t Rm = ((ir>>8)&0xF); 
nkeynes@387
  1127
                                        sh4_stats[I_LDC]++;
nkeynes@387
  1128
                                        }
nkeynes@387
  1129
                                        break;
nkeynes@387
  1130
                                    default:
nkeynes@387
  1131
                                        UNDEF();
nkeynes@387
  1132
                                        break;
nkeynes@387
  1133
                                }
nkeynes@387
  1134
                                break;
nkeynes@387
  1135
                            case 0x1:
nkeynes@387
  1136
                                { /* LDC Rm, Rn_BANK */
nkeynes@387
  1137
                                uint32_t Rm = ((ir>>8)&0xF); uint32_t Rn_BANK = ((ir>>4)&0x7); 
nkeynes@387
  1138
                                sh4_stats[I_LDC]++;
nkeynes@387
  1139
                                }
nkeynes@387
  1140
                                break;
nkeynes@387
  1141
                        }
nkeynes@387
  1142
                        break;
nkeynes@387
  1143
                    case 0xF:
nkeynes@387
  1144
                        { /* MAC.W @Rm+, @Rn+ */
nkeynes@387
  1145
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1146
                        sh4_stats[I_MACW]++;
nkeynes@387
  1147
                        }
nkeynes@387
  1148
                        break;
nkeynes@387
  1149
                }
nkeynes@387
  1150
                break;
nkeynes@387
  1151
            case 0x5:
nkeynes@387
  1152
                { /* MOV.L @(disp, Rm), Rn */
nkeynes@387
  1153
                uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); uint32_t disp = (ir&0xF)<<2; 
nkeynes@387
  1154
                sh4_stats[I_MOVL]++;
nkeynes@387
  1155
                }
nkeynes@387
  1156
                break;
nkeynes@387
  1157
            case 0x6:
nkeynes@387
  1158
                switch( ir&0xF ) {
nkeynes@387
  1159
                    case 0x0:
nkeynes@387
  1160
                        { /* MOV.B @Rm, Rn */
nkeynes@387
  1161
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1162
                        sh4_stats[I_MOVB]++;
nkeynes@387
  1163
                        }
nkeynes@387
  1164
                        break;
nkeynes@387
  1165
                    case 0x1:
nkeynes@387
  1166
                        { /* MOV.W @Rm, Rn */
nkeynes@387
  1167
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1168
                        sh4_stats[I_MOVW]++;
nkeynes@387
  1169
                        }
nkeynes@387
  1170
                        break;
nkeynes@387
  1171
                    case 0x2:
nkeynes@387
  1172
                        { /* MOV.L @Rm, Rn */
nkeynes@387
  1173
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1174
                        sh4_stats[I_MOVL]++;
nkeynes@387
  1175
                        }
nkeynes@387
  1176
                        break;
nkeynes@387
  1177
                    case 0x3:
nkeynes@387
  1178
                        { /* MOV Rm, Rn */
nkeynes@387
  1179
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1180
                        sh4_stats[I_MOV]++;
nkeynes@387
  1181
                        }
nkeynes@387
  1182
                        break;
nkeynes@387
  1183
                    case 0x4:
nkeynes@387
  1184
                        { /* MOV.B @Rm+, Rn */
nkeynes@387
  1185
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1186
                        sh4_stats[I_MOVB]++;
nkeynes@387
  1187
                        }
nkeynes@387
  1188
                        break;
nkeynes@387
  1189
                    case 0x5:
nkeynes@387
  1190
                        { /* MOV.W @Rm+, Rn */
nkeynes@387
  1191
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1192
                        sh4_stats[I_MOVW]++;
nkeynes@387
  1193
                        }
nkeynes@387
  1194
                        break;
nkeynes@387
  1195
                    case 0x6:
nkeynes@387
  1196
                        { /* MOV.L @Rm+, Rn */
nkeynes@387
  1197
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1198
                        sh4_stats[I_MOVL]++;
nkeynes@387
  1199
                        }
nkeynes@387
  1200
                        break;
nkeynes@387
  1201
                    case 0x7:
nkeynes@387
  1202
                        { /* NOT Rm, Rn */
nkeynes@387
  1203
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1204
                        sh4_stats[I_NOT]++;
nkeynes@387
  1205
                        }
nkeynes@387
  1206
                        break;
nkeynes@387
  1207
                    case 0x8:
nkeynes@387
  1208
                        { /* SWAP.B Rm, Rn */
nkeynes@387
  1209
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1210
                        sh4_stats[I_SWAPB]++;
nkeynes@387
  1211
                        }
nkeynes@387
  1212
                        break;
nkeynes@387
  1213
                    case 0x9:
nkeynes@387
  1214
                        { /* SWAP.W Rm, Rn */
nkeynes@387
  1215
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1216
                        sh4_stats[I_SWAPW]++;
nkeynes@387
  1217
                        }
nkeynes@387
  1218
                        break;
nkeynes@387
  1219
                    case 0xA:
nkeynes@387
  1220
                        { /* NEGC Rm, Rn */
nkeynes@387
  1221
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1222
                        sh4_stats[I_NEGC]++;
nkeynes@387
  1223
                        }
nkeynes@387
  1224
                        break;
nkeynes@387
  1225
                    case 0xB:
nkeynes@387
  1226
                        { /* NEG Rm, Rn */
nkeynes@387
  1227
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1228
                        sh4_stats[I_NEG]++;
nkeynes@387
  1229
                        }
nkeynes@387
  1230
                        break;
nkeynes@387
  1231
                    case 0xC:
nkeynes@387
  1232
                        { /* EXTU.B Rm, Rn */
nkeynes@387
  1233
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1234
                        sh4_stats[I_EXTUB]++;
nkeynes@387
  1235
                        }
nkeynes@387
  1236
                        break;
nkeynes@387
  1237
                    case 0xD:
nkeynes@387
  1238
                        { /* EXTU.W Rm, Rn */
nkeynes@387
  1239
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1240
                        sh4_stats[I_EXTUW]++;
nkeynes@387
  1241
                        }
nkeynes@387
  1242
                        break;
nkeynes@387
  1243
                    case 0xE:
nkeynes@387
  1244
                        { /* EXTS.B Rm, Rn */
nkeynes@387
  1245
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1246
                        sh4_stats[I_EXTSB]++;
nkeynes@387
  1247
                        }
nkeynes@387
  1248
                        break;
nkeynes@387
  1249
                    case 0xF:
nkeynes@387
  1250
                        { /* EXTS.W Rm, Rn */
nkeynes@387
  1251
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1252
                        sh4_stats[I_EXTSW]++;
nkeynes@387
  1253
                        }
nkeynes@387
  1254
                        break;
nkeynes@387
  1255
                }
nkeynes@387
  1256
                break;
nkeynes@387
  1257
            case 0x7:
nkeynes@387
  1258
                { /* ADD #imm, Rn */
nkeynes@387
  1259
                uint32_t Rn = ((ir>>8)&0xF); int32_t imm = SIGNEXT8(ir&0xFF); 
nkeynes@387
  1260
                sh4_stats[I_ADDI]++;
nkeynes@387
  1261
                }
nkeynes@387
  1262
                break;
nkeynes@387
  1263
            case 0x8:
nkeynes@387
  1264
                switch( (ir&0xF00) >> 8 ) {
nkeynes@387
  1265
                    case 0x0:
nkeynes@387
  1266
                        { /* MOV.B R0, @(disp, Rn) */
nkeynes@387
  1267
                        uint32_t Rn = ((ir>>4)&0xF); uint32_t disp = (ir&0xF); 
nkeynes@387
  1268
                        sh4_stats[I_MOVB]++;
nkeynes@387
  1269
                        }
nkeynes@387
  1270
                        break;
nkeynes@387
  1271
                    case 0x1:
nkeynes@387
  1272
                        { /* MOV.W R0, @(disp, Rn) */
nkeynes@387
  1273
                        uint32_t Rn = ((ir>>4)&0xF); uint32_t disp = (ir&0xF)<<1; 
nkeynes@387
  1274
                        sh4_stats[I_MOVW]++;
nkeynes@387
  1275
                        }
nkeynes@387
  1276
                        break;
nkeynes@387
  1277
                    case 0x4:
nkeynes@387
  1278
                        { /* MOV.B @(disp, Rm), R0 */
nkeynes@387
  1279
                        uint32_t Rm = ((ir>>4)&0xF); uint32_t disp = (ir&0xF); 
nkeynes@387
  1280
                        sh4_stats[I_MOVB]++;
nkeynes@387
  1281
                        }
nkeynes@387
  1282
                        break;
nkeynes@387
  1283
                    case 0x5:
nkeynes@387
  1284
                        { /* MOV.W @(disp, Rm), R0 */
nkeynes@387
  1285
                        uint32_t Rm = ((ir>>4)&0xF); uint32_t disp = (ir&0xF)<<1; 
nkeynes@387
  1286
                        sh4_stats[I_MOVW]++;
nkeynes@387
  1287
                        }
nkeynes@387
  1288
                        break;
nkeynes@387
  1289
                    case 0x8:
nkeynes@387
  1290
                        { /* CMP/EQ #imm, R0 */
nkeynes@387
  1291
                        int32_t imm = SIGNEXT8(ir&0xFF); 
nkeynes@387
  1292
                        sh4_stats[I_CMPEQI]++;
nkeynes@387
  1293
                        }
nkeynes@387
  1294
                        break;
nkeynes@387
  1295
                    case 0x9:
nkeynes@387
  1296
                        { /* BT disp */
nkeynes@387
  1297
                        int32_t disp = SIGNEXT8(ir&0xFF)<<1; 
nkeynes@387
  1298
                        sh4_stats[I_BT]++;
nkeynes@387
  1299
                        }
nkeynes@387
  1300
                        break;
nkeynes@387
  1301
                    case 0xB:
nkeynes@387
  1302
                        { /* BF disp */
nkeynes@387
  1303
                        int32_t disp = SIGNEXT8(ir&0xFF)<<1; 
nkeynes@387
  1304
                        sh4_stats[I_BF]++;
nkeynes@387
  1305
                        }
nkeynes@387
  1306
                        break;
nkeynes@387
  1307
                    case 0xD:
nkeynes@387
  1308
                        { /* BT/S disp */
nkeynes@387
  1309
                        int32_t disp = SIGNEXT8(ir&0xFF)<<1; 
nkeynes@387
  1310
                        sh4_stats[I_BTS]++;
nkeynes@387
  1311
                        }
nkeynes@387
  1312
                        break;
nkeynes@387
  1313
                    case 0xF:
nkeynes@387
  1314
                        { /* BF/S disp */
nkeynes@387
  1315
                        int32_t disp = SIGNEXT8(ir&0xFF)<<1; 
nkeynes@387
  1316
                        sh4_stats[I_BFS]++;
nkeynes@387
  1317
                        }
nkeynes@387
  1318
                        break;
nkeynes@387
  1319
                    default:
nkeynes@387
  1320
                        UNDEF();
nkeynes@387
  1321
                        break;
nkeynes@387
  1322
                }
nkeynes@387
  1323
                break;
nkeynes@387
  1324
            case 0x9:
nkeynes@387
  1325
                { /* MOV.W @(disp, PC), Rn */
nkeynes@387
  1326
                uint32_t Rn = ((ir>>8)&0xF); uint32_t disp = (ir&0xFF)<<1; 
nkeynes@387
  1327
                sh4_stats[I_MOVW]++;
nkeynes@387
  1328
                }
nkeynes@387
  1329
                break;
nkeynes@387
  1330
            case 0xA:
nkeynes@387
  1331
                { /* BRA disp */
nkeynes@387
  1332
                int32_t disp = SIGNEXT12(ir&0xFFF)<<1; 
nkeynes@387
  1333
                sh4_stats[I_BRA]++;
nkeynes@387
  1334
                }
nkeynes@387
  1335
                break;
nkeynes@387
  1336
            case 0xB:
nkeynes@387
  1337
                { /* BSR disp */
nkeynes@387
  1338
                int32_t disp = SIGNEXT12(ir&0xFFF)<<1; 
nkeynes@387
  1339
                sh4_stats[I_BSR]++;
nkeynes@387
  1340
                }
nkeynes@387
  1341
                break;
nkeynes@387
  1342
            case 0xC:
nkeynes@387
  1343
                switch( (ir&0xF00) >> 8 ) {
nkeynes@387
  1344
                    case 0x0:
nkeynes@387
  1345
                        { /* MOV.B R0, @(disp, GBR) */
nkeynes@387
  1346
                        uint32_t disp = (ir&0xFF); 
nkeynes@387
  1347
                        sh4_stats[I_MOVB]++;
nkeynes@387
  1348
                        }
nkeynes@387
  1349
                        break;
nkeynes@387
  1350
                    case 0x1:
nkeynes@387
  1351
                        { /* MOV.W R0, @(disp, GBR) */
nkeynes@387
  1352
                        uint32_t disp = (ir&0xFF)<<1; 
nkeynes@387
  1353
                        sh4_stats[I_MOVW]++;
nkeynes@387
  1354
                        }
nkeynes@387
  1355
                        break;
nkeynes@387
  1356
                    case 0x2:
nkeynes@387
  1357
                        { /* MOV.L R0, @(disp, GBR) */
nkeynes@387
  1358
                        uint32_t disp = (ir&0xFF)<<2; 
nkeynes@387
  1359
                        sh4_stats[I_MOVL]++;
nkeynes@387
  1360
                        }
nkeynes@387
  1361
                        break;
nkeynes@387
  1362
                    case 0x3:
nkeynes@387
  1363
                        { /* TRAPA #imm */
nkeynes@387
  1364
                        uint32_t imm = (ir&0xFF); 
nkeynes@387
  1365
                        sh4_stats[I_TRAPA]++;
nkeynes@387
  1366
                        }
nkeynes@387
  1367
                        break;
nkeynes@387
  1368
                    case 0x4:
nkeynes@387
  1369
                        { /* MOV.B @(disp, GBR), R0 */
nkeynes@387
  1370
                        uint32_t disp = (ir&0xFF); 
nkeynes@387
  1371
                        sh4_stats[I_MOVB]++;
nkeynes@387
  1372
                        }
nkeynes@387
  1373
                        break;
nkeynes@387
  1374
                    case 0x5:
nkeynes@387
  1375
                        { /* MOV.W @(disp, GBR), R0 */
nkeynes@387
  1376
                        uint32_t disp = (ir&0xFF)<<1; 
nkeynes@387
  1377
                        sh4_stats[I_MOVW]++;
nkeynes@387
  1378
                        }
nkeynes@387
  1379
                        break;
nkeynes@387
  1380
                    case 0x6:
nkeynes@387
  1381
                        { /* MOV.L @(disp, GBR), R0 */
nkeynes@387
  1382
                        uint32_t disp = (ir&0xFF)<<2; 
nkeynes@387
  1383
                        sh4_stats[I_MOVL]++;
nkeynes@387
  1384
                        }
nkeynes@387
  1385
                        break;
nkeynes@387
  1386
                    case 0x7:
nkeynes@387
  1387
                        { /* MOVA @(disp, PC), R0 */
nkeynes@387
  1388
                        uint32_t disp = (ir&0xFF)<<2; 
nkeynes@387
  1389
                        sh4_stats[I_MOVA]++;
nkeynes@387
  1390
                        }
nkeynes@387
  1391
                        break;
nkeynes@387
  1392
                    case 0x8:
nkeynes@387
  1393
                        { /* TST #imm, R0 */
nkeynes@387
  1394
                        uint32_t imm = (ir&0xFF); 
nkeynes@387
  1395
                        sh4_stats[I_TSTI]++;
nkeynes@387
  1396
                        }
nkeynes@387
  1397
                        break;
nkeynes@387
  1398
                    case 0x9:
nkeynes@387
  1399
                        { /* AND #imm, R0 */
nkeynes@387
  1400
                        uint32_t imm = (ir&0xFF); 
nkeynes@387
  1401
                        sh4_stats[I_ANDI]++;
nkeynes@387
  1402
                        }
nkeynes@387
  1403
                        break;
nkeynes@387
  1404
                    case 0xA:
nkeynes@387
  1405
                        { /* XOR #imm, R0 */
nkeynes@387
  1406
                        uint32_t imm = (ir&0xFF); 
nkeynes@387
  1407
                        sh4_stats[I_XORI]++;
nkeynes@387
  1408
                        }
nkeynes@387
  1409
                        break;
nkeynes@387
  1410
                    case 0xB:
nkeynes@387
  1411
                        { /* OR #imm, R0 */
nkeynes@387
  1412
                        uint32_t imm = (ir&0xFF); 
nkeynes@387
  1413
                        sh4_stats[I_ORI]++;
nkeynes@387
  1414
                        }
nkeynes@387
  1415
                        break;
nkeynes@387
  1416
                    case 0xC:
nkeynes@387
  1417
                        { /* TST.B #imm, @(R0, GBR) */
nkeynes@387
  1418
                        uint32_t imm = (ir&0xFF); 
nkeynes@387
  1419
                        sh4_stats[I_TSTB]++;
nkeynes@387
  1420
                        }
nkeynes@387
  1421
                        break;
nkeynes@387
  1422
                    case 0xD:
nkeynes@387
  1423
                        { /* AND.B #imm, @(R0, GBR) */
nkeynes@387
  1424
                        uint32_t imm = (ir&0xFF); 
nkeynes@387
  1425
                        sh4_stats[I_ANDB]++;
nkeynes@387
  1426
                        }
nkeynes@387
  1427
                        break;
nkeynes@387
  1428
                    case 0xE:
nkeynes@387
  1429
                        { /* XOR.B #imm, @(R0, GBR) */
nkeynes@387
  1430
                        uint32_t imm = (ir&0xFF); 
nkeynes@387
  1431
                        sh4_stats[I_XORB]++;
nkeynes@387
  1432
                        }
nkeynes@387
  1433
                        break;
nkeynes@387
  1434
                    case 0xF:
nkeynes@387
  1435
                        { /* OR.B #imm, @(R0, GBR) */
nkeynes@387
  1436
                        uint32_t imm = (ir&0xFF); 
nkeynes@387
  1437
                        sh4_stats[I_ORB]++;
nkeynes@387
  1438
                        }
nkeynes@387
  1439
                        break;
nkeynes@387
  1440
                }
nkeynes@387
  1441
                break;
nkeynes@387
  1442
            case 0xD:
nkeynes@387
  1443
                { /* MOV.L @(disp, PC), Rn */
nkeynes@387
  1444
                uint32_t Rn = ((ir>>8)&0xF); uint32_t disp = (ir&0xFF)<<2; 
nkeynes@387
  1445
                sh4_stats[I_MOVLPC]++;
nkeynes@387
  1446
                }
nkeynes@387
  1447
                break;
nkeynes@387
  1448
            case 0xE:
nkeynes@387
  1449
                { /* MOV #imm, Rn */
nkeynes@387
  1450
                uint32_t Rn = ((ir>>8)&0xF); int32_t imm = SIGNEXT8(ir&0xFF); 
nkeynes@387
  1451
                sh4_stats[I_MOVI]++;
nkeynes@387
  1452
                }
nkeynes@387
  1453
                break;
nkeynes@387
  1454
            case 0xF:
nkeynes@387
  1455
                switch( ir&0xF ) {
nkeynes@387
  1456
                    case 0x0:
nkeynes@387
  1457
                        { /* FADD FRm, FRn */
nkeynes@387
  1458
                        uint32_t FRn = ((ir>>8)&0xF); uint32_t FRm = ((ir>>4)&0xF); 
nkeynes@387
  1459
                        sh4_stats[I_FADD]++;
nkeynes@387
  1460
                        }
nkeynes@387
  1461
                        break;
nkeynes@387
  1462
                    case 0x1:
nkeynes@387
  1463
                        { /* FSUB FRm, FRn */
nkeynes@387
  1464
                        uint32_t FRn = ((ir>>8)&0xF); uint32_t FRm = ((ir>>4)&0xF); 
nkeynes@387
  1465
                        sh4_stats[I_FSUB]++;
nkeynes@387
  1466
                        }
nkeynes@387
  1467
                        break;
nkeynes@387
  1468
                    case 0x2:
nkeynes@387
  1469
                        { /* FMUL FRm, FRn */
nkeynes@387
  1470
                        uint32_t FRn = ((ir>>8)&0xF); uint32_t FRm = ((ir>>4)&0xF); 
nkeynes@387
  1471
                        sh4_stats[I_FMUL]++;
nkeynes@387
  1472
                        }
nkeynes@387
  1473
                        break;
nkeynes@387
  1474
                    case 0x3:
nkeynes@387
  1475
                        { /* FDIV FRm, FRn */
nkeynes@387
  1476
                        uint32_t FRn = ((ir>>8)&0xF); uint32_t FRm = ((ir>>4)&0xF); 
nkeynes@387
  1477
                        sh4_stats[I_FDIV]++;
nkeynes@387
  1478
                        }
nkeynes@387
  1479
                        break;
nkeynes@387
  1480
                    case 0x4:
nkeynes@387
  1481
                        { /* FCMP/EQ FRm, FRn */
nkeynes@387
  1482
                        uint32_t FRn = ((ir>>8)&0xF); uint32_t FRm = ((ir>>4)&0xF); 
nkeynes@387
  1483
                        sh4_stats[I_FCMPEQ]++;
nkeynes@387
  1484
                        }
nkeynes@387
  1485
                        break;
nkeynes@387
  1486
                    case 0x5:
nkeynes@387
  1487
                        { /* FCMP/GT FRm, FRn */
nkeynes@387
  1488
                        uint32_t FRn = ((ir>>8)&0xF); uint32_t FRm = ((ir>>4)&0xF); 
nkeynes@387
  1489
                        sh4_stats[I_FCMPGT]++;
nkeynes@387
  1490
                        }
nkeynes@387
  1491
                        break;
nkeynes@387
  1492
                    case 0x6:
nkeynes@387
  1493
                        { /* FMOV @(R0, Rm), FRn */
nkeynes@387
  1494
                        uint32_t FRn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1495
                        sh4_stats[I_FMOV7]++;
nkeynes@387
  1496
                        }
nkeynes@387
  1497
                        break;
nkeynes@387
  1498
                    case 0x7:
nkeynes@387
  1499
                        { /* FMOV FRm, @(R0, Rn) */
nkeynes@387
  1500
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t FRm = ((ir>>4)&0xF); 
nkeynes@387
  1501
                        sh4_stats[I_FMOV4]++;
nkeynes@387
  1502
                        }
nkeynes@387
  1503
                        break;
nkeynes@387
  1504
                    case 0x8:
nkeynes@387
  1505
                        { /* FMOV @Rm, FRn */
nkeynes@387
  1506
                        uint32_t FRn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1507
                        sh4_stats[I_FMOV5]++;
nkeynes@387
  1508
                        }
nkeynes@387
  1509
                        break;
nkeynes@387
  1510
                    case 0x9:
nkeynes@387
  1511
                        { /* FMOV @Rm+, FRn */
nkeynes@387
  1512
                        uint32_t FRn = ((ir>>8)&0xF); uint32_t Rm = ((ir>>4)&0xF); 
nkeynes@387
  1513
                        sh4_stats[I_FMOV6]++;
nkeynes@387
  1514
                        }
nkeynes@387
  1515
                        break;
nkeynes@387
  1516
                    case 0xA:
nkeynes@387
  1517
                        { /* FMOV FRm, @Rn */
nkeynes@387
  1518
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t FRm = ((ir>>4)&0xF); 
nkeynes@387
  1519
                        sh4_stats[I_FMOV2]++;
nkeynes@387
  1520
                        }
nkeynes@387
  1521
                        break;
nkeynes@387
  1522
                    case 0xB:
nkeynes@387
  1523
                        { /* FMOV FRm, @-Rn */
nkeynes@387
  1524
                        uint32_t Rn = ((ir>>8)&0xF); uint32_t FRm = ((ir>>4)&0xF); 
nkeynes@387
  1525
                        sh4_stats[I_FMOV3]++;
nkeynes@387
  1526
                        }
nkeynes@387
  1527
                        break;
nkeynes@387
  1528
                    case 0xC:
nkeynes@387
  1529
                        { /* FMOV FRm, FRn */
nkeynes@387
  1530
                        uint32_t FRn = ((ir>>8)&0xF); uint32_t FRm = ((ir>>4)&0xF); 
nkeynes@387
  1531
                        sh4_stats[I_FMOV1]++;
nkeynes@387
  1532
                        }
nkeynes@387
  1533
                        break;
nkeynes@387
  1534
                    case 0xD:
nkeynes@387
  1535
                        switch( (ir&0xF0) >> 4 ) {
nkeynes@387
  1536
                            case 0x0:
nkeynes@387
  1537
                                { /* FSTS FPUL, FRn */
nkeynes@387
  1538
                                uint32_t FRn = ((ir>>8)&0xF); 
nkeynes@387
  1539
                                sh4_stats[I_FSTS]++;
nkeynes@387
  1540
                                }
nkeynes@387
  1541
                                break;
nkeynes@387
  1542
                            case 0x1:
nkeynes@387
  1543
                                { /* FLDS FRm, FPUL */
nkeynes@387
  1544
                                uint32_t FRm = ((ir>>8)&0xF); 
nkeynes@387
  1545
                                sh4_stats[I_FLDS]++;
nkeynes@387
  1546
                                }
nkeynes@387
  1547
                                break;
nkeynes@387
  1548
                            case 0x2:
nkeynes@387
  1549
                                { /* FLOAT FPUL, FRn */
nkeynes@387
  1550
                                uint32_t FRn = ((ir>>8)&0xF); 
nkeynes@387
  1551
                                sh4_stats[I_FLOAT]++;
nkeynes@387
  1552
                                }
nkeynes@387
  1553
                                break;
nkeynes@387
  1554
                            case 0x3:
nkeynes@387
  1555
                                { /* FTRC FRm, FPUL */
nkeynes@387
  1556
                                uint32_t FRm = ((ir>>8)&0xF); 
nkeynes@387
  1557
                                sh4_stats[I_FTRC]++;
nkeynes@387
  1558
                                }
nkeynes@387
  1559
                                break;
nkeynes@387
  1560
                            case 0x4:
nkeynes@387
  1561
                                { /* FNEG FRn */
nkeynes@387
  1562
                                uint32_t FRn = ((ir>>8)&0xF); 
nkeynes@387
  1563
                                sh4_stats[I_FNEG]++;
nkeynes@387
  1564
                                }
nkeynes@387
  1565
                                break;
nkeynes@387
  1566
                            case 0x5:
nkeynes@387
  1567
                                { /* FABS FRn */
nkeynes@387
  1568
                                uint32_t FRn = ((ir>>8)&0xF); 
nkeynes@387
  1569
                                sh4_stats[I_FABS]++;
nkeynes@387
  1570
                                }
nkeynes@387
  1571
                                break;
nkeynes@387
  1572
                            case 0x6:
nkeynes@387
  1573
                                { /* FSQRT FRn */
nkeynes@387
  1574
                                uint32_t FRn = ((ir>>8)&0xF); 
nkeynes@387
  1575
                                sh4_stats[I_FSQRT]++;
nkeynes@387
  1576
                                }
nkeynes@387
  1577
                                break;
nkeynes@387
  1578
                            case 0x7:
nkeynes@387
  1579
                                { /* FSRRA FRn */
nkeynes@387
  1580
                                uint32_t FRn = ((ir>>8)&0xF); 
nkeynes@387
  1581
                                sh4_stats[I_FSRRA]++;
nkeynes@387
  1582
                                }
nkeynes@387
  1583
                                break;
nkeynes@387
  1584
                            case 0x8:
nkeynes@387
  1585
                                { /* FLDI0 FRn */
nkeynes@387
  1586
                                uint32_t FRn = ((ir>>8)&0xF); 
nkeynes@387
  1587
                                sh4_stats[I_FLDI0]++;
nkeynes@387
  1588
                                }
nkeynes@387
  1589
                                break;
nkeynes@387
  1590
                            case 0x9:
nkeynes@387
  1591
                                { /* FLDI1 FRn */
nkeynes@387
  1592
                                uint32_t FRn = ((ir>>8)&0xF); 
nkeynes@387
  1593
                                sh4_stats[I_FLDI1]++;
nkeynes@387
  1594
                                }
nkeynes@387
  1595
                                break;
nkeynes@387
  1596
                            case 0xA:
nkeynes@387
  1597
                                { /* FCNVSD FPUL, FRn */
nkeynes@387
  1598
                                uint32_t FRn = ((ir>>8)&0xF); 
nkeynes@387
  1599
                                sh4_stats[I_FCNVSD]++;
nkeynes@387
  1600
                                }
nkeynes@387
  1601
                                break;
nkeynes@387
  1602
                            case 0xB:
nkeynes@387
  1603
                                { /* FCNVDS FRm, FPUL */
nkeynes@387
  1604
                                uint32_t FRm = ((ir>>8)&0xF); 
nkeynes@387
  1605
                                sh4_stats[I_FCNVDS]++;
nkeynes@387
  1606
                                }
nkeynes@387
  1607
                                break;
nkeynes@387
  1608
                            case 0xE:
nkeynes@387
  1609
                                { /* FIPR FVm, FVn */
nkeynes@387
  1610
                                uint32_t FVn = ((ir>>10)&0x3); uint32_t FVm = ((ir>>8)&0x3); 
nkeynes@387
  1611
                                sh4_stats[I_FIPR]++;
nkeynes@387
  1612
                                }
nkeynes@387
  1613
                                break;
nkeynes@387
  1614
                            case 0xF:
nkeynes@387
  1615
                                switch( (ir&0x100) >> 8 ) {
nkeynes@387
  1616
                                    case 0x0:
nkeynes@387
  1617
                                        { /* FSCA FPUL, FRn */
nkeynes@387
  1618
                                        uint32_t FRn = ((ir>>9)&0x7)<<1; 
nkeynes@387
  1619
                                        sh4_stats[I_FSCA]++;
nkeynes@387
  1620
                                        }
nkeynes@387
  1621
                                        break;
nkeynes@387
  1622
                                    case 0x1:
nkeynes@387
  1623
                                        switch( (ir&0x200) >> 9 ) {
nkeynes@387
  1624
                                            case 0x0:
nkeynes@387
  1625
                                                { /* FTRV XMTRX, FVn */
nkeynes@387
  1626
                                                uint32_t FVn = ((ir>>10)&0x3); 
nkeynes@387
  1627
                                                sh4_stats[I_FTRV]++;
nkeynes@387
  1628
                                                }
nkeynes@387
  1629
                                                break;
nkeynes@387
  1630
                                            case 0x1:
nkeynes@387
  1631
                                                switch( (ir&0xC00) >> 10 ) {
nkeynes@387
  1632
                                                    case 0x0:
nkeynes@387
  1633
                                                        { /* FSCHG */
nkeynes@387
  1634
                                                        sh4_stats[I_FSCHG]++;
nkeynes@387
  1635
                                                        }
nkeynes@387
  1636
                                                        break;
nkeynes@387
  1637
                                                    case 0x2:
nkeynes@387
  1638
                                                        { /* FRCHG */
nkeynes@387
  1639
                                                        sh4_stats[I_FRCHG]++;
nkeynes@387
  1640
                                                        }
nkeynes@387
  1641
                                                        break;
nkeynes@387
  1642
                                                    case 0x3:
nkeynes@387
  1643
                                                        { /* UNDEF */
nkeynes@387
  1644
                                                        sh4_stats[I_UNDEF]++;
nkeynes@387
  1645
                                                        }
nkeynes@387
  1646
                                                        break;
nkeynes@387
  1647
                                                    default:
nkeynes@387
  1648
                                                        UNDEF();
nkeynes@387
  1649
                                                        break;
nkeynes@387
  1650
                                                }
nkeynes@387
  1651
                                                break;
nkeynes@387
  1652
                                        }
nkeynes@387
  1653
                                        break;
nkeynes@387
  1654
                                }
nkeynes@387
  1655
                                break;
nkeynes@387
  1656
                            default:
nkeynes@387
  1657
                                UNDEF();
nkeynes@387
  1658
                                break;
nkeynes@387
  1659
                        }
nkeynes@387
  1660
                        break;
nkeynes@387
  1661
                    case 0xE:
nkeynes@387
  1662
                        { /* FMAC FR0, FRm, FRn */
nkeynes@387
  1663
                        uint32_t FRn = ((ir>>8)&0xF); uint32_t FRm = ((ir>>4)&0xF); 
nkeynes@387
  1664
                        sh4_stats[I_FMAC]++;
nkeynes@387
  1665
                        }
nkeynes@387
  1666
                        break;
nkeynes@387
  1667
                    default:
nkeynes@387
  1668
                        UNDEF();
nkeynes@387
  1669
                        break;
nkeynes@387
  1670
                }
nkeynes@387
  1671
                break;
nkeynes@387
  1672
        }
nkeynes@387
  1673
nkeynes@387
  1674
nkeynes@387
  1675
sh4_stats_total++;
nkeynes@387
  1676
}
.