|
From: <sv...@va...> - 2006-10-13 00:39:22
|
Author: sewardj
Date: 2006-10-13 01:39:18 +0100 (Fri, 13 Oct 2006)
New Revision: 6215
Log:
Make the profiling dispatcher work.
Modified:
branches/AIX5/coregrind/m_dispatch/dispatch-ppc64-aix5.S
Modified: branches/AIX5/coregrind/m_dispatch/dispatch-ppc64-aix5.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/AIX5/coregrind/m_dispatch/dispatch-ppc64-aix5.S 2006-10-12 1=
8:09:58 UTC (rev 6214)
+++ branches/AIX5/coregrind/m_dispatch/dispatch-ppc64-aix5.S 2006-10-13 0=
0:39:18 UTC (rev 6215)
@@ -62,6 +62,8 @@
.tc vgPlain_machine_ppc64_has_VMX[TC],vgPlain_machine_ppc64_has_VMX[=
RW]
tocent__vgPlain_tt_fast:
.tc vgPlain_tt_fast[TC],vgPlain_tt_fast[RW]
+tocent__vgPlain_tt_fastN:
+ .tc vgPlain_tt_fast[TC],vgPlain_tt_fastN[RW]
.csect .text[PR]
.align 2
.globl vgPlain_run_innerloop
@@ -303,47 +305,48 @@
=20
.globl VG_(run_innerloop__dispatch_profiled)
VG_(run_innerloop__dispatch_profiled):
- trap
-#if 0
/* At entry: Live regs:
- r1 (=3Dsp)
+ r1 (=3Dsp)
r3 (=3DCIA =3D next guest address)
r29 (=3Ddispatch_ctr)
r31 (=3Dguest_state)
Stack state:
- 44(r1) (=3Dorig guest_state)
+ 256(r1) (=3Dorig guest_state)
*/
=20
/* Has the guest state pointer been messed with? If yes, exit. */
- lwz 5,44(1) /* original guest_state ptr */
- cmpw 5,31
+ ld 5,256(1) /* original guest_state ptr */
+ cmpd 5,31
bne gsp_changed
=20
/* save the jump address in the guest state */
- stw 3,OFFSET_ppc32_CIA(31)
+ std 3,OFFSET_ppc64_CIA(31)
=20
/* Are we out of timeslice? If yes, defer to scheduler. */
- subi 29,29,1
- cmplwi 29,0
+ addi 29,29,-1
+ cmplwi 29,0 /* yes, lwi - is 32-bit */
beq counter_is_zero
=20
/* try a fast lookup in the translation cache */
/* r4 =3D VG_TT_FAST_HASH(addr) * sizeof(ULong*)
- =3D ((r3 >>u 2) & VG_TT_FAST_MASK) << 2 */
- rlwinm 4,3, 0, 32-2-VG_TT_FAST_BITS, 31-2=20
- addis 5,4,VG_(tt_fast)@ha
- lwz 5,VG_(tt_fast)@l(5)
- lwz 6,4(5) /* big-endian, so comparing 2nd 32bit word */
- cmpw 3,6
+ =3D ((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 =3D &tt_fast */
+
+ ldx 5,5,4 /* r5 =3D VG_(tt_fast)[VG_TT_FAST_HASH(addr)] */
+ ld 6,0(5) /* r6 =3D (r5)->orig_addr */
+ cmpd 3,6
bne fast_lookup_failed
=20
/* increment bb profile counter */
- addis 6,4,VG_(tt_fastN)@ha
- lwz 7,VG_(tt_fastN)@l(6)
- lwz 8,0(7)
- addi 8,8,1
- stw 8,0(7)
-
+ ld 9,tocent__vgPlain_tt_fastN(2) /* r9 =3D &tt_fastN */
+ ldx 7,9,4 /* r7 =3D tt_fastN[r4] */
+ lwz 10,0(7)
+ addi 10,10,1
+ stw 10,0(7)
+=09
/* Found a match. Call tce[1], which is 8 bytes along, since
each tce element is a 64-bit int. */
addi 8,5,8
@@ -361,7 +364,6 @@
/* start over */
b VG_(run_innerloop__dispatch_profiled)
/*NOTREACHED*/
-#endif
=20
/*----------------------------------------------------*/
/*--- exit points ---*/
|