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: 394 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:42:15 -0000 Delivered-To: patches@linaro.org Received: by 10.224.60.68 with SMTP id o4cs79759qah; Sun, 6 Mar 2011 12:32:13 -0800 (PST) Received: by 10.227.202.73 with SMTP id fd9mr2729555wbb.72.1299443532401; Sun, 06 Mar 2011 12:32:12 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk [81.2.115.146]) by mx.google.com with ESMTPS id g26si3176562wbe.56.2011.03.06.12.32.11 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Mar 2011 12:32:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk 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 Cc: patches@linaro.org, Aurelien Jarno Subject: [PATCH v2] target-arm: Set carry flag correctly for Thumb2 ORNS 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 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 */