From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52711 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5Doq-00063S-LC for qemu-devel@nongnu.org; Mon, 11 Oct 2010 04:33:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P5Dcb-0007q5-Sx for qemu-devel@nongnu.org; Mon, 11 Oct 2010 04:20:38 -0400 Received: from mail-ew0-f45.google.com ([209.85.215.45]:53344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P5Dcb-0007o3-OZ for qemu-devel@nongnu.org; Mon, 11 Oct 2010 04:20:37 -0400 Received: by mail-ew0-f45.google.com with SMTP id 26so1961613ewy.4 for ; Mon, 11 Oct 2010 01:20:37 -0700 (PDT) From: Johan Bengtsson Date: Mon, 11 Oct 2010 10:18:57 +0200 Message-Id: <1286785138-20401-2-git-send-email-teofrastius@gmail.com> In-Reply-To: <1286785138-20401-1-git-send-email-teofrastius@gmail.com> References: <1286785138-20401-1-git-send-email-teofrastius@gmail.com> Subject: [Qemu-devel] [PATCH 2/4] 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