From nobody Mon Feb 9 11:51:28 2026 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 15058244845111014.9414291232013; Tue, 19 Sep 2017 05:34:44 -0700 (PDT) Received: from localhost ([::1]:42579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duHjf-0007RI-Il for importer@patchew.org; Tue, 19 Sep 2017 08:34:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duHev-0003ey-PC for qemu-devel@nongnu.org; Tue, 19 Sep 2017 08:29:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duHer-00059E-Va for qemu-devel@nongnu.org; Tue, 19 Sep 2017 08:29:49 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:33609) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duHer-00058k-QV for qemu-devel@nongnu.org; Tue, 19 Sep 2017 08:29:45 -0400 Received: by mail-wr0-x243.google.com with SMTP id b9so2160707wra.0 for ; Tue, 19 Sep 2017 05:29:45 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id k18sm1292878wmd.22.2017.09.19.05.29.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Sep 2017 05:29:42 -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=Z76u6uJK4H2QtI+pnHduG+/CMgVgds+nvBw0zfof5HM=; b=GDwYydO8MzFjSy1VPbcK9XKuvFbIIxr9YKPeJIOpodrF52EL8V4wZFbr4o7zRO9q8G +CPX5oqQdaH0uqXHVnga0IlSAN1X1+GT14nT5UVyVyWiIVAdeQ5Bug36OrSZln0t/DKF oyYB0lgHR80qecWUuLXXDTD3rhg/oYwjpmEiX9cOFLOolLDx2xz8UfjpTyQhWx8rSjyS 5d9mzufEtd8sp/I5p+xJnfpNP8w7IL2u6QMZrdYF3LzGwZMM0tflL4AhCm7ZA2PpjB2Q RGjZepXySaL1BR6jrFTWJj0EDBglQ4Ewpj2qO/8b0jUCldGh/xxA85ojpz3SKAYf0wvG nxyA== 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=Z76u6uJK4H2QtI+pnHduG+/CMgVgds+nvBw0zfof5HM=; b=RC4+Dukhs8uCT56SwSqY+vx6dhGEqQzxWaZYWu1itRKiCIMJfpd3MY6fawOzkKGc1W IzWDvPPmeevwFBPN5irIXtJf1qxdwyHAtRVQY4MxvSjyorr8PlBxXEH8kOEWa4Mlo8xe 4MRQTpDipOoMivWJBpYlOjNkFKMswWTdRaNk5NRrMKjGv1otBtJFdzsiLbji5hmhhA5z y0bEpsBKxTm+ejv1nYAt88ZfdEm58rF7/tYJYBF3/RYT62y8EgcE8uh1P3L9D5t+2mVI U9gBKcM61G8fwvTDRxB99uZFliIhBwpRYm33nFin76RXGcTSfktrrwmBLrBdNgP7JhWi lvHw== X-Gm-Message-State: AHPjjUiW4QYGGWm43o+kLQKkCPPm1NEV3z52/RWzvUr/KV5D0Mw40iZs HmaG3kYsgOPK1odJLzflB/wRU9dD X-Google-Smtp-Source: AOwi7QAVJZdPuc5l/rTh/omgBjzn243ZRcKrb8L4s5C9kxFf9OqBuc+aHF9TAB+p1nit02JnAAaxVg== X-Received: by 10.223.196.73 with SMTP id a9mr1270662wrg.144.1505824184494; Tue, 19 Sep 2017 05:29:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 19 Sep 2017 14:28:50 +0200 Message-Id: <1505824179-21541-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1505824179-21541-1-git-send-email-pbonzini@redhat.com> References: <1505824179-21541-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PULL 01/50] target/i386: fix pmovsx/pmovzx in-place operations 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: Joseph Myers 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" From: Joseph Myers The SSE4.1 pmovsx* and pmovzx* instructions take packed 1-byte, 2-byte or 4-byte inputs and sign-extend or zero-extend them to a wider vector output. The associated helpers for these instructions do the extension on each element in turn, starting with the lowest. If the input and output are the same register, this means that all the input elements after the first have been overwritten before they are read. This patch makes the helpers extend starting with the highest element, not the lowest, to avoid such overwriting. This fixes many GCC test failures (161 in the gcc testsuite in my GCC 6-based testing) when testing with a default CPU setting enabling those instructions. Signed-off-by: Joseph Myers Message-Id: Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 16509d0..d578216 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -1617,18 +1617,18 @@ void glue(helper_ptest, SUFFIX)(CPUX86State *env, R= eg *d, Reg *s) #define SSE_HELPER_F(name, elem, num, F) \ void glue(name, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) \ { \ - d->elem(0) =3D F(0); \ - d->elem(1) =3D F(1); \ if (num > 2) { \ - d->elem(2) =3D F(2); \ - d->elem(3) =3D F(3); \ if (num > 4) { \ - d->elem(4) =3D F(4); \ - d->elem(5) =3D F(5); \ - d->elem(6) =3D F(6); \ d->elem(7) =3D F(7); \ + d->elem(6) =3D F(6); \ + d->elem(5) =3D F(5); \ + d->elem(4) =3D F(4); \ } \ + d->elem(3) =3D F(3); \ + d->elem(2) =3D F(2); \ } \ + d->elem(1) =3D F(1); \ + d->elem(0) =3D F(0); \ } =20 SSE_HELPER_F(helper_pmovsxbw, W, 8, (int8_t) s->B) --=20 1.8.3.1