From patchwork Tue Jun 1 20:12:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Igor V. Kovalenko" X-Patchwork-Id: 54300 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3DB12B7D1D for ; Wed, 2 Jun 2010 06:25:05 +1000 (EST) Received: from localhost ([127.0.0.1]:54300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJY1G-0000O0-Qq for incoming@patchwork.ozlabs.org; Tue, 01 Jun 2010 16:25:03 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:subject:to:from:date :message-id:in-reply-to:references:user-agent:mime-version :content-type:content-transfer-encoding; bh=y2/RQbaA2JRGg0CdWIin4wv+NuAWViybd5upZMpSzvU=; b=VWYUnZIU0LZP8MiKsfo+L/DesT0hmxalDmphhdbbTngL3O+yBXlzW1xAt4xyeLmlrO PmdIs5wzAK9RqWUgaUbu4UgI6xBfRvumUL8ON/ClRaHeSU168mVCsmOHyrgeZbW2DZne idaND08gA9/JDVwXc6z7r+ikCtyDmNpfcgLZU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:to:from:date:message-id:in-reply-to:references:user-agent :mime-version:content-type:content-transfer-encoding; b=glswN6wq7pwoi/Cwr0bKX9UPIaZwJ/2NzQYLdegE/yTKKYJiNeGS278TBTac3JVHEO eiRe6QoYT/i0AnO7i1DtQ5Kn0uvZybXNPLc3ongN2/fye+KsKJWyd9RAFGyiJibtlOUV pCiBD/b4RJMtr3kazaQuNNPTKrPvBK4JeyU2A= Received: by 10.223.24.130 with SMTP id v2mr7612296fab.61.1275423174720; Tue, 01 Jun 2010 13:12:54 -0700 (PDT) Received: from skyserv ([87.255.14.75]) by mx.google.com with ESMTPS id 13sm48642733fad.7.2010.06.01.13.12.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); 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 To: qemu-devel@nongnu.org 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> User-Agent: StGit/0.15 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 7/8] sparc64: fix udiv and sdiv insns X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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);