From patchwork Mon Sep 14 13:52:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 53585 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 330A92056A for ; Mon, 14 Sep 2015 14:05:15 +0000 (UTC) Received: by wisv5 with SMTP id v5sf41798670wis.0 for ; Mon, 14 Sep 2015 07:05:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=fZ87NFqDa2pc9znYZpEK5Oip72KyW84EVY8/g6SP2mI=; b=iKvE4ZMQHzNwFZdkovi1+rkojOqKuRM3rl1a4SaPbvBLlJsQ87MK/bCuLY18h0RPtL JANJ+xg5ldlBM3RsRYZ3P7DCchyTstHiFByYBgNM3s96lXoaB7B8J7ziugdumRHqdoU3 0tNMyR68ttVdL9+WXMlZ73d4QfazYYqUcY6CLstG0730UUgMvg3cUtWFkyBoG7ObVNgw piJKTLYFGjuUIyM5aO8H56EieFTqnH3Ls3k+eiyd3lFNVe4NfdJv+Tfz8rNN3G7lLM/z eEC6zyuMEJGHHyf5/OTtkAeNyRkwwzdi5uj8wjLq+Ux/BUG+si1175pL6gFJVtSYNkUC LacA== X-Gm-Message-State: ALoCoQn3pD50dIAeBclL/WX0VcE1Cef1RUFp8Z/O/olpfe/PxcAb+tvF08gZnoHNE7a28ryt4kGM X-Received: by 10.180.81.165 with SMTP id b5mr2949906wiy.1.1442239514523; Mon, 14 Sep 2015 07:05:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.37 with SMTP id x5ls654424lax.50.gmail; Mon, 14 Sep 2015 07:05:14 -0700 (PDT) X-Received: by 10.152.22.102 with SMTP id c6mr3033395laf.16.1442239514140; Mon, 14 Sep 2015 07:05:14 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id h5si9831181laf.45.2015.09.14.07.05.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 07:05:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbmp1 with SMTP id mp1so67992817lbb.1 for ; Mon, 14 Sep 2015 07:05:14 -0700 (PDT) X-Received: by 10.152.161.232 with SMTP id xv8mr14503034lab.32.1442239513999; Mon, 14 Sep 2015 07:05:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1218892lbq; Mon, 14 Sep 2015 07:05:12 -0700 (PDT) X-Received: by 10.50.138.76 with SMTP id qo12mr18840193igb.38.1442239512492; Mon, 14 Sep 2015 07:05:12 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id ru4si8166372igb.32.2015.09.14.07.05.11 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 14 Sep 2015 07:05:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:41077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbUNb-0007EN-8Q for patch@linaro.org; Mon, 14 Sep 2015 10:05:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbUCD-0004kv-VF for qemu-devel@nongnu.org; Mon, 14 Sep 2015 09:53:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbUCC-0000FG-IG for qemu-devel@nongnu.org; Mon, 14 Sep 2015 09:53:25 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:35073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbUCC-00005c-C0 for qemu-devel@nongnu.org; Mon, 14 Sep 2015 09:53:24 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZbUBz-0007sq-Fl for qemu-devel@nongnu.org; Mon, 14 Sep 2015 14:53:11 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 14 Sep 2015 14:52:52 +0100 Message-Id: <1442238791-30255-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1442238791-30255-1-git-send-email-peter.maydell@linaro.org> References: <1442238791-30255-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 05/24] target-arm: Handle always condition codes within arm_test_cc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Richard Henderson Handling this with TCG_COND_ALWAYS will allow these unlikely cases to be handled without special cases in the rest of the translator. The TCG optimizer ought to be able to reduce these ALWAYS conditions completely. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 1441909103-24666-4-git-send-email-rth@twiddle.net Signed-off-by: Peter Maydell --- target-arm/translate.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target-arm/translate.c b/target-arm/translate.c index 7d2e984..84a21ac 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -804,6 +804,14 @@ void arm_test_cc(DisasCompare *cmp, int cc) tcg_gen_andc_i32(value, cpu_ZF, value); break; + case 14: /* always */ + case 15: /* always */ + /* Use the ALWAYS condition, which will fold early. + * It doesn't matter what we use for the value. */ + cond = TCG_COND_ALWAYS; + value = cpu_ZF; + goto no_invert; + default: fprintf(stderr, "Bad condition code 0x%x\n", cc); abort(); @@ -813,6 +821,7 @@ void arm_test_cc(DisasCompare *cmp, int cc) cond = tcg_invert_cond(cond); } + no_invert: cmp->cond = cond; cmp->value = value; cmp->value_global = global;