pcnt: measure gte too
authornotaz <notasas@gmail.com>
Tue, 18 Oct 2011 22:58:04 +0000 (01:58 +0300)
committernotaz <notasas@gmail.com>
Sun, 30 Oct 2011 21:48:07 +0000 (23:48 +0200)
frontend/pcnt.h
frontend/plugin.c
libpcsxcore/new_dynarec/assem_arm.c
libpcsxcore/new_dynarec/emu_if.c

index 3969aa4..0213ca1 100644 (file)
@@ -4,13 +4,14 @@ enum pcounters {
        PCNT_GPU,
        PCNT_SPU,
        PCNT_BLIT,
        PCNT_GPU,
        PCNT_SPU,
        PCNT_BLIT,
+       PCNT_GTE,
        PCNT_TEST,
        PCNT_CNT
 };
 
 #ifdef PCNT
 
        PCNT_TEST,
        PCNT_CNT
 };
 
 #ifdef PCNT
 
-static const char *pcnt_names[PCNT_CNT] = { "", "gpu", "spu", "blit", "test" };
+static const char *pcnt_names[PCNT_CNT] = { "", "gpu", "spu", "blit", "gte", "test" };
 
 #define PCNT_FRAMES 10
 
 
 #define PCNT_FRAMES 10
 
@@ -96,6 +97,9 @@ static inline void pcnt_init(void)
 #endif
 }
 
 #endif
 }
 
+void pcnt_gte_start(int op);
+void pcnt_gte_end(int op);
+
 #else
 
 #define pcnt_start(id)
 #else
 
 #define pcnt_start(id)
index 2492f4a..e741a1a 100644 (file)
@@ -292,4 +292,15 @@ void pcnt_hook_plugins(void)
        hook_it(SPU_playCDDAchannel);
 }
 
        hook_it(SPU_playCDDAchannel);
 }
 
+// hooked into recompiler
+void pcnt_gte_start(int op)
+{
+       pcnt_start(PCNT_GTE);
+}
+
+void pcnt_gte_end(int op)
+{
+       pcnt_end(PCNT_GTE);
+}
+
 #endif
 #endif
index d0d43f4..ddbfafa 100644 (file)
@@ -4410,11 +4410,19 @@ void cop2_assemble(int i,struct regstat *i_regs)
 static void c2op_prologue(u_int op,u_int reglist)
 {
   save_regs_all(reglist);
 static void c2op_prologue(u_int op,u_int reglist)
 {
   save_regs_all(reglist);
+#ifdef PCNT
+  emit_movimm(op,0);
+  emit_call((int)pcnt_gte_start);
+#endif
   emit_addimm(FP,(int)&psxRegs.CP2D.r[0]-(int)&dynarec_local,0); // cop2 regs
 }
 
 static void c2op_epilogue(u_int op,u_int reglist)
 {
   emit_addimm(FP,(int)&psxRegs.CP2D.r[0]-(int)&dynarec_local,0); // cop2 regs
 }
 
 static void c2op_epilogue(u_int op,u_int reglist)
 {
+#ifdef PCNT
+  emit_movimm(op,0);
+  emit_call((int)pcnt_gte_end);
+#endif
   restore_regs_all(reglist);
 }
 
   restore_regs_all(reglist);
 }
 
index 485a7c8..b3bcc29 100644 (file)
@@ -266,7 +266,7 @@ static int ari64_init()
                if (psxCP2[i] != psxNULL)
                        gte_handlers[i] = psxCP2[i];
 
                if (psxCP2[i] != psxNULL)
                        gte_handlers[i] = psxCP2[i];
 
-#if !defined(DRC_DBG) && !defined(PCNT)
+#if !defined(DRC_DBG)
 #ifdef __arm__
        gte_handlers[0x06] = gteNCLIP_arm;
        gte_handlers_nf[0x01] = gteRTPS_nf_arm;
 #ifdef __arm__
        gte_handlers[0x06] = gteNCLIP_arm;
        gte_handlers_nf[0x01] = gteRTPS_nf_arm;