From patchwork Thu Jan 24 04:03:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 215255 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C2C2D2C007C for ; Thu, 24 Jan 2013 16:55:14 +1100 (EST) Received: from localhost ([::1]:36016 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyE4h-0004Cm-Gk for incoming@patchwork.ozlabs.org; Wed, 23 Jan 2013 23:06:03 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyE3L-0002Wz-JN for qemu-devel@nongnu.org; Wed, 23 Jan 2013 23:04:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TyE38-0004Ls-Va for qemu-devel@nongnu.org; Wed, 23 Jan 2013 23:04:39 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:43722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyE38-0004Li-NS for qemu-devel@nongnu.org; Wed, 23 Jan 2013 23:04:26 -0500 Received: by mail-pa0-f48.google.com with SMTP id fa1so5227665pad.35 for ; Wed, 23 Jan 2013 20:04:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=D3c7MD/m0nKmlXc5S+sz977OIHjsJSzIYXb2MziLVPg=; b=XXGlGWfcvbs3YARWll3g+o/eSJfeqjmyrIQIGYEIKHqPXta8hwFQ3Y6P72QhTiRlTG mantTEBZAPC84+pR81yysCse2cBAr8eddS5X3zNZ4/Rth2T865IbCyBeXFL4jvya44YD 8ESnwgEDoVYjfzPABb+JDMQ7ia9Fv6+F3fBPOq4qh+nguCbzhtCNi4W4yW3tfYV2ccNS iu0CmmUcwNiF1qjAEaaG4D72b+AGvn6LiIq000wV8rrrl7rhvxP+C/GYt768Ug/q9uiM WY40hGKjuINEJNeyR7MnCcKJzKMfFHHWbNZcyABhfCsayRikwHIJyzdTQdP2/2tP713i 4PrA== X-Received: by 10.68.189.35 with SMTP id gf3mr1433797pbc.69.1359000266082; Wed, 23 Jan 2013 20:04:26 -0800 (PST) Received: from anchor.twiddle.home (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPS id ot3sm14027480pbb.38.2013.01.23.20.04.24 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 23 Jan 2013 20:04:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 23 Jan 2013 20:03:09 -0800 Message-Id: <1359000221-19834-26-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1359000221-19834-1-git-send-email-rth@twiddle.net> References: <1359000221-19834-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.48 Cc: Blue Swirl , Paolo Bonzini Subject: [Qemu-devel] [PATCH 25/57] target-i386: optimize setbe 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This is looking at EFLAGS, but it can do so more efficiently with setcond. Reviewed-by: Blue Swirl Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 85be697..2cf668b 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -1055,10 +1055,9 @@ static void gen_setcc_slow(DisasContext *s, int jcc_op, TCGv reg, bool inv) break; case JCC_BE: gen_compute_eflags(s); - tcg_gen_shri_tl(reg, cpu_cc_src, 6); - tcg_gen_or_tl(reg, reg, cpu_cc_src); - tcg_gen_andi_tl(reg, reg, 1); - break; + tcg_gen_andi_tl(reg, cpu_cc_src, CC_Z | CC_C); + tcg_gen_setcondi_tl(inv ? TCG_COND_EQ : TCG_COND_NE, reg, reg, 0); + return; case JCC_S: gen_compute_eflags_s(s, reg, inv); inv = false;