Search
lxdream.org :: lxdream/src/sh4/sh4stat.in
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4stat.in
changeset 945:787729653236
prev905:4c17ebd9ef5e
next1074:397d77b6e346
author nkeynes
date Mon Jan 05 04:19:46 2009 +0000 (12 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change Move address space decls to mmu.h
Finally remove sh4_read_long and friends
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@730
    20
#include "sh4/sh4stat.h"
nkeynes@730
    21
#include "sh4/sh4core.h"
nkeynes@945
    22
#include "sh4/mmu.h"
nkeynes@387
    23
nkeynes@387
    24
static uint64_t sh4_stats[SH4_INSTRUCTION_COUNT+1];
nkeynes@387
    25
static uint64_t sh4_stats_total;
nkeynes@387
    26
static const char *sh4_stats_names[] = {
nkeynes@387
    27
    "???",
nkeynes@387
    28
"ADD Rm, Rn",
nkeynes@387
    29
"ADD #imm, Rn",
nkeynes@387
    30
"ADDC Rm, Rn",
nkeynes@387
    31
"ADDV Rm, Rn",
nkeynes@387
    32
"AND Rm, Rn",
nkeynes@387
    33
"AND #imm, R0",
nkeynes@387
    34
"AND.B #imm, @(R0, GBR)",
nkeynes@387
    35
"BF disp",
nkeynes@387
    36
"BF/S disp",
nkeynes@387
    37
"BRA disp",
nkeynes@387
    38
"BRAF Rn",
nkeynes@387
    39
"BSR disp",
nkeynes@387
    40
"BSRF Rn",
nkeynes@387
    41
"BT disp",
nkeynes@387
    42
"BT/S disp",
nkeynes@387
    43
"CLRMAC",
nkeynes@387
    44
"CLRS",
nkeynes@387
    45
"CLRT",
nkeynes@387
    46
"CMP/EQ Rm, Rn",
nkeynes@387
    47
"CMP/EQ #imm, R0",
nkeynes@387
    48
"CMP/GE Rm, Rn",
nkeynes@387
    49
"CMP/GT Rm, Rn",
nkeynes@387
    50
"CMP/HI Rm, Rn",
nkeynes@387
    51
"CMP/HS Rm, Rn",
nkeynes@387
    52
"CMP/PL Rn",
nkeynes@387
    53
"CMP/PZ Rn",
nkeynes@387
    54
"CMP/STR Rm, Rn",
nkeynes@387
    55
"DIV0S Rm, Rn",
nkeynes@387
    56
"DIV0U",
nkeynes@387
    57
"DIV1 Rm, Rn",
nkeynes@387
    58
"DMULS.L Rm, Rn",
nkeynes@387
    59
"DMULU.L Rm, Rn",
nkeynes@387
    60
"DT Rn",
nkeynes@387
    61
"EXTS.B Rm, Rn",
nkeynes@387
    62
"EXTS.W Rm, Rn",
nkeynes@387
    63
"EXTU.B Rm, Rn",
nkeynes@387
    64
"EXTU.W Rm, Rn",
nkeynes@387
    65
"FABS FRn",
nkeynes@387
    66
"FADD FRm, FRn",
nkeynes@387
    67
"FCMP/EQ FRm, FRn",
nkeynes@387
    68
"FCMP/GT FRm, FRn",
nkeynes@387
    69
"FCNVDS FRm, FPUL",
nkeynes@387
    70
"FCNVSD FPUL, FRn",
nkeynes@387
    71
"FDIV FRm, FRn",
nkeynes@387
    72
"FIPR FVm, FVn",
nkeynes@387
    73
"FLDS FRm, FPUL",
nkeynes@387
    74
"FLDI0 FRn",
nkeynes@387
    75
"FLDI1 FRn",
nkeynes@387
    76
"FLOAT FPUL, FRn",
nkeynes@387
    77
"FMAC FR0, FRm, FRn",
nkeynes@387
    78
"FMOV FRm, FRn",
nkeynes@387
    79
"FMOV FRm, @Rn",
nkeynes@387
    80
"FMOV FRm, @-Rn",
nkeynes@387
    81
"FMOV FRm, @(R0, Rn)",
nkeynes@387
    82
"FMOV @Rm, FRn",
nkeynes@387
    83
"FMOV @Rm+, FRn",
nkeynes@387
    84
"FMOV @(R0, Rm), FRn",
nkeynes@387
    85
"FMUL FRm, FRn",
nkeynes@387
    86
"FNEG FRn",
nkeynes@387
    87
"FRCHG",
nkeynes@387
    88
"FSCA FPUL, FRn",
nkeynes@387
    89
"FSCHG",
nkeynes@387
    90
"FSQRT FRn",
nkeynes@387
    91
"FSRRA FRn",
nkeynes@387
    92
"FSTS FPUL, FRn",
nkeynes@387
    93
"FSUB FRm, FRn",
nkeynes@387
    94
"FTRC FRm, FPUL",
nkeynes@387
    95
"FTRV XMTRX, FVn",
nkeynes@387
    96
"JMP @Rn",
nkeynes@387
    97
"JSR @Rn",
nkeynes@387
    98
"LDC Rm, SR",
nkeynes@387
    99
"LDC Rm, *",
nkeynes@387
   100
"LDC.L @Rm+, SR",
nkeynes@387
   101
"LDC.L @Rm+, *",
nkeynes@673
   102
"LDS Rm, FPSCR",
nkeynes@387
   103
"LDS Rm, *",
nkeynes@673
   104
"LDS.L @Rm+, FPSCR",
nkeynes@387
   105
"LDS.L @Rm+, *",
nkeynes@387
   106
"LDTLB",
nkeynes@387
   107
"MAC.L @Rm+, @Rn+",
nkeynes@387
   108
"MAC.W @Rm+, @Rn+",
nkeynes@387
   109
"MOV Rm, Rn",
nkeynes@387
   110
"MOV #imm, Rn",
nkeynes@387
   111
"MOV.B ...",
nkeynes@387
   112
"MOV.L ...",
nkeynes@387
   113
"MOV.L @(disp, PC)",
nkeynes@387
   114
"MOV.W ...",
nkeynes@387
   115
"MOVA @(disp, PC), R0",
nkeynes@387
   116
"MOVCA.L R0, @Rn",
nkeynes@387
   117
"MOVT Rn",
nkeynes@387
   118
"MUL.L Rm, Rn",
nkeynes@387
   119
"MULS.W Rm, Rn",
nkeynes@387
   120
"MULU.W Rm, Rn",
nkeynes@387
   121
"NEG Rm, Rn",
nkeynes@387
   122
"NEGC Rm, Rn",
nkeynes@387
   123
"NOP",
nkeynes@387
   124
"NOT Rm, Rn",
nkeynes@387
   125
"OCBI @Rn",
nkeynes@387
   126
"OCBP @Rn",
nkeynes@387
   127
"OCBWB @Rn",
nkeynes@387
   128
"OR Rm, Rn",
nkeynes@387
   129
"OR #imm, R0",
nkeynes@387
   130
"OR.B #imm, @(R0, GBR)",
nkeynes@387
   131
"PREF @Rn",
nkeynes@387
   132
"ROTCL Rn",
nkeynes@387
   133
"ROTCR Rn",
nkeynes@387
   134
"ROTL Rn",
nkeynes@387
   135
"ROTR Rn",
nkeynes@387
   136
"RTE",
nkeynes@387
   137
"RTS",
nkeynes@387
   138
"SETS",
nkeynes@387
   139
"SETT",
nkeynes@387
   140
"SHAD Rm, Rn",
nkeynes@387
   141
"SHAL Rn",
nkeynes@387
   142
"SHAR Rn",
nkeynes@387
   143
"SHLD Rm, Rn",
nkeynes@387
   144
"SHLL* Rn",
nkeynes@387
   145
"SHLR* Rn",
nkeynes@387
   146
"SLEEP",
nkeynes@387
   147
"STC SR, Rn",
nkeynes@387
   148
"STC *, Rn",
nkeynes@387
   149
"STC.L SR, @-Rn",
nkeynes@387
   150
"STC.L *, @-Rn",
nkeynes@673
   151
"STS FPSCR, Rn",
nkeynes@387
   152
"STS *, Rn",
nkeynes@673
   153
"STS.L FPSCR, @-Rn",
nkeynes@387
   154
"STS.L *, @-Rn",
nkeynes@387
   155
"SUB Rm, Rn",
nkeynes@387
   156
"SUBC Rm, Rn",
nkeynes@387
   157
"SUBV Rm, Rn",
nkeynes@387
   158
"SWAP.B Rm, Rn",
nkeynes@387
   159
"SWAP.W Rm, Rn",
nkeynes@387
   160
"TAS.B @Rn",
nkeynes@387
   161
"TRAPA #imm",
nkeynes@387
   162
"TST Rm, Rn",
nkeynes@387
   163
"TST #imm, R0",
nkeynes@387
   164
"TST.B #imm, @(R0, GBR)",
nkeynes@387
   165
"XOR Rm, Rn",
nkeynes@387
   166
"XOR #imm, R0",
nkeynes@387
   167
"XOR.B #imm, @(R0, GBR)",
nkeynes@387
   168
"XTRCT Rm, Rn",
nkeynes@387
   169
"UNDEF"
nkeynes@387
   170
};
nkeynes@387
   171
nkeynes@387
   172
void sh4_stats_reset( void )
nkeynes@387
   173
{
nkeynes@387
   174
    int i;
nkeynes@387
   175
    for( i=0; i<= I_UNDEF; i++ ) {
nkeynes@387
   176
	sh4_stats[i] = 0;
nkeynes@387
   177
    }
nkeynes@387
   178
    sh4_stats_total = 0;
nkeynes@387
   179
}
nkeynes@387
   180
nkeynes@387
   181
void sh4_stats_print( FILE *out )
nkeynes@387
   182
{
nkeynes@387
   183
    int i;
nkeynes@387
   184
    for( i=0; i<= I_UNDEF; i++ ) {
nkeynes@500
   185
	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
   186
    }
nkeynes@500
   187
    fprintf( out, "Total: %lld\n", sh4_stats_total );
nkeynes@387
   188
}
nkeynes@387
   189
nkeynes@905
   190
void FASTCALL sh4_stats_add( sh4_inst_id item )
nkeynes@671
   191
{
nkeynes@671
   192
    sh4_stats[item]++;
nkeynes@671
   193
    sh4_stats_total++;
nkeynes@671
   194
}
nkeynes@671
   195
nkeynes@671
   196
void sh4_stats_add_by_pc( uint32_t pc ) 
nkeynes@387
   197
{
nkeynes@945
   198
    sh4addr_t addr = mmu_vma_to_phys_disasm(pc);
nkeynes@945
   199
    uint16_t ir = ext_address_space[addr>>12]->read_word(addr);
nkeynes@824
   200
#define UNDEF(ir) sh4_stats[0]++
nkeynes@387
   201
%%
nkeynes@387
   202
ADD Rm, Rn {: sh4_stats[I_ADD]++; :}
nkeynes@387
   203
ADD #imm, Rn {: sh4_stats[I_ADDI]++; :}
nkeynes@387
   204
ADDC Rm, Rn {: sh4_stats[I_ADDC]++; :}
nkeynes@387
   205
ADDV Rm, Rn {: sh4_stats[I_ADDV]++; :}
nkeynes@387
   206
AND Rm, Rn {: sh4_stats[I_AND]++; :}
nkeynes@387
   207
AND #imm, R0 {: sh4_stats[I_ANDI]++; :}
nkeynes@387
   208
AND.B #imm, @(R0, GBR) {: sh4_stats[I_ANDB]++; :}
nkeynes@387
   209
BF disp {: sh4_stats[I_BF]++; :}
nkeynes@387
   210
BF/S disp {: sh4_stats[I_BFS]++; :}
nkeynes@387
   211
BRA disp {: sh4_stats[I_BRA]++; :}
nkeynes@387
   212
BRAF Rn {: sh4_stats[I_BRAF]++; :}
nkeynes@387
   213
BSR disp {: sh4_stats[I_BSR]++; :}
nkeynes@387
   214
BSRF Rn {: sh4_stats[I_BSRF]++; :}
nkeynes@387
   215
BT disp {: sh4_stats[I_BT]++; :}
nkeynes@387
   216
BT/S disp {: sh4_stats[I_BTS]++; :}
nkeynes@387
   217
CLRMAC {: sh4_stats[I_CLRMAC]++; :}
nkeynes@387
   218
CLRS {: sh4_stats[I_CLRS]++; :}
nkeynes@387
   219
CLRT {: sh4_stats[I_CLRT]++; :}
nkeynes@387
   220
CMP/EQ Rm, Rn {: sh4_stats[I_CMPEQ]++; :}
nkeynes@387
   221
CMP/EQ #imm, R0 {: sh4_stats[I_CMPEQI]++; :}
nkeynes@387
   222
CMP/GE Rm, Rn {: sh4_stats[I_CMPGE]++; :}
nkeynes@387
   223
CMP/GT Rm, Rn {: sh4_stats[I_CMPGT]++; :}
nkeynes@387
   224
CMP/HI Rm, Rn {: sh4_stats[I_CMPHI]++; :}
nkeynes@387
   225
CMP/HS Rm, Rn {: sh4_stats[I_CMPHS]++; :}
nkeynes@387
   226
CMP/PL Rn {: sh4_stats[I_CMPPL]++; :}
nkeynes@387
   227
CMP/PZ Rn {: sh4_stats[I_CMPPZ]++; :}
nkeynes@387
   228
CMP/STR Rm, Rn {: sh4_stats[I_CMPSTR]++; :}
nkeynes@387
   229
DIV0S Rm, Rn {: sh4_stats[I_DIV0S]++; :}
nkeynes@387
   230
DIV0U {: sh4_stats[I_DIV0U]++; :}
nkeynes@387
   231
DIV1 Rm, Rn {: sh4_stats[I_DIV1]++; :}
nkeynes@387
   232
DMULS.L Rm, Rn {: sh4_stats[I_DMULS]++; :}
nkeynes@387
   233
DMULU.L Rm, Rn {: sh4_stats[I_DMULU]++; :}
nkeynes@387
   234
DT Rn {: sh4_stats[I_DT]++; :}
nkeynes@387
   235
EXTS.B Rm, Rn {: sh4_stats[I_EXTSB]++; :}
nkeynes@387
   236
EXTS.W Rm, Rn {: sh4_stats[I_EXTSW]++; :}
nkeynes@387
   237
EXTU.B Rm, Rn {: sh4_stats[I_EXTUB]++; :}
nkeynes@387
   238
EXTU.W Rm, Rn {: sh4_stats[I_EXTUW]++; :}
nkeynes@387
   239
FABS FRn {: sh4_stats[I_FABS]++; :}
nkeynes@387
   240
FADD FRm, FRn {: sh4_stats[I_FADD]++; :}
nkeynes@387
   241
FCMP/EQ FRm, FRn {: sh4_stats[I_FCMPEQ]++; :}
nkeynes@387
   242
FCMP/GT FRm, FRn {: sh4_stats[I_FCMPGT]++; :}
nkeynes@387
   243
FCNVDS FRm, FPUL {: sh4_stats[I_FCNVDS]++; :}
nkeynes@387
   244
FCNVSD FPUL, FRn {: sh4_stats[I_FCNVSD]++; :}
nkeynes@387
   245
FDIV FRm, FRn {: sh4_stats[I_FDIV]++; :}
nkeynes@387
   246
FIPR FVm, FVn {: sh4_stats[I_FIPR]++; :}
nkeynes@387
   247
FLDS FRm, FPUL {: sh4_stats[I_FLDS]++; :}
nkeynes@387
   248
FLDI0 FRn {: sh4_stats[I_FLDI0]++; :}
nkeynes@387
   249
FLDI1 FRn {: sh4_stats[I_FLDI1]++; :}
nkeynes@387
   250
FLOAT FPUL, FRn {: sh4_stats[I_FLOAT]++; :}
nkeynes@387
   251
FMAC FR0, FRm, FRn {: sh4_stats[I_FMAC]++; :}
nkeynes@387
   252
FMOV FRm, FRn {: sh4_stats[I_FMOV1]++; :}
nkeynes@387
   253
FMOV FRm, @Rn {: sh4_stats[I_FMOV2]++; :}
nkeynes@387
   254
FMOV FRm, @-Rn {: sh4_stats[I_FMOV3]++; :}
nkeynes@387
   255
FMOV FRm, @(R0, Rn) {: sh4_stats[I_FMOV4]++; :}
nkeynes@387
   256
FMOV @Rm, FRn {: sh4_stats[I_FMOV5]++; :}
nkeynes@387
   257
FMOV @Rm+, FRn {: sh4_stats[I_FMOV6]++; :}
nkeynes@387
   258
FMOV @(R0, Rm), FRn {: sh4_stats[I_FMOV7]++; :}
nkeynes@387
   259
FMUL FRm, FRn {: sh4_stats[I_FMUL]++; :}
nkeynes@387
   260
FNEG FRn {: sh4_stats[I_FNEG]++; :}
nkeynes@387
   261
FRCHG {: sh4_stats[I_FRCHG]++; :}
nkeynes@387
   262
FSCA FPUL, FRn {: sh4_stats[I_FSCA]++; :}
nkeynes@387
   263
FSCHG {: sh4_stats[I_FSCHG]++; :}
nkeynes@387
   264
FSQRT FRn {: sh4_stats[I_FSQRT]++; :}
nkeynes@387
   265
FSRRA FRn {: sh4_stats[I_FSRRA]++; :}
nkeynes@387
   266
FSTS FPUL, FRn {: sh4_stats[I_FSTS]++; :}
nkeynes@387
   267
FSUB FRm, FRn {: sh4_stats[I_FSUB]++; :}
nkeynes@387
   268
FTRC FRm, FPUL {: sh4_stats[I_FTRC]++; :}
nkeynes@387
   269
FTRV XMTRX, FVn {: sh4_stats[I_FTRV]++; :}
nkeynes@387
   270
JMP @Rn {: sh4_stats[I_JMP]++; :}
nkeynes@387
   271
JSR @Rn {: sh4_stats[I_JSR]++; :}
nkeynes@387
   272
LDC Rm, GBR {: sh4_stats[I_LDC]++; :}
nkeynes@387
   273
LDC Rm, SR {: sh4_stats[I_LDCSR]++; :}
nkeynes@387
   274
LDC Rm, VBR {: sh4_stats[I_LDC]++; :}
nkeynes@387
   275
LDC Rm, SSR {: sh4_stats[I_LDC]++; :}
nkeynes@387
   276
LDC Rm, SGR {: sh4_stats[I_LDC]++; :}
nkeynes@387
   277
LDC Rm, SPC {: sh4_stats[I_LDC]++; :}
nkeynes@387
   278
LDC Rm, DBR {: sh4_stats[I_LDC]++; :}
nkeynes@387
   279
LDC Rm, Rn_BANK {: sh4_stats[I_LDC]++; :}
nkeynes@387
   280
LDC.L @Rm+, GBR {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   281
LDC.L @Rm+, SR {: sh4_stats[I_LDCSRM]++; :}
nkeynes@387
   282
LDC.L @Rm+, VBR {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   283
LDC.L @Rm+, SSR {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   284
LDC.L @Rm+, SGR {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   285
LDC.L @Rm+, SPC {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   286
LDC.L @Rm+, DBR {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   287
LDC.L @Rm+, Rn_BANK {: sh4_stats[I_LDCM]++; :}
nkeynes@673
   288
LDS Rm, FPSCR {: sh4_stats[I_LDSFPSCR]++; :}
nkeynes@673
   289
LDS.L @Rm+, FPSCR {: sh4_stats[I_LDSFPSCRM]++; :}
nkeynes@387
   290
LDS Rm, FPUL {: sh4_stats[I_LDS]++; :}
nkeynes@387
   291
LDS.L @Rm+, FPUL {: sh4_stats[I_LDSM]++; :}
nkeynes@387
   292
LDS Rm, MACH {: sh4_stats[I_LDS]++; :}
nkeynes@387
   293
LDS.L @Rm+, MACH {: sh4_stats[I_LDSM]++; :}
nkeynes@387
   294
LDS Rm, MACL {: sh4_stats[I_LDS]++; :}
nkeynes@387
   295
LDS.L @Rm+, MACL {: sh4_stats[I_LDSM]++; :}
nkeynes@387
   296
LDS Rm, PR {: sh4_stats[I_LDS]++; :}
nkeynes@387
   297
LDS.L @Rm+, PR {: sh4_stats[I_LDSM]++; :}
nkeynes@387
   298
LDTLB {: sh4_stats[I_LDTLB]++; :}
nkeynes@387
   299
MAC.L @Rm+, @Rn+ {: sh4_stats[I_MACL]++; :}
nkeynes@387
   300
MAC.W @Rm+, @Rn+ {: sh4_stats[I_MACW]++; :}
nkeynes@387
   301
MOV Rm, Rn {: sh4_stats[I_MOV]++; :}
nkeynes@387
   302
MOV #imm, Rn {: sh4_stats[I_MOVI]++; :}
nkeynes@387
   303
MOV.B Rm, @Rn {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   304
MOV.B Rm, @-Rn {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   305
MOV.B Rm, @(R0, Rn) {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   306
MOV.B R0, @(disp, GBR) {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   307
MOV.B R0, @(disp, Rn) {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   308
MOV.B @Rm, Rn {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   309
MOV.B @Rm+, Rn {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   310
MOV.B @(R0, Rm), Rn {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   311
MOV.B @(disp, GBR), R0 {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   312
MOV.B @(disp, Rm), R0 {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   313
MOV.L Rm, @Rn {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   314
MOV.L Rm, @-Rn {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   315
MOV.L Rm, @(R0, Rn) {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   316
MOV.L R0, @(disp, GBR) {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   317
MOV.L Rm, @(disp, Rn) {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   318
MOV.L @Rm, Rn {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   319
MOV.L @Rm+, Rn {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   320
MOV.L @(R0, Rm), Rn {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   321
MOV.L @(disp, GBR), R0 {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   322
MOV.L @(disp, PC), Rn {: sh4_stats[I_MOVLPC]++; :}
nkeynes@387
   323
MOV.L @(disp, Rm), Rn {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   324
MOV.W Rm, @Rn {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   325
MOV.W Rm, @-Rn {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   326
MOV.W Rm, @(R0, Rn) {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   327
MOV.W R0, @(disp, GBR) {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   328
MOV.W R0, @(disp, Rn) {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   329
MOV.W @Rm, Rn {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   330
MOV.W @Rm+, Rn {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   331
MOV.W @(R0, Rm), Rn {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   332
MOV.W @(disp, GBR), R0 {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   333
MOV.W @(disp, PC), Rn {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   334
MOV.W @(disp, Rm), R0 {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   335
MOVA @(disp, PC), R0 {: sh4_stats[I_MOVA]++; :}
nkeynes@387
   336
MOVCA.L R0, @Rn {: sh4_stats[I_MOVCA]++; :}
nkeynes@387
   337
MOVT Rn {: sh4_stats[I_MOVT]++; :}
nkeynes@387
   338
MUL.L Rm, Rn {: sh4_stats[I_MULL]++; :}
nkeynes@387
   339
MULS.W Rm, Rn {: sh4_stats[I_MULSW]++; :}
nkeynes@387
   340
MULU.W Rm, Rn {: sh4_stats[I_MULUW]++; :}
nkeynes@387
   341
NEG Rm, Rn {: sh4_stats[I_NEG]++; :}
nkeynes@387
   342
NEGC Rm, Rn {: sh4_stats[I_NEGC]++; :}
nkeynes@387
   343
NOP {: sh4_stats[I_NOP]++; :}
nkeynes@387
   344
NOT Rm, Rn {: sh4_stats[I_NOT]++; :}
nkeynes@387
   345
OCBI @Rn {: sh4_stats[I_OCBI]++; :}
nkeynes@387
   346
OCBP @Rn {: sh4_stats[I_OCBP]++; :}
nkeynes@387
   347
OCBWB @Rn {: sh4_stats[I_OCBWB]++; :}
nkeynes@387
   348
OR Rm, Rn {: sh4_stats[I_OR]++; :}
nkeynes@387
   349
OR #imm, R0 {: sh4_stats[I_ORI]++; :}
nkeynes@387
   350
OR.B #imm, @(R0, GBR) {: sh4_stats[I_ORB]++; :}
nkeynes@387
   351
PREF @Rn {: sh4_stats[I_PREF]++; :}
nkeynes@387
   352
ROTCL Rn {: sh4_stats[I_ROTCL]++; :}
nkeynes@387
   353
ROTCR Rn {: sh4_stats[I_ROTCR]++; :}
nkeynes@387
   354
ROTL Rn {: sh4_stats[I_ROTL]++; :}
nkeynes@387
   355
ROTR Rn {: sh4_stats[I_ROTR]++; :}
nkeynes@387
   356
RTE {: sh4_stats[I_RTE]++; :}
nkeynes@387
   357
RTS {: sh4_stats[I_RTS]++; :}
nkeynes@387
   358
SETS {: sh4_stats[I_SETS]++; :}
nkeynes@387
   359
SETT {: sh4_stats[I_SETT]++; :}
nkeynes@387
   360
SHAD Rm, Rn {: sh4_stats[I_SHAD]++; :}
nkeynes@387
   361
SHAL Rn {: sh4_stats[I_SHAL]++; :}
nkeynes@387
   362
SHAR Rn {: sh4_stats[I_SHAR]++; :}
nkeynes@387
   363
SHLD Rm, Rn {: sh4_stats[I_SHLD]++; :}
nkeynes@387
   364
SHLL Rn {: sh4_stats[I_SHLL]++; :}
nkeynes@387
   365
SHLL2 Rn {: sh4_stats[I_SHLL]++; :}
nkeynes@387
   366
SHLL8 Rn {: sh4_stats[I_SHLL]++; :}
nkeynes@387
   367
SHLL16 Rn {: sh4_stats[I_SHLL]++; :}
nkeynes@387
   368
SHLR Rn {: sh4_stats[I_SHLR]++; :}
nkeynes@387
   369
SHLR2 Rn {: sh4_stats[I_SHLR]++; :}
nkeynes@387
   370
SHLR8 Rn {: sh4_stats[I_SHLR]++; :}
nkeynes@387
   371
SHLR16 Rn {: sh4_stats[I_SHLR]++; :}
nkeynes@387
   372
SLEEP {: sh4_stats[I_SLEEP]++; :}
nkeynes@387
   373
STC SR, Rn {: sh4_stats[I_STCSR]++; :}
nkeynes@387
   374
STC GBR, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   375
STC VBR, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   376
STC SSR, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   377
STC SPC, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   378
STC SGR, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   379
STC DBR, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   380
STC Rm_BANK, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   381
STC.L SR, @-Rn {: sh4_stats[I_STCSRM]++; :}
nkeynes@387
   382
STC.L VBR, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   383
STC.L SSR, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   384
STC.L SPC, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   385
STC.L SGR, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   386
STC.L DBR, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   387
STC.L Rm_BANK, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   388
STC.L GBR, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@673
   389
STS FPSCR, Rn {: sh4_stats[I_STSFPSCR]++; :}
nkeynes@673
   390
STS.L FPSCR, @-Rn {: sh4_stats[I_STSFPSCRM]++; :}
nkeynes@387
   391
STS FPUL, Rn {: sh4_stats[I_STS]++; :}
nkeynes@387
   392
STS.L FPUL, @-Rn {: sh4_stats[I_STSM]++; :}
nkeynes@387
   393
STS MACH, Rn {: sh4_stats[I_STS]++; :}
nkeynes@387
   394
STS.L MACH, @-Rn {: sh4_stats[I_STSM]++; :}
nkeynes@387
   395
STS MACL, Rn {: sh4_stats[I_STS]++; :}
nkeynes@387
   396
STS.L MACL, @-Rn {: sh4_stats[I_STSM]++; :}
nkeynes@387
   397
STS PR, Rn {: sh4_stats[I_STS]++; :}
nkeynes@387
   398
STS.L PR, @-Rn {: sh4_stats[I_STSM]++; :}
nkeynes@387
   399
SUB Rm, Rn {: sh4_stats[I_SUB]++; :}
nkeynes@387
   400
SUBC Rm, Rn {: sh4_stats[I_SUBC]++; :}
nkeynes@387
   401
SUBV Rm, Rn {: sh4_stats[I_SUBV]++; :}
nkeynes@387
   402
SWAP.B Rm, Rn {: sh4_stats[I_SWAPB]++; :}
nkeynes@387
   403
SWAP.W Rm, Rn {: sh4_stats[I_SWAPW]++; :}
nkeynes@387
   404
TAS.B @Rn {: sh4_stats[I_TASB]++; :}
nkeynes@387
   405
TRAPA #imm {: sh4_stats[I_TRAPA]++; :}
nkeynes@387
   406
TST Rm, Rn {: sh4_stats[I_TST]++; :}
nkeynes@387
   407
TST #imm, R0 {: sh4_stats[I_TSTI]++; :}
nkeynes@387
   408
TST.B #imm, @(R0, GBR) {: sh4_stats[I_TSTB]++; :}
nkeynes@387
   409
XOR Rm, Rn {: sh4_stats[I_XOR]++; :}
nkeynes@387
   410
XOR #imm, R0 {: sh4_stats[I_XORI]++; :}
nkeynes@387
   411
XOR.B #imm, @(R0, GBR) {: sh4_stats[I_XORB]++; :}
nkeynes@387
   412
XTRCT Rm, Rn {: sh4_stats[I_XTRCT]++; :}
nkeynes@387
   413
UNDEF {: sh4_stats[I_UNDEF]++; :}
nkeynes@387
   414
%%
nkeynes@387
   415
nkeynes@387
   416
sh4_stats_total++;
nkeynes@387
   417
}
.