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) From: Johan Bengtsson Date: Thu, 16 Sep 2010 13:55:06 +0200 Message-Id: <1284638106-6751-2-git-send-email-teofrastius@gmail.com> In-Reply-To: <1284638106-6751-1-git-send-email-teofrastius@gmail.com> References: <1284638106-6751-1-git-send-email-teofrastius@gmail.com> Subject: [Qemu-devel] [PATCH 2/2] target-arm: Fix mixup in decoding of saturating add and sub List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Johan Bengtsson 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); -- 1.7.0.4