Search
lxdream.org :: lxdream/src/sh4/sh4stat.in :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4stat.in
changeset 387:38e9fddbf0e3
next500:848e66eee418
author nkeynes
date Tue Sep 18 08:58:23 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Add instruction statistics gathering module
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/sh4/sh4stat.in Tue Sep 18 08:58:23 2007 +0000
1.3 @@ -0,0 +1,405 @@
1.4 +/**
1.5 + * $Id: sh4stat.in,v 1.1 2007-09-18 08:58:23 nkeynes Exp $
1.6 + *
1.7 + * Support module for collecting instruction stats
1.8 + *
1.9 + * Copyright (c) 2005 Nathan Keynes.
1.10 + *
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
1.15 + *
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.20 + */
1.21 +
1.22 +#include "dream.h"
1.23 +#include "sh4stat.h"
1.24 +#include "sh4core.h"
1.25 +
1.26 +static uint64_t sh4_stats[SH4_INSTRUCTION_COUNT+1];
1.27 +static uint64_t sh4_stats_total;
1.28 +static const char *sh4_stats_names[] = {
1.29 + "???",
1.30 +"ADD Rm, Rn",
1.31 +"ADD #imm, Rn",
1.32 +"ADDC Rm, Rn",
1.33 +"ADDV Rm, Rn",
1.34 +"AND Rm, Rn",
1.35 +"AND #imm, R0",
1.36 +"AND.B #imm, @(R0, GBR)",
1.37 +"BF disp",
1.38 +"BF/S disp",
1.39 +"BRA disp",
1.40 +"BRAF Rn",
1.41 +"BSR disp",
1.42 +"BSRF Rn",
1.43 +"BT disp",
1.44 +"BT/S disp",
1.45 +"CLRMAC",
1.46 +"CLRS",
1.47 +"CLRT",
1.48 +"CMP/EQ Rm, Rn",
1.49 +"CMP/EQ #imm, R0",
1.50 +"CMP/GE Rm, Rn",
1.51 +"CMP/GT Rm, Rn",
1.52 +"CMP/HI Rm, Rn",
1.53 +"CMP/HS Rm, Rn",
1.54 +"CMP/PL Rn",
1.55 +"CMP/PZ Rn",
1.56 +"CMP/STR Rm, Rn",
1.57 +"DIV0S Rm, Rn",
1.58 +"DIV0U",
1.59 +"DIV1 Rm, Rn",
1.60 +"DMULS.L Rm, Rn",
1.61 +"DMULU.L Rm, Rn",
1.62 +"DT Rn",
1.63 +"EXTS.B Rm, Rn",
1.64 +"EXTS.W Rm, Rn",
1.65 +"EXTU.B Rm, Rn",
1.66 +"EXTU.W Rm, Rn",
1.67 +"FABS FRn",
1.68 +"FADD FRm, FRn",
1.69 +"FCMP/EQ FRm, FRn",
1.70 +"FCMP/GT FRm, FRn",
1.71 +"FCNVDS FRm, FPUL",
1.72 +"FCNVSD FPUL, FRn",
1.73 +"FDIV FRm, FRn",
1.74 +"FIPR FVm, FVn",
1.75 +"FLDS FRm, FPUL",
1.76 +"FLDI0 FRn",
1.77 +"FLDI1 FRn",
1.78 +"FLOAT FPUL, FRn",
1.79 +"FMAC FR0, FRm, FRn",
1.80 +"FMOV FRm, FRn",
1.81 +"FMOV FRm, @Rn",
1.82 +"FMOV FRm, @-Rn",
1.83 +"FMOV FRm, @(R0, Rn)",
1.84 +"FMOV @Rm, FRn",
1.85 +"FMOV @Rm+, FRn",
1.86 +"FMOV @(R0, Rm), FRn",
1.87 +"FMUL FRm, FRn",
1.88 +"FNEG FRn",
1.89 +"FRCHG",
1.90 +"FSCA FPUL, FRn",
1.91 +"FSCHG",
1.92 +"FSQRT FRn",
1.93 +"FSRRA FRn",
1.94 +"FSTS FPUL, FRn",
1.95 +"FSUB FRm, FRn",
1.96 +"FTRC FRm, FPUL",
1.97 +"FTRV XMTRX, FVn",
1.98 +"JMP @Rn",
1.99 +"JSR @Rn",
1.100 +"LDC Rm, SR",
1.101 +"LDC Rm, *",
1.102 +"LDC.L @Rm+, SR",
1.103 +"LDC.L @Rm+, *",
1.104 +"LDS Rm, *",
1.105 +"LDS.L @Rm+, *",
1.106 +"LDTLB",
1.107 +"MAC.L @Rm+, @Rn+",
1.108 +"MAC.W @Rm+, @Rn+",
1.109 +"MOV Rm, Rn",
1.110 +"MOV #imm, Rn",
1.111 +"MOV.B ...",
1.112 +"MOV.L ...",
1.113 +"MOV.L @(disp, PC)",
1.114 +"MOV.W ...",
1.115 +"MOVA @(disp, PC), R0",
1.116 +"MOVCA.L R0, @Rn",
1.117 +"MOVT Rn",
1.118 +"MUL.L Rm, Rn",
1.119 +"MULS.W Rm, Rn",
1.120 +"MULU.W Rm, Rn",
1.121 +"NEG Rm, Rn",
1.122 +"NEGC Rm, Rn",
1.123 +"NOP",
1.124 +"NOT Rm, Rn",
1.125 +"OCBI @Rn",
1.126 +"OCBP @Rn",
1.127 +"OCBWB @Rn",
1.128 +"OR Rm, Rn",
1.129 +"OR #imm, R0",
1.130 +"OR.B #imm, @(R0, GBR)",
1.131 +"PREF @Rn",
1.132 +"ROTCL Rn",
1.133 +"ROTCR Rn",
1.134 +"ROTL Rn",
1.135 +"ROTR Rn",
1.136 +"RTE",
1.137 +"RTS",
1.138 +"SETS",
1.139 +"SETT",
1.140 +"SHAD Rm, Rn",
1.141 +"SHAL Rn",
1.142 +"SHAR Rn",
1.143 +"SHLD Rm, Rn",
1.144 +"SHLL* Rn",
1.145 +"SHLR* Rn",
1.146 +"SLEEP",
1.147 +"STC SR, Rn",
1.148 +"STC *, Rn",
1.149 +"STC.L SR, @-Rn",
1.150 +"STC.L *, @-Rn",
1.151 +"STS *, Rn",
1.152 +"STS.L *, @-Rn",
1.153 +"SUB Rm, Rn",
1.154 +"SUBC Rm, Rn",
1.155 +"SUBV Rm, Rn",
1.156 +"SWAP.B Rm, Rn",
1.157 +"SWAP.W Rm, Rn",
1.158 +"TAS.B @Rn",
1.159 +"TRAPA #imm",
1.160 +"TST Rm, Rn",
1.161 +"TST #imm, R0",
1.162 +"TST.B #imm, @(R0, GBR)",
1.163 +"XOR Rm, Rn",
1.164 +"XOR #imm, R0",
1.165 +"XOR.B #imm, @(R0, GBR)",
1.166 +"XTRCT Rm, Rn",
1.167 +"UNDEF"
1.168 +};
1.169 +
1.170 +void sh4_stats_reset( void )
1.171 +{
1.172 + int i;
1.173 + for( i=0; i<= I_UNDEF; i++ ) {
1.174 + sh4_stats[i] = 0;
1.175 + }
1.176 + sh4_stats_total = 0;
1.177 +}
1.178 +
1.179 +void sh4_stats_print( FILE *out )
1.180 +{
1.181 + int i;
1.182 + for( i=0; i<= I_UNDEF; i++ ) {
1.183 + 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 );
1.184 + }
1.185 + fprintf( out, "Total: %d\n", sh4_stats_total );
1.186 +}
1.187 +
1.188 +void sh4_stats_add( uint32_t pc )
1.189 +{
1.190 + uint16_t ir = sh4_read_word(pc);
1.191 +#define UNDEF() sh4_stats[0]++
1.192 +%%
1.193 +ADD Rm, Rn {: sh4_stats[I_ADD]++; :}
1.194 +ADD #imm, Rn {: sh4_stats[I_ADDI]++; :}
1.195 +ADDC Rm, Rn {: sh4_stats[I_ADDC]++; :}
1.196 +ADDV Rm, Rn {: sh4_stats[I_ADDV]++; :}
1.197 +AND Rm, Rn {: sh4_stats[I_AND]++; :}
1.198 +AND #imm, R0 {: sh4_stats[I_ANDI]++; :}
1.199 +AND.B #imm, @(R0, GBR) {: sh4_stats[I_ANDB]++; :}
1.200 +BF disp {: sh4_stats[I_BF]++; :}
1.201 +BF/S disp {: sh4_stats[I_BFS]++; :}
1.202 +BRA disp {: sh4_stats[I_BRA]++; :}
1.203 +BRAF Rn {: sh4_stats[I_BRAF]++; :}
1.204 +BSR disp {: sh4_stats[I_BSR]++; :}
1.205 +BSRF Rn {: sh4_stats[I_BSRF]++; :}
1.206 +BT disp {: sh4_stats[I_BT]++; :}
1.207 +BT/S disp {: sh4_stats[I_BTS]++; :}
1.208 +CLRMAC {: sh4_stats[I_CLRMAC]++; :}
1.209 +CLRS {: sh4_stats[I_CLRS]++; :}
1.210 +CLRT {: sh4_stats[I_CLRT]++; :}
1.211 +CMP/EQ Rm, Rn {: sh4_stats[I_CMPEQ]++; :}
1.212 +CMP/EQ #imm, R0 {: sh4_stats[I_CMPEQI]++; :}
1.213 +CMP/GE Rm, Rn {: sh4_stats[I_CMPGE]++; :}
1.214 +CMP/GT Rm, Rn {: sh4_stats[I_CMPGT]++; :}
1.215 +CMP/HI Rm, Rn {: sh4_stats[I_CMPHI]++; :}
1.216 +CMP/HS Rm, Rn {: sh4_stats[I_CMPHS]++; :}
1.217 +CMP/PL Rn {: sh4_stats[I_CMPPL]++; :}
1.218 +CMP/PZ Rn {: sh4_stats[I_CMPPZ]++; :}
1.219 +CMP/STR Rm, Rn {: sh4_stats[I_CMPSTR]++; :}
1.220 +DIV0S Rm, Rn {: sh4_stats[I_DIV0S]++; :}
1.221 +DIV0U {: sh4_stats[I_DIV0U]++; :}
1.222 +DIV1 Rm, Rn {: sh4_stats[I_DIV1]++; :}
1.223 +DMULS.L Rm, Rn {: sh4_stats[I_DMULS]++; :}
1.224 +DMULU.L Rm, Rn {: sh4_stats[I_DMULU]++; :}
1.225 +DT Rn {: sh4_stats[I_DT]++; :}
1.226 +EXTS.B Rm, Rn {: sh4_stats[I_EXTSB]++; :}
1.227 +EXTS.W Rm, Rn {: sh4_stats[I_EXTSW]++; :}
1.228 +EXTU.B Rm, Rn {: sh4_stats[I_EXTUB]++; :}
1.229 +EXTU.W Rm, Rn {: sh4_stats[I_EXTUW]++; :}
1.230 +FABS FRn {: sh4_stats[I_FABS]++; :}
1.231 +FADD FRm, FRn {: sh4_stats[I_FADD]++; :}
1.232 +FCMP/EQ FRm, FRn {: sh4_stats[I_FCMPEQ]++; :}
1.233 +FCMP/GT FRm, FRn {: sh4_stats[I_FCMPGT]++; :}
1.234 +FCNVDS FRm, FPUL {: sh4_stats[I_FCNVDS]++; :}
1.235 +FCNVSD FPUL, FRn {: sh4_stats[I_FCNVSD]++; :}
1.236 +FDIV FRm, FRn {: sh4_stats[I_FDIV]++; :}
1.237 +FIPR FVm, FVn {: sh4_stats[I_FIPR]++; :}
1.238 +FLDS FRm, FPUL {: sh4_stats[I_FLDS]++; :}
1.239 +FLDI0 FRn {: sh4_stats[I_FLDI0]++; :}
1.240 +FLDI1 FRn {: sh4_stats[I_FLDI1]++; :}
1.241 +FLOAT FPUL, FRn {: sh4_stats[I_FLOAT]++; :}
1.242 +FMAC FR0, FRm, FRn {: sh4_stats[I_FMAC]++; :}
1.243 +FMOV FRm, FRn {: sh4_stats[I_FMOV1]++; :}
1.244 +FMOV FRm, @Rn {: sh4_stats[I_FMOV2]++; :}
1.245 +FMOV FRm, @-Rn {: sh4_stats[I_FMOV3]++; :}
1.246 +FMOV FRm, @(R0, Rn) {: sh4_stats[I_FMOV4]++; :}
1.247 +FMOV @Rm, FRn {: sh4_stats[I_FMOV5]++; :}
1.248 +FMOV @Rm+, FRn {: sh4_stats[I_FMOV6]++; :}
1.249 +FMOV @(R0, Rm), FRn {: sh4_stats[I_FMOV7]++; :}
1.250 +FMUL FRm, FRn {: sh4_stats[I_FMUL]++; :}
1.251 +FNEG FRn {: sh4_stats[I_FNEG]++; :}
1.252 +FRCHG {: sh4_stats[I_FRCHG]++; :}
1.253 +FSCA FPUL, FRn {: sh4_stats[I_FSCA]++; :}
1.254 +FSCHG {: sh4_stats[I_FSCHG]++; :}
1.255 +FSQRT FRn {: sh4_stats[I_FSQRT]++; :}
1.256 +FSRRA FRn {: sh4_stats[I_FSRRA]++; :}
1.257 +FSTS FPUL, FRn {: sh4_stats[I_FSTS]++; :}
1.258 +FSUB FRm, FRn {: sh4_stats[I_FSUB]++; :}
1.259 +FTRC FRm, FPUL {: sh4_stats[I_FTRC]++; :}
1.260 +FTRV XMTRX, FVn {: sh4_stats[I_FTRV]++; :}
1.261 +JMP @Rn {: sh4_stats[I_JMP]++; :}
1.262 +JSR @Rn {: sh4_stats[I_JSR]++; :}
1.263 +LDC Rm, GBR {: sh4_stats[I_LDC]++; :}
1.264 +LDC Rm, SR {: sh4_stats[I_LDCSR]++; :}
1.265 +LDC Rm, VBR {: sh4_stats[I_LDC]++; :}
1.266 +LDC Rm, SSR {: sh4_stats[I_LDC]++; :}
1.267 +LDC Rm, SGR {: sh4_stats[I_LDC]++; :}
1.268 +LDC Rm, SPC {: sh4_stats[I_LDC]++; :}
1.269 +LDC Rm, DBR {: sh4_stats[I_LDC]++; :}
1.270 +LDC Rm, Rn_BANK {: sh4_stats[I_LDC]++; :}
1.271 +LDC.L @Rm+, GBR {: sh4_stats[I_LDCM]++; :}
1.272 +LDC.L @Rm+, SR {: sh4_stats[I_LDCSRM]++; :}
1.273 +LDC.L @Rm+, VBR {: sh4_stats[I_LDCM]++; :}
1.274 +LDC.L @Rm+, SSR {: sh4_stats[I_LDCM]++; :}
1.275 +LDC.L @Rm+, SGR {: sh4_stats[I_LDCM]++; :}
1.276 +LDC.L @Rm+, SPC {: sh4_stats[I_LDCM]++; :}
1.277 +LDC.L @Rm+, DBR {: sh4_stats[I_LDCM]++; :}
1.278 +LDC.L @Rm+, Rn_BANK {: sh4_stats[I_LDCM]++; :}
1.279 +LDS Rm, FPSCR {: sh4_stats[I_LDS]++; :}
1.280 +LDS.L @Rm+, FPSCR {: sh4_stats[I_LDSM]++; :}
1.281 +LDS Rm, FPUL {: sh4_stats[I_LDS]++; :}
1.282 +LDS.L @Rm+, FPUL {: sh4_stats[I_LDSM]++; :}
1.283 +LDS Rm, MACH {: sh4_stats[I_LDS]++; :}
1.284 +LDS.L @Rm+, MACH {: sh4_stats[I_LDSM]++; :}
1.285 +LDS Rm, MACL {: sh4_stats[I_LDS]++; :}
1.286 +LDS.L @Rm+, MACL {: sh4_stats[I_LDSM]++; :}
1.287 +LDS Rm, PR {: sh4_stats[I_LDS]++; :}
1.288 +LDS.L @Rm+, PR {: sh4_stats[I_LDSM]++; :}
1.289 +LDTLB {: sh4_stats[I_LDTLB]++; :}
1.290 +MAC.L @Rm+, @Rn+ {: sh4_stats[I_MACL]++; :}
1.291 +MAC.W @Rm+, @Rn+ {: sh4_stats[I_MACW]++; :}
1.292 +MOV Rm, Rn {: sh4_stats[I_MOV]++; :}
1.293 +MOV #imm, Rn {: sh4_stats[I_MOVI]++; :}
1.294 +MOV.B Rm, @Rn {: sh4_stats[I_MOVB]++; :}
1.295 +MOV.B Rm, @-Rn {: sh4_stats[I_MOVB]++; :}
1.296 +MOV.B Rm, @(R0, Rn) {: sh4_stats[I_MOVB]++; :}
1.297 +MOV.B R0, @(disp, GBR) {: sh4_stats[I_MOVB]++; :}
1.298 +MOV.B R0, @(disp, Rn) {: sh4_stats[I_MOVB]++; :}
1.299 +MOV.B @Rm, Rn {: sh4_stats[I_MOVB]++; :}
1.300 +MOV.B @Rm+, Rn {: sh4_stats[I_MOVB]++; :}
1.301 +MOV.B @(R0, Rm), Rn {: sh4_stats[I_MOVB]++; :}
1.302 +MOV.B @(disp, GBR), R0 {: sh4_stats[I_MOVB]++; :}
1.303 +MOV.B @(disp, Rm), R0 {: sh4_stats[I_MOVB]++; :}
1.304 +MOV.L Rm, @Rn {: sh4_stats[I_MOVL]++; :}
1.305 +MOV.L Rm, @-Rn {: sh4_stats[I_MOVL]++; :}
1.306 +MOV.L Rm, @(R0, Rn) {: sh4_stats[I_MOVL]++; :}
1.307 +MOV.L R0, @(disp, GBR) {: sh4_stats[I_MOVL]++; :}
1.308 +MOV.L Rm, @(disp, Rn) {: sh4_stats[I_MOVL]++; :}
1.309 +MOV.L @Rm, Rn {: sh4_stats[I_MOVL]++; :}
1.310 +MOV.L @Rm+, Rn {: sh4_stats[I_MOVL]++; :}
1.311 +MOV.L @(R0, Rm), Rn {: sh4_stats[I_MOVL]++; :}
1.312 +MOV.L @(disp, GBR), R0 {: sh4_stats[I_MOVL]++; :}
1.313 +MOV.L @(disp, PC), Rn {: sh4_stats[I_MOVLPC]++; :}
1.314 +MOV.L @(disp, Rm), Rn {: sh4_stats[I_MOVL]++; :}
1.315 +MOV.W Rm, @Rn {: sh4_stats[I_MOVW]++; :}
1.316 +MOV.W Rm, @-Rn {: sh4_stats[I_MOVW]++; :}
1.317 +MOV.W Rm, @(R0, Rn) {: sh4_stats[I_MOVW]++; :}
1.318 +MOV.W R0, @(disp, GBR) {: sh4_stats[I_MOVW]++; :}
1.319 +MOV.W R0, @(disp, Rn) {: sh4_stats[I_MOVW]++; :}
1.320 +MOV.W @Rm, Rn {: sh4_stats[I_MOVW]++; :}
1.321 +MOV.W @Rm+, Rn {: sh4_stats[I_MOVW]++; :}
1.322 +MOV.W @(R0, Rm), Rn {: sh4_stats[I_MOVW]++; :}
1.323 +MOV.W @(disp, GBR), R0 {: sh4_stats[I_MOVW]++; :}
1.324 +MOV.W @(disp, PC), Rn {: sh4_stats[I_MOVW]++; :}
1.325 +MOV.W @(disp, Rm), R0 {: sh4_stats[I_MOVW]++; :}
1.326 +MOVA @(disp, PC), R0 {: sh4_stats[I_MOVA]++; :}
1.327 +MOVCA.L R0, @Rn {: sh4_stats[I_MOVCA]++; :}
1.328 +MOVT Rn {: sh4_stats[I_MOVT]++; :}
1.329 +MUL.L Rm, Rn {: sh4_stats[I_MULL]++; :}
1.330 +MULS.W Rm, Rn {: sh4_stats[I_MULSW]++; :}
1.331 +MULU.W Rm, Rn {: sh4_stats[I_MULUW]++; :}
1.332 +NEG Rm, Rn {: sh4_stats[I_NEG]++; :}
1.333 +NEGC Rm, Rn {: sh4_stats[I_NEGC]++; :}
1.334 +NOP {: sh4_stats[I_NOP]++; :}
1.335 +NOT Rm, Rn {: sh4_stats[I_NOT]++; :}
1.336 +OCBI @Rn {: sh4_stats[I_OCBI]++; :}
1.337 +OCBP @Rn {: sh4_stats[I_OCBP]++; :}
1.338 +OCBWB @Rn {: sh4_stats[I_OCBWB]++; :}
1.339 +OR Rm, Rn {: sh4_stats[I_OR]++; :}
1.340 +OR #imm, R0 {: sh4_stats[I_ORI]++; :}
1.341 +OR.B #imm, @(R0, GBR) {: sh4_stats[I_ORB]++; :}
1.342 +PREF @Rn {: sh4_stats[I_PREF]++; :}
1.343 +ROTCL Rn {: sh4_stats[I_ROTCL]++; :}
1.344 +ROTCR Rn {: sh4_stats[I_ROTCR]++; :}
1.345 +ROTL Rn {: sh4_stats[I_ROTL]++; :}
1.346 +ROTR Rn {: sh4_stats[I_ROTR]++; :}
1.347 +RTE {: sh4_stats[I_RTE]++; :}
1.348 +RTS {: sh4_stats[I_RTS]++; :}
1.349 +SETS {: sh4_stats[I_SETS]++; :}
1.350 +SETT {: sh4_stats[I_SETT]++; :}
1.351 +SHAD Rm, Rn {: sh4_stats[I_SHAD]++; :}
1.352 +SHAL Rn {: sh4_stats[I_SHAL]++; :}
1.353 +SHAR Rn {: sh4_stats[I_SHAR]++; :}
1.354 +SHLD Rm, Rn {: sh4_stats[I_SHLD]++; :}
1.355 +SHLL Rn {: sh4_stats[I_SHLL]++; :}
1.356 +SHLL2 Rn {: sh4_stats[I_SHLL]++; :}
1.357 +SHLL8 Rn {: sh4_stats[I_SHLL]++; :}
1.358 +SHLL16 Rn {: sh4_stats[I_SHLL]++; :}
1.359 +SHLR Rn {: sh4_stats[I_SHLR]++; :}
1.360 +SHLR2 Rn {: sh4_stats[I_SHLR]++; :}
1.361 +SHLR8 Rn {: sh4_stats[I_SHLR]++; :}
1.362 +SHLR16 Rn {: sh4_stats[I_SHLR]++; :}
1.363 +SLEEP {: sh4_stats[I_SLEEP]++; :}
1.364 +STC SR, Rn {: sh4_stats[I_STCSR]++; :}
1.365 +STC GBR, Rn {: sh4_stats[I_STC]++; :}
1.366 +STC VBR, Rn {: sh4_stats[I_STC]++; :}
1.367 +STC SSR, Rn {: sh4_stats[I_STC]++; :}
1.368 +STC SPC, Rn {: sh4_stats[I_STC]++; :}
1.369 +STC SGR, Rn {: sh4_stats[I_STC]++; :}
1.370 +STC DBR, Rn {: sh4_stats[I_STC]++; :}
1.371 +STC Rm_BANK, Rn {: sh4_stats[I_STC]++; :}
1.372 +STC.L SR, @-Rn {: sh4_stats[I_STCSRM]++; :}
1.373 +STC.L VBR, @-Rn {: sh4_stats[I_STCM]++; :}
1.374 +STC.L SSR, @-Rn {: sh4_stats[I_STCM]++; :}
1.375 +STC.L SPC, @-Rn {: sh4_stats[I_STCM]++; :}
1.376 +STC.L SGR, @-Rn {: sh4_stats[I_STCM]++; :}
1.377 +STC.L DBR, @-Rn {: sh4_stats[I_STCM]++; :}
1.378 +STC.L Rm_BANK, @-Rn {: sh4_stats[I_STCM]++; :}
1.379 +STC.L GBR, @-Rn {: sh4_stats[I_STCM]++; :}
1.380 +STS FPSCR, Rn {: sh4_stats[I_STS]++; :}
1.381 +STS.L FPSCR, @-Rn {: sh4_stats[I_STSM]++; :}
1.382 +STS FPUL, Rn {: sh4_stats[I_STS]++; :}
1.383 +STS.L FPUL, @-Rn {: sh4_stats[I_STSM]++; :}
1.384 +STS MACH, Rn {: sh4_stats[I_STS]++; :}
1.385 +STS.L MACH, @-Rn {: sh4_stats[I_STSM]++; :}
1.386 +STS MACL, Rn {: sh4_stats[I_STS]++; :}
1.387 +STS.L MACL, @-Rn {: sh4_stats[I_STSM]++; :}
1.388 +STS PR, Rn {: sh4_stats[I_STS]++; :}
1.389 +STS.L PR, @-Rn {: sh4_stats[I_STSM]++; :}
1.390 +SUB Rm, Rn {: sh4_stats[I_SUB]++; :}
1.391 +SUBC Rm, Rn {: sh4_stats[I_SUBC]++; :}
1.392 +SUBV Rm, Rn {: sh4_stats[I_SUBV]++; :}
1.393 +SWAP.B Rm, Rn {: sh4_stats[I_SWAPB]++; :}
1.394 +SWAP.W Rm, Rn {: sh4_stats[I_SWAPW]++; :}
1.395 +TAS.B @Rn {: sh4_stats[I_TASB]++; :}
1.396 +TRAPA #imm {: sh4_stats[I_TRAPA]++; :}
1.397 +TST Rm, Rn {: sh4_stats[I_TST]++; :}
1.398 +TST #imm, R0 {: sh4_stats[I_TSTI]++; :}
1.399 +TST.B #imm, @(R0, GBR) {: sh4_stats[I_TSTB]++; :}
1.400 +XOR Rm, Rn {: sh4_stats[I_XOR]++; :}
1.401 +XOR #imm, R0 {: sh4_stats[I_XORI]++; :}
1.402 +XOR.B #imm, @(R0, GBR) {: sh4_stats[I_XORB]++; :}
1.403 +XTRCT Rm, Rn {: sh4_stats[I_XTRCT]++; :}
1.404 +UNDEF {: sh4_stats[I_UNDEF]++; :}
1.405 +%%
1.406 +
1.407 +sh4_stats_total++;
1.408 +}
.