|
From: <sv...@va...> - 2011-05-28 17:12:44
|
Author: sewardj
Date: 2011-05-28 18:07:53 +0100 (Sat, 28 May 2011)
New Revision: 11785
Log:
dispatch-x86-linux.S:
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.
Modified:
trunk/coregrind/m_dispatch/dispatch-amd64-linux.S
trunk/coregrind/m_dispatch/dispatch-x86-linux.S
Modified: trunk/coregrind/m_dispatch/dispatch-amd64-linux.S
===================================================================
--- trunk/coregrind/m_dispatch/dispatch-amd64-linux.S 2011-05-28 16:58:45 UTC (rev 11784)
+++ trunk/coregrind/m_dispatch/dispatch-amd64-linux.S 2011-05-28 17:07:53 UTC (rev 11785)
@@ -121,12 +121,9 @@
/* 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 @@
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 @@
/* 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 @@
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) */
Modified: trunk/coregrind/m_dispatch/dispatch-x86-linux.S
===================================================================
--- trunk/coregrind/m_dispatch/dispatch-x86-linux.S 2011-05-28 16:58:45 UTC (rev 11784)
+++ trunk/coregrind/m_dispatch/dispatch-x86-linux.S 2011-05-28 17:07:53 UTC (rev 11785)
@@ -111,7 +111,7 @@
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 @@
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 */
|