From nobody Sat May 4 09:24:01 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 1499885226665812.2820889657552; Wed, 12 Jul 2017 11:47:06 -0700 (PDT) Received: from localhost ([::1]:55227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVMf8-0007Sv-J7 for importer@patchew.org; Wed, 12 Jul 2017 14:47:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVMe2-0006m6-6l for qemu-devel@nongnu.org; Wed, 12 Jul 2017 14:45:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVMdy-0001JG-QR for qemu-devel@nongnu.org; Wed, 12 Jul 2017 14:45:54 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:34638) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVMdy-0001Is-La for qemu-devel@nongnu.org; Wed, 12 Jul 2017 14:45:50 -0400 Received: by mail-qk0-x242.google.com with SMTP id q66so5198764qki.1 for ; Wed, 12 Jul 2017 11:45:50 -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 v47sm2582926qtb.11.2017.07.12.11.45.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2017 11:45:49 -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=VIh/gticZqhRUtI22KZ003y9m0H5xVlV12xQUSc67L4=; b=lLWvcMYmEUsyeVJ9/zfcaMne5hGsnOKy03yFeH+1CSYHzksiZoC9YaSpap4YsdeYRI hO5iz97ApKwYCS1V0o2yrvgUEAEh+RU11S3k0DsoIK6d3Js2D5EuG7vfn0KggIQ4OCmL yE3AfYVtuIgfMPetYkp4+qeXu42Q8MtB8GuQguQ+qrt2wRqFKRdzJgvSNo+vidM0MSlA 68aq4T4MeDeBUtfqS8E7LnoecnaHTBJnWE23hUwzI88y60fxnr+5+7CfI/XJtZp71MCV HB9vYh9TZCzs8ipCjtYd2rI9xVtsVMT2ZkukWInRv7TJI/dS1m+TdwAo06k3eIEPpISp aUCQ== 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=VIh/gticZqhRUtI22KZ003y9m0H5xVlV12xQUSc67L4=; b=Et67If5nr52QtZr0jtYZ82Ei+N8RDBtW9XU27xrpJrQ3PTSHYXU23AaTcuKoqYFgpT LkOLz9ZoOy6lePpMEqlIJox+6p0WgGn02jQ3fPgrGONyAHhx8FKtx8wAUDpgxtPllDfl hVNXdFD2a/Z/AvjurU68zQFFTIMtseILOBCjAF2uf28lCwFYUHXGbl9BmDjLqkaVeq8z brr9el637DNtcTGPTGaaq/N0X2MI3CMwb4zqkvJBXHt+Bb4MpepCA937OzCQ0yOf/knr TVvhpq45SR+5NKNxBwLA1By0e/HMxP5s7lJ146yguZFqO84uM5Ozh15vrH/zs0C2ruAA Q/Kw== X-Gm-Message-State: AIVw110gwhnjkSeAALz1X315w2adjz245m3gFKF0hoPlT94qPMJPQ2Th vMAJElRaJ0GcYidgqhI= X-Received: by 10.55.54.196 with SMTP id d187mr4908qka.96.1499885149783; Wed, 12 Jul 2017 11:45:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 12 Jul 2017 08:45:40 -1000 Message-Id: <20170712184540.12352-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::242 Subject: [Qemu-devel] [PATCH] 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 | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 8365a6d..087a2e6 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4029,36 +4029,27 @@ static void gen_sse(CPUX86State *env, DisasContext = *s, int b, goto illegal_op; } ot =3D mo_64_32(s->dflag); - gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0); + gen_ldst_modrm(env, s, modrm, ot, OR_TMP1, 0); =20 switch (reg & 7) { case 1: /* blsr By,Ey */ - tcg_gen_neg_tl(cpu_T1, cpu_T0); + tcg_gen_subi_tl(cpu_T0, cpu_T1, 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_T0, cpu_T1, 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_T0, cpu_T1); + tcg_gen_and_tl(cpu_T0, cpu_T0, cpu_T1); break; - default: goto unknown_op; } + gen_op_update2_cc(); + set_cc_op(s, CC_OP_BMILGB + ot); break; =20 default: --=20 2.9.4