From b1d64f9231c9e7370b5d2cdddce6c78d9bb5114e Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Sat, 17 Sep 2011 15:46:59 +0000 Subject: [PATCH] Dispatcher tweak. Saves ALU operation. Suggested by Julian Seward. Implemented by Christian Borntraeger (borntraeger@de.ibm.com). See bugzilla #274378 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12036 --- NEWS | 2 ++ coregrind/m_dispatch/dispatch-s390x-linux.S | 24 ++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index ba68895ce2..a13b290f6c 100644 --- a/NEWS +++ b/NEWS @@ -277,6 +277,8 @@ fixed 281883 - s390x: Fix system call wrapper for "clone". +274378 - s390x: Various dispatcher tweaks + Release 3.6.1 (16 February 2011) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/coregrind/m_dispatch/dispatch-s390x-linux.S b/coregrind/m_dispatch/dispatch-s390x-linux.S index bc3b0fd84b..b04d4fe6b1 100644 --- a/coregrind/m_dispatch/dispatch-s390x-linux.S +++ b/coregrind/m_dispatch/dispatch-s390x-linux.S @@ -154,11 +154,15 @@ run_innerloop__dispatch_unprofiled: and sizeof(FastCacheEntry) == 16 offset = ((addr >> 1) & VG_TT_FAST_MASK) << 4 + which is + offset = ((addr & (VG_TT_FAST_MASK << 1) ) << 3 */ - lghi %r5,VG_TT_FAST_MASK - srlg %r7, %r2,1 /* next guest addr >> 1*/ - ngr %r7,%r5 - sllg %r7,%r7,4 + llill %r5,( VG_TT_FAST_MASK << 1) & 0xffff +#if ((( VG_TT_FAST_MASK << 1) & 0xffff0000) >> 16 != 0) + iilh %r5,(( VG_TT_FAST_MASK << 1) & 0xffff0000) >> 16 +#endif + ngr %r5,%r2 + sllg %r7,%r5,3 /* Set the return address to the beginning of the loop here to have some instruction between setting r7 and using it as an @@ -207,11 +211,15 @@ run_innerloop__dispatch_profiled: and sizeof(FastCacheEntry) == 16 offset = ((addr >> 1) & VG_TT_FAST_MASK) << 4 + which is + offset = ((addr & (VG_TT_FAST_MASK << 1) ) << 3 */ - lghi %r5,VG_TT_FAST_MASK - srlg %r7,%r2,1 /* next guest addr >> 1*/ - ngr %r7,%r5 - sllg %r7,%r7,4 + llill %r5,( VG_TT_FAST_MASK << 1) & 0xffff +#if ((( VG_TT_FAST_MASK << 1) & 0xffff0000) >> 16 != 0) + iilh %r5,(( VG_TT_FAST_MASK << 1) & 0xffff0000) >> 16 +#endif + ngr %r5,%r2 + sllg %r7,%r5,3 /* Set the return address to the beginning of the loop here to have some instruction between setting r7 and using it as an -- 2.47.3