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