|
From: <sv...@va...> - 2011-05-28 11:10:34
|
Author: sewardj
Date: 2011-05-28 12:05:44 +0100 (Sat, 28 May 2011)
New Revision: 11781
Log:
Remove another memory reference from the arm dispatcher loop, by using
the fact that all {VG,VEX}_TRC_VALUES have their lowest bit set. All
other targets can benefit from this trick too.
Modified:
trunk/coregrind/m_dispatch/dispatch-arm-linux.S
trunk/coregrind/pub_core_dispatch_asm.h
Modified: trunk/coregrind/m_dispatch/dispatch-arm-linux.S
===================================================================
--- trunk/coregrind/m_dispatch/dispatch-arm-linux.S 2011-05-28 10:16:58 UTC (rev 11780)
+++ trunk/coregrind/m_dispatch/dispatch-arm-linux.S 2011-05-28 11:05:44 UTC (rev 11781)
@@ -85,10 +85,9 @@
modified guest state ptr */
/* Has the guest state pointer been messed with? If yes, exit. */
- ldr r1, [sp, #0]
movw r3, #:lower16:VG_(dispatch_ctr)
+ tst r8, #1
- cmp r8, r1
movt r3, #:upper16:VG_(dispatch_ctr)
bne gsp_changed
@@ -142,10 +141,9 @@
modified guest state ptr */
/* Has the guest state pointer been messed with? If yes, exit. */
- ldr r1, [sp, #0]
movw r3, #:lower16:VG_(dispatch_ctr)
+ tst r8, #1
- cmp r8, r1
movt r3, #:upper16:VG_(dispatch_ctr)
bne gsp_changed
Modified: trunk/coregrind/pub_core_dispatch_asm.h
===================================================================
--- trunk/coregrind/pub_core_dispatch_asm.h 2011-05-28 10:16:58 UTC (rev 11780)
+++ trunk/coregrind/pub_core_dispatch_asm.h 2011-05-28 11:05:44 UTC (rev 11781)
@@ -41,7 +41,13 @@
#include "libvex_trc_values.h"
/* And some more of our own. These must not have the same values as
- those from libvex_trc_values.h. (viz, 60 or below is safe). */
+ those from libvex_trc_values.h. (viz, 60 or below is safe).
+
+ These values *must* be odd (have bit 0 set) because the dispatchers
+ (coregrind/m_dispatch/dispatch-*-*.S) use this fact to distinguish
+ a TRC value from the unchanged baseblock pointer -- which has 0 as
+ its lowest bit.
+*/
#define VG_TRC_BORING 29 /* no event; just keep going */
#define VG_TRC_INNER_FASTMISS 37 /* TRC only; means fast-cache miss. */
#define VG_TRC_INNER_COUNTERZERO 41 /* TRC only; means bb ctr == 0 */
|