|
From: <sv...@va...> - 2009-11-30 09:06:09
|
Author: sewardj
Date: 2009-11-30 09:05:50 +0000 (Mon, 30 Nov 2009)
New Revision: 10959
Log:
On ARM, change the hash function for the fast translation table so
that we can use all of the entries instead of only 1/4 of them.
Modified:
branches/ARM/coregrind/m_dispatch/dispatch-arm-linux.S
branches/ARM/coregrind/pub_core_transtab_asm.h
Modified: branches/ARM/coregrind/m_dispatch/dispatch-arm-linux.S
===================================================================
--- branches/ARM/coregrind/m_dispatch/dispatch-arm-linux.S 2009-11-27 10:08:49 UTC (rev 10958)
+++ branches/ARM/coregrind/m_dispatch/dispatch-arm-linux.S 2009-11-30 09:05:50 UTC (rev 10959)
@@ -97,7 +97,7 @@
/* try a fast lookup in the translation cache */
// r0 = next guest, r1,r2,r3 scratch
ldr r1, =VG_TT_FAST_MASK // r1 = VG_TT_FAST_MASK
- and r2, r1, r0 // r2 = entry #
+ and r2, r1, r0, LSR #2 // r2 = entry #
ldr r1, =VG_(tt_fast) // r1 = &tt_fast[0]
add r1, r1, r2, LSL #3 // r1 = &tt_fast[entry#]
ldr r3, [r1, #0] /* .guest */
@@ -142,7 +142,7 @@
/* try a fast lookup in the translation cache */
// r0 = next guest, r1,r2,r3 scratch
ldr r1, =VG_TT_FAST_MASK // r1 = VG_TT_FAST_MASK
- and r2, r1, r0 // r2 = entry #
+ and r2, r1, r0, LSR #2 // r2 = entry #
ldr r1, =VG_(tt_fast) // r1 = &tt_fast[0]
add r1, r1, r2, LSL #3 // r1 = &tt_fast[entry#]
ldr r3, [r1, #0] /* .guest */
Modified: branches/ARM/coregrind/pub_core_transtab_asm.h
===================================================================
--- branches/ARM/coregrind/pub_core_transtab_asm.h 2009-11-27 10:08:49 UTC (rev 10958)
+++ branches/ARM/coregrind/pub_core_transtab_asm.h 2009-11-30 09:05:50 UTC (rev 10959)
@@ -40,17 +40,20 @@
On ppc32/ppc64, the bottom two bits of instruction addresses are
zero, which means that function causes only 1/4 of the entries to
ever be used. So instead the function is '(address >>u
- 2)[VG_TT_FAST_BITS-1 : 0]' on those targets. */
+ 2)[VG_TT_FAST_BITS-1 : 0]' on those targets.
+ On ARM we do like ppc32/ppc64, although that will have to be
+ revisited when we come to implement Thumb. */
+
#define VG_TT_FAST_BITS 15
#define VG_TT_FAST_SIZE (1 << VG_TT_FAST_BITS)
#define VG_TT_FAST_MASK ((VG_TT_FAST_SIZE) - 1)
/* This macro isn't usable in asm land; nevertheless this seems
like a good place to put it. */
-#if defined(VGA_x86) || defined(VGA_amd64) || defined(VGA_arm)
+#if defined(VGA_x86) || defined(VGA_amd64)
# define VG_TT_FAST_HASH(_addr) ((((UWord)(_addr)) ) & VG_TT_FAST_MASK)
-#elif defined(VGA_ppc32) || defined(VGA_ppc64)
+#elif defined(VGA_ppc32) || defined(VGA_ppc64) || defined(VGA_arm)
# define VG_TT_FAST_HASH(_addr) ((((UWord)(_addr)) >> 2) & VG_TT_FAST_MASK)
#else
# error "VG_TT_FAST_HASH: unknown platform"
|