From nobody Mon Apr 29 08:48:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499887805413956.6462750239323; Wed, 12 Jul 2017 12:30:05 -0700 (PDT) Received: from localhost ([::1]:55428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVNKj-0000Hp-C4 for importer@patchew.org; Wed, 12 Jul 2017 15:30:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVNJz-0008Ro-0p for qemu-devel@nongnu.org; Wed, 12 Jul 2017 15:29:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVNJv-0007tl-RX for qemu-devel@nongnu.org; Wed, 12 Jul 2017 15:29:14 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:36092) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVNJv-0007tW-M7 for qemu-devel@nongnu.org; Wed, 12 Jul 2017 15:29:11 -0400 Received: by mail-qk0-x243.google.com with SMTP id v17so3050958qka.3 for ; Wed, 12 Jul 2017 12:29:11 -0700 (PDT) Received: from bigtime.twiddle.net.com (rrcs-173-197-98-123.west.biz.rr.com. [173.197.98.123]) by smtp.gmail.com with ESMTPSA id d44sm2592186qta.55.2017.07.12.12.29.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2017 12:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=jU3u9VJlv90aJAGPMM/xYFpOrZHzGA7Hp5adnZNf0uU=; b=aWVgm9q8RzarAdem64JoY0MIf3fqj/4x49DrwWXw77glsGar2+GkhZo2XcxqScsQvX 3R9PUHCwSSA+Y425bR/uD0076TJ8hbIqs/1F89noFiIlkQPBPrt0VUPpcUcjGyqJV8iR Oti4Ywjk2LgmolJ5U/Q7POM4qlUzfieevd1+7QQoS3q/V6cYdpHUMEGu0fCZk+EVobQA QL7R8d6h/xEvPuf3dMbmiOnCsRvP1ZrAmaTEcFq5JzLbnzDG/D+fVJXJbYApT14zPBHx gcg31fLUz069irrV20MuYv8K+vb9kc8hjFVTInpxuXkDxSCSlCReOi3OljEWz/1qPtBL YLsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=jU3u9VJlv90aJAGPMM/xYFpOrZHzGA7Hp5adnZNf0uU=; b=qoTlh/pCES2czHqMo4fnczFZNK7n/R/wyZkO+FT0bNxIPFhXYXOnta8PSOb3m793G6 FGM5z7Z2uNndOPAx57vh0zwX9nZltgWIDFErEfQ2ADqaLRfEgcYFiRw3m9hFCpwVhvNU /pK6BI16eR2smZnFMNEQt3t2ObiyE8J1NmjdgGYYtZxaBk4gASLIYPzTrM4DfLj2h+gG UrluEbc3vRaWII5PIrE7FbSNYwTxgYWXACsAV1kEoBefpbZftzGK0SVh6LyuYyIxCqMD 2/yz9xjOQKUP2ZMR+XnlvLVPFgG6S8gy60KQAxdkqyby23lQTvQtZd5m2+PMuh21D0vy UvPw== X-Gm-Message-State: AIVw113cqaOaI4yoe18wCFSZKhME03czW0UROvnM3UWhDHeBdf/x3tx5 1Rkh3qwrW7sVHmoUl0g= X-Received: by 10.55.99.85 with SMTP id x82mr249182qkb.62.1499887750660; Wed, 12 Jul 2017 12:29:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 12 Jul 2017 09:29:02 -1000 Message-Id: <20170712192902.15493-1-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH v2] target/i386: Fix BLSR and BLSI X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ricardo.ribalda@gmail.com, ehabkost@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The implementation of these two instructions was swapped. At the same time, unify the setup of eflags for the insn group. Reported-by: Ricardo Ribalda Delgado Signed-off-by: Richard Henderson --- target/i386/translate.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 9d5f1c3..69d3787 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4031,34 +4031,26 @@ static void gen_sse(CPUX86State *env, DisasContext = *s, int b, ot =3D mo_64_32(s->dflag); gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0); =20 + tcg_gen_mov_tl(cpu_cc_src, cpu_T0); switch (reg & 7) { case 1: /* blsr By,Ey */ - tcg_gen_neg_tl(cpu_T1, cpu_T0); + tcg_gen_subi_tl(cpu_T1, cpu_T0, 1); tcg_gen_and_tl(cpu_T0, cpu_T0, cpu_T1); - gen_op_mov_reg_v(ot, s->vex_v, cpu_T0); - gen_op_update2_cc(); - set_cc_op(s, CC_OP_BMILGB + ot); break; - case 2: /* blsmsk By,Ey */ - tcg_gen_mov_tl(cpu_cc_src, cpu_T0); - tcg_gen_subi_tl(cpu_T0, cpu_T0, 1); - tcg_gen_xor_tl(cpu_T0, cpu_T0, cpu_cc_src); - tcg_gen_mov_tl(cpu_cc_dst, cpu_T0); - set_cc_op(s, CC_OP_BMILGB + ot); + tcg_gen_subi_tl(cpu_T1, cpu_T0, 1); + tcg_gen_xor_tl(cpu_T0, cpu_T0, cpu_T1); break; - case 3: /* blsi By, Ey */ - tcg_gen_mov_tl(cpu_cc_src, cpu_T0); - tcg_gen_subi_tl(cpu_T0, cpu_T0, 1); - tcg_gen_and_tl(cpu_T0, cpu_T0, cpu_cc_src); - tcg_gen_mov_tl(cpu_cc_dst, cpu_T0); - set_cc_op(s, CC_OP_BMILGB + ot); + tcg_gen_neg_tl(cpu_T1, cpu_T0); + tcg_gen_and_tl(cpu_T0, cpu_T0, cpu_T1); break; - default: goto unknown_op; } + tcg_gen_mov_tl(cpu_cc_dst, cpu_T0); + gen_op_mov_reg_v(ot, s->vex_v, cpu_T0); + set_cc_op(s, CC_OP_BMILGB + ot); break; =20 default: --=20 2.9.4