From patchwork Sun Mar 6 20:32:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 85593 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]) by ozlabs.org (Postfix) with ESMTP id 8C16AB7100 for ; Mon, 7 Mar 2011 07:40:33 +1100 (EST) Received: from localhost ([127.0.0.1]:38649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwKdM-0000js-S2 for incoming@patchwork.ozlabs.org; Sun, 06 Mar 2011 15:32:56 -0500 Received: from [140.186.70.92] (port=54906 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwKcl-0008GB-Bk for qemu-devel@nongnu.org; Sun, 06 Mar 2011 15:32:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwKck-0002Eb-1F for qemu-devel@nongnu.org; Sun, 06 Mar 2011 15:32:19 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:56615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwKcj-0002BH-RG for qemu-devel@nongnu.org; Sun, 06 Mar 2011 15:32:17 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1PwKcb-0003RU-7H; Sun, 06 Mar 2011 20:32:09 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Sun, 6 Mar 2011 20:32:09 +0000 Message-Id: <1299443529-13209-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Aurelien Jarno , patches@linaro.org Subject: [Qemu-devel] [PATCH v2] target-arm: Set carry flag correctly for Thumb2 ORNS 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 code for Thumb2 ORNS (or negated and set flags) was trashing a TCG input register which was needed later for use in calculating flags, with the effect that the carry flag was always set with the wrong sense. Fix this by using the TCG orc op instead of separate not and or ops. Signed-off-by: Peter Maydell --- Change from v1: use orc as suggested by Aurelien target-arm/translate.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index dbd958b..dd56ac6 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -7326,8 +7326,7 @@ gen_thumb2_data_op(DisasContext *s, int op, int conds, uint32_t shifter_out, TCG logic_cc = conds; break; case 3: /* orn */ - tcg_gen_not_i32(t1, t1); - tcg_gen_or_i32(t0, t0, t1); + tcg_gen_orc_i32(t0, t0, t1); logic_cc = conds; break; case 4: /* eor */