From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIaxi-0001gc-3F for qemu-devel@nongnu.org; Fri, 24 Jul 2015 07:16:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIaxg-0001OG-DP for qemu-devel@nongnu.org; Fri, 24 Jul 2015 07:16:22 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:51658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIaxg-0001Nw-8P for qemu-devel@nongnu.org; Fri, 24 Jul 2015 07:16:20 -0400 Received: from weber.rr44.fr ([2001:bc8:30d7:120:7e05:7ff:fe0d:f152]) by hall.aurel32.net with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1ZIaxf-0005iz-IU for qemu-devel@nongnu.org; Fri, 24 Jul 2015 13:16:19 +0200 Received: from aurel32 by weber.rr44.fr with local (Exim 4.85) (envelope-from ) id 1ZIaxe-0006rJ-SM for qemu-devel@nongnu.org; Fri, 24 Jul 2015 13:16:18 +0200 Date: Fri, 24 Jul 2015 13:16:18 +0200 From: Aurelien Jarno Message-ID: <20150724111618.GC30591@aurel32.net> References: <1437736471-26124-1-git-send-email-aurelien@aurel32.net> <1437736471-26124-6-git-send-email-aurelien@aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437736471-26124-6-git-send-email-aurelien@aurel32.net> Subject: Re: [Qemu-devel] [PATCH 5/5] target-sh4: improve shad instruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 2015-07-24 13:14, Aurelien Jarno wrote: > The SH4 shad instruction can shift in both direction, depending on the > sign of the shift. This is currently implemented using branches, which > is not really efficient and prevents the optimizer to do its job. In > practice it is often used with a constant loaded in a register just > before. > > Simplify the implementation by computing both the value shifted to the > left and to the right, and then selecting the correct one with a > movcond. As with a negative value the shift amount can go up to 32 which > is undefined, we shift the value in two steps. > > Signed-off-by: Aurelien Jarno > --- > target-sh4/translate.c | 53 +++++++++++++++++++++----------------------------- > 1 file changed, 22 insertions(+), 31 deletions(-) Despite the subject, this patch is of course also for 2.5. -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net