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