From patchwork Thu Sep 16 11:55:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Bengtsson X-Patchwork-Id: 64960 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 D6C711007D2 for ; Thu, 16 Sep 2010 21:57:55 +1000 (EST) Received: from localhost ([127.0.0.1]:57617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwD68-000668-S3 for incoming@patchwork.ozlabs.org; Thu, 16 Sep 2010 07:57:52 -0400 Received: from [140.186.70.92] (port=33686 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwD5F-00064K-Rt for qemu-devel@nongnu.org; Thu, 16 Sep 2010 07:56:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OwD5E-0002ZN-L0 for qemu-devel@nongnu.org; Thu, 16 Sep 2010 07:56:57 -0400 Received: from mail-ew0-f45.google.com ([209.85.215.45]:44481) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwD5E-0002ZI-Gj for qemu-devel@nongnu.org; Thu, 16 Sep 2010 07:56:56 -0400 Received: by ewy27 with SMTP id 27so594600ewy.4 for ; Thu, 16 Sep 2010 04:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=6aUxElC3IX5ysMgSY7+/Dv4EotefWGGE0DJ7Yv1Fffg=; b=EuYDWIpxBYb4ffsxOacMUAXTHMaTeAeNXZB43RtVqtAO78mkpqvuYyN9KthFqO+KTz cPRXsh+vNGlcTnqqrRfRd3qP300YP73MVngofBR2ML5KxSsS94MbTk8O5L1F1bwlXr/7 KrToQSnnRq+OPvx/ciy18SHcDna0XU3pac1bc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=eOiCRmzy4ZgqaNou9QYbzLNfaJFuFwPenm+oIUPj0KxFYSqCRhN9qWOqQ3vXrGVKPZ qX7FdaB8WkxUI5y7CbihXaKt34IVJZjWIbVAtR0wIyjyL4u3SBUjPGiwplKxDXCU6mHZ p5LK/R/GV+9RiYZdI4Ue4qKKCuHUIFnKf0mjE= Received: by 10.213.25.144 with SMTP id z16mr5223344ebb.40.1284638215555; Thu, 16 Sep 2010 04:56:55 -0700 (PDT) Received: from localhost.localdomain (store.iar.se [213.136.49.54]) by mx.google.com with ESMTPS id a48sm3792876eei.7.2010.09.16.04.56.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 16 Sep 2010 04:56:54 -0700 (PDT) From: Johan Bengtsson To: qemu-devel@nongnu.org Date: Thu, 16 Sep 2010 13:55:06 +0200 Message-Id: <1284638106-6751-2-git-send-email-teofrastius@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1284638106-6751-1-git-send-email-teofrastius@gmail.com> References: <1284638106-6751-1-git-send-email-teofrastius@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Johan Bengtsson Subject: [Qemu-devel] [PATCH 2/2] target-arm: Fix mixup in decoding of saturating add and sub 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 The thumb2 decoder contained a mixup between the bit controlling doubling and the bit controlling if the operation was an add or a sub. Signed-off-by: Johan Bengtsson --- target-arm/translate.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index f39efc5..b530a53 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -7713,9 +7713,9 @@ static int disas_thumb2_insn(CPUState *env, DisasContext *s, uint16_t insn_hw1) /* Saturating add/subtract. */ tmp = load_reg(s, rn); tmp2 = load_reg(s, rm); - if (op & 2) - gen_helper_double_saturate(tmp, tmp); if (op & 1) + gen_helper_double_saturate(tmp, tmp); + if (op & 2) gen_helper_sub_saturate(tmp, tmp2, tmp); else gen_helper_add_saturate(tmp, tmp, tmp2);