Search
lxdream.org :: lxdream/src/sh4/sh4stat.in
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4stat.in
changeset 671:a530ea88eebd
prev561:533f6b478071
next673:44c579439d73
author nkeynes
date Thu May 15 10:22:39 2008 +0000 (13 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
%%
nkeynes@387
   196
ADD Rm, Rn {: sh4_stats[I_ADD]++; :}
nkeynes@387
   197
ADD #imm, Rn {: sh4_stats[I_ADDI]++; :}
nkeynes@387
   198
ADDC Rm, Rn {: sh4_stats[I_ADDC]++; :}
nkeynes@387
   199
ADDV Rm, Rn {: sh4_stats[I_ADDV]++; :}
nkeynes@387
   200
AND Rm, Rn {: sh4_stats[I_AND]++; :}
nkeynes@387
   201
AND #imm, R0 {: sh4_stats[I_ANDI]++; :}
nkeynes@387
   202
AND.B #imm, @(R0, GBR) {: sh4_stats[I_ANDB]++; :}
nkeynes@387
   203
BF disp {: sh4_stats[I_BF]++; :}
nkeynes@387
   204
BF/S disp {: sh4_stats[I_BFS]++; :}
nkeynes@387
   205
BRA disp {: sh4_stats[I_BRA]++; :}
nkeynes@387
   206
BRAF Rn {: sh4_stats[I_BRAF]++; :}
nkeynes@387
   207
BSR disp {: sh4_stats[I_BSR]++; :}
nkeynes@387
   208
BSRF Rn {: sh4_stats[I_BSRF]++; :}
nkeynes@387
   209
BT disp {: sh4_stats[I_BT]++; :}
nkeynes@387
   210
BT/S disp {: sh4_stats[I_BTS]++; :}
nkeynes@387
   211
CLRMAC {: sh4_stats[I_CLRMAC]++; :}
nkeynes@387
   212
CLRS {: sh4_stats[I_CLRS]++; :}
nkeynes@387
   213
CLRT {: sh4_stats[I_CLRT]++; :}
nkeynes@387
   214
CMP/EQ Rm, Rn {: sh4_stats[I_CMPEQ]++; :}
nkeynes@387
   215
CMP/EQ #imm, R0 {: sh4_stats[I_CMPEQI]++; :}
nkeynes@387
   216
CMP/GE Rm, Rn {: sh4_stats[I_CMPGE]++; :}
nkeynes@387
   217
CMP/GT Rm, Rn {: sh4_stats[I_CMPGT]++; :}
nkeynes@387
   218
CMP/HI Rm, Rn {: sh4_stats[I_CMPHI]++; :}
nkeynes@387
   219
CMP/HS Rm, Rn {: sh4_stats[I_CMPHS]++; :}
nkeynes@387
   220
CMP/PL Rn {: sh4_stats[I_CMPPL]++; :}
nkeynes@387
   221
CMP/PZ Rn {: sh4_stats[I_CMPPZ]++; :}
nkeynes@387
   222
CMP/STR Rm, Rn {: sh4_stats[I_CMPSTR]++; :}
nkeynes@387
   223
DIV0S Rm, Rn {: sh4_stats[I_DIV0S]++; :}
nkeynes@387
   224
DIV0U {: sh4_stats[I_DIV0U]++; :}
nkeynes@387
   225
DIV1 Rm, Rn {: sh4_stats[I_DIV1]++; :}
nkeynes@387
   226
DMULS.L Rm, Rn {: sh4_stats[I_DMULS]++; :}
nkeynes@387
   227
DMULU.L Rm, Rn {: sh4_stats[I_DMULU]++; :}
nkeynes@387
   228
DT Rn {: sh4_stats[I_DT]++; :}
nkeynes@387
   229
EXTS.B Rm, Rn {: sh4_stats[I_EXTSB]++; :}
nkeynes@387
   230
EXTS.W Rm, Rn {: sh4_stats[I_EXTSW]++; :}
nkeynes@387
   231
EXTU.B Rm, Rn {: sh4_stats[I_EXTUB]++; :}
nkeynes@387
   232
EXTU.W Rm, Rn {: sh4_stats[I_EXTUW]++; :}
nkeynes@387
   233
FABS FRn {: sh4_stats[I_FABS]++; :}
nkeynes@387
   234
FADD FRm, FRn {: sh4_stats[I_FADD]++; :}
nkeynes@387
   235
FCMP/EQ FRm, FRn {: sh4_stats[I_FCMPEQ]++; :}
nkeynes@387
   236
FCMP/GT FRm, FRn {: sh4_stats[I_FCMPGT]++; :}
nkeynes@387
   237
FCNVDS FRm, FPUL {: sh4_stats[I_FCNVDS]++; :}
nkeynes@387
   238
FCNVSD FPUL, FRn {: sh4_stats[I_FCNVSD]++; :}
nkeynes@387
   239
FDIV FRm, FRn {: sh4_stats[I_FDIV]++; :}
nkeynes@387
   240
FIPR FVm, FVn {: sh4_stats[I_FIPR]++; :}
nkeynes@387
   241
FLDS FRm, FPUL {: sh4_stats[I_FLDS]++; :}
nkeynes@387
   242
FLDI0 FRn {: sh4_stats[I_FLDI0]++; :}
nkeynes@387
   243
FLDI1 FRn {: sh4_stats[I_FLDI1]++; :}
nkeynes@387
   244
FLOAT FPUL, FRn {: sh4_stats[I_FLOAT]++; :}
nkeynes@387
   245
FMAC FR0, FRm, FRn {: sh4_stats[I_FMAC]++; :}
nkeynes@387
   246
FMOV FRm, FRn {: sh4_stats[I_FMOV1]++; :}
nkeynes@387
   247
FMOV FRm, @Rn {: sh4_stats[I_FMOV2]++; :}
nkeynes@387
   248
FMOV FRm, @-Rn {: sh4_stats[I_FMOV3]++; :}
nkeynes@387
   249
FMOV FRm, @(R0, Rn) {: sh4_stats[I_FMOV4]++; :}
nkeynes@387
   250
FMOV @Rm, FRn {: sh4_stats[I_FMOV5]++; :}
nkeynes@387
   251
FMOV @Rm+, FRn {: sh4_stats[I_FMOV6]++; :}
nkeynes@387
   252
FMOV @(R0, Rm), FRn {: sh4_stats[I_FMOV7]++; :}
nkeynes@387
   253
FMUL FRm, FRn {: sh4_stats[I_FMUL]++; :}
nkeynes@387
   254
FNEG FRn {: sh4_stats[I_FNEG]++; :}
nkeynes@387
   255
FRCHG {: sh4_stats[I_FRCHG]++; :}
nkeynes@387
   256
FSCA FPUL, FRn {: sh4_stats[I_FSCA]++; :}
nkeynes@387
   257
FSCHG {: sh4_stats[I_FSCHG]++; :}
nkeynes@387
   258
FSQRT FRn {: sh4_stats[I_FSQRT]++; :}
nkeynes@387
   259
FSRRA FRn {: sh4_stats[I_FSRRA]++; :}
nkeynes@387
   260
FSTS FPUL, FRn {: sh4_stats[I_FSTS]++; :}
nkeynes@387
   261
FSUB FRm, FRn {: sh4_stats[I_FSUB]++; :}
nkeynes@387
   262
FTRC FRm, FPUL {: sh4_stats[I_FTRC]++; :}
nkeynes@387
   263
FTRV XMTRX, FVn {: sh4_stats[I_FTRV]++; :}
nkeynes@387
   264
JMP @Rn {: sh4_stats[I_JMP]++; :}
nkeynes@387
   265
JSR @Rn {: sh4_stats[I_JSR]++; :}
nkeynes@387
   266
LDC Rm, GBR {: sh4_stats[I_LDC]++; :}
nkeynes@387
   267
LDC Rm, SR {: sh4_stats[I_LDCSR]++; :}
nkeynes@387
   268
LDC Rm, VBR {: sh4_stats[I_LDC]++; :}
nkeynes@387
   269
LDC Rm, SSR {: sh4_stats[I_LDC]++; :}
nkeynes@387
   270
LDC Rm, SGR {: sh4_stats[I_LDC]++; :}
nkeynes@387
   271
LDC Rm, SPC {: sh4_stats[I_LDC]++; :}
nkeynes@387
   272
LDC Rm, DBR {: sh4_stats[I_LDC]++; :}
nkeynes@387
   273
LDC Rm, Rn_BANK {: sh4_stats[I_LDC]++; :}
nkeynes@387
   274
LDC.L @Rm+, GBR {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   275
LDC.L @Rm+, SR {: sh4_stats[I_LDCSRM]++; :}
nkeynes@387
   276
LDC.L @Rm+, VBR {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   277
LDC.L @Rm+, SSR {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   278
LDC.L @Rm+, SGR {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   279
LDC.L @Rm+, SPC {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   280
LDC.L @Rm+, DBR {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   281
LDC.L @Rm+, Rn_BANK {: sh4_stats[I_LDCM]++; :}
nkeynes@387
   282
LDS Rm, FPSCR {: sh4_stats[I_LDS]++; :}
nkeynes@387
   283
LDS.L @Rm+, FPSCR {: sh4_stats[I_LDSM]++; :}
nkeynes@387
   284
LDS Rm, FPUL {: sh4_stats[I_LDS]++; :}
nkeynes@387
   285
LDS.L @Rm+, FPUL {: sh4_stats[I_LDSM]++; :}
nkeynes@387
   286
LDS Rm, MACH {: sh4_stats[I_LDS]++; :}
nkeynes@387
   287
LDS.L @Rm+, MACH {: sh4_stats[I_LDSM]++; :}
nkeynes@387
   288
LDS Rm, MACL {: sh4_stats[I_LDS]++; :}
nkeynes@387
   289
LDS.L @Rm+, MACL {: sh4_stats[I_LDSM]++; :}
nkeynes@387
   290
LDS Rm, PR {: sh4_stats[I_LDS]++; :}
nkeynes@387
   291
LDS.L @Rm+, PR {: sh4_stats[I_LDSM]++; :}
nkeynes@387
   292
LDTLB {: sh4_stats[I_LDTLB]++; :}
nkeynes@387
   293
MAC.L @Rm+, @Rn+ {: sh4_stats[I_MACL]++; :}
nkeynes@387
   294
MAC.W @Rm+, @Rn+ {: sh4_stats[I_MACW]++; :}
nkeynes@387
   295
MOV Rm, Rn {: sh4_stats[I_MOV]++; :}
nkeynes@387
   296
MOV #imm, Rn {: sh4_stats[I_MOVI]++; :}
nkeynes@387
   297
MOV.B Rm, @Rn {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   298
MOV.B Rm, @-Rn {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   299
MOV.B Rm, @(R0, Rn) {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   300
MOV.B R0, @(disp, GBR) {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   301
MOV.B R0, @(disp, Rn) {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   302
MOV.B @Rm, Rn {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   303
MOV.B @Rm+, Rn {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   304
MOV.B @(R0, Rm), Rn {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   305
MOV.B @(disp, GBR), R0 {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   306
MOV.B @(disp, Rm), R0 {: sh4_stats[I_MOVB]++; :}
nkeynes@387
   307
MOV.L Rm, @Rn {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   308
MOV.L Rm, @-Rn {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   309
MOV.L Rm, @(R0, Rn) {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   310
MOV.L R0, @(disp, GBR) {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   311
MOV.L Rm, @(disp, Rn) {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   312
MOV.L @Rm, Rn {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   313
MOV.L @Rm+, Rn {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   314
MOV.L @(R0, Rm), Rn {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   315
MOV.L @(disp, GBR), R0 {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   316
MOV.L @(disp, PC), Rn {: sh4_stats[I_MOVLPC]++; :}
nkeynes@387
   317
MOV.L @(disp, Rm), Rn {: sh4_stats[I_MOVL]++; :}
nkeynes@387
   318
MOV.W Rm, @Rn {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   319
MOV.W Rm, @-Rn {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   320
MOV.W Rm, @(R0, Rn) {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   321
MOV.W R0, @(disp, GBR) {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   322
MOV.W R0, @(disp, Rn) {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   323
MOV.W @Rm, Rn {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   324
MOV.W @Rm+, Rn {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   325
MOV.W @(R0, Rm), Rn {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   326
MOV.W @(disp, GBR), R0 {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   327
MOV.W @(disp, PC), Rn {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   328
MOV.W @(disp, Rm), R0 {: sh4_stats[I_MOVW]++; :}
nkeynes@387
   329
MOVA @(disp, PC), R0 {: sh4_stats[I_MOVA]++; :}
nkeynes@387
   330
MOVCA.L R0, @Rn {: sh4_stats[I_MOVCA]++; :}
nkeynes@387
   331
MOVT Rn {: sh4_stats[I_MOVT]++; :}
nkeynes@387
   332
MUL.L Rm, Rn {: sh4_stats[I_MULL]++; :}
nkeynes@387
   333
MULS.W Rm, Rn {: sh4_stats[I_MULSW]++; :}
nkeynes@387
   334
MULU.W Rm, Rn {: sh4_stats[I_MULUW]++; :}
nkeynes@387
   335
NEG Rm, Rn {: sh4_stats[I_NEG]++; :}
nkeynes@387
   336
NEGC Rm, Rn {: sh4_stats[I_NEGC]++; :}
nkeynes@387
   337
NOP {: sh4_stats[I_NOP]++; :}
nkeynes@387
   338
NOT Rm, Rn {: sh4_stats[I_NOT]++; :}
nkeynes@387
   339
OCBI @Rn {: sh4_stats[I_OCBI]++; :}
nkeynes@387
   340
OCBP @Rn {: sh4_stats[I_OCBP]++; :}
nkeynes@387
   341
OCBWB @Rn {: sh4_stats[I_OCBWB]++; :}
nkeynes@387
   342
OR Rm, Rn {: sh4_stats[I_OR]++; :}
nkeynes@387
   343
OR #imm, R0 {: sh4_stats[I_ORI]++; :}
nkeynes@387
   344
OR.B #imm, @(R0, GBR) {: sh4_stats[I_ORB]++; :}
nkeynes@387
   345
PREF @Rn {: sh4_stats[I_PREF]++; :}
nkeynes@387
   346
ROTCL Rn {: sh4_stats[I_ROTCL]++; :}
nkeynes@387
   347
ROTCR Rn {: sh4_stats[I_ROTCR]++; :}
nkeynes@387
   348
ROTL Rn {: sh4_stats[I_ROTL]++; :}
nkeynes@387
   349
ROTR Rn {: sh4_stats[I_ROTR]++; :}
nkeynes@387
   350
RTE {: sh4_stats[I_RTE]++; :}
nkeynes@387
   351
RTS {: sh4_stats[I_RTS]++; :}
nkeynes@387
   352
SETS {: sh4_stats[I_SETS]++; :}
nkeynes@387
   353
SETT {: sh4_stats[I_SETT]++; :}
nkeynes@387
   354
SHAD Rm, Rn {: sh4_stats[I_SHAD]++; :}
nkeynes@387
   355
SHAL Rn {: sh4_stats[I_SHAL]++; :}
nkeynes@387
   356
SHAR Rn {: sh4_stats[I_SHAR]++; :}
nkeynes@387
   357
SHLD Rm, Rn {: sh4_stats[I_SHLD]++; :}
nkeynes@387
   358
SHLL Rn {: sh4_stats[I_SHLL]++; :}
nkeynes@387
   359
SHLL2 Rn {: sh4_stats[I_SHLL]++; :}
nkeynes@387
   360
SHLL8 Rn {: sh4_stats[I_SHLL]++; :}
nkeynes@387
   361
SHLL16 Rn {: sh4_stats[I_SHLL]++; :}
nkeynes@387
   362
SHLR Rn {: sh4_stats[I_SHLR]++; :}
nkeynes@387
   363
SHLR2 Rn {: sh4_stats[I_SHLR]++; :}
nkeynes@387
   364
SHLR8 Rn {: sh4_stats[I_SHLR]++; :}
nkeynes@387
   365
SHLR16 Rn {: sh4_stats[I_SHLR]++; :}
nkeynes@387
   366
SLEEP {: sh4_stats[I_SLEEP]++; :}
nkeynes@387
   367
STC SR, Rn {: sh4_stats[I_STCSR]++; :}
nkeynes@387
   368
STC GBR, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   369
STC VBR, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   370
STC SSR, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   371
STC SPC, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   372
STC SGR, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   373
STC DBR, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   374
STC Rm_BANK, Rn {: sh4_stats[I_STC]++; :}
nkeynes@387
   375
STC.L SR, @-Rn {: sh4_stats[I_STCSRM]++; :}
nkeynes@387
   376
STC.L VBR, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   377
STC.L SSR, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   378
STC.L SPC, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   379
STC.L SGR, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   380
STC.L DBR, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   381
STC.L Rm_BANK, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   382
STC.L GBR, @-Rn {: sh4_stats[I_STCM]++; :}
nkeynes@387
   383
STS FPSCR, Rn {: sh4_stats[I_STS]++; :}
nkeynes@387
   384
STS.L FPSCR, @-Rn {: sh4_stats[I_STSM]++; :}
nkeynes@387
   385
STS FPUL, Rn {: sh4_stats[I_STS]++; :}
nkeynes@387
   386
STS.L FPUL, @-Rn {: sh4_stats[I_STSM]++; :}
nkeynes@387
   387
STS MACH, Rn {: sh4_stats[I_STS]++; :}
nkeynes@387
   388
STS.L MACH, @-Rn {: sh4_stats[I_STSM]++; :}
nkeynes@387
   389
STS MACL, Rn {: sh4_stats[I_STS]++; :}
nkeynes@387
   390
STS.L MACL, @-Rn {: sh4_stats[I_STSM]++; :}
nkeynes@387
   391
STS PR, Rn {: sh4_stats[I_STS]++; :}
nkeynes@387
   392
STS.L PR, @-Rn {: sh4_stats[I_STSM]++; :}
nkeynes@387
   393
SUB Rm, Rn {: sh4_stats[I_SUB]++; :}
nkeynes@387
   394
SUBC Rm, Rn {: sh4_stats[I_SUBC]++; :}
nkeynes@387
   395
SUBV Rm, Rn {: sh4_stats[I_SUBV]++; :}
nkeynes@387
   396
SWAP.B Rm, Rn {: sh4_stats[I_SWAPB]++; :}
nkeynes@387
   397
SWAP.W Rm, Rn {: sh4_stats[I_SWAPW]++; :}
nkeynes@387
   398
TAS.B @Rn {: sh4_stats[I_TASB]++; :}
nkeynes@387
   399
TRAPA #imm {: sh4_stats[I_TRAPA]++; :}
nkeynes@387
   400
TST Rm, Rn {: sh4_stats[I_TST]++; :}
nkeynes@387
   401
TST #imm, R0 {: sh4_stats[I_TSTI]++; :}
nkeynes@387
   402
TST.B #imm, @(R0, GBR) {: sh4_stats[I_TSTB]++; :}
nkeynes@387
   403
XOR Rm, Rn {: sh4_stats[I_XOR]++; :}
nkeynes@387
   404
XOR #imm, R0 {: sh4_stats[I_XORI]++; :}
nkeynes@387
   405
XOR.B #imm, @(R0, GBR) {: sh4_stats[I_XORB]++; :}
nkeynes@387
   406
XTRCT Rm, Rn {: sh4_stats[I_XTRCT]++; :}
nkeynes@387
   407
UNDEF {: sh4_stats[I_UNDEF]++; :}
nkeynes@387
   408
%%
nkeynes@387
   409
nkeynes@387
   410
sh4_stats_total++;
nkeynes@387
   411
}
.