From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33196 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJXpc-0000sc-CM for qemu-devel@nongnu.org; Tue, 01 Jun 2010 16:13:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJXpX-0006VL-IP for qemu-devel@nongnu.org; Tue, 01 Jun 2010 16:13:00 -0400 Received: from mail-fx0-f45.google.com ([209.85.161.45]:34677) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJXpX-0006Nu-9Y for qemu-devel@nongnu.org; Tue, 01 Jun 2010 16:12:55 -0400 Received: by mail-fx0-f45.google.com with SMTP id 17so4227877fxm.4 for ; Tue, 01 Jun 2010 13:12:54 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=[192.168.1.2]) by skyserv with esmtp (Exim 4.71) (envelope-from ) id 1OJXpV-0001ck-76 for qemu-devel@nongnu.org; Wed, 02 Jun 2010 00:12:53 +0400 From: "Igor V. Kovalenko" Date: Wed, 02 Jun 2010 00:12:53 +0400 Message-ID: <20100601201253.5908.41570.stgit@skyserv> In-Reply-To: <20100601200434.5908.19495.stgit@skyserv> References: <20100601200434.5908.19495.stgit@skyserv> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 7/8] sparc64: fix udiv and sdiv insns List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Igor V. Kovalenko - truncate second operand to 32bit Signed-off-by: Igor V. Kovalenko --- target-sparc/op_helper.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index 83067ae..4c5155f 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -3307,7 +3307,7 @@ target_ulong helper_udiv(target_ulong a, target_ulong b) uint32_t x1; x0 = (a & 0xffffffff) | ((int64_t) (env->y) << 32); - x1 = b; + x1 = (b & 0xffffffff); if (x1 == 0) { raise_exception(TT_DIV_ZERO); @@ -3329,7 +3329,7 @@ target_ulong helper_sdiv(target_ulong a, target_ulong b) int32_t x1; x0 = (a & 0xffffffff) | ((int64_t) (env->y) << 32); - x1 = b; + x1 = (b & 0xffffffff); if (x1 == 0) { raise_exception(TT_DIV_ZERO);