]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Remove another memory reference from the arm dispatcher loop, by using
authorJulian Seward <jseward@acm.org>
Sat, 28 May 2011 11:05:44 +0000 (11:05 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 28 May 2011 11:05:44 +0000 (11:05 +0000)
the fact that all {VG,VEX}_TRC_VALUES have their lowest bit set.  All
other targets can benefit from this trick too.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11781

coregrind/m_dispatch/dispatch-arm-linux.S
coregrind/pub_core_dispatch_asm.h

index 20b13facdebcb6a11d205c9576d1f03aa8fa7d0a..f3de4459b7dba74883dda065e6ea9ea3e5cbe167 100644 (file)
@@ -85,10 +85,9 @@ VG_(run_innerloop__dispatch_unprofiled):
         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 @@ VG_(run_innerloop__dispatch_profiled):
         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
index d08183bb8d2487c43f78de22134cb5064547e19a..77a7afecf21a766039d7924887eb9a9a9836436f 100644 (file)
 #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 */