|
From: <sv...@va...> - 2007-02-20 19:23:29
|
Author: sewardj
Date: 2007-02-20 19:23:19 +0000 (Tue, 20 Feb 2007)
New Revision: 6606
Log:
Make ppc32/64-aix5 work again following recent VG_(tt_fast) rearrangement.
Modified:
trunk/coregrind/m_dispatch/dispatch-ppc32-aix5.S
trunk/coregrind/m_dispatch/dispatch-ppc64-aix5.S
trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S
Modified: trunk/coregrind/m_dispatch/dispatch-ppc32-aix5.S
===================================================================
--- trunk/coregrind/m_dispatch/dispatch-ppc32-aix5.S 2007-02-19 11:51:16 UTC (rev 6605)
+++ trunk/coregrind/m_dispatch/dispatch-ppc32-aix5.S 2007-02-20 19:23:19 UTC (rev 6606)
@@ -267,9 +267,12 @@
128(r1) (=orig guest_state)
*/
- /* Has the guest state pointer been messed with? If yes, exit. */
+ /* Has the guest state pointer been messed with? If yes, exit.
+ Also set up & VG_(tt_fast) early in an attempt at better
+ scheduling. */
lwz 5,128(1) /* original guest_state ptr */
cmpw 5,31
+ lwz 5,tocent__vgPlain_tt_fast(2) /* r5 = &tt_fast */
bne gsp_changed
/* save the jump address in the guest state */
@@ -281,24 +284,17 @@
beq counter_is_zero
/* try a fast lookup in the translation cache */
- /* r4 = VG_TT_FAST_HASH(addr) * sizeof(ULong*)
- = ((r3 >>u 2) & VG_TT_FAST_MASK) << 2 */
- rlwinm 4,3, 0, 32-2-VG_TT_FAST_BITS, 31-2
-
- lwz 5,tocent__vgPlain_tt_fast(2) /* r5 = &tt_fast */
-
- lwzx 5,5,4 /* r5 = tt_fast[r5] */
-
- lwz 6,4(5) /* big-endian, so comparing 2nd 32bit word */
+ /* r4 = VG_TT_FAST_HASH(addr) * sizeof(FastCacheEntry)
+ = ((r3 >>u 2) & VG_TT_FAST_MASK) << 3 */
+ rlwinm 4,3,1, 29-VG_TT_FAST_BITS, 28 /* entry# * 8 */
+ add 5,5,4 /* & VG_(tt_fast)[entry#] */
+ lwz 6,0(5) /* .guest */
+ lwz 7,4(5) /* .host */
cmpw 3,6
bne fast_lookup_failed
- /* Found a match. Call tce[1], which is 8 bytes along, since
- each tce element is a 64-bit int. */
- addi 8,5,8
- mtctr 8
-
- /* run the translation */
+ /* Found a match. Call .host. */
+ mtctr 7
bctrl
/* On return from guest code:
@@ -306,7 +302,6 @@
r31 may be unchanged (guest_state), or may indicate further
details of the control transfer requested to *r3.
*/
-
/* start over */
b VG_(run_innerloop__dispatch_unprofiled)
/*NOTREACHED*/
@@ -325,10 +320,12 @@
Stack state:
128(r1) (=orig guest_state)
*/
-
- /* Has the guest state pointer been messed with? If yes, exit. */
+ /* Has the guest state pointer been messed with? If yes, exit.
+ Also set up & VG_(tt_fast) early in an attempt at better
+ scheduling. */
lwz 5,128(1) /* original guest_state ptr */
cmpw 5,31
+ lwz 5,tocent__vgPlain_tt_fast(2) /* r5 = &tt_fast */
bne gsp_changed
/* save the jump address in the guest state */
@@ -340,31 +337,25 @@
beq counter_is_zero
/* try a fast lookup in the translation cache */
- /* r4 = VG_TT_FAST_HASH(addr) * sizeof(ULong*)
- = ((r3 >>u 2) & VG_TT_FAST_MASK) << 2 */
- rlwinm 4,3, 0, 32-2-VG_TT_FAST_BITS, 31-2
-
- lwz 5,tocent__vgPlain_tt_fast(2) /* r5 = &tt_fast */
-
- lwzx 5,5,4 /* r5 = tt_fast[r4] */
-
- lwz 6,4(5) /* big-endian, so comparing 2nd 32bit word */
+ /* r4 = VG_TT_FAST_HASH(addr) * sizeof(FastCacheEntry)
+ = ((r3 >>u 2) & VG_TT_FAST_MASK) << 3 */
+ rlwinm 4,3,1, 29-VG_TT_FAST_BITS, 28 /* entry# * 8 */
+ add 5,5,4 /* & VG_(tt_fast)[entry#] */
+ lwz 6,0(5) /* .guest */
+ lwz 7,4(5) /* .host */
cmpw 3,6
bne fast_lookup_failed
/* increment bb profile counter */
+ srwi 4,4,1 /* entry# * sizeof(UInt*) */
lwz 9,tocent__vgPlain_tt_fastN(2) /* r9 = &tt_fastN */
- lwzx 7,9,4 /* r7 = tt_fastN[r4] */
- lwz 10,0(7)
+ lwzx 8,9,4 /* r7 = tt_fastN[r4] */
+ lwz 10,0(8)
addi 10,10,1
- stw 10,0(7)
+ stw 10,0(8)
- /* Found a match. Call tce[1], which is 8 bytes along, since
- each tce element is a 64-bit int. */
- addi 8,5,8
- mtctr 8
-
- /* run the translation */
+ /* Found a match. Call .host. */
+ mtctr 7
bctrl
/* On return from guest code:
@@ -372,11 +363,11 @@
r31 may be unchanged (guest_state), or may indicate further
details of the control transfer requested to *r3.
*/
-
/* start over */
- b VG_(run_innerloop__dispatch_profiled)
+ b VG_(run_innerloop__dispatch_unprofiled)
/*NOTREACHED*/
+
/*----------------------------------------------------*/
/*--- exit points ---*/
/*----------------------------------------------------*/
Modified: trunk/coregrind/m_dispatch/dispatch-ppc64-aix5.S
===================================================================
--- trunk/coregrind/m_dispatch/dispatch-ppc64-aix5.S 2007-02-19 11:51:16 UTC (rev 6605)
+++ trunk/coregrind/m_dispatch/dispatch-ppc64-aix5.S 2007-02-20 19:23:19 UTC (rev 6606)
@@ -203,7 +203,7 @@
/* hold dispatch_ctr (NOTE: 32-bit value) in r29 */
ld 5,tocent__vgPlain_dispatch_ctr(2)
- lwz 29,0(5)
+ lwz 29,0(5) /* 32-bit zero-extending load */
/* set host FPU control word to the default mode expected
by VEX-generated code. See comments in libvex.h for
@@ -258,6 +258,7 @@
/* Has the guest state pointer been messed with? If yes, exit. */
ld 5,256(1) /* original guest_state ptr */
cmpd 5,31
+ ld 5,tocent__vgPlain_tt_fast(2) /* &VG_(tt_fast) */
bne gsp_changed
/* save the jump address in the guest state */
@@ -269,24 +270,18 @@
beq counter_is_zero
/* try a fast lookup in the translation cache */
- /* r4 = VG_TT_FAST_HASH(addr) * sizeof(ULong*)
- = ((r3 >>u 2) & VG_TT_FAST_MASK) << 3 */
- rldicl 4,3, 62, 64-VG_TT_FAST_BITS
- sldi 4,4,3
-
- ld 5,tocent__vgPlain_tt_fast(2) /* r5 = &tt_fast */
-
- ldx 5,5,4 /* r5 = VG_(tt_fast)[VG_TT_FAST_HASH(addr)] */
- ld 6,0(5) /* r6 = (r5)->orig_addr */
+ /* r4 = VG_TT_FAST_HASH(addr) * sizeof(FastCacheEntry)
+ = ((r3 >>u 2) & VG_TT_FAST_MASK) << 4 */
+ rldicl 4,3, 62, 64-VG_TT_FAST_BITS /* entry# */
+ sldi 4,4,4 /* entry# * sizeof(FastCacheEntry) */
+ add 5,5,4 /* &VG_(tt_fast)[entry#] */
+ ld 6,0(5) /* .guest */
+ ld 7,8(5) /* .host */
cmpd 3,6
bne fast_lookup_failed
- /* Found a match. Call tce[1], which is 8 bytes along, since
- each tce element is a 64-bit int. */
- addi 8,5,8
- mtctr 8
-
- /* run the translation */
+ /* Found a match. Call .host. */
+ mtctr 7
bctrl
/* On return from guest code:
@@ -294,7 +289,6 @@
r31 may be unchanged (guest_state), or may indicate further
details of the control transfer requested to *r3.
*/
-
/* start over */
b VG_(run_innerloop__dispatch_unprofiled)
/*NOTREACHED*/
@@ -317,6 +311,7 @@
/* Has the guest state pointer been messed with? If yes, exit. */
ld 5,256(1) /* original guest_state ptr */
cmpd 5,31
+ ld 5,tocent__vgPlain_tt_fast(2) /* &VG_(tt_fast) */
bne gsp_changed
/* save the jump address in the guest state */
@@ -328,31 +323,26 @@
beq counter_is_zero
/* try a fast lookup in the translation cache */
- /* r4 = VG_TT_FAST_HASH(addr) * sizeof(ULong*)
- = ((r3 >>u 2) & VG_TT_FAST_MASK) << 3 */
- rldicl 4,3, 62, 64-VG_TT_FAST_BITS
- sldi 4,4,3
-
- ld 5,tocent__vgPlain_tt_fast(2) /* r5 = &tt_fast */
-
- ldx 5,5,4 /* r5 = VG_(tt_fast)[VG_TT_FAST_HASH(addr)] */
- ld 6,0(5) /* r6 = (r5)->orig_addr */
+ /* r4 = VG_TT_FAST_HASH(addr) * sizeof(FastCacheEntry)
+ = ((r3 >>u 2) & VG_TT_FAST_MASK) << 4 */
+ rldicl 4,3, 62, 64-VG_TT_FAST_BITS /* entry# */
+ sldi 4,4,4 /* entry# * sizeof(FastCacheEntry) */
+ add 5,5,4 /* &VG_(tt_fast)[entry#] */
+ ld 6,0(5) /* .guest */
+ ld 7,8(5) /* .host */
cmpd 3,6
bne fast_lookup_failed
/* increment bb profile counter */
ld 9,tocent__vgPlain_tt_fastN(2) /* r9 = &tt_fastN */
- ldx 7,9,4 /* r7 = tt_fastN[r4] */
- lwz 10,0(7)
+ srdi 4,4,1 /* entry# * sizeof(UInt*) */
+ ldx 8,9,4 /* r7 = tt_fastN[r4] */
+ lwz 10,0(8)
addi 10,10,1
- stw 10,0(7)
+ stw 10,0(8)
- /* Found a match. Call tce[1], which is 8 bytes along, since
- each tce element is a 64-bit int. */
- addi 8,5,8
- mtctr 8
-
- /* run the translation */
+ /* Found a match. Call .host. */
+ mtctr 7
bctrl
/* On return from guest code:
@@ -360,7 +350,6 @@
r31 may be unchanged (guest_state), or may indicate further
details of the control transfer requested to *r3.
*/
-
/* start over */
b VG_(run_innerloop__dispatch_profiled)
/*NOTREACHED*/
Modified: trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S
===================================================================
--- trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S 2007-02-19 11:51:16 UTC (rev 6605)
+++ trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S 2007-02-20 19:23:19 UTC (rev 6606)
@@ -204,7 +204,7 @@
/* hold dispatch_ctr (=32bit value) in r29 */
ld 29,.tocent__vgPlain_dispatch_ctr@toc(2)
- lwz 29,0(29)
+ lwz 29,0(29) /* 32-bit zero-extending load */
/* set host FPU control word to the default mode expected
by VEX-generated code. See comments in libvex.h for
|