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