From nobody Mon Apr 29 02:47:05 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; 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 1502236359368843.355374676238; Tue, 8 Aug 2017 16:52:39 -0700 (PDT) Received: from localhost ([::1]:44955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfEIf-0006Yq-8c for importer@patchew.org; Tue, 08 Aug 2017 19:52:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfEHo-0006EP-D7 for qemu-devel@nongnu.org; Tue, 08 Aug 2017 19:51:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfEHj-00022n-Gf for qemu-devel@nongnu.org; Tue, 08 Aug 2017 19:51:44 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:33842) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dfEHj-00022Y-Ae for qemu-devel@nongnu.org; Tue, 08 Aug 2017 19:51:39 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1dfEHf-0004lP-NF from joseph_myers@mentor.com ; Tue, 08 Aug 2017 16:51:35 -0700 Received: from digraph.polyomino.org.uk (137.202.0.87) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Wed, 9 Aug 2017 00:51:32 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.86_2) (envelope-from ) id 1dfEHZ-0003JZ-53; Tue, 08 Aug 2017 23:51:29 +0000 Date: Tue, 8 Aug 2017 23:51:29 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: , , , Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-Originating-IP: [137.202.0.87] X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 Subject: [Qemu-devel] [PATCH] target/i386: set rip_offset for further SSE instructions 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It turns out that my recent fix to set rip_offset when emulating some SSE4.1 instructions needs generalizing to cover a wider class of instructions. Specifically, every instruction in the sse_op_table7 table, coming from various instruction set extensions, has an 8-bit immediate operand that comes after any memory operand, and so needs rip_offset set for correctness if there is a memory operand that is rip-relative, and my patch only set it for a subset of those instructions. This patch moves the rip_offset setting to cover the wider class of instructions, so fixing 9 further gcc testsuite failures in my GCC 6-based testing. (I do not know whether there might be still further classes of instructions missing this setting.) Signed-off-by: Joseph Myers --- diff --git a/target/i386/translate.c b/target/i386/translate.c index 5fdadf9..95f7261 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4077,10 +4077,11 @@ static void gen_sse(CPUX86State *env, DisasContext = *s, int b, if (!(s->cpuid_ext_features & sse_op_table7[b].ext_mask)) goto illegal_op; =20 + s->rip_offset =3D 1; + if (sse_fn_eppi =3D=3D SSE_SPECIAL) { ot =3D mo_64_32(s->dflag); rm =3D (modrm & 7) | REX_B(s); - s->rip_offset =3D 1; if (mod !=3D 3) gen_lea_modrm(env, s, modrm); reg =3D ((modrm >> 3) & 7) | rex_r; --=20 Joseph S. Myers joseph@codesourcery.com