]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
dispatch-x86-linux.S:
authorJulian Seward <jseward@acm.org>
Sat, 28 May 2011 17:07:53 +0000 (17:07 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 28 May 2011 17:07:53 +0000 (17:07 +0000)
   use test-based detection of GSP pointer changes.
   Saves one load per SB.

dispatch-amd64-linux.S:
   ditto

dispatch-amd64-linux.S:
   use movabsq to get &VG_(tt_fast) into a register,
   instead of an rsp-relative load from a constant pool.
   Saves a second load per SB.

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

coregrind/m_dispatch/dispatch-amd64-linux.S
coregrind/m_dispatch/dispatch-x86-linux.S

index b125a573fb98d8f34c583f3407076054d1f8f87f..82a77bd66a01df8c0f766dda19fc293ac90c2fa3 100644 (file)
@@ -121,12 +121,9 @@ VG_(run_innerloop__dispatch_unprofiled):
        /* AT ENTRY: %rax is next guest addr, %rbp is possibly
            modified guest state ptr */
 
-       /* Has the guest state pointer been messed with?  If yes, exit.
-           Also, set %rcx to be &VG_(tt_fast), some insns before it is
-           used, in the hope of getting it off the critical path.  This
-           location seems to be optimal on 2.2GHz Athlon64. */
-       cmpq    8(%rsp), %rbp
-       movq    VG_(tt_fast)@GOTPCREL(%rip), %rcx
+       /* Has the guest state pointer been messed with?  If yes,
+          exit. */
+       testq   $1, %rbp
        jnz     gsp_changed
 
        /* save the jump address in the guest state */
@@ -137,6 +134,7 @@ VG_(run_innerloop__dispatch_unprofiled):
        jz      counter_is_zero
 
        /* try a fast lookup in the translation cache */
+       movabsq $VG_(tt_fast), %rcx
        movq    %rax, %rbx              /* next guest addr */
        andq    $VG_TT_FAST_MASK, %rbx  /* entry# */
        shlq    $4, %rbx                /* entry# * sizeof(FastCacheEntry) */
@@ -162,12 +160,9 @@ VG_(run_innerloop__dispatch_profiled):
        /* AT ENTRY: %rax is next guest addr, %rbp is possibly
            modified guest state ptr */
 
-       /* Has the guest state pointer been messed with?  If yes, exit.
-           Also, set %rcx to be &VG_(tt_fast), some insns before it is
-           used, in the hope of getting it off the critical path.  This
-           location seems to be optimal on 2.2GHz Athlon64. */
-       cmpq    8(%rsp), %rbp
-       movq    VG_(tt_fast)@GOTPCREL(%rip), %rcx
+       /* Has the guest state pointer been messed with?  If yes,
+          exit. */
+       testq   $1, %rbp
        jnz     gsp_changed
 
        /* save the jump address in the guest state */
@@ -178,6 +173,7 @@ VG_(run_innerloop__dispatch_profiled):
        jz      counter_is_zero
 
        /* try a fast lookup in the translation cache */
+       movabsq $VG_(tt_fast), %rcx
        movq    %rax, %rbx
        andq    $VG_TT_FAST_MASK, %rbx  /* entry# */
        shlq    $4, %rbx                /* entry# * sizeof(FastCacheEntry) */
index 774aa8ae52ca471f9377ee04c9f63d146c7a561f..c719e010acd2e44c0e087089671493b1f8c54032 100644 (file)
@@ -111,7 +111,7 @@ VG_(run_innerloop__dispatch_unprofiled):
            modified guest state ptr */
 
        /* Has the guest state pointer been messed with?  If yes, exit. */
-       cmpl    28(%esp), %ebp
+       testl   $1, %ebp
        jnz     gsp_changed
 
        /* save the jump address in the guest state */
@@ -147,7 +147,7 @@ VG_(run_innerloop__dispatch_profiled):
            modified guest state ptr */
 
        /* Has the guest state pointer been messed with?  If yes, exit. */
-       cmpl    28(%esp), %ebp
+       testl   $1, %ebp
        jnz     gsp_changed
 
        /* save the jump address in the guest state */