]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix ppc64-linux dispatcher following r6582.
authorJulian Seward <jseward@acm.org>
Sun, 11 Feb 2007 09:09:20 +0000 (09:09 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 11 Feb 2007 09:09:20 +0000 (09:09 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6583

coregrind/m_dispatch/dispatch-ppc32-linux.S
coregrind/m_dispatch/dispatch-ppc64-linux.S

index 53f92ca9e599b58c0697ffd74974131efe973701..0523bc35cf6b8af5ca0cde5981f1c23d38f465b6 100644 (file)
@@ -249,8 +249,8 @@ VG_(run_innerloop__dispatch_unprofiled):
                44(r1) (=orig guest_state)
        */
        /* Has the guest state pointer been messed with?  If yes, exit.
-           Also set up & VG_(tt_fast) to give the load time to come
-           through. */
+           Also set up & VG_(tt_fast) early in an attempt at better
+           scheduling. */
         lwz     9,44(1)              /* original guest_state ptr */
         lis    5,VG_(tt_fast)@ha
         addi    5,5,VG_(tt_fast)@l   /* & VG_(tt_fast) */
@@ -266,7 +266,7 @@ VG_(run_innerloop__dispatch_unprofiled):
         beq    counter_is_zero
 
         /* try a fast lookup in the translation cache */
-        /* r4 = VG_TT_FAST_HASH(addr)           * sizeof(ULong*)
+        /* 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#] */
@@ -303,8 +303,8 @@ VG_(run_innerloop__dispatch_profiled):
                44(r1) (=orig guest_state)
        */
        /* Has the guest state pointer been messed with?  If yes, exit.
-           Also set up & VG_(tt_fast) to give the load time to come
-           through. */
+           Also set up & VG_(tt_fast) early in an attempt at better
+           scheduling. */
         lwz     9,44(1)              /* original guest_state ptr */
         lis    5,VG_(tt_fast)@ha
         addi    5,5,VG_(tt_fast)@l   /* & VG_(tt_fast) */
@@ -320,7 +320,7 @@ VG_(run_innerloop__dispatch_profiled):
         beq    counter_is_zero
 
         /* try a fast lookup in the translation cache */
-        /* r4 = VG_TT_FAST_HASH(addr)           * sizeof(ULong*)
+        /* 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#] */
@@ -330,7 +330,7 @@ VG_(run_innerloop__dispatch_profiled):
         bne     fast_lookup_failed
 
         /* increment bb profile counter */
-       srwi    4,4,1   /* entry# * 4 */
+       srwi    4,4,1   /* entry# * sizeof(UInt*) */
         addis   6,4,VG_(tt_fastN)@ha
         lwz     9,VG_(tt_fastN)@l(6)
         lwz     8,0(9)
index 581e6c61d8df253f8e90675601b145dc67a3fecf..e4c328a575755495338f96f5dbf02a8305644e90 100644 (file)
@@ -8,7 +8,7 @@
   This file is part of Valgrind, a dynamic binary instrumentation
   framework.
 
-  Copyright (C) 2005 Cerion Armour-Brown <cerion@open-works.co.uk>
+  Copyright (C) 2005-2007 Cerion Armour-Brown <cerion@open-works.co.uk>
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
@@ -269,10 +269,12 @@ VG_(run_innerloop__dispatch_unprofiled):
                152(r1) (=orig guest_state)
                144(r1) (=var space for FPSCR[RM])
        */
-
-       /* Has the guest state ptr been messed with?  If yes, exit. */
-        ld      5,152(1)        /* original guest_state ptr */
-        cmpd    5,31
+       /* Has the guest state pointer been messed with?  If yes, exit.
+           Also set up & VG_(tt_fast) early in an attempt at better
+           scheduling. */
+        ld      9,152(1)        /* original guest_state ptr */
+       ld      5, .tocent__vgPlain_tt_fast@toc(2) /* &VG_(tt_fast) */
+        cmpd    9,31
         bne    .gsp_changed
 
         /* save the jump address in the guest state */
@@ -284,23 +286,18 @@ VG_(run_innerloop__dispatch_unprofiled):
         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@toc(2)
-       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:
@@ -308,7 +305,6 @@ VG_(run_innerloop__dispatch_unprofiled):
            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*/
@@ -340,10 +336,12 @@ VG_(run_innerloop__dispatch_profiled):
                152(r1) (=orig guest_state)
                144(r1) (=var space for FPSCR[RM])
        */
-
-       /* Has the guest state ptr been messed with?  If yes, exit. */
-        ld      5,152(1)        /* original guest_state ptr */
-        cmpd    5,31
+       /* Has the guest state pointer been messed with?  If yes, exit.
+           Also set up & VG_(tt_fast) early in an attempt at better
+           scheduling. */
+        ld      9,152(1)        /* original guest_state ptr */
+       ld      5, .tocent__vgPlain_tt_fast@toc(2) /* &VG_(tt_fast) */
+        cmpd    9,31
         bne    .gsp_changed
 
         /* save the jump address in the guest state */
@@ -355,30 +353,26 @@ VG_(run_innerloop__dispatch_profiled):
         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@toc(2)
-       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 VG_(tt_fastN)[x] (=32bit val) */
-       ld      7, .tocent__vgPlain_tt_fastN@toc(2)
-       ldx     7, 7,4     /* r7 = VG_(tt_fastN)[VG_TT_HASH(addr)] */
-       lwz     6, 0(7)    /* *(UInt*)r7 ++ */
+       ld      9, .tocent__vgPlain_tt_fastN@toc(2)
+       srdi    4, 4,1     /* entry# * sizeof(UInt*) */
+       ldx     9, 9,4     /* r7 = VG_(tt_fastN)[VG_TT_HASH(addr)] */
+       lwz     6, 0(9)    /* *(UInt*)r7 ++ */
        addi    6, 6,1
-       stw     6, 0(7)
-
-        /* 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
+       stw     6, 0(9)
 
-       /* run the translation */
+        /* Found a match.  Call .host. */
+        mtctr   7
         bctrl
 
         /* On return from guest code:
@@ -386,7 +380,6 @@ VG_(run_innerloop__dispatch_profiled):
            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*/